Gerrit Patch Uploader has uploaded a new change for review. https://gerrit.wikimedia.org/r/166023
Change subject: Apply coding conventions for JavaScript ...................................................................... Apply coding conventions for JavaScript * Fix closure invocation * Avoid global variablesin closure * Avoid unused variable * Fix whitespaces Change-Id: I67552a67e8ab493e5af8717c11668430886ee468 --- M modules/ext.codeEditor.geshi.js 1 file changed, 10 insertions(+), 12 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CodeEditor refs/changes/23/166023/1 diff --git a/modules/ext.codeEditor.geshi.js b/modules/ext.codeEditor.geshi.js index 6bafa2b..791dd5e 100644 --- a/modules/ext.codeEditor.geshi.js +++ b/modules/ext.codeEditor.geshi.js @@ -4,7 +4,7 @@ * Needs some code de-dup with the full-page JS/CSS page editing. */ /*global require, ace */ -(function ( $, mw ) { +( function ( $, mw ) { $( function () { var $sources, setupEditor, openEditor; @@ -16,7 +16,7 @@ var $link, $edit; $link = $( '<a>' ) - .text( mediaWiki.msg( 'editsection' ) ) + .text( mw.msg( 'editsection' ) ) .attr( 'href', '#' ) .attr( 'title', 'Edit this code section' ) .click( function ( event ) { @@ -41,7 +41,7 @@ if ( matches ) { geshiLang = matches[1]; } - mediaWiki.loader.using( 'ext.codeEditor.ace.modes', function () { + mw.loader.using( 'ext.codeEditor.ace.modes', function () { var map, $container, $save, $cancel, $controls, setLanguage, closeEditor; // @fixme de-duplicate @@ -84,12 +84,12 @@ $langDropDown .val( geshiLang ) .appendTo( $label ) - .change( function ( ) { + .change( function () { setLanguage( $( this ).val() ); } ); $save = $( '<button>' ) - .text( mediaWiki.msg( 'savearticle' ) ) - .click( function ( ) { + .text( mw.msg( 'savearticle' ) ) + .click( function () { // horrible hack ;) var src, tag; @@ -154,11 +154,9 @@ } ); }; - $sources.each( function ( i, div ) { - var $div = $( div ); - setupEditor( $div ); + $sources.each( function () { + setupEditor( $( this ) ); } ); } -}); -})( jQuery, mediaWiki ); - +} ); +}( jQuery, mediaWiki ) ); -- To view, visit https://gerrit.wikimedia.org/r/166023 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I67552a67e8ab493e5af8717c11668430886ee468 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CodeEditor Gerrit-Branch: master Gerrit-Owner: Gerrit Patch Uploader <gerritpatchuploa...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits