From 09dc37ea26fe6fd9bf494c9d1574a321df597e20 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Sun, 20 Sep 2015 01:06:45 -0500 Subject: [PATCH] Refactor out all CSS rules. --- src/main.css | 99 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/tfd.js | 46 ++++++++------------------ src/tfd_close.js | 21 ++++++------ src/tfd_relist.js | 7 ++-- 4 files changed, 126 insertions(+), 47 deletions(-) diff --git a/src/main.css b/src/main.css index e4ac5ea..9c50ea7 100644 --- a/src/main.css +++ b/src/main.css @@ -21,3 +21,102 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @TFDCLERK_HEADER_END@ */ + +/* General */ + +.tfdclerk-hooks { + margin-left: 1em; +} + +.tfdclerk-hook-divider { + display: inline; +} + +.tfdclerk-error { + color: #A00; +} + +.tfdclerk-error-extra { + font-family: monospace; +} + +.tfdclerk-box { + position: relative; + margin: 0.5em 0; + padding: 1em; + border: 1px solid #AAA; + color: #000; + background-color: #F9F9F9; +} + +.tfdclerk-box-info { + position: absolute; + right: 1em; + top: 0.5em; + font-size: 75%; + color: #777; +} + +.tfdclerk-box-heading { + margin: 0; + padding: 0 0 0.25em 0; +} + +.tfdclerk-submit { + margin-right: 0.5em; +} + +.tfdclerk-options { + border-spacing: 0; +} + +.tfdclerk-option-name { + padding-bottom: 0.75em; + padding-right: 0.5em; +} + +.tfdclerk-option-value { + padding-bottom: 0.75em; +} + +.tfdclerk-loading { + font-style: italic; + color: #777; +} + +/* Relisting */ + +.tfdclerk-discussion-info { + vertical-align: middle; + margin-left: 0.5em; +} + +.tfdclerk-bad-date { + color: #A00; +} + +/* Closing */ + +.tfdclerk-result-option { + margin: 0 1.25em 0 0.25em; +} + +.tfdclerk-result-other { + margin: 0 0.25em; +} + +.tfdclerk-close-actions { + margin: 0 0 0 1em; +} + +.tfdclerk-action-page { + font-weight: bold; +} + +.tfdclerk-backlink-sum-list { + display: inline; +} + +.tfdclerk-backlink-sum-div { + display: inline; +} diff --git a/src/tfd.js b/src/tfd.js index e1c98e5..03f689d 100644 --- a/src/tfd.js +++ b/src/tfd.js @@ -52,13 +52,12 @@ TFD.prototype._unblock_submit = function(reason) { TFD.prototype._error = function(msg, extra) { var elem = $("", { addClass: "tfdclerk-error", - html: "Error: " + (extra ? msg + ": " : msg), - style: "color: #A00;" + html: "Error: " + (extra ? msg + ": " : msg) }); if (extra) elem.append($("", { - text: extra, - style: "font-family: monospace;" + addClass: "tfdclerk-error-extra", + text: extra })); var contact = $("", { @@ -146,20 +145,9 @@ TFD.prototype._add_option_box = function(verb, title, callback, options) { var self = this; this.box = $("
", { id: "tfdclerk-" + verb + "-box-" + this.id, - addClass: "tfdclerk-" + verb + "-box" + addClass: "tfdclerk-box tfdclerk-" + verb + "-box" }) - .css("position", "relative") - .css("border", "1px solid #AAA") - .css("color", "#000") - .css("background-color", "#F9F9F9") - .css("margin", "0.5em 0") - .css("padding", "1em") - .append($("
") - .css("position", "absolute") - .css("right", "1em") - .css("top", "0.5em") - .css("font-size", "75%") - .css("color", "#777") + .append($("
", {addClass: "tfdclerk-box-info"}) .append($("", { href: TFDClerk.script_url, title: "tfdclerk.js", @@ -167,15 +155,14 @@ TFD.prototype._add_option_box = function(verb, title, callback, options) { })) .append($("", {text: " version " + TFDClerk.version}))) .append($("
", { - text: title, - style: "margin: 0; padding: 0 0 0.25em 0;" + addClass: "tfdclerk-box-heading", + text: title })); options.call(this); this.box.append($("