diff --git a/4chan_x.user.js b/4chan_x.user.js index 68e18d88d..b3ef0761e 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1688,7 +1688,7 @@ caretPos = ta.selectionStart; ta.value = ta.value.slice(0, caretPos) + text + ta.value.slice(ta.selectionEnd, ta.value.length); ta.focus(); - return ta.selectionEnd = ta.selectionStart = caretPos + text.length; + return ta.selectionEnd = ta.selectionStart = caretPos + text.length + 1 * (engine === 'presto'); }, refresh: function() { var m, newFile, oldFile, _ref; diff --git a/changelog b/changelog index 97fac12b3..9461230bb 100644 --- a/changelog +++ b/changelog @@ -1,6 +1,7 @@ master - mayhem enable autoposting when submitting a captcha while on cooldown + fix caret position when quoting on Opera 2.23.1 - mayhem diff --git a/script.coffee b/script.coffee index 6b9dce615..6be3dd4cd 100644 --- a/script.coffee +++ b/script.coffee @@ -1327,7 +1327,7 @@ qr = ta.value = ta.value.slice(0, caretPos) + text + ta.value.slice(ta.selectionEnd, ta.value.length) ta.focus() #move the caret to the end of the new quote - ta.selectionEnd = ta.selectionStart = caretPos + text.length + ta.selectionEnd = ta.selectionStart = caretPos + text.length + 1*(engine is 'presto') refresh: -> $('[name=sub]', qr.el).value = ''