mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-12-18 10:52:27 +00:00
3b3ed1e3bc
* In some languages like persian, the number 0 is represented as '.', we can't compare '.' with either 0 or '0' to detect the no-notification status of the badge * The markread API doesn't respect uselang param, it would return 0 instead of . in a url with uselang=fa Note: we need to provide raw and formatted count in the API since client side javascript doesn't provide fancy function like $wgLang->formatNum() bug: 54575 Change-Id: I0a49828253ec346ed27c5b9a976f8bdff4e1fa90
21 lines
445 B
JavaScript
21 lines
445 B
JavaScript
( function ( $, mw ) {
|
|
'use strict';
|
|
|
|
// Functions that are only available to echo desktop version
|
|
mw.echo.desktop = {
|
|
/**
|
|
* Append uselang param to API get/post data if applicable
|
|
* @param apiData {Object}
|
|
*/
|
|
appendUseLang: function ( apiData ) {
|
|
var curUri = new mw.Uri();
|
|
if ( curUri.query.uselang !== undefined ) {
|
|
apiData.uselang = curUri.query.uselang;
|
|
}
|
|
|
|
return apiData;
|
|
}
|
|
};
|
|
|
|
} )( jQuery, mediaWiki );
|