From 16814f4c7385fb2dbe40c0f60db40bddd00dd027 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Fri, 17 Jun 2016 19:48:31 -0700 Subject: [PATCH] Remove 'QR Shortcut' option. #904 --- src/General/Settings.coffee | 1 + src/Posting/QR.coffee | 33 +++++++++++++++------------------ src/config/Config.coffee | 5 ----- src/main/Main.coffee | 1 + 4 files changed, 17 insertions(+), 23 deletions(-) diff --git a/src/General/Settings.coffee b/src/General/Settings.coffee index 9e788777d..0711b71c9 100644 --- a/src/General/Settings.coffee +++ b/src/General/Settings.coffee @@ -382,6 +382,7 @@ Settings = if compareString < '00001.00012.00000.00000' set 'Exempt Archives from Encryption', false unless data['Exempt Archives from Encryption']? addCSS '#qr .persona .field {display: block !important;}' if data['Show Name and Subject'] + addCSS '#shortcut-qr {display: none;}' if data['QR Shortcut'] is false changes loadSettings: (data, cb) -> diff --git a/src/Posting/QR.coffee b/src/Posting/QR.coffee index d4924a9d7..84c7c3d42 100644 --- a/src/Posting/QR.coffee +++ b/src/Posting/QR.coffee @@ -37,21 +37,20 @@ QR = name: 'Quick Reply' cb: @node - if Conf['QR Shortcut'] - @shortcut = sc = $.el 'a', - className: 'fa fa-comment-o disabled' - textContent: 'QR' - title: 'Quick Reply' - href: 'javascript:;' - $.on sc, 'click', -> - return unless QR.postingIsEnabled - if Conf['Persistent QR'] or !QR.nodes or QR.nodes.el.hidden - QR.open() - QR.nodes.com.focus() - else - QR.close() + @shortcut = sc = $.el 'a', + className: 'fa fa-comment-o disabled' + textContent: 'QR' + title: 'Quick Reply' + href: 'javascript:;' + $.on sc, 'click', -> + return unless QR.postingIsEnabled + if Conf['Persistent QR'] or !QR.nodes or QR.nodes.el.hidden + QR.open() + QR.nodes.com.focus() + else + QR.close() - Header.addShortcut 'qr', sc, 540 + Header.addShortcut 'qr', sc, 540 initReady: -> $.off d, '4chanXInitFinished', @initReady @@ -123,8 +122,7 @@ QR = message: 'Quick Reply dialog creation crashed.' error: err return - if Conf['QR Shortcut'] - $.rmClass QR.shortcut, 'disabled' + $.rmClass QR.shortcut, 'disabled' close: -> if QR.req @@ -134,8 +132,7 @@ QR = QR.cleanNotifications() d.activeElement.blur() $.rmClass QR.nodes.el, 'dump' - if Conf['QR Shortcut'] - $.addClass QR.shortcut, 'disabled' + $.addClass QR.shortcut, 'disabled' new QR.post true for post in QR.posts.splice 0, QR.posts.length - 1 post.delete() diff --git a/src/config/Config.coffee b/src/config/Config.coffee index 35d77f092..87de48360 100644 --- a/src/config/Config.coffee +++ b/src/config/Config.coffee @@ -407,11 +407,6 @@ Config = true 'All-in-one form to reply, create threads, automate dumping and more.' ] - 'QR Shortcut': [ - true - 'Add a shortcut to the header to toggle the QR.' - 1 - ] 'Persistent QR': [ false 'The Quick reply won\'t disappear after posting.' diff --git a/src/main/Main.coffee b/src/main/Main.coffee index 7d288dee1..05ad1f8b2 100644 --- a/src/main/Main.coffee +++ b/src/main/Main.coffee @@ -50,6 +50,7 @@ Main = Conf['JSON Navigation'] = true Conf['Oekaki Links'] = true Conf['Show Name and Subject'] = false + Conf['QR Shortcut'] = true # Pseudo-enforce default whitelist while configuration loads if $.platform is 'crx' then $.global ->