Legoktm has uploaded a new change for review.
https://gerrit.wikimedia.org/r/97468
Change subject: Cleanup inconsistent code style
......................................................................
Cleanup inconsistent code style
Change-Id: Ie3c660e7de32c11d2ee368783f0c66387a8f9157
---
M modules/ext.MassMessage.badhtml.js
1 file changed, 16 insertions(+), 14 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MassMessage
refs/changes/68/97468/1
diff --git a/modules/ext.MassMessage.badhtml.js
b/modules/ext.MassMessage.badhtml.js
index 1a1d081..cf5c1e1 100644
--- a/modules/ext.MassMessage.badhtml.js
+++ b/modules/ext.MassMessage.badhtml.js
@@ -6,44 +6,46 @@
$( 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);
+ 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() );
if( code === '' ) {
- $('#mw-massmessage-form-warnings').hide();
+ $( '#mw-massmessage-form-warnings' ).hide();
return;
}
regex = /<.*?>/g;
- matches = code.match(regex);
+ matches = code.match( regex );
if( !matches.length ) {
- $('#mw-massmessage-form-warnings').hide();
+ $( '#mw-massmessage-form-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 ( itm.substr( itm.length - 2, itm.length )
!== '/>' ) {
//strip out any attributes
- tag = itm.replace(/[<>]/g, '').split('
')[0];
+ tag = itm.replace( /[<>]/g, '' ).split(
' ' )[0];
//start or end tag?
- if ( tag.charAt(0) !== '/' ) {
+ 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,10 +60,10 @@
possibles.push( '<' + tag + '>' );
}
}
- warnings = $('#mw-massmessage-form-warnings');
- if (possibles.length) {
+ warnings = $( '#mw-massmessage-form-warnings' );
+ if ( possibles.length ) {
warnings.show();
- warnings.text(mw.message(
'massmessage-badhtml', possibles.join(', '), possibles.length ).text());
+ warnings.text( mw.message(
'massmessage-badhtml', possibles.join(', '), possibles.length ).text() );
} else {
warnings.hide();
}
--
To view, visit https://gerrit.wikimedia.org/r/97468
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie3c660e7de32c11d2ee368783f0c66387a8f9157
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MassMessage
Gerrit-Branch: master
Gerrit-Owner: Legoktm <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits