From c3f04314cc147bb172169d9853c59a7b53396d2a Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sun, 11 May 2014 17:36:13 -0700 Subject: [PATCH] make things work with Quick Reply and Thread Updater disabled --- src/General/Navigate.coffee | 19 +++++++------------ src/Menu/DeleteLink.coffee | 2 +- src/Miscellaneous/Keybinds.coffee | 2 +- src/Monitoring/Unread.coffee | 6 +++--- 4 files changed, 12 insertions(+), 17 deletions(-) diff --git a/src/General/Navigate.coffee b/src/General/Navigate.coffee index bfc530bd3..3db08ca3c 100644 --- a/src/General/Navigate.coffee +++ b/src/General/Navigate.coffee @@ -105,16 +105,11 @@ Navigate = $.rmClass doc, g.VIEW $.addClass doc, view - { - index: -> - delete g.THREADID - QR.link.textContent = 'Start a Thread' + delete g.THREADID if view is 'index' - thread: -> - QR.link.textContent = 'Reply to Thread' - }[view]() - - QR.status() # Re-enable the QR in the case of a 404'd thread or something. + if Conf['Quick Reply'] + QR.link.textContent = if g.VIEW is 'thread' then 'Reply to Thread' else 'Start a Thread' + QR.status() # Re-enable the QR in the case of a 404'd thread or something. g.VIEW = view @@ -126,7 +121,7 @@ Navigate = $('#returnlink a').href = "/#{g.BOARD}/" - QR.flagsInput() + QR.flagsInput() if Conf['Quick Reply'] $.cache '//a.4cdn.org/boards.json', -> try @@ -183,7 +178,7 @@ Navigate = if @pathname is Navigate.path return if @id is 'popState' if g.VIEW is 'thread' - ThreadUpdater.update() + ThreadUpdater.update() if Conf['Thread Updater'] else Index.update() e?.preventDefault() @@ -305,7 +300,7 @@ Navigate = Unread.ready() if Conf['Unread Count'] - QR.generatePostableThreadsList() + QR.generatePostableThreadsList() if Conf['Quick Reply'] Header.hashScroll.call window Main.handleErrors errors if errors diff --git a/src/Menu/DeleteLink.coffee b/src/Menu/DeleteLink.coffee index 1805047f8..2a08d953e 100755 --- a/src/Menu/DeleteLink.coffee +++ b/src/Menu/DeleteLink.coffee @@ -50,7 +50,7 @@ DeleteLink = form = mode: 'usrdel' onlyimgdel: fileOnly - pwd: QR.persona.getPassword() + form.pwd = QR.persona.getPassword() if Conf['Quick Reply'] form[post.ID] = 'delete' link = @ diff --git a/src/Miscellaneous/Keybinds.coffee b/src/Miscellaneous/Keybinds.coffee index 756c5a728..20bf25f15 100755 --- a/src/Miscellaneous/Keybinds.coffee +++ b/src/Miscellaneous/Keybinds.coffee @@ -70,7 +70,7 @@ Keybinds = when Conf['Update'] switch g.VIEW when 'thread' - ThreadUpdater.update() + ThreadUpdater.update() if Conf['Thread Updater'] when 'index' if Conf['JSON Navigation'] then Index.update() when Conf['Watch'] diff --git a/src/Monitoring/Unread.coffee b/src/Monitoring/Unread.coffee index 262b4867b..2c87bcfde 100755 --- a/src/Monitoring/Unread.coffee +++ b/src/Monitoring/Unread.coffee @@ -87,7 +87,7 @@ Unread = addPosts: (posts) -> for post in posts {ID} = post - continue if ID <= Unread.lastReadPost or post.isHidden or QR.db.get { + continue if ID <= Unread.lastReadPost or post.isHidden or QR.db?.get { boardID: post.board.ID threadID: post.thread.ID postID: ID @@ -101,7 +101,7 @@ Unread = Unread.update() addPostQuotingYou: (post) -> - for quotelink in post.nodes.quotelinks when QR.db.get Get.postDataFromLink quotelink + for quotelink in post.nodes.quotelinks when QR.db?.get Get.postDataFromLink quotelink Unread.postsQuotingYou.push post Unread.openNotification post return @@ -159,7 +159,7 @@ Unread = {ID, data} = post posts.rm ID - if Conf['Mark Quotes of You'] and QR.db.get { + if Conf['Mark Quotes of You'] and QR.db?.get { boardID: data.board.ID threadID: data.thread.ID postID: ID