Don’t post a new status if no text was entered.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 30 Dec 2010 20:33:31 +0000 (21:33 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 30 Dec 2010 20:33:31 +0000 (21:33 +0100)
src/main/resources/static/javascript/sone.js

index acb1d46..898c3c0 100644 (file)
@@ -823,6 +823,9 @@ $(document).ready(function() {
        getTranslation("WebInterface.DefaultText.StatusUpdate", function(defaultText) {
                registerInputTextareaSwap("#sone #update-status .status-input", defaultText, "text", false, false);
                $("#sone #update-status").submit(function() {
+                       if ($(this).find(":input").hasClass("default")) {
+                               return false;
+                       }
                        text = $(this).find(":input:enabled").val();
                        $.getJSON("createPost.ajax", { "formPassword": getFormPassword(), "text": text }, function(data, textStatus) {
                                if ((data != null) && data.success) {