Difference between revisions of "MediaWiki:Gadget-site-lib.js"

From Moegirlpedia
Jump to: navigation, search
(同步小工具)
(Tag: Bot)
 
m (跨站同步)
(Tag: Bot)
 
Line 1: Line 1:
window.wgUXS = function(wg, hans, hant, cn, tw, hk, sg, zh, mo, my) {
+
/* <pre> */
 +
/**
 +
* -------------------------------------------------------------------------
 +
* !!! DON'T MODIFY THIS PAGE MANUALLY, YOUR CHANGES WILL BE OVERWRITTEN !!!
 +
* -------------------------------------------------------------------------
 +
*/
 +
var _addText = '{{GHIACode|page=GHIA:MoegirlPediaInterfaceCodes/blob/master/src/gadgets/site-lib/MediaWiki:Gadget-site-lib.js|user=[[U:AnnAngela]]|longId=2ed6c0ce53260c5c00dbbb17cf0a74b0255e597b|shortId=2ed6c0c|message=upgrade}}';
 +
 
 +
"use strict";
 +
var __read = (this && this.__read) || function (o, n) {
 +
    var m = typeof Symbol === "function" && o[Symbol.iterator];
 +
    if (!m) return o;
 +
    var i = m.call(o), r, ar = [], e;
 +
    try {
 +
        while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
 +
    }
 +
    catch (error) { e = { error: error }; }
 +
    finally {
 +
        try {
 +
            if (r && !r.done && (m = i["return"])) m.call(i);
 +
        }
 +
        finally { if (e) throw e.error; }
 +
    }
 +
    return ar;
 +
};
 +
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
 +
    if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
 +
        if (ar || !(i in from)) {
 +
            if (!ar) ar = Array.prototype.slice.call(from, 0, i);
 +
            ar[i] = from[i];
 +
        }
 +
    }
 +
    return to.concat(ar || Array.prototype.slice.call(from));
 +
};
 +
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,
         'zh-hans': hans || cn || sg || my,
+
         "zh-hans": hans || cn || sg || my,
         'zh-hant': hant || tw || hk || mo,
+
         "zh-hant": hant || tw || hk || mo,
         'zh-cn': cn || hans || sg || my,
+
         "zh-cn": cn || hans || sg || my,
         'zh-sg': sg || hans || cn || my,
+
         "zh-sg": sg || hans || cn || my,
         'zh-tw': tw || hant || hk || mo,
+
         "zh-tw": tw || hant || hk || mo,
         'zh-hk': hk || hant || mo || tw,
+
         "zh-hk": hk || hant || mo || tw,
         'zh-mo': mo || hant || hk || tw
+
         "zh-mo": mo || hant || hk || tw
     }
+
     };
     return ret[wg] || zh || hans || hant || cn || tw || hk || sg || mo || my; //保證每一語言有值
+
     return ret[wg] || zh || hans || hant || cn || tw || hk || sg || mo || my;
}
+
};
 
+
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 window.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 window.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);
 
 
};
 
};
 +
mw.log.deprecate(window, "addPortletLink", function () {
 +
    var args = [];
 +
    for (var _i = 0; _i < arguments.length; _i++) {
 +
        args[_i] = arguments[_i];
 +
    }
 +
    return mw.util.addPortletLink.bind(mw.util).apply(void 0, __spreadArray([], __read(args), false));
 +
}, "Use mw.util.addPortletLink() instead");
 +
mw.log.deprecate(window, "getURLParamValue", function () {
 +
    var args = [];
 +
    for (var _i = 0; _i < arguments.length; _i++) {
 +
        args[_i] = arguments[_i];
 +
    }
 +
    return mw.util.getParamValue.bind(mw.util).apply(void 0, __spreadArray([], __read(args), false));
 +
}, "Use mw.util.getParamValue() 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) { return $.ajax({
 +
    url: "".concat(mw.config.get("wgServer")).concat(mw.config.get("wgScript"), "?title=").concat(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) { return $.ajax({
 +
    url: page,
 +
    dataType: "script",
 +
    crossDomain: !0,
 +
    cache: !0,
 +
    success: ready
 +
}); }, "Use jQuery.ajax with dataType `script` instead");
  
/**
+
/* </pre> */
* 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');
 

Latest revision as of 18:18, 5 September 2022

/* <pre> */
/**
 * -------------------------------------------------------------------------
 * !!! DON'T MODIFY THIS PAGE MANUALLY, YOUR CHANGES WILL BE OVERWRITTEN !!!
 * -------------------------------------------------------------------------
 */
var _addText = '{{GHIACode|page=GHIA:MoegirlPediaInterfaceCodes/blob/master/src/gadgets/site-lib/MediaWiki:Gadget-site-lib.js|user=[[U:AnnAngela]]|longId=2ed6c0ce53260c5c00dbbb17cf0a74b0255e597b|shortId=2ed6c0c|message=upgrade}}';

"use strict";
var __read = (this && this.__read) || function (o, n) {
    var m = typeof Symbol === "function" && o[Symbol.iterator];
    if (!m) return o;
    var i = m.call(o), r, ar = [], e;
    try {
        while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
    }
    catch (error) { e = { error: error }; }
    finally {
        try {
            if (r && !r.done && (m = i["return"])) m.call(i);
        }
        finally { if (e) throw e.error; }
    }
    return ar;
};
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
    if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
        if (ar || !(i in from)) {
            if (!ar) ar = Array.prototype.slice.call(from, 0, i);
            ar[i] = from[i];
        }
    }
    return to.concat(ar || Array.prototype.slice.call(from));
};
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 window.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 window.wgUXS(mw.config.get("wgUserVariant"), hans, hant, cn, tw, hk, sg, zh, mo, my);
};
mw.log.deprecate(window, "addPortletLink", function () {
    var args = [];
    for (var _i = 0; _i < arguments.length; _i++) {
        args[_i] = arguments[_i];
    }
    return mw.util.addPortletLink.bind(mw.util).apply(void 0, __spreadArray([], __read(args), false));
}, "Use mw.util.addPortletLink() instead");
mw.log.deprecate(window, "getURLParamValue", function () {
    var args = [];
    for (var _i = 0; _i < arguments.length; _i++) {
        args[_i] = arguments[_i];
    }
    return mw.util.getParamValue.bind(mw.util).apply(void 0, __spreadArray([], __read(args), false));
}, "Use mw.util.getParamValue() 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) { return $.ajax({
    url: "".concat(mw.config.get("wgServer")).concat(mw.config.get("wgScript"), "?title=").concat(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) { return $.ajax({
    url: page,
    dataType: "script",
    crossDomain: !0,
    cache: !0,
    success: ready
}); }, "Use jQuery.ajax with dataType `script` instead");

/* </pre> */