From 9238b3987409faaae4dbff1a6597867ad6b46e3c Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sat, 21 Feb 2015 20:35:12 -0800 Subject: [PATCH] Additional cooldown -> custom cooldown. --- src/General/Config.coffee | 2 +- src/General/Settings.coffee | 4 ++-- src/General/css/style.css | 4 ++-- src/General/html/Features/QuickReply.html | 2 +- src/General/html/Settings/Advanced.html | 4 ++-- src/Posting/QR.coffee | 18 +++++++++--------- src/Posting/QR.cooldown.coffee | 8 ++++---- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/General/Config.coffee b/src/General/Config.coffee index 525d65438..6f05a766e 100755 --- a/src/General/Config.coffee +++ b/src/General/Config.coffee @@ -936,4 +936,4 @@ Config = ] 'Interval': 30 - additionalCooldown: 0 + customCooldown: 0 diff --git a/src/General/Settings.coffee b/src/General/Settings.coffee index af928ff94..2a5b719e9 100755 --- a/src/General/Settings.coffee +++ b/src/General/Settings.coffee @@ -315,7 +315,7 @@ Settings = items = {} inputs = {} - for name in ['boardnav', 'time', 'backlink', 'fileInfo', 'favicon', 'usercss', 'additionalCooldown'] + for name in ['boardnav', 'time', 'backlink', 'fileInfo', 'favicon', 'usercss', 'customCooldown'] input = $ "[name='#{name}']", section items[name] = Conf[name] inputs[name] = input @@ -339,7 +339,7 @@ Settings = for key, val of items input = inputs[key] input.value = val - continue if key in ['usercss', 'additionalCooldown'] + continue if key in ['usercss', 'customCooldown'] Settings[key].call input return diff --git a/src/General/css/style.css b/src/General/css/style.css index 477947a8b..1b4b7ed7f 100755 --- a/src/General/css/style.css +++ b/src/General/css/style.css @@ -1321,10 +1321,10 @@ input#qr-filename:not(.edit) { #file-n-submit { height: 23px; } -#file-n-submit.add-cooldown { +#file-n-submit.custom-cooldown { height: 43px; } -#file-n-submit:not(.add-cooldown) #add-cooldown-label { +#file-n-submit:not(.custom-cooldown) #custom-cooldown-label { display: none; } #qr input[type="file"] { diff --git a/src/General/html/Features/QuickReply.html b/src/General/html/Features/QuickReply.html index fa1187734..5890a255a 100755 --- a/src/General/html/Features/QuickReply.html +++ b/src/General/html/Features/QuickReply.html @@ -36,7 +36,7 @@ - + diff --git a/src/General/html/Settings/Advanced.html b/src/General/html/Settings/Advanced.html index 2e3b27d93..2814d98f8 100755 --- a/src/General/html/Settings/Advanced.html +++ b/src/General/html/Settings/Advanced.html @@ -110,9 +110,9 @@
- Additional Cooldown Time + Custom Cooldown Time
- Seconds: + Seconds:
diff --git a/src/Posting/QR.coffee b/src/Posting/QR.coffee index b2cfeb098..8093221a6 100644 --- a/src/Posting/QR.coffee +++ b/src/Posting/QR.coffee @@ -166,11 +166,11 @@ QR = else QR.unhide() - toggleAddCooldown: -> + toggleCustomCooldown: -> if @checked - QR.cooldown.addCooldown = true + QR.cooldown.customCooldown = true else - QR.cooldown.addCooldown = false + QR.cooldown.customCooldown = false error: (err) -> QR.open() @@ -491,7 +491,7 @@ QR = setNode 'spoilerPar', '#qr-spoiler-label' setNode 'status', '[type=submit]' setNode 'fileInput', '[type=file]' - setNode 'addCooldown', '[data-name=addCooldown]' + setNode 'customCooldown', '[data-name=customCooldown]' rules = $('ul.rules').textContent.trim() match_min = rules.match(/.+smaller than (\d+)x(\d+).+/) @@ -529,10 +529,10 @@ QR = else nodes.spoiler.parentElement.hidden = true - if parseInt(Conf['additionalCooldown']) > 0 - $.addClass QR.nodes.fileSubmit, 'add-cooldown' + if parseInt(Conf['customCooldown']) > 0 + $.addClass QR.nodes.fileSubmit, 'custom-cooldown' else - $.rmClass QR.nodes.fileSubmit, 'add-cooldown' + $.rmClass QR.nodes.fileSubmit, 'custom-cooldown' if g.BOARD.ID is 'f' and g.VIEW isnt 'thread' nodes.flashTag = $.el 'select', @@ -564,8 +564,8 @@ QR = $.on nodes.fileExtras, 'click', (e) -> e.stopPropagation() $.on nodes.spoiler, 'change', -> QR.selected.nodes.spoiler.click() $.on nodes.fileInput, 'change', QR.handleFiles - if parseInt(Conf['additionalCooldown']) > 0 - $.on nodes.addCooldown,'change', QR.toggleAddCooldown + if parseInt(Conf['customCooldown']) > 0 + $.on nodes.customCooldown,'change', QR.toggleCustomCooldown # save selected post's data items = ['thread', 'name', 'email', 'sub', 'com', 'filename'] diff --git a/src/Posting/QR.cooldown.coffee b/src/Posting/QR.cooldown.coffee index 50bf5aee4..2bc624e6c 100644 --- a/src/Posting/QR.cooldown.coffee +++ b/src/Posting/QR.cooldown.coffee @@ -110,8 +110,8 @@ QR.cooldown = QR.cooldown.maxDelay else QR.cooldown.delays[if scope is 'global' then 'thread_global' else 'thread'] - if QR.cooldown.addCooldown - maxDelay += parseInt(Conf['additionalCooldown']) + if QR.cooldown.customCooldown + maxDelay = Math.max maxDelay, parseInt(Conf['customCooldown'], 10) if maxDelay <= elapsed delete QR.cooldown[scope][start] save = true @@ -130,8 +130,8 @@ QR.cooldown = seconds = Math.max seconds, QR.cooldown.delays[type + suffix] - elapsed # If additional cooldown is enabled, add the configured seconds to the count. - if QR.cooldown.addCooldown - seconds = Math.max seconds, QR.cooldown.delays[type] + parseInt(Conf['additionalCooldown']) - elapsed + if QR.cooldown.customCooldown + seconds = Math.max seconds, parseInt(Conf['customCooldown'], 10) - elapsed QR.cooldown.save scope if save