Revert "Remove 'Open Post in New Tab' option. #904"
This reverts commit 02e9089f9694b47321b24915448968e0f456e36d.
This commit is contained in:
parent
1179c12377
commit
b804143cd4
@ -775,28 +775,33 @@ 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 # replying from the index
|
||||
else if g.VIEW is 'index' and lastPostToThread and Conf['Open Post in New Tab'] # replying from the index
|
||||
"#{window.location.origin}/#{g.BOARD}/thread/#{threadID}#p#{postID}"
|
||||
|
||||
if url
|
||||
if URL
|
||||
open = if Conf['Open Post in New Tab'] or postsCount
|
||||
-> $.open URL
|
||||
else
|
||||
-> window.location = URL
|
||||
|
||||
if threadID is postID
|
||||
# XXX 4chan sometimes responds before the thread exists.
|
||||
QR.waitForThread url
|
||||
QR.waitForThread URL, open
|
||||
else
|
||||
$.open url
|
||||
open()
|
||||
|
||||
QR.status()
|
||||
|
||||
waitForThread: (url) ->
|
||||
waitForThread: (url, cb) ->
|
||||
attempts = 0
|
||||
check = ->
|
||||
$.ajax url,
|
||||
onloadend: ->
|
||||
attempts++
|
||||
if attempts >= 6 or @status is 200
|
||||
$.open url
|
||||
cb()
|
||||
else
|
||||
setTimeout check, attempts * $.SECOND
|
||||
,
|
||||
|
||||
@ -413,6 +413,11 @@ 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.'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user