diff --git a/README.md b/README.md index 4696494..afab8ce 100644 --- a/README.md +++ b/README.md @@ -111,5 +111,8 @@ In my book, all of these people are ace - I just borrowed from them and spliced noCanvasMsg: "Your browser doesn't support - try Chrome, FF4, Safari or IE9." // This could be any HTML string (eg. ''): - label: '

Please draw the shape in the box to submit the form:

' - }); + label: '

Please draw the shape in the box to submit the form:

', + + // message position on canvas + isRTL: false + }); \ No newline at end of file diff --git a/jquery.motionCaptcha.0.2.js b/jquery.motionCaptcha.0.2.js index 1f362c5..d86e15c 100644 --- a/jquery.motionCaptcha.0.2.js +++ b/jquery.motionCaptcha.0.2.js @@ -65,6 +65,14 @@ jQuery.fn.motionCaptcha || (function($) { ctx.canvasWidth = canvasWidth; ctx.canvasHeight = canvasHeight; + // msg position + msgX = opts.isRTL? + canvasWidth - 10 : 10; + + ctx.textAlign = opts.isRTL? + 'right' : 'left'; + + // Set canvas context font and fillStyle: ctx.font = opts.canvasFont; ctx.fillStyle = opts.canvasTextColor; @@ -304,7 +312,10 @@ jQuery.fn.motionCaptcha || (function($) { onError: function($form, $canvas, ctx) { var opts = this; return; - } + }, + + // msg postion (top right or top left) + isRTL: false };