“MediaWiki:Gadget-site-lib.js”的版本间的差异
来自希灵百科
(创建页面,内容为“window.wgUXS = function (wg, hans, hant, cn, tw, hk, sg, zh, mo, my) { var ret = { 'zh': zh || hans || hant || cn || tw || hk || sg || mo || my,...”) |
(没有差异)
|
2017年1月18日 (三) 14:28的最新版本
window.wgUXS = function (wg, hans, hant, cn, tw, hk, sg, zh, mo, my) {
var ret = {
'zh': zh || hans || hant || cn || tw || hk || sg || mo || my,
'zh-hans': hans || cn || sg || my,
'zh-hant': hant || tw || hk || mo,
'zh-cn': cn || hans || sg || my,
'zh-sg': sg || hans || cn || my,
'zh-tw': tw || hant || hk || mo,
'zh-hk': hk || hant || mo || tw,
'zh-mo': mo || hant || hk || tw
}
return ret[wg] || zh || hans || hant || cn || tw || hk || sg || mo || my; //保证每一语言有值
}
window.wgULS = function (hans, hant, cn, tw, hk, sg, zh, mo, my) {
return wgUXS(mw.config.values.wgUserLanguage, hans, hant, cn, tw, hk, sg, zh, mo, my);
};
window.wgUVS = function (hans, hant, cn, tw, hk, sg, zh, mo, my) {
return wgUXS(mw.config.values.wgUserVariant, hans, hant, cn, tw, hk, sg, zh, mo, my);
};
/**
* Map addPortletLink to mw.util
*
* @deprecated: Use mw.util.addPortletLink instead.
*/
mw.log.deprecate( window, 'addPortletLink', function () {
return mw.util.addPortletLink.apply( mw.util, arguments );
}, 'Use mw.util.addPortletLink() instead' );
/**
* Extract a URL parameter from the current URL
*
* @deprecated: Use mw.util.getParamValue with proper escaping
*/
mw.log.deprecate( window, 'getURLParamValue', function () {
return mw.util.getParamValue.apply( mw.util, arguments );
}, 'Use mw.util.getParamValue() instead' );
/**
* Test if an element has a certain class
*
* @deprecated: Use $(element).hasClass() instead.
*/
mw.log.deprecate( window, 'hasClass', function ( element, className ) {
return $( element ).hasClass( className );
}, 'Use jQuery.hasClass() instead' );
window.importScriptCallback = function(page, ready) {
importScriptURICallback(wgServer + wgScript + '?title=' + mw.util.wikiUrlencode(page) + '&action=raw&ctype=text/javascript', ready);
};
window.importScriptURICallback = jQuery.getScript;