]> git.openstreetmap.org Git - osqa.git/commitdiff
OSQA-313
authorqw3rty <qw3rty@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Fri, 11 Jun 2010 18:22:53 +0000 (18:22 +0000)
committerqw3rty <qw3rty@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Fri, 11 Jun 2010 18:22:53 +0000 (18:22 +0000)
users can no longer add repeating spaces to get around the minimum comment length.

git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@409 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum/skins/default/media/js/osqa.main.js

index c78367bf3333c3d42ba750a0a86472c84be2d3ca..8326eb0f2de5b1ab6922239de3134d70b543911f 100644 (file)
@@ -390,7 +390,7 @@ $(function() {
         cleanup_form();\r
 \r
         function process_form_changes() {\r
-            var length = $textarea.val().length;\r
+            var length = $textarea.val().replace(/[ ]{2,}/g," ").length;\r
 \r
             if (current_length == length)\r
                 return;\r
@@ -406,6 +406,7 @@ $(function() {
                 $chars_togo_message.show();\r
                 $chars_counter.html(min_length - length);\r
             } else {\r
+                length = $textarea.val().length;\r
                 $chars_togo_message.hide();\r
                 $chars_left_message.show();\r
                 $chars_counter.html(max_length - length);\r