Move Pass Link out of Main.coffee, make optional, fix minor issues.
This commit is contained in:
parent
d7268d2518
commit
73fc544dea
@ -502,6 +502,10 @@ Config =
|
|||||||
false
|
false
|
||||||
'Use the image selection captcha in the report window.'
|
'Use the image selection captcha in the report window.'
|
||||||
]
|
]
|
||||||
|
'Pass Link': [
|
||||||
|
true
|
||||||
|
'Add a 4chan Pass login link to the bottom of the page.'
|
||||||
|
]
|
||||||
|
|
||||||
'Quote Links':
|
'Quote Links':
|
||||||
'Quote Backlinks': [
|
'Quote Backlinks': [
|
||||||
|
|||||||
@ -204,17 +204,6 @@ Main =
|
|||||||
|
|
||||||
return if d.title in ['4chan - Temporarily Offline', '4chan - 404 Not Found']
|
return if d.title in ['4chan - Temporarily Offline', '4chan - 404 Not Found']
|
||||||
|
|
||||||
# 4chan Pass Link
|
|
||||||
if styleSelector = $.id 'styleSelector'
|
|
||||||
passLink = $.el 'a',
|
|
||||||
textContent: '4chan Pass'
|
|
||||||
href: 'javascript:;'
|
|
||||||
$.on passLink, 'click', ->
|
|
||||||
window.open '//sys.4chan.org/auth',
|
|
||||||
'This will steal your data.'
|
|
||||||
'left=0,top=0,width=500,height=255,toolbar=0,resizable=0'
|
|
||||||
$.before styleSelector.previousSibling, [$.tn '['; passLink, $.tn ']\u00A0\u00A0']
|
|
||||||
|
|
||||||
# Parse HTML or skip it and start building from JSON.
|
# Parse HTML or skip it and start building from JSON.
|
||||||
unless Conf['JSON Navigation'] and g.VIEW is 'index'
|
unless Conf['JSON Navigation'] and g.VIEW is 'index'
|
||||||
Main.initThread()
|
Main.initThread()
|
||||||
@ -380,6 +369,7 @@ Main =
|
|||||||
['Quick Reply', QR]
|
['Quick Reply', QR]
|
||||||
['Cooldown', QR.cooldown]
|
['Cooldown', QR.cooldown]
|
||||||
['Oekaki Links', QR.oekaki]
|
['Oekaki Links', QR.oekaki]
|
||||||
|
['Pass Link', PassLink]
|
||||||
['Menu', Menu]
|
['Menu', Menu]
|
||||||
['Index Generator (Menu)', Index.menu]
|
['Index Generator (Menu)', Index.menu]
|
||||||
['Report Link', ReportLink]
|
['Report Link', ReportLink]
|
||||||
|
|||||||
16
src/Posting/PassLink.coffee
Normal file
16
src/Posting/PassLink.coffee
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
PassLink =
|
||||||
|
init: ->
|
||||||
|
return unless Conf['Pass Link']
|
||||||
|
Main.ready @ready
|
||||||
|
|
||||||
|
ready: ->
|
||||||
|
return unless (styleSelector = $.id 'styleSelector')
|
||||||
|
|
||||||
|
passLink = $.el 'span',
|
||||||
|
className: 'brackets-wrap pass-link-container'
|
||||||
|
$.extend passLink, <%= html('<a href="javascript:;">4chan Pass</a>') %>
|
||||||
|
$.on passLink.firstElementChild, 'click', ->
|
||||||
|
window.open '//sys.4chan.org/auth',
|
||||||
|
Date.now()
|
||||||
|
'width=500,height=280,toolbar=0'
|
||||||
|
$.before styleSelector.previousSibling, [passLink, $.tn('\u00A0\u00A0')]
|
||||||
Loading…
x
Reference in New Issue
Block a user