recaptcha and redirect
This commit is contained in:
parent
741d3224aa
commit
abcecc3ec1
120
4chan_x.js
120
4chan_x.js
@ -59,7 +59,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
var $, $$, NAMESPACE, anonymize, autoWatch, callback, config, d, el, expandComment, expandThread, g, imageClick, imageExpand, imageExpandClick, imageHover, imageResize, imageThumb, imageToggle, imageTypeChange, imgExpansion, imgGif, imgPreloading, keybinds, localize, log, nav, navtopr, nodeInserted, options, pathname, qr, quickReport, recaptcha, recaptchaListener, recaptchaReload, redirect, replyHiding, sauce, temp, threadHiding, titlePost, tzOffset, ui, unread, updater, watcher, _config, _i, _j, _len, _len2, _ref, _ref2, _ref3;
|
var $, $$, NAMESPACE, anonymize, autoWatch, callback, config, d, el, expandComment, expandThread, g, imageClick, imageExpand, imageExpandClick, imageHover, imageResize, imageThumb, imageToggle, imageTypeChange, imgExpansion, imgGif, imgPreloading, keybinds, localize, log, nav, navtopr, nodeInserted, options, pathname, qr, quickReport, recaptcha, redirect, replyHiding, sauce, temp, threadHiding, titlePost, tzOffset, ui, unread, updater, watcher, _config, _i, _j, _len, _len2, _ref, _ref2, _ref3;
|
||||||
var __slice = Array.prototype.slice;
|
var __slice = Array.prototype.slice;
|
||||||
if (typeof console != "undefined" && console !== null) {
|
if (typeof console != "undefined" && console !== null) {
|
||||||
log = console.log;
|
log = console.log;
|
||||||
@ -1016,7 +1016,7 @@
|
|||||||
},
|
},
|
||||||
load: function(e) {
|
load: function(e) {
|
||||||
var dialog;
|
var dialog;
|
||||||
recaptchaReload();
|
recaptcha.reload();
|
||||||
try {
|
try {
|
||||||
return e.target.contentWindow.postMessage('', '*');
|
return e.target.contentWindow.postMessage('', '*');
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
@ -1056,7 +1056,7 @@
|
|||||||
$.append(dialog, error);
|
$.append(dialog, error);
|
||||||
qr.autohide.unset();
|
qr.autohide.unset();
|
||||||
}
|
}
|
||||||
return recaptchaReload();
|
return recaptcha.reload();
|
||||||
},
|
},
|
||||||
node: function(root) {
|
node: function(root) {
|
||||||
var quote, quotes, _i, _len, _results;
|
var quote, quotes, _i, _len, _results;
|
||||||
@ -1183,7 +1183,7 @@
|
|||||||
}
|
}
|
||||||
clone.target = 'iframe';
|
clone.target = 'iframe';
|
||||||
$.bind(clone, 'submit', qr.cb.submit);
|
$.bind(clone, 'submit', qr.cb.submit);
|
||||||
$.bind($('input[name=recaptcha_response_field]', clone), 'keydown', recaptchaListener);
|
$.bind($('input[name=recaptcha_response_field]', clone), 'keydown', recaptcha.listener);
|
||||||
if (!g.REPLY) {
|
if (!g.REPLY) {
|
||||||
xpath = 'preceding::span[@class="postername"][1]/preceding::input[1]';
|
xpath = 'preceding::span[@class="postername"][1]/preceding::input[1]';
|
||||||
resto = $.el('input', {
|
resto = $.el('input', {
|
||||||
@ -1206,7 +1206,7 @@
|
|||||||
var board, html, id, recaptcha, thread, _, _base, _ref, _ref2;
|
var board, html, id, recaptcha, thread, _, _base, _ref, _ref2;
|
||||||
$.bind(window, 'message', qr.cb.messageIframe);
|
$.bind(window, 'message', qr.cb.messageIframe);
|
||||||
if (recaptcha = $('#recaptcha_response_field')) {
|
if (recaptcha = $('#recaptcha_response_field')) {
|
||||||
$.bind(recaptcha, 'keydown', recaptchaListener);
|
$.bind(recaptcha, 'keydown', recaptcha.listener);
|
||||||
}
|
}
|
||||||
if ($.config('Auto Watch')) {
|
if ($.config('Auto Watch')) {
|
||||||
html = $('b').innerHTML;
|
html = $('b').innerHTML;
|
||||||
@ -1815,6 +1815,61 @@
|
|||||||
return $.replace(favicon, clone);
|
return $.replace(favicon, clone);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
redirect = function() {
|
||||||
|
var url;
|
||||||
|
switch (g.BOARD) {
|
||||||
|
case 'a':
|
||||||
|
case 'g':
|
||||||
|
case 'lit':
|
||||||
|
case 'sci':
|
||||||
|
case 'tv':
|
||||||
|
url = "http://green-oval.net/cgi-board.pl/" + g.BOARD + "/thread/" + g.THREAD_ID;
|
||||||
|
break;
|
||||||
|
case 'cgl':
|
||||||
|
case 'jp':
|
||||||
|
case 'm':
|
||||||
|
case 'tg':
|
||||||
|
url = "http://archive.easymodo.net/cgi-board.pl/" + g.BOARD + "/thread/" + g.THREAD_ID;
|
||||||
|
break;
|
||||||
|
case '3':
|
||||||
|
case 'adv':
|
||||||
|
case 'an':
|
||||||
|
case 'c':
|
||||||
|
case 'ck':
|
||||||
|
case 'co':
|
||||||
|
case 'fa':
|
||||||
|
case 'fit':
|
||||||
|
case 'int':
|
||||||
|
case 'k':
|
||||||
|
case 'mu':
|
||||||
|
case 'n':
|
||||||
|
case 'o':
|
||||||
|
case 'p':
|
||||||
|
case 'po':
|
||||||
|
case 'soc':
|
||||||
|
case 'sp':
|
||||||
|
case 'toy':
|
||||||
|
case 'trv':
|
||||||
|
case 'v':
|
||||||
|
case 'vp':
|
||||||
|
case 'x':
|
||||||
|
url = "http://archive.no-ip.org/" + g.BOARD + "/thread/" + g.THREAD_ID;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
url = "http://boards.4chan.org/" + g.BOARD;
|
||||||
|
}
|
||||||
|
return location.href = url;
|
||||||
|
};
|
||||||
|
recaptcha = {
|
||||||
|
listener: function(e) {
|
||||||
|
if (e.keyCode === 8 && this.value === '') {
|
||||||
|
return recaptcha.reload();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
reload: function() {
|
||||||
|
return window.location = 'javascript:Recaptcha.reload()';
|
||||||
|
}
|
||||||
|
};
|
||||||
imageClick = function(e) {
|
imageClick = function(e) {
|
||||||
if (e.shiftKey || e.altKey || e.ctrlKey) {
|
if (e.shiftKey || e.altKey || e.ctrlKey) {
|
||||||
return;
|
return;
|
||||||
@ -1928,59 +1983,6 @@
|
|||||||
autoText = $('textarea', this).value.slice(0, 25);
|
autoText = $('textarea', this).value.slice(0, 25);
|
||||||
return GM_setValue('autoText', "/" + g.BOARD + "/ - " + autoText);
|
return GM_setValue('autoText', "/" + g.BOARD + "/ - " + autoText);
|
||||||
};
|
};
|
||||||
recaptchaListener = function(e) {
|
|
||||||
if (e.keyCode === 8 && this.value === '') {
|
|
||||||
return recaptchaReload();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
recaptchaReload = function() {
|
|
||||||
return window.location = 'javascript:Recaptcha.reload()';
|
|
||||||
};
|
|
||||||
redirect = function() {
|
|
||||||
var url;
|
|
||||||
switch (g.BOARD) {
|
|
||||||
case 'a':
|
|
||||||
case 'g':
|
|
||||||
case 'lit':
|
|
||||||
case 'sci':
|
|
||||||
case 'tv':
|
|
||||||
url = "http://green-oval.net/cgi-board.pl/" + g.BOARD + "/thread/" + g.THREAD_ID;
|
|
||||||
break;
|
|
||||||
case 'cgl':
|
|
||||||
case 'jp':
|
|
||||||
case 'm':
|
|
||||||
case 'tg':
|
|
||||||
url = "http://archive.easymodo.net/cgi-board.pl/" + g.BOARD + "/thread/" + g.THREAD_ID;
|
|
||||||
break;
|
|
||||||
case '3':
|
|
||||||
case 'adv':
|
|
||||||
case 'an':
|
|
||||||
case 'c':
|
|
||||||
case 'ck':
|
|
||||||
case 'co':
|
|
||||||
case 'fa':
|
|
||||||
case 'fit':
|
|
||||||
case 'int':
|
|
||||||
case 'k':
|
|
||||||
case 'mu':
|
|
||||||
case 'n':
|
|
||||||
case 'o':
|
|
||||||
case 'p':
|
|
||||||
case 'po':
|
|
||||||
case 'soc':
|
|
||||||
case 'sp':
|
|
||||||
case 'toy':
|
|
||||||
case 'trv':
|
|
||||||
case 'v':
|
|
||||||
case 'vp':
|
|
||||||
case 'x':
|
|
||||||
url = "http://archive.no-ip.org/" + g.BOARD + "/thread/" + g.THREAD_ID;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
url = "http://boards.4chan.org/" + g.BOARD;
|
|
||||||
}
|
|
||||||
return location.href = url;
|
|
||||||
};
|
|
||||||
NAMESPACE = 'AEOS.4chan_x.';
|
NAMESPACE = 'AEOS.4chan_x.';
|
||||||
g = {
|
g = {
|
||||||
cache: {},
|
cache: {},
|
||||||
@ -2143,7 +2145,7 @@
|
|||||||
el.tabIndex = 1;
|
el.tabIndex = 1;
|
||||||
}
|
}
|
||||||
recaptcha = $('#recaptcha_response_field');
|
recaptcha = $('#recaptcha_response_field');
|
||||||
$.bind(recaptcha, 'keydown', recaptchaListener);
|
$.bind(recaptcha, 'keydown', recaptcha.listener);
|
||||||
$.bind($('form[name=post]'), 'submit', qr.cb.submit);
|
$.bind($('form[name=post]'), 'submit', qr.cb.submit);
|
||||||
if ($.config('Image Expansion')) {
|
if ($.config('Image Expansion')) {
|
||||||
imgExpansion.init();
|
imgExpansion.init();
|
||||||
|
|||||||
@ -764,7 +764,7 @@ qr =
|
|||||||
$.removeClass dialog, 'auto'
|
$.removeClass dialog, 'auto'
|
||||||
|
|
||||||
load: (e) ->
|
load: (e) ->
|
||||||
recaptchaReload()
|
recaptcha.reload()
|
||||||
try
|
try
|
||||||
e.target.contentWindow.postMessage '', '*'
|
e.target.contentWindow.postMessage '', '*'
|
||||||
catch err
|
catch err
|
||||||
@ -798,7 +798,7 @@ qr =
|
|||||||
$.append dialog, error
|
$.append dialog, error
|
||||||
qr.autohide.unset()
|
qr.autohide.unset()
|
||||||
|
|
||||||
recaptchaReload()
|
recaptcha.reload()
|
||||||
|
|
||||||
node: (root) ->
|
node: (root) ->
|
||||||
quotes = $$ 'a.quotejs:not(:first-child)', root
|
quotes = $$ 'a.quotejs:not(:first-child)', root
|
||||||
@ -901,7 +901,7 @@ qr =
|
|||||||
$.remove script
|
$.remove script
|
||||||
clone.target = 'iframe'
|
clone.target = 'iframe'
|
||||||
$.bind clone, 'submit', qr.cb.submit
|
$.bind clone, 'submit', qr.cb.submit
|
||||||
$.bind $('input[name=recaptcha_response_field]', clone), 'keydown', recaptchaListener
|
$.bind $('input[name=recaptcha_response_field]', clone), 'keydown', recaptcha.listener
|
||||||
|
|
||||||
if not g.REPLY
|
if not g.REPLY
|
||||||
#figure out which thread we're replying to
|
#figure out which thread we're replying to
|
||||||
@ -928,7 +928,7 @@ qr =
|
|||||||
$.bind window, 'message', qr.cb.messageIframe
|
$.bind window, 'message', qr.cb.messageIframe
|
||||||
if recaptcha = $ '#recaptcha_response_field'
|
if recaptcha = $ '#recaptcha_response_field'
|
||||||
# post reporting
|
# post reporting
|
||||||
$.bind recaptcha, 'keydown', recaptchaListener
|
$.bind recaptcha, 'keydown', recaptcha.listener
|
||||||
if $.config 'Auto Watch'
|
if $.config 'Auto Watch'
|
||||||
html = $('b').innerHTML
|
html = $('b').innerHTML
|
||||||
[_, thread, id] = html.match(/<!-- thread:(\d+),no:(\d+) -->/)
|
[_, thread, id] = html.match(/<!-- thread:(\d+),no:(\d+) -->/)
|
||||||
@ -1405,6 +1405,25 @@ unread =
|
|||||||
clone.href = href
|
clone.href = href
|
||||||
$.replace favicon, clone
|
$.replace favicon, clone
|
||||||
|
|
||||||
|
redirect = ->
|
||||||
|
switch g.BOARD
|
||||||
|
when 'a', 'g', 'lit', 'sci', 'tv'
|
||||||
|
url = "http://green-oval.net/cgi-board.pl/#{g.BOARD}/thread/#{g.THREAD_ID}"
|
||||||
|
when 'cgl', 'jp', 'm', 'tg'
|
||||||
|
url = "http://archive.easymodo.net/cgi-board.pl/#{g.BOARD}/thread/#{g.THREAD_ID}"
|
||||||
|
when '3', 'adv', 'an', 'c', 'ck', 'co', 'fa', 'fit', 'int', 'k', 'mu', 'n', 'o', 'p', 'po', 'soc', 'sp', 'toy', 'trv', 'v', 'vp', 'x'
|
||||||
|
url = "http://archive.no-ip.org/#{g.BOARD}/thread/#{g.THREAD_ID}"
|
||||||
|
else
|
||||||
|
url = "http://boards.4chan.org/#{g.BOARD}"
|
||||||
|
location.href = url
|
||||||
|
|
||||||
|
recaptcha =
|
||||||
|
listener: (e) ->
|
||||||
|
if e.keyCode is 8 and @value is ''
|
||||||
|
recaptcha.reload()
|
||||||
|
reload: ->
|
||||||
|
window.location = 'javascript:Recaptcha.reload()'
|
||||||
|
|
||||||
# TODO rewrite these **************************************************************************
|
# TODO rewrite these **************************************************************************
|
||||||
|
|
||||||
imageClick = (e) ->
|
imageClick = (e) ->
|
||||||
@ -1497,25 +1516,6 @@ autoWatch = ->
|
|||||||
autoText = $('textarea', this).value.slice(0, 25)
|
autoText = $('textarea', this).value.slice(0, 25)
|
||||||
GM_setValue('autoText', "/#{g.BOARD}/ - #{autoText}")
|
GM_setValue('autoText', "/#{g.BOARD}/ - #{autoText}")
|
||||||
|
|
||||||
recaptchaListener = (e) ->
|
|
||||||
if e.keyCode is 8 and @value is ''
|
|
||||||
recaptchaReload()
|
|
||||||
|
|
||||||
recaptchaReload = ->
|
|
||||||
window.location = 'javascript:Recaptcha.reload()'
|
|
||||||
|
|
||||||
redirect = ->
|
|
||||||
switch g.BOARD
|
|
||||||
when 'a', 'g', 'lit', 'sci', 'tv'
|
|
||||||
url = "http://green-oval.net/cgi-board.pl/#{g.BOARD}/thread/#{g.THREAD_ID}"
|
|
||||||
when 'cgl', 'jp', 'm', 'tg'
|
|
||||||
url = "http://archive.easymodo.net/cgi-board.pl/#{g.BOARD}/thread/#{g.THREAD_ID}"
|
|
||||||
when '3', 'adv', 'an', 'c', 'ck', 'co', 'fa', 'fit', 'int', 'k', 'mu', 'n', 'o', 'p', 'po', 'soc', 'sp', 'toy', 'trv', 'v', 'vp', 'x'
|
|
||||||
url = "http://archive.no-ip.org/#{g.BOARD}/thread/#{g.THREAD_ID}"
|
|
||||||
else
|
|
||||||
url = "http://boards.4chan.org/#{g.BOARD}"
|
|
||||||
location.href = url
|
|
||||||
|
|
||||||
# /TODO ***************************************************************
|
# /TODO ***************************************************************
|
||||||
|
|
||||||
#main
|
#main
|
||||||
@ -1682,7 +1682,7 @@ else
|
|||||||
for el in $$ '#recaptcha_table a'
|
for el in $$ '#recaptcha_table a'
|
||||||
el.tabIndex = 1
|
el.tabIndex = 1
|
||||||
recaptcha = $ '#recaptcha_response_field'
|
recaptcha = $ '#recaptcha_response_field'
|
||||||
$.bind recaptcha, 'keydown', recaptchaListener
|
$.bind recaptcha, 'keydown', recaptcha.listener
|
||||||
|
|
||||||
$.bind $('form[name=post]'), 'submit', qr.cb.submit
|
$.bind $('form[name=post]'), 'submit', qr.cb.submit
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user