diff --git a/src/General/Config.coffee b/src/General/Config.coffee index 20cb39b91..7d262a616 100755 --- a/src/General/Config.coffee +++ b/src/General/Config.coffee @@ -502,6 +502,10 @@ Config = false '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 Backlinks': [ diff --git a/src/General/Main.coffee b/src/General/Main.coffee index 6faa43d3f..ba4041d94 100755 --- a/src/General/Main.coffee +++ b/src/General/Main.coffee @@ -204,17 +204,6 @@ Main = 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. unless Conf['JSON Navigation'] and g.VIEW is 'index' Main.initThread() @@ -380,6 +369,7 @@ Main = ['Quick Reply', QR] ['Cooldown', QR.cooldown] ['Oekaki Links', QR.oekaki] + ['Pass Link', PassLink] ['Menu', Menu] ['Index Generator (Menu)', Index.menu] ['Report Link', ReportLink] diff --git a/src/Posting/PassLink.coffee b/src/Posting/PassLink.coffee new file mode 100644 index 000000000..e518e86bb --- /dev/null +++ b/src/Posting/PassLink.coffee @@ -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('4chan Pass') %> + $.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')]