diff --git a/4chan_x.user.js b/4chan_x.user.js index 42401f8cf..9c011e9e4 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -20,7 +20,7 @@ // @icon data:image/gif;base64,R0lGODlhEAAQAKECAAAAAGbMM////////yH5BAEKAAIALAAAAAAQABAAAAIxlI+pq+D9DAgUoFkPDlbs7lGiI2bSVnKglnJMOL6omczxVZK3dH/41AG6Lh7i6qUoAAA7 // ==/UserScript== -/* 4chan X Beta - Version 3.0.0 - 2013-03-07 +/* 4chan X Beta - Version 3.0.0 - 2013-03-08 * http://mayhemydg.github.com/4chan-x/ * * Copyright (c) 2009-2011 James Campos @@ -3000,7 +3000,7 @@ return key; }, qr: function(thread, quote) { - if (!(Conf['Quick Reply'] && QR.postingIsEnable)) { + if (!(Conf['Quick Reply'] && QR.postingIsEnabled)) { return; } QR.open(); @@ -5823,8 +5823,8 @@ }, initReady: function() { var link; - QR.postingIsEnable = !!$.id('postForm'); - if (!QR.postingIsEnable) { + QR.postingIsEnabled = !!$.id('postForm'); + if (!QR.postingIsEnabled) { return; } link = $.el('a', { @@ -6105,19 +6105,18 @@ if (e != null) { e.preventDefault(); } - if (!QR.postingIsEnable) { + if (!QR.postingIsEnabled) { return; } - text = ""; sel = d.getSelection(); selectionRoot = $.x('ancestor::div[contains(@class,"postContainer")][1]', sel.anchorNode); post = Get.postFromNode(this); OP = Get.contextFromLink(this).thread.OP; + text = ">>" + post + "\n"; if ((s = sel.toString().trim()) && post.nodes.root === selectionRoot) { s = s.replace(/\n/g, '\n>'); text += ">" + s + "\n"; } - text = !text && post === OP && (!QR.nodes || QR.nodes.el.hidden) ? "" : ">>" + post + "\n" + text; QR.open(); ta = QR.nodes.com; if (!ta.value) { diff --git a/changelog b/changelog index ec7e5a85d..fef3e4d64 100644 --- a/changelog +++ b/changelog @@ -24,7 +24,6 @@ beta Closing the QR while uploading will abort the upload and won't close the QR anymore. Creating threads outside of the index is now possible. Selection-to-quote also applies to selected text inside the post, not just inside the comment. - Quoting the OP will not insert the >>opnumber anymore unless the QR was already opened. Added thumbnailing support for Opera. Image Expansion changes: diff --git a/src/features.coffee b/src/features.coffee index a03839eb9..10202288d 100644 --- a/src/features.coffee +++ b/src/features.coffee @@ -1662,7 +1662,7 @@ Keybinds = key qr: (thread, quote) -> - return unless Conf['Quick Reply'] and QR.postingIsEnable + return unless Conf['Quick Reply'] and QR.postingIsEnabled QR.open() if quote QR.quote.call $ 'input', $('.post.highlight', thread) or thread diff --git a/src/qr.coffee b/src/qr.coffee index 0ae117342..7e38161be 100644 --- a/src/qr.coffee +++ b/src/qr.coffee @@ -15,8 +15,8 @@ QR = cb: @node initReady: -> - QR.postingIsEnable = !!$.id 'postForm' - return unless QR.postingIsEnable + QR.postingIsEnabled = !!$.id 'postForm' + return unless QR.postingIsEnabled link = $.el 'a', className: 'qr-shortcut' @@ -250,25 +250,19 @@ QR = quote: (e) -> e?.preventDefault() - return unless QR.postingIsEnable - text = "" + return unless QR.postingIsEnabled sel = d.getSelection() selectionRoot = $.x 'ancestor::div[contains(@class,"postContainer")][1]', sel.anchorNode post = Get.postFromNode @ {OP} = Get.contextFromLink(@).thread + text = ">>#{post}\n" if (s = sel.toString().trim()) and post.nodes.root is selectionRoot # XXX Opera doesn't retain `\n`s? s = s.replace /\n/g, '\n>' text += ">#{s}\n" - text = if !text and post is OP and (!QR.nodes or QR.nodes.el.hidden) - # Don't quote the OP unless the QR was already opened once. - "" - else - ">>#{post}\n#{text}" - QR.open() ta = QR.nodes.com QR.nodes.thread.value = OP.ID unless ta.value