jenkins-bot has submitted this change and it was merged.
Change subject: Beautify JS in modules
......................................................................
Beautify JS in modules
* Used js-beautify tool.
* JS coding standards as per MediaWiki.
* Fixed indentation 'by hand' where js-beautify fails.
Change-Id: I1e92efdf70ff47e0c31ca7ffc1098dea5bac0aee
---
M modules/base/ext.cx.base.js
M modules/base/ext.cx.datamanager.js
M modules/header/ext.cx.header.js
M modules/header/ext.cx.header.render.js
M modules/header/ext.cx.progressbar.js
M modules/source/ext.cx.source.js
M modules/tools/ext.cx.tools.helpmessage.js
M modules/tools/ext.cx.tools.js
M modules/translation/ext.cx.translation.js
9 files changed, 15 insertions(+), 22 deletions(-)
Approvals:
Amire80: Looks good to me, approved
jenkins-bot: Verified
diff --git a/modules/base/ext.cx.base.js b/modules/base/ext.cx.base.js
index b612fb0..d9dc437 100644
--- a/modules/base/ext.cx.base.js
+++ b/modules/base/ext.cx.base.js
@@ -17,7 +17,7 @@
* @class
*/
function ContentTranslation( element, options ) {
- this.$container = $( element );
+ this.$container = $( element );
this.$translation = null;
this.$header = null;
this.$source = null;
@@ -66,13 +66,11 @@
data = $this.data( 'cx' );
if ( !data ) {
- $this.data( 'cx',
- ( data = new ContentTranslation( this,
options ) )
- );
+ $this.data( 'cx', ( data = new
ContentTranslation( this, options ) ) );
}
if ( typeof options === 'string' ) {
- data[options].call( $this );
+ data[ options ].call( $this );
}
} );
};
diff --git a/modules/base/ext.cx.datamanager.js
b/modules/base/ext.cx.datamanager.js
index 450be01..a404c73 100644
--- a/modules/base/ext.cx.datamanager.js
+++ b/modules/base/ext.cx.datamanager.js
@@ -19,7 +19,7 @@
mw.log( '[CX] Connected to server' );
}
- function updateModel( data) {
+ function updateModel( data ) {
mw.log( '[CX] Received data from server' );
mw.cx.data = data;
mw.hook( 'mw.cx.source.ready' ).fire();
diff --git a/modules/header/ext.cx.header.js b/modules/header/ext.cx.header.js
index 9d19472..bd0fa09 100644
--- a/modules/header/ext.cx.header.js
+++ b/modules/header/ext.cx.header.js
@@ -51,13 +51,12 @@
if ( !data ) {
$this.data(
- 'cxHeader',
- ( data = new ContentTranslationHeader(
this, options ) )
+ 'cxHeader', ( data = new
ContentTranslationHeader( this, options ) )
);
}
if ( typeof options === 'string' ) {
- data[options].call( $this );
+ data[ options ].call( $this );
}
} );
};
diff --git a/modules/header/ext.cx.header.render.js
b/modules/header/ext.cx.header.render.js
index 618609b..df76cc4 100644
--- a/modules/header/ext.cx.header.render.js
+++ b/modules/header/ext.cx.header.render.js
@@ -22,7 +22,7 @@
$( '<a>' )
.addClass(
'cx-header__user-details__user-name' )
.attr( 'href', mw.util.getUrl(
'User:' + mw.user.getName() ) )
- .text ( mw.user.getName() )
+ .text( mw.user.getName() )
)
);
diff --git a/modules/header/ext.cx.progressbar.js
b/modules/header/ext.cx.progressbar.js
index 3c0d6e4..71c315a 100644
--- a/modules/header/ext.cx.progressbar.js
+++ b/modules/header/ext.cx.progressbar.js
@@ -61,13 +61,11 @@
data = $this.data( 'cxProgressBar' );
if ( !data ) {
- $this.data( 'cxProgressBar',
- ( data = new ProgressBar( this, options
) )
- );
+ $this.data( 'cxProgressBar', ( data = new
ProgressBar( this, options ) ) );
}
if ( typeof options === 'string' ) {
- data[options].call( $this );
+ data[ options ].call( $this );
}
} );
};
diff --git a/modules/source/ext.cx.source.js b/modules/source/ext.cx.source.js
index 93306b3..db4b0b0 100644
--- a/modules/source/ext.cx.source.js
+++ b/modules/source/ext.cx.source.js
@@ -89,13 +89,12 @@
if ( !data ) {
$this.data(
- 'cxSource',
- ( data = new ContentTranslationSource(
this, options ) )
+ 'cxSource', ( data = new
ContentTranslationSource( this, options ) )
);
}
if ( typeof options === 'string' ) {
- data[options].call( $this );
+ data[ options ].call( $this );
}
} );
};
diff --git a/modules/tools/ext.cx.tools.helpmessage.js
b/modules/tools/ext.cx.tools.helpmessage.js
index b32effe..98b806f 100644
--- a/modules/tools/ext.cx.tools.helpmessage.js
+++ b/modules/tools/ext.cx.tools.helpmessage.js
@@ -57,4 +57,4 @@
);
};
-}( jQuery, mediaWiki ) );
\ No newline at end of file
+}( jQuery, mediaWiki ) );
diff --git a/modules/tools/ext.cx.tools.js b/modules/tools/ext.cx.tools.js
index 267ca9b..5b240fe 100644
--- a/modules/tools/ext.cx.tools.js
+++ b/modules/tools/ext.cx.tools.js
@@ -49,13 +49,11 @@
data = $this.data( 'cxTools' );
if ( !data ) {
- $this.data( 'cxTools',
- ( data = new ContentTranslationTools(
this, options ) )
- );
+ $this.data( 'cxTools', ( data = new
ContentTranslationTools( this, options ) ) );
}
if ( typeof options === 'string' ) {
- data[options].call( $this );
+ data[ options ].call( $this );
}
} );
};
diff --git a/modules/translation/ext.cx.translation.js
b/modules/translation/ext.cx.translation.js
index 21e7a08..6f7059c 100644
--- a/modules/translation/ext.cx.translation.js
+++ b/modules/translation/ext.cx.translation.js
@@ -76,6 +76,7 @@
ContentTranslationEditor.prototype.listen = function () {
mw.hook( 'mw.cx.translation.add' ).add( $.proxy( this.update,
this ) );
mw.hook( 'mw.cx.source.loaded' ).add( $.proxy(
this.addPlaceholders, this ) );
+
this.$content.on( 'input', function () {
mw.hook( 'mw.cx.translation.change' ).fire();
} );
--
To view, visit https://gerrit.wikimedia.org/r/119462
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I1e92efdf70ff47e0c31ca7ffc1098dea5bac0aee
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: KartikMistry <[email protected]>
Gerrit-Reviewer: Amire80 <[email protected]>
Gerrit-Reviewer: Divec <[email protected]>
Gerrit-Reviewer: Nikerabbit <[email protected]>
Gerrit-Reviewer: Santhosh <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits