From ee53c212cf0ca88ecf453e6de89ae42dcd7bc5b3 Mon Sep 17 00:00:00 2001
From: AchtBit <8bitfur@gmail.com>
Date: Sun, 15 Feb 2015 16:57:02 -0600
Subject: [PATCH 1/5] Implement additional cooldown.
---
src/General/Config.coffee | 2 ++
src/General/Settings.coffee | 4 ++--
src/General/css/style.css | 3 +++
src/General/html/Features/QuickReply.html | 1 +
src/General/html/Settings/Advanced.html | 7 +++++++
src/Posting/QR.coffee | 18 ++++++++++++++++++
src/Posting/QR.cooldown.coffee | 8 ++++++++
7 files changed, 41 insertions(+), 2 deletions(-)
diff --git a/src/General/Config.coffee b/src/General/Config.coffee
index 67f941ae4..525d65438 100755
--- a/src/General/Config.coffee
+++ b/src/General/Config.coffee
@@ -935,3 +935,5 @@ Config =
'Increase the intervals between updates on threads without new posts.'
]
'Interval': 30
+
+ additionalCooldown: 0
diff --git a/src/General/Settings.coffee b/src/General/Settings.coffee
index 1518da3df..af928ff94 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']
+ for name in ['boardnav', 'time', 'backlink', 'fileInfo', 'favicon', 'usercss', 'additionalCooldown']
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 is 'usercss'
+ continue if key in ['usercss', 'additionalCooldown']
Settings[key].call input
return
diff --git a/src/General/css/style.css b/src/General/css/style.css
index fed33c815..014e807e1 100755
--- a/src/General/css/style.css
+++ b/src/General/css/style.css
@@ -1277,6 +1277,9 @@ input#qr-filename:not(.edit) {
#file-n-submit {
height: 23px;
}
+#file-n-submit.add-cooldown {
+ height: 43px;
+}
#qr input[type="file"] {
visibility: hidden;
position: absolute;
diff --git a/src/General/html/Features/QuickReply.html b/src/General/html/Features/QuickReply.html
index c1401fc53..c9ed33c32 100755
--- a/src/General/html/Features/QuickReply.html
+++ b/src/General/html/Features/QuickReply.html
@@ -36,6 +36,7 @@
+ #{if parseInt(Conf['additionalCooldown']) > 0 then 'Enable Custom Cooldown' else ''}
diff --git a/src/General/html/Settings/Advanced.html b/src/General/html/Settings/Advanced.html
index 6a2b6c095..dbd7a1326 100755
--- a/src/General/html/Settings/Advanced.html
+++ b/src/General/html/Settings/Advanced.html
@@ -109,6 +109,13 @@
+
+