From: David ‘Bombe’ Roden Date: Wed, 20 Oct 2010 08:27:48 +0000 (+0200) Subject: Fix posting of comments. X-Git-Tag: 0.1-RC1~165 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=166dc6b6fe82485e8b66f713f6822d60cbde386d;p=Sone.git Fix posting of comments. --- diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index 7fbdab9..13d990d 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -1,25 +1,23 @@ /* Sone JavaScript functions. */ function registerInputTextareaSwap(inputSelector, defaultText) { - (function(inputSelector, defaultText) { - $(inputSelector).focus(function() { + $(inputSelector).each(function() { + $(this).focus(function() { if ($(this).hasClass("default")) { $(this).removeClass("default").val(""); } }).blur(function() { - alert($(this).val()); if ($(this).val() == "") { - alert("setting default"); $(this).val(defaultText).addClass("default"); } }).addClass("default").val(defaultText); - $($(inputSelector).get(0).form).submit(function() { - if ($(inputSelector).hasClass("default")) { - $(inputSelector).val(""); + var inputField = $(this); + $(this.form).submit(function() { + if (inputField.hasClass("default")) { + inputField.val(""); } - alert(($(inputSelector).hasClass("default") ? "def: ": "ok: ") + $(inputSelector).val()); }); - })(inputSelector, defaultText); + }); } /* hide all the “create reply” forms until a link is clicked. */ diff --git a/src/main/resources/templates/include/updateStatus.html b/src/main/resources/templates/include/updateStatus.html index a769503..63b4b8f 100644 --- a/src/main/resources/templates/include/updateStatus.html +++ b/src/main/resources/templates/include/updateStatus.html @@ -3,7 +3,7 @@ - +