X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fresources%2Fstatic%2Fjavascript%2Fsone.js;h=6022655cea2a2ae7fb476818de55016665a7cbe7;hb=c67605d6ee939160420d176cba9571f442c14978;hp=9ef681203c8ec20a578460ee9c8be8f8d63efe1d;hpb=c3745c94d79e6fba53c95003287f539b79b2e749;p=Sone.git diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index 9ef6812..6022655 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -639,6 +639,8 @@ function ajaxifyPost(postElement) { return false; }); $(postElement).find(".create-reply button:submit").click(function() { + button = $(this); + button.attr("disabled", "disabled"); sender = $(this.form).find(":input[name=sender]").val(); inputField = $(this.form).find(":input[name=text]:enabled").get(0); postId = getPostId(this); @@ -655,6 +657,7 @@ function ajaxifyPost(postElement) { } else { alert(error); } + button.removeAttr("disabled"); }); })(sender, postId, text, inputField); return false; @@ -1298,6 +1301,8 @@ $(document).ready(function() { return false; }); $("#sone #update-status").submit(function() { + button = $("button:submit", this); + button.attr("disabled", "disabled"); if ($(this).find(":input.default:enabled").length > 0) { return false; } @@ -1307,6 +1312,7 @@ $(document).ready(function() { if ((data != null) && data.success) { loadNewPost(data.postId, data.sone, data.recipient); } + button.removeAttr("disabled"); }); $(this).find(":input[name=sender]").val(getCurrentSoneId()); $(this).find(":input[name=text]:enabled").val("").blur(); @@ -1316,6 +1322,11 @@ $(document).ready(function() { }); }); + /* ajaxify the search input field. */ + getTranslation("WebInterface.DefaultText.Search", function(defaultText) { + registerInputTextareaSwap("#sone #search input[name=query]", defaultText, "query", false, true); + }); + /* ajaxify input field on “view Sone” page. */ getTranslation("WebInterface.DefaultText.Message", function(defaultText) { registerInputTextareaSwap("#sone #post-message input[name=text]", defaultText, "text", false, false);