Cicalese has submitted this change and it was merged.

Change subject: Ensure comment title/text can't be only whitespace
......................................................................


Ensure comment title/text can't be only whitespace

Change-Id: I8761591cead9c2248c8a59bb958465ff553faba9
---
M resources/CommentStreams.js
1 file changed, 4 insertions(+), 4 deletions(-)

Approvals:
  Cicalese: Verified; Looks good to me, approved



diff --git a/resources/CommentStreams.js b/resources/CommentStreams.js
index d07ee46..403291b 100644
--- a/resources/CommentStreams.js
+++ b/resources/CommentStreams.js
@@ -422,14 +422,14 @@
                        var titleField = $( '#cs-title-edit-field' );
                        if ( titleField !== null ) {
                                var commentTitle = titleField .val();
-                               if ( commentTitle === null || commentTitle === 
"" ) {
+                               if ( commentTitle === null || 
commentTitle.trim() === "" ) {
                                        this.reportError( 
'commentstreams-validation-error-nocommenttitle' );
                                        return;
                                }
                        }
 
                        var commentText = $( '#cs-body-edit-field' ).val();
-                       if ( commentText === null || commentText === "" ) {
+                       if ( commentText === null || commentText.trim() === "" 
) {
                                this.reportError( 
'commentstreams-validation-error-nocommenttext' );
                                return;
                        }
@@ -598,7 +598,7 @@
                                                        var titleField = $( 
'#cs-title-edit-field' );
                                                        if ( titleField !== 
null ) {
                                                                var 
commentTitle = $( '#cs-title-edit-field' ).val();
-                                                               if ( 
commentTitle === null || commentTitle === "" ) {
+                                                               if ( 
commentTitle === null || commentTitle.trim() === "" ) {
                                                                        
self.reportError(
                                                                                
'commentstreams-validation-error-nocommenttitle' );
                                                                        return;
@@ -606,7 +606,7 @@
                                                        }
 
                                                        var commentText = $( 
'#cs-body-edit-field' ).val();
-                                                       if ( commentText === 
null || commentText === "" ) {
+                                                       if ( commentText === 
null || commentText.trim() === "" ) {
                                                                
self.reportError(
                                                                        
'commentstreams-validation-error-nocommenttext' );
                                                                return;

-- 
To view, visit https://gerrit.wikimedia.org/r/323320
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I8761591cead9c2248c8a59bb958465ff553faba9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CommentStreams
Gerrit-Branch: master
Gerrit-Owner: Cicalese <cical...@mitre.org>
Gerrit-Reviewer: Cicalese <cical...@mitre.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to