mediawiki-extensions-Echo/modules/desktop/ext.echo.desktop.js
bsitu 3b3ed1e3bc Fix some notification badge related issue
* 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
2013-10-02 11:25:05 -07:00

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 );