MediaWiki:Gadget-libJQuery.js

MediaWiki界面页面
一位史蒂夫讨论 | 贡献2024年1月2日 (二) 23:17的版本 (导入1个版本)

注意:在发布之后,您可能需要清除浏览器缓存才能看到所作出的变更的影响。

  • Firefox或Safari:按住Shift的同时单击刷新,或按Ctrl-F5Ctrl-R(Mac为⌘-R
  • Google Chrome:Ctrl-Shift-R(Mac为⌘-Shift-R
  • Internet Explorer或Edge:按住Ctrl的同时单击刷新,或按Ctrl-F5
  • Opera:Ctrl-F5
/* <pre> */
/**
 * -------------------------------------------------------------------------
 * !!! DON'T MODIFY THIS PAGE MANUALLY, YOUR CHANGES WILL BE OVERWRITTEN !!!
 * -------------------------------------------------------------------------
 */
var _addText = '{{GHIACode|page=GHIA:MoegirlPediaInterfaceCodes/blob/master/src/gadgets/libJQuery/MediaWiki:Gadget-libJQuery.js|user=[[U:AnnAngela]]|longId=933a60a3ea0382fd227141260c3225a488af0ca3|shortId=933a60a|message=chore: Add track field}}';

"use strict";
(function ($, mw) {
    $.extend({
        createIcon: function (iconClass) {
            return $("<span>", {
                "class": "ui-icon ".concat(iconClass, " jquery-inline-icon"),
                text: " "
            });
        },
        createNotifyArea: function (textNode, icon, state) {
            return $("<div>", {
                "class": "ui-widget"
            }).append($("<div>", {
                "class": "".concat(state, " ui-corner-all"),
                style: "margin-top:20px; padding:0.7em;"
            }).append($("<p>").append($.createIcon(icon).css("margin-right", ".3em"), textNode)));
        },
        ucFirst: function (str) {
            return str.charAt(0).toUpperCase() + str.slice(1);
        }
    });
    mw.messages.set({
        "libjq-cancel-title": "关闭该对话框 [Esc]",
        "libjq-proceed-title": "在单行输入框内按下回车键",
        "libjq-report-title": "报告错误以改进本工具"
    });
    var buttonConfig = {
        proceed: {
            icon: "ui-icon-circle-check",
            "class": "ui-button-green",
            title: "libjq-proceed-title"
        },
        cancel: {
            icon: "ui-icon-circle-close",
            "class": "ui-button-red",
            title: "libjq-cancel-title"
        },
        report: {
            icon: "ui-icon-circle-check",
            "class": "",
            title: "libjq-report-title"
        }
    };
    $.extend($.fn, {
        specialButton: function (which) {
            return this.button({
                icons: {
                    primary: buttonConfig[which].icon
                }
            }).addClass(buttonConfig[which]["class"]).attr("title", mw.msg(buttonConfig[which].title));
        },
        _jqInteraction: function () {
            var _this = this;
            return this.on({
                mouseenter: function () {
                    _this.addClass("ui-state-hover");
                },
                mouseleave: function () {
                    _this.removeClass("ui-state-hover").removeClass("ui-state-active");
                }
            }).on("focusin", function () {
                _this.addClass("ui-state-focus");
            }).on("focusout", function () {
                _this.removeClass("ui-state-focus");
            }).on("mousedown", function (e) {
                if (0 === e.originalEvent.button) {
                    _this.addClass("ui-state-active");
                }
            }).on("mouseup", function () {
                _this.removeClass("ui-state-active");
            });
        }
    });
}(jQuery, mediaWiki));

/* </pre> */