Fix and improve.
This commit is contained in:
parent
e6dc2f5a58
commit
1f39d1e085
@ -1147,7 +1147,7 @@
|
|||||||
var input, time, _, _ref;
|
var input, time, _, _ref;
|
||||||
if (location.search) {
|
if (location.search) {
|
||||||
_ref = location.search.match(/cooldown=(\d+)/), _ = _ref[0], time = _ref[1];
|
_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);
|
$.setValue(g.BOARD + '/cooldown', time);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1161,7 +1161,7 @@
|
|||||||
});
|
});
|
||||||
input = $('.postarea input[name=email]');
|
input = $('.postarea input[name=email]');
|
||||||
if (/sage/i.test(input.value)) {
|
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);
|
return $.bind(input, 'keyup', cooldown.sage);
|
||||||
},
|
},
|
||||||
|
|||||||
@ -913,13 +913,13 @@ cooldown =
|
|||||||
init: ->
|
init: ->
|
||||||
if location.search
|
if location.search
|
||||||
[_, time] = location.search.match /cooldown=(\d+)/
|
[_, 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
|
cooldown.start() if Date.now() < $.getValue g.BOARD+'/cooldown', 0
|
||||||
$.bind window, 'storage', (e) -> cooldown.start() if e.key is "#{NAMESPACE}#{g.BOARD}/cooldown"
|
$.bind window, 'storage', (e) -> cooldown.start() if e.key is "#{NAMESPACE}#{g.BOARD}/cooldown"
|
||||||
|
|
||||||
input = $('.postarea input[name=email]')
|
input = $('.postarea input[name=email]')
|
||||||
if /sage/i.test input.value
|
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
|
$.bind input, 'keyup', cooldown.sage
|
||||||
|
|
||||||
sage: ->
|
sage: ->
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user