Fix and improve.

This commit is contained in:
Nicolas Stepien 2011-06-26 04:10:50 +02:00
parent e6dc2f5a58
commit 1f39d1e085
2 changed files with 4 additions and 4 deletions

View File

@ -1147,7 +1147,7 @@
var input, time, _, _ref;
if (location.search) {
_ref = location.search.match(/cooldown=(\d+)/), _ = _ref[0], time = _ref[1];
if ($.getValue(g.BOARD + '/cooldown', 0 < time)) {
if ($.getValue(g.BOARD + '/cooldown', 0) < time) {
$.setValue(g.BOARD + '/cooldown', time);
}
}
@ -1161,7 +1161,7 @@
});
input = $('.postarea input[name=email]');
if (/sage/i.test(input.value)) {
$('.postarea form').action = "http://sys.4chan.org/" + g.BOARD + "/post?sage";
$('.postarea form').action += "?sage";
}
return $.bind(input, 'keyup', cooldown.sage);
},

View File

@ -913,13 +913,13 @@ cooldown =
init: ->
if location.search
[_, time] = location.search.match /cooldown=(\d+)/
$.setValue g.BOARD+'/cooldown', time if $.getValue g.BOARD+'/cooldown', 0 < time
$.setValue g.BOARD+'/cooldown', time if $.getValue(g.BOARD+'/cooldown', 0) < time
cooldown.start() if Date.now() < $.getValue g.BOARD+'/cooldown', 0
$.bind window, 'storage', (e) -> cooldown.start() if e.key is "#{NAMESPACE}#{g.BOARD}/cooldown"
input = $('.postarea input[name=email]')
if /sage/i.test input.value
$('.postarea form').action = "http://sys.4chan.org/#{g.BOARD}/post?sage"
$('.postarea form').action += "?sage"
$.bind input, 'keyup', cooldown.sage
sage: ->