Lazyload jquery.uls library
In the "interlanguage" position ULS is shown after 2 clicks, so don't load it initially. In the "personal" position ULS is shown immediately after the language icon click, so load it, but conditionally. The new RL module ext.uls.mediawiki is added for setting jquery.uls defaults in a way that will lazy-load the language names. Change-Id: Ic33ef034c794a523b5403867196c6098a58eb5b1
This commit is contained in:
@@ -40,16 +40,6 @@
|
||||
}() );
|
||||
}
|
||||
|
||||
// MediaWiki override for ULS defaults.
|
||||
$.fn.uls.defaults = $.extend( $.fn.uls.defaults, {
|
||||
languages: mw.config.get( 'wgULSLanguages' ),
|
||||
searchAPI: mw.util.wikiScript( 'api' ) + '?action=languagesearch'
|
||||
} );
|
||||
|
||||
// No need of IME in language search bar of ULS
|
||||
$.fn.uls.Constructor.prototype.render = function () {
|
||||
this.$languageFilter.addClass( 'noime' );
|
||||
};
|
||||
|
||||
var jsonLoader = null,
|
||||
initialized = false,
|
||||
@@ -256,16 +246,6 @@
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* The 'als' is used in a non-standard way in MediaWiki -
|
||||
* it may be used to represent the Allemanic language,
|
||||
* the standard code of which is 'gsw', while 'als'
|
||||
* is ISO 639 3 refers to Tosk Albanian, which is
|
||||
* not currently used in any way in MediaWiki.
|
||||
* This local fix adds a redirect for it.
|
||||
*/
|
||||
$.uls.data.addLanguage( 'als', { target: 'gsw' } );
|
||||
|
||||
if ( !jsonLoader ) {
|
||||
jsonLoader = mw.uls.loadLocalization( currentLang );
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user