diff --git a/4chan_x.user.js b/4chan_x.user.js index 3be948806..3fe9f23e0 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -5690,9 +5690,11 @@ }, cooldown: { init: function() { + var board; + board = g.BOARD.ID; QR.cooldown.types = { thread: (function() { - switch (g.BOARD) { + switch (board) { case 'q': return 86400; case 'b': @@ -5703,13 +5705,13 @@ return 300; } })(), - sage: g.BOARD === 'q' ? 600 : 60, - file: g.BOARD === 'q' ? 300 : 30, - post: g.BOARD === 'q' ? 60 : 30 + sage: board === 'q' ? 600 : 60, + file: board === 'q' ? 300 : 30, + post: board === 'q' ? 60 : 30 }; - QR.cooldown.cooldowns = $.get("" + g.BOARD + ".cooldown", {}); + QR.cooldown.cooldowns = $.get("" + board + ".cooldown", {}); QR.cooldown.start(); - return $.sync("" + g.BOARD + ".cooldown", QR.cooldown.sync); + return $.sync("" + board + ".cooldown", QR.cooldown.sync); }, start: function() { if (QR.cooldown.isCounting) { diff --git a/src/qr.coffee b/src/qr.coffee index 6145ade24..593a85002 100644 --- a/src/qr.coffee +++ b/src/qr.coffee @@ -118,17 +118,18 @@ QR = cooldown: init: -> + board = g.BOARD.ID QR.cooldown.types = - thread: switch g.BOARD + thread: switch board when 'q' then 86400 when 'b', 'soc', 'r9k' then 600 else 300 - sage: if g.BOARD is 'q' then 600 else 60 - file: if g.BOARD is 'q' then 300 else 30 - post: if g.BOARD is 'q' then 60 else 30 - QR.cooldown.cooldowns = $.get "#{g.BOARD}.cooldown", {} + sage: if board is 'q' then 600 else 60 + file: if board is 'q' then 300 else 30 + post: if board is 'q' then 60 else 30 + QR.cooldown.cooldowns = $.get "#{board}.cooldown", {} QR.cooldown.start() - $.sync "#{g.BOARD}.cooldown", QR.cooldown.sync + $.sync "#{board}.cooldown", QR.cooldown.sync start: -> return if QR.cooldown.isCounting QR.cooldown.isCounting = true