From 02e9089f9694b47321b24915448968e0f456e36d Mon Sep 17 00:00:00 2001 From: ccd0 Date: Fri, 17 Jun 2016 22:53:27 -0700 Subject: [PATCH] Remove 'Open Post in New Tab' option. #904 --- src/Posting/QR.coffee | 19 +++++++------------ src/config/Config.coffee | 5 ----- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/src/Posting/QR.coffee b/src/Posting/QR.coffee index 8884e5b3f..d0e1a0b21 100644 --- a/src/Posting/QR.coffee +++ b/src/Posting/QR.coffee @@ -775,33 +775,28 @@ QR = QR.cooldown.add threadID, postID - URL = if threadID is postID # new thread + url = if threadID is postID # new thread "#{window.location.origin}/#{g.BOARD}/thread/#{threadID}" - else if g.VIEW is 'index' and lastPostToThread and Conf['Open Post in New Tab'] # replying from the index + else if g.VIEW is 'index' and lastPostToThread # replying from the index "#{window.location.origin}/#{g.BOARD}/thread/#{threadID}#p#{postID}" - if URL - open = if Conf['Open Post in New Tab'] or postsCount - -> $.open URL - else - -> window.location = URL - + if url if threadID is postID # XXX 4chan sometimes responds before the thread exists. - QR.waitForThread URL, open + QR.waitForThread url else - open() + $.open url QR.status() - waitForThread: (url, cb) -> + waitForThread: (url) -> attempts = 0 check = -> $.ajax url, onloadend: -> attempts++ if attempts >= 6 or @status is 200 - cb() + $.open url else setTimeout check, attempts * $.SECOND , diff --git a/src/config/Config.coffee b/src/config/Config.coffee index a0e911888..fd4648a62 100644 --- a/src/config/Config.coffee +++ b/src/config/Config.coffee @@ -417,11 +417,6 @@ Config = 'Automatically hide the quick reply when posting.' 1 ] - 'Open Post in New Tab': [ - true - 'Open new threads or replies to a thread from the index in a new tab.' - 1 - ] 'Remember QR Size': [ false 'Remember the size of the Quick reply.'