Add decorator option for language links

Callback function to be called when a language link is prepared
Can be used for custom decoration.
Arguments:
(a) the $language - the language link jQuery object
(b) languageCode

The function can do any styling, changing properites etc on the passed link.
See examples/decorator.html for example usage.

Change-Id: I5a67654440a07cf7dfac683e22dcb5000ded0bfe
This commit is contained in:
Santhosh Thottingal
2014-09-22 12:32:05 +05:30
parent f2e00432ce
commit 7346469e20
4 changed files with 51 additions and 4 deletions

View File

@@ -267,7 +267,8 @@
quickList: this.options.quickList,
clickhandler: $.proxy( this.select, this ),
source: this.$languageFilter,
showRegions: this.options.showRegions
showRegions: this.options.showRegions,
languageDecorator: this.options.languageDecorator
} ).data( 'lcd' );
this.$languageFilter.languagefilter( {
@@ -400,7 +401,8 @@
languages: $.uls.data.getAutonyms(), // Languages to be used for ULS, default is all languages
quickList: null, // Array of language codes or function that returns such
compact: false, // Show ULS in compact mode
showRegions: [ 'WW', 'AM', 'EU', 'ME', 'AF', 'AS', 'PA' ]
showRegions: [ 'WW', 'AM', 'EU', 'ME', 'AF', 'AS', 'PA' ],
languageDecorator: null // Callback function to be called when a language link is prepared - for custom decoration.
};
// Define a dummy i18n function, if jquery.i18n not integrated.