「MediaWiki:Gadget-site-lib.js」の版間の差分

提供: 萌えっ娘百科事典
移動先: 案内検索
(bot work)
(タグ: Bot)
 
(同步小工具)
(タグ: Bot)
1行目: 1行目:
window.wgUXS = function (wg, hans, hant, cn, tw, hk, sg, zh, mo, my) {
+
window.wgUXS = function(wg, hans, hant, cn, tw, hk, sg, zh, mo, my) {
 
     var ret = {
 
     var ret = {
 
         'zh': zh || hans || hant || cn || tw || hk || sg || mo || my,
 
         'zh': zh || hans || hant || cn || tw || hk || sg || mo || my,
13行目: 13行目:
 
}
 
}
  
window.wgULS = function (hans, hant, cn, tw, hk, sg, zh, mo, my) {
+
window.wgULS = function(hans, hant, cn, tw, hk, sg, zh, mo, my) {
 
     return wgUXS(mw.config.get('wgUserLanguage'), hans, hant, cn, tw, hk, sg, zh, mo, my);
 
     return wgUXS(mw.config.get('wgUserLanguage'), hans, hant, cn, tw, hk, sg, zh, mo, my);
 
};
 
};
  
window.wgUVS = function (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.get('wgUserVariant'), hans, hant, cn, tw, hk, sg, zh, mo, my);
 
     return wgUXS(mw.config.get('wgUserVariant'), hans, hant, cn, tw, hk, sg, zh, mo, my);
 
};
 
};
26行目: 26行目:
 
  * @deprecated: Use mw.util.addPortletLink instead.
 
  * @deprecated: Use mw.util.addPortletLink instead.
 
  */
 
  */
mw.log.deprecate( window, 'addPortletLink', function () {
+
mw.log.deprecate(window, 'addPortletLink', function() {
     return mw.util.addPortletLink.apply( mw.util, arguments );
+
     return mw.util.addPortletLink.apply(mw.util, arguments);
}, 'Use mw.util.addPortletLink() instead' );
+
}, 'Use mw.util.addPortletLink() instead');
  
 
/**
 
/**
35行目: 35行目:
 
  * @deprecated: Use mw.util.getParamValue with proper escaping
 
  * @deprecated: Use mw.util.getParamValue with proper escaping
 
  */
 
  */
mw.log.deprecate( window, 'getURLParamValue', function () {
+
mw.log.deprecate(window, 'getURLParamValue', function() {
     return mw.util.getParamValue.apply( mw.util, arguments );
+
     return mw.util.getParamValue.apply(mw.util, arguments);
}, 'Use mw.util.getParamValue() instead' );
+
}, 'Use mw.util.getParamValue() instead');
  
 
/**  
 
/**  
44行目: 44行目:
 
  * @deprecated:  Use $(element).hasClass() instead.
 
  * @deprecated:  Use $(element).hasClass() instead.
 
  */
 
  */
mw.log.deprecate( window, 'hasClass', function ( element, className ) {
+
mw.log.deprecate(window, 'hasClass', function(element, className) {
     return $( element ).hasClass( className );
+
     return $(element).hasClass(className);
}, 'Use jQuery.hasClass() instead' );
+
}, 'Use jQuery#hasClass instead');
  
window.importScriptCallback = function(page, ready) {
+
mw.log.deprecate(window, 'importScriptCallback', function(page, ready) {
     importScriptURICallback(wgServer + wgScript + '?title=' + mw.util.wikiUrlencode(page) + '&action=raw&ctype=text/javascript', ready);
+
     $.ajax({
};
+
        url: mw.config.get("wgServer") + mw.config.get("wgScript") + '?title=' + mw.util.wikiUrlencode(page) + '&action=raw&ctype=text/javascript',
 +
        dataType: 'script',
 +
        crossDomain: !0,
 +
        cache: !0,
 +
        success: ready
 +
    });
 +
}, 'Use jQuery.ajax with dataType `script` instead');
  
window.importScriptURICallback = jQuery.getScript;
+
mw.log.deprecate(window, 'importScriptURICallback', function(page, ready) {
 +
    $.ajax({
 +
        url: page,
 +
        dataType: 'script',
 +
        crossDomain: !0,
 +
        cache: !0,
 +
        success: ready
 +
    });
 +
}, 'Use jQuery.ajax with dataType `script` instead');

2022年3月28日 (月) 13:57時点における版

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.get('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.get('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');

mw.log.deprecate(window, 'importScriptCallback', function(page, ready) {
    $.ajax({
        url: mw.config.get("wgServer") + mw.config.get("wgScript") + '?title=' + mw.util.wikiUrlencode(page) + '&action=raw&ctype=text/javascript',
        dataType: 'script',
        crossDomain: !0,
        cache: !0,
        success: ready
    });
}, 'Use jQuery.ajax with dataType `script` instead');

mw.log.deprecate(window, 'importScriptURICallback', function(page, ready) {
    $.ajax({
        url: page,
        dataType: 'script',
        crossDomain: !0,
        cache: !0,
        success: ready
    });
}, 'Use jQuery.ajax with dataType `script` instead');