diff --git a/src/tfd.js b/src/tfd.js index 786c38f..f6eb4de 100644 --- a/src/tfd.js +++ b/src/tfd.js @@ -51,6 +51,7 @@ 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;" }); @@ -76,6 +77,9 @@ TFD.prototype._error = function(msg, extra) { "persists, you can " + contact.prop("outerHTML") + " or " + file_bug.prop("outerHTML") + "." })); + + if (this.box.find(".tfdclerk-error")) + this.box.find(".tfdclerk-error").remove(); elem.insertAfter(this.box.find("h5")); this._block_submit("error"); }; diff --git a/tfdclerk.js b/tfdclerk.js index c8fcd89..c2be82f 100644 --- a/tfdclerk.js +++ b/tfdclerk.js @@ -50,7 +50,7 @@ var is_tfd_page = function() { if (is_tfd_page()) { mw.loader.using(dependencies, function() { - /* Main script starts here */ +/* Main script starts here */ @TFDCLERK_INCLUDE:main.js@ @TFDCLERK_INCLUDE:util.js@ @@ -58,9 +58,9 @@ if (is_tfd_page()) { @TFDCLERK_INCLUDE:tfd_close.js@ @TFDCLERK_INCLUDE:tfd_relist.js@ - $(TFDClerk.install); +$(TFDClerk.install); - /* Main script ends here */ +/* Main script ends here */ }); }