strip location.search stuff

This commit is contained in:
James Campos 2011-09-03 23:21:26 -07:00
parent e0212edafa
commit ea76eca01c
2 changed files with 4 additions and 56 deletions

View File

@ -1224,7 +1224,7 @@
};
QR = {
init: function() {
var accept, holder, m;
var accept, holder;
g.callbacks.push(function(root) {
var quote;
quote = $('a.quotejs + a', root);
@ -1257,14 +1257,9 @@
if (conf['Persistent QR']) {
QR.dialog();
if (conf['Auto Hide QR']) {
$('#autohide', QR.qr).checked = true;
return $('#autohide', QR.qr).checked = true;
}
}
if (conf['Cooldown'] && (m = location.search.match(/cooldown=(\d+)/))) {
cooldown = m[1];
$.set("cooldown/" + g.BOARD, cooldown);
return QR.cooldown();
}
},
attach: function() {
var div, file;
@ -1527,12 +1522,12 @@
}
},
sys: function() {
var duration, id, noko, recaptcha, sage, search, thread, url, watch, _, _ref;
var recaptcha;
if (recaptcha = $('#recaptcha_response_field')) {
$.bind(recaptcha, 'keydown', Recaptcha.listener);
return;
}
$.globalEval(function() {
return $.globalEval(function() {
var data, href, node, textContent, _ref;
if (node = (_ref = document.querySelector('table font b')) != null ? _ref.firstChild : void 0) {
textContent = node.textContent, href = node.href;
@ -1543,30 +1538,6 @@
}
return parent.postMessage(data, '*');
});
if (!(d = $('b').lastChild.data)) {
return;
}
_ref = d.match(/thread:(\d+),no:(\d+)/), _ = _ref[0], thread = _ref[1], id = _ref[2];
search = location.search;
cooldown = /cooldown/.test(search);
noko = /noko/.test(search);
sage = /sage/.test(search);
watch = /watch/.test(search);
url = "http://boards.4chan.org/" + g.BOARD;
if (watch && thread === '0') {
url += "/res/" + id + "?watch";
} else if (noko) {
url += '/res/';
url += thread === '0' ? id : thread;
}
if (cooldown) {
duration = Date.now() + (sage ? 60 : 30) * 1000;
url += '?cooldown=' + duration;
}
if (noko) {
url += '#' + id;
}
return window.location = url;
}
};
qr = {

View File

@ -991,10 +991,6 @@ QR =
QR.dialog()
if conf['Auto Hide QR']
$('#autohide', QR.qr).checked = true
if conf['Cooldown'] and m = location.search.match /cooldown=(\d+)/
cooldown = m[1]
$.set "cooldown/#{g.BOARD}", cooldown
QR.cooldown()
attach: ->
$('#auto', QR.qr).checked = true
div = $.el 'div',
@ -1203,25 +1199,6 @@ QR =
parent.postMessage data, '*'
#parent will blank us on message receival;
#if we're not an iframe, we won't get blanked
return unless d = $('b').lastChild.data #html comment
[_, thread, id] = d.match(/thread:(\d+),no:(\d+)/)
{search} = location
cooldown = /cooldown/.test search
noko = /noko/ .test search
sage = /sage/ .test search
watch = /watch/ .test search
url = "http://boards.4chan.org/#{g.BOARD}"
if watch and thread is '0'
url += "/res/#{id}?watch"
else if noko
url += '/res/'
url += if thread is '0' then id else thread
if cooldown
duration = Date.now() + (if sage then 60 else 30) * 1000
url += '?cooldown=' + duration
if noko
url += '#' + id
window.location = url
qr =
# TODO