jenkins-bot has submitted this change and it was merged.

Change subject: Cleanup inconsistent code style
......................................................................


Cleanup inconsistent code style

Change-Id: Ie3c660e7de32c11d2ee368783f0c66387a8f9157
---
M modules/ext.MassMessage.badhtml.js
1 file changed, 25 insertions(+), 25 deletions(-)

Approvals:
  Bartosz Dziewoński: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/ext.MassMessage.badhtml.js 
b/modules/ext.MassMessage.badhtml.js
index c64263f..a4acbf4 100644
--- a/modules/ext.MassMessage.badhtml.js
+++ b/modules/ext.MassMessage.badhtml.js
@@ -5,45 +5,46 @@
 ( function ( mw, $ ) {
        $( function () {
                'use strict';
-               var msg, warnings;
-               msg = $( '#mw-massmessage-form-message');
-               warnings = $('<div></div>').attr('id', 
'mw-massmessage-form-warnings').attr('class', 'warningbox');
-               msg.after(warnings);
-               warnings.hide();
-               msg.delayedBind( 500, 'keyup', function( ) {
-                       var code, regex, matches, tags, possibles, tag, 
warnings;
-                       code = $.trim( $( '#mw-massmessage-form-message' 
).val() );
+               var $msg, $warnings;
+               $msg = $( '#mw-massmessage-form-message' );
+               $warnings = $( '<div>' )
+                       .attr( 'id', 'mw-massmessage-form-warnings' )
+                       .addClass( 'warningbox' );
+               $msg.after( $warnings );
+               $warnings.hide();
+               $msg.delayedBind( 500, 'keyup', function( ) {
+                       var code, matches, tags, possibles, tag;
+                       code = $.trim( $msg.val() );
                        if( code === '' ) {
-                               $('#mw-massmessage-form-warnings').hide();
+                               $warnings.hide();
                                return;
                        }
 
-                       regex = /<.*?>/g;
-                       matches = code.match(regex);
+                       matches = code.match( /<.*?>/g );
                        if( !matches ) {
-                               $('#mw-massmessage-form-warnings').hide();
+                               $warnings.hide();
                                return;
                        }
 
                        tags = {};
 
-                       $.each(matches, function( idx, itm ) {
+                       $.each( matches, function( idx, itm ) {
                                var realTag, tag;
-                               //if the tag is, <..../>, it's self closing
+                               // if the tag is, <..../>, it's self closing
                                if ( itm.substr( itm.length - 2, itm.length ) 
!== '/>' ) {
 
-                                       //strip out any attributes
-                                       tag = itm.replace(/[<>]/g, '').split(' 
')[0];
-                                       //start or end tag?
-                                       if ( tag.charAt(0) !== '/' ) {
+                                       // strip out any attributes
+                                       tag = itm.replace( /[<>]/g, '' ).split( 
' ' )[0];
+                                       // start or end tag?
+                                       if ( tag.charAt( 0 ) !== '/' ) {
                                                if ( tags.hasOwnProperty( tag ) 
) {
                                                        tags[tag]++;
                                                } else {
                                                        tags[tag] = 1;
                                                }
                                        } else {
-                                               realTag = tag.substr(1, 
tag.length);
-                                               if 
(tags.hasOwnProperty(realTag)) {
+                                               realTag = tag.substr( 1, 
tag.length );
+                                               if ( tags.hasOwnProperty( 
realTag ) ) {
                                                        tags[realTag]--;
                                                } else {
                                                        tags[realTag] = -1;
@@ -58,12 +59,11 @@
                                        possibles.push( '<' + tag + '>' );
                                }
                        }
-                       warnings = $('#mw-massmessage-form-warnings');
-                       if (possibles.length) {
-                               warnings.show();
-                               warnings.text(mw.message( 
'massmessage-badhtml', possibles.join(', '), possibles.length ).text());
+                       if ( possibles.length ) {
+                               $warnings.show();
+                               $warnings.text( mw.message( 
'massmessage-badhtml', possibles.join(', '), possibles.length ).text() );
                        } else {
-                               warnings.hide();
+                               $warnings.hide();
                        }
                });
        });

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie3c660e7de32c11d2ee368783f0c66387a8f9157
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/extensions/MassMessage
Gerrit-Branch: master
Gerrit-Owner: Legoktm <[email protected]>
Gerrit-Reviewer: Bartosz Dziewoński <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to