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

Change subject: Apply coding conventions for JavaScript
......................................................................


Apply coding conventions for JavaScript

* Fix whitespaces
* Add closure
* Reduce global variables

Change-Id: I589b3111d8097386139f2732f33ea2c2f55842e0
---
M resources/UiBuilder.js
M resources/apiSandbox.js
M resources/main.js
3 files changed, 25 insertions(+), 23 deletions(-)

Approvals:
  MaxSem: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/resources/UiBuilder.js b/resources/UiBuilder.js
index 99a20e6..544e8f8 100644
--- a/resources/UiBuilder.js
+++ b/resources/UiBuilder.js
@@ -192,7 +192,7 @@
                                        $node = $( '#param-' + name );
                                        if ( param.type === 'boolean' ) {
                                                if ( $node.prop( 'checked' ) 
=== true ) {
-                                                       //the = is needed (at 
least in post), see bug 25174
+                                                       // the = is needed (at 
least in post), see bug 25174
                                                        params += '&' + name + 
'=';
                                                }
                                        } else {
diff --git a/resources/apiSandbox.js b/resources/apiSandbox.js
index 7601c98..5b3be04 100644
--- a/resources/apiSandbox.js
+++ b/resources/apiSandbox.js
@@ -1,22 +1,24 @@
 /*jslint regexp: true, browser: true, continue: true, sloppy: true, white: 
true, forin: true, plusplus: true */
-/*global mediaWiki,mw */
-mediaWiki.apiSandbox = {
-       namespaceOptions: [],
+/*global jQuery, mediaWiki */
+( function ( $, mw ) {
+       mw.apiSandbox = {
+               namespaceOptions: [],
 
-       // build namespace cache
-       init: function() {
-               $.each( mw.config.get( 'wgFormattedNamespaces' ), function ( 
nsId, nsName ) {
-                       if ( Number( nsId ) >= 0 ) {
-                               if ( nsId === '0' ) {
-                                       nsName = mw.msg( 'apisb-ns-main' );
+               // build namespace cache
+               init: function () {
+                       $.each( mw.config.get( 'wgFormattedNamespaces' ), 
function ( nsId, nsName ) {
+                               if ( Number( nsId ) >= 0 ) {
+                                       if ( nsId === '0' ) {
+                                               nsName = mw.msg( 
'apisb-ns-main' );
+                                       }
+                                       mw.apiSandbox.namespaceOptions.push( {
+                                               key: nsId,
+                                               value: nsName
+                                       } );
                                }
-                               mw.apiSandbox.namespaceOptions.push( {
-                                       key: nsId,
-                                       value: nsName
-                               } );
-                       }
-               } );
-       }
-};
+                       } );
+               }
+       };
 
-mediaWiki.apiSandbox.init();
+       mw.apiSandbox.init();
+}( jQuery, mediaWiki ) );
diff --git a/resources/main.js b/resources/main.js
index a2f94c8..0ee1ab3 100644
--- a/resources/main.js
+++ b/resources/main.js
@@ -1,4 +1,4 @@
-/*global jQuery, mediaWiki, apiSandbox, mw*/
+/*global jQuery, mediaWiki*/
 /*jslint regexp: true, browser: true, continue: true, sloppy: true, white: 
true, forin: true, plusplus: true */
 ( function ( $, mw, apiSandbox, undefined ) {
 
@@ -380,7 +380,7 @@
                        function () {
                                var info = {};
                                if ( isQuery ) {
-                                       $.each( queryModules, function ( key, 
queryModule )  {
+                                       $.each( queryModules, function ( key, 
queryModule ) {
                                                info[queryModule] = 
paramInfo.querymodules[queryModule];
                                        } );
                                } else {
@@ -434,7 +434,7 @@
         *
         * @param html {string} HTML source of a MediaWiki page
         * @return {number|null} Backend response time in seconds or null if a 
value
-        *  could not be extracted
+        * could not be extracted
         */
        function extractResponseTime( html ) {
                var match;
@@ -669,4 +669,4 @@
                } );
                doHash();
        } );
-}( jQuery, mediaWiki, mw.apiSandbox ) );
+}( jQuery, mediaWiki, mediaWiki.apiSandbox ) );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I589b3111d8097386139f2732f33ea2c2f55842e0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ApiSandbox
Gerrit-Branch: master
Gerrit-Owner: Gerrit Patch Uploader <[email protected]>
Gerrit-Reviewer: Gerrit Patch Uploader <[email protected]>
Gerrit-Reviewer: Jackmcbarn <[email protected]>
Gerrit-Reviewer: MaxSem <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to