diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 2f3a94d25..06f2ed274 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -12523,7 +12523,7 @@ }); }, initReady: function() { - var GMver, err, href, i, threadRoot, v, _i, _len, _ref, _ref1; + var GMver, err, href, i, passLink, styleSelector, threadRoot, v, _i, _len, _ref, _ref1; if ((_ref = d.title) === '4chan - Temporarily Offline' || _ref === '4chan - 404 Not Found') { if (Conf['404 Redirect'] && g.VIEW === 'thread') { href = Redirect.to('thread', { @@ -12536,6 +12536,16 @@ return; } Main.initStyle(); + if (styleSelector = $.id('styleSelector')) { + passLink = $.el('a', { + textContent: '4chan Pass', + href: 'javascript:;' + }); + $.on(passLink, 'click', function() { + return 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')]); + } if (g.VIEW === 'thread' && (threadRoot = $('.thread'))) { Main.initThread(threadRoot); } @@ -12560,7 +12570,7 @@ } }, initThread: function(threadRoot) { - var err, errors, passLink, post, postRoot, posts, styleSelector, thread, _i, _len, _ref; + var err, errors, post, postRoot, posts, thread, _i, _len, _ref; thread = new Thread(+threadRoot.id.slice(1), g.BOARD); posts = []; _ref = $$('.thread > .postContainer', threadRoot); @@ -12585,19 +12595,9 @@ Main.handleErrors(errors); } Main.callbackNodes(Thread, [thread]); - Main.callbackNodesDB(Post, posts, function() { + return Main.callbackNodesDB(Post, posts, function() { return $.event('4chanXInitFinished'); }); - if (styleSelector = $.id('styleSelector')) { - passLink = $.el('a', { - textContent: '4chan Pass', - href: 'javascript:;' - }); - $.on(passLink, 'click', function() { - return window.open('//sys.4chan.org/auth', 'This will steal your data.', 'left=0,top=0,width=500,height=255,toolbar=0,resizable=0'); - }); - return $.before(styleSelector.previousSibling, [$.tn('['), passLink, $.tn(']\u00A0\u00A0')]); - } }, callbackNodes: function(klass, nodes) { var cb, i, node; diff --git a/builds/crx/script.js b/builds/crx/script.js index 6dee5e39c..a38f854cd 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -12510,7 +12510,7 @@ }); }, initReady: function() { - var err, href, threadRoot, _ref; + var err, href, passLink, styleSelector, threadRoot, _ref; if ((_ref = d.title) === '4chan - Temporarily Offline' || _ref === '4chan - 404 Not Found') { if (Conf['404 Redirect'] && g.VIEW === 'thread') { href = Redirect.to('thread', { @@ -12523,6 +12523,16 @@ return; } Main.initStyle(); + if (styleSelector = $.id('styleSelector')) { + passLink = $.el('a', { + textContent: '4chan Pass', + href: 'javascript:;' + }); + $.on(passLink, 'click', function() { + return 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')]); + } if (g.VIEW === 'thread' && (threadRoot = $('.thread'))) { Main.initThread(threadRoot); } @@ -12534,7 +12544,7 @@ } }, initThread: function(threadRoot) { - var err, errors, passLink, post, postRoot, posts, styleSelector, thread, _i, _len, _ref; + var err, errors, post, postRoot, posts, thread, _i, _len, _ref; thread = new Thread(+threadRoot.id.slice(1), g.BOARD); posts = []; _ref = $$('.thread > .postContainer', threadRoot); @@ -12559,19 +12569,9 @@ Main.handleErrors(errors); } Main.callbackNodes(Thread, [thread]); - Main.callbackNodesDB(Post, posts, function() { + return Main.callbackNodesDB(Post, posts, function() { return $.event('4chanXInitFinished'); }); - if (styleSelector = $.id('styleSelector')) { - passLink = $.el('a', { - textContent: '4chan Pass', - href: 'javascript:;' - }); - $.on(passLink, 'click', function() { - return window.open('//sys.4chan.org/auth', 'This will steal your data.', 'left=0,top=0,width=500,height=255,toolbar=0,resizable=0'); - }); - return $.before(styleSelector.previousSibling, [$.tn('['), passLink, $.tn(']\u00A0\u00A0')]); - } }, callbackNodes: function(klass, nodes) { var cb, i, node; diff --git a/src/General/Main.coffee b/src/General/Main.coffee index f09816464..3574aa363 100755 --- a/src/General/Main.coffee +++ b/src/General/Main.coffee @@ -118,6 +118,16 @@ Main = # Something might have gone wrong! Main.initStyle() + 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'] + Main.initThread threadRoot if g.VIEW is 'thread' and threadRoot = $ '.thread' <% if (type === 'userscript') { %> @@ -152,16 +162,6 @@ Main = Main.callbackNodesDB Post, posts, -> $.event '4chanXInitFinished' - 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'] - callbackNodes: (klass, nodes) -> i = 0 cb = klass.callbacks