“MediaWiki:Common.js/edit.js”与“MediaWiki:Gadget-site-javascript.js”:页面之间的差异

H萌娘,万物皆可H的百科全书!
< MediaWiki:Common.js(页面间差异)
跳到导航 跳到搜索
imported>=海豚=
无编辑摘要
 
imported>=海豚=
无编辑摘要
 
第1行: 第1行:
/* Any JavaScript here will be loaded for all users on edit page load. */
/* Tabs */
$(function() {
/* eslint-disable no-var */
    var wpSummary = $('[name="wpSummary"]');
/* eslint-disable no-magic-numbers */
   // $(".mw-summary-preset-item a").closest('.oo-ui-fieldLayout-header').width($('#wpSummary').width());
/* global OO, mediaWiki, jQuery */
   $(".mw-summary-preset-item a").on("click", function() {
/* eslint-disable comma-dangle */
     wpSummary.val(wpSummary.val() + " " + $(this).text());
/* eslint-disable prefer-arrow-callback */
      wpSummary.focus();
/* eslint-disable no-var */
      return false;
"use strict";
   });
$(function () {
 
    var defaultStyle = {
   // .wikiEditor-ui-controls 颜色修正
     purple: {
   $('.wikiEditor-ui-controls').css('background-color', $('#content').css('background-color'));
       labelColor: " ", //anti check
 
       labelBackgroundColor: "#9070c0",
    //编辑提示检查
       labelBorderColor: "#b090e0 #7050a0 #9070c0 #b090e0",
    if ($(".mw-summary-preset")[0]) {
       labelPadding: ".2em .3em .2em .3em",
      $(".CheckNewSectionOn").hide();
       textBorderColor: "#9070c0",
    } else {
       textBackgroundColor: "#f0edf5",
      $(".CheckNewSectionOff").hide();
       textPadding: "1em",
      $('.headerInputbox a[href*="preload=Template%3A权限申请%2F"]').attr("target", "_self");
     },
     green: {
       labelColor: " ",
       labelBackgroundColor: "#75c045",
       labelBorderColor: "#90d060 #60b030 #75c045 #90d060",
       labelPadding: ".2em .3em .2em .3em",
       textBorderColor: "#75c045 #60b030 #60b030 #75c045",
       textBackgroundColor: "#f5fffa",
       textPadding: "1em",
     },
     red: {
       labelColor: " ",
       labelBackgroundColor: "#FF0000",
       labelBorderColor: "#FF8888 #CC0000 #FF0000 #FF8888",
       labelPadding: ".2em .3em .2em .3em",
       textBorderColor: "#FF0000 #CC0000 #CC0000 #FF0000",
       textBackgroundColor: "#fffafa",
       textPadding: "1em",
     },
     blue: {
       labelColor: " ",
       labelBackgroundColor: "#5b8dd6",
       labelBorderColor: "#88abde #3379de #5b8dd6 #88abde",
       labelPadding: ".2em .3em .2em .3em",
       textBackgroundColor: "#f0f8ff",
       textBorderColor: "#5b8dd6 #3379de #3379de #5b8dd6",
       textPadding: "1em",
     },
     yellow: {
       labelColor: " ",
       labelBackgroundColor: "#ffe147",
       labelBorderColor: "#ffe977 #ffd813 #ffe147 #ffe977",
       labelPadding: ".2em .3em .2em .3em",
       textBackgroundColor: "#fffce8",
       textBorderColor: "#ffe147 #ffd813 #ffd813 #ffe147",
       textPadding: "1em",
     },
     orange: {
       labelColor: " ",
       labelBackgroundColor: "#ff9d42",
       labelBorderColor: "#ffac5d #ff820e #ff9d42 #ffac5d",
       labelPadding: ".2em .3em .2em .3em",
       textBackgroundColor: "#ffeedd",
       textBorderColor: "#ff9d42 #ff820e #ff820e #ff9d42",
       textPadding: "1em",
      },
      black: {
       labelColor: " ",
       labelBackgroundColor: "#7f7f7f",
       labelBorderColor: "#999999 #4c4c4c #7f7f7f #999999",
       labelPadding: ".2em .3em .2em .3em",
       textBackgroundColor: "#e5e5e5",
       textBorderColor: "#7f7f7f #4c4c4c #4c4c4c #7f7f7f",
       textPadding: "1em",
     },
    };
    var sides = {
     top: {
       className: "tabLabelTop",
       labelColorSide: "top",
       labelBorderSide: ["left", "right"],
       labelColorSideReverse: "bottom",
       dividerSizeType: "height"
     },
     bottom: {
       className: "tabLabelBottom",
       labelColorSide: "bottom",
       labelBorderSide: ["left", "right"],
       labelColorSideReverse: "top",
       dividerSizeType: "height"
     },
     left: {
       className: "tabLabelLeft",
       labelColorSide: "left",
       labelBorderSide: ["top", "bottom"],
       labelColorSideReverse: "right",
       dividerSizeType: "width"
      },
     right: {
       className: "tabLabelRight",
       labelColorSide: "right",
       labelBorderSide: ["top", "bottom"],
       labelColorSideReverse: "left",
       dividerSizeType: "width"
     }
   };
   var truthy = ["1", "on", "true", "yes"];
   $("body").addClass("tab");
    function getOwnPropertyNamesLength(obj) {
      return Object.getOwnPropertyNames(obj).length;
   }
   function toLowerFirstCase(str) {
      return str.substring(0, 1).toLowerCase() + str.substring(1);
    }
    }
 
    function toUpperFirstCase(str) {
    if ($(".AbusefilterWarningNoHttp")[0]) {
      return str.substring(0, 1).toUpperCase() + str.substring(1);
      $("#wpTextbox1").val($("#wpTextbox1").val().replace(/http:\/\/([a-z\d]+\.bilibili\.[a-z\d]+)/ig, "https://$1"));
    }
    }
 
   mw.hook("wikipage.content").add(function () {
   // Customized File Insertion dialog
     $(".Tabs").each(function () {
   // Copyright 2017 The Little Moe New LLC. All rights reserved.
       if ($(this).children(".TabLabel")[0]) {
   mw.loader.using(["oojs", "oojs-ui"]).then(function() {
         return true;
     $("#wpTextbox1").on("wikiEditor-toolbar-doneInitialSections", function() {
       }
        function FileInsertionDialog(config) {
       var self = $(this),
          FileInsertionDialog.super.call(this, config);
         classList = Array.from(this.classList).filter(function (n) {
           return n in defaultStyle;
         }),
         data = $.extend({
           labelPadding: "2px",
           labelBorderColor: "#aaa",
           labelColor: "green",
           labelBackgroundColor: $("#content").css("background-color"),
           textPadding: "20px 30px",
           textBorderColor: "#aaa",
           textBackgroundColor: "white",
           defaultTab: 1,
         }, classList[0] ? defaultStyle[classList[0]] || {} : {}, this.dataset || {}),
         tabLabel = self.append('<div class="TabLabel"></div>').children(".TabLabel"),
         tabDivider = self.append('<div class="TabDivider"></div>').children(".TabDivider"),
         tabContent = self.append('<div class="TabContent"></div>').children(".TabContent"),
         labelPadding = data.labelPadding,
         labelColor = data.labelColor,
         styleSheet = {
           label: {},
           text: {},
         },
         labelSide = data.labelSide in sides ? data.labelSide : "top",
         side = sides[labelSide],
         labelColorSideReverse = truthy.includes(data.labelColorSideReverse),
         dividerSize = parseInt(data.dividerSize),
         defaultTab = parseInt(data.defaultTab);
       if(labelSide==="top"){
         tabLabel.after(tabDivider);
         tabDivider.after(tabContent);
        }else if(labelSide==="bottom"){
          tabContent.after(tabDivider);
         tabDivider.after(tabLabel);
       }
       if (!isNaN(dividerSize) && dividerSize > 0) {
         self.find(".TabDivider")[side.dividerSizeType](dividerSize);
       }
       var labelColorName = toUpperFirstCase(labelColorSideReverse ? side.labelColorSideReverse : side.labelColorSide);
       self.addClass(side.className);
       if (labelColorSideReverse) {
         self.addClass("reverse");
        }
        }
        OO.inheritClass(FileInsertionDialog, OO.ui.ProcessDialog);
        self.children(".Tab").each(function () {
       // Name
          if ($(this).children(".TabLabelText").text().replace(/\s/g, "").length || $(this).children(".TabLabelText").children().length) {
       FileInsertionDialog.static.name = "fileInsertionDialog";
            $(this).children(".TabLabelText").appendTo(tabLabel);
       FileInsertionDialog.static.title = mw.msg("wikieditor-toolbar-tool-file-title");
            $(this).children(".TabContentText").appendTo(self.children(".TabContent"));
       FileInsertionDialog.static.actions = [{
         flags: "primary",
         label: mw.msg("wikieditor-toolbar-tool-file-insert"),
         action: "insert"
       }, {
         flags: "safe",
         label: mw.msg("wikieditor-toolbar-tool-file-cancel")
       }];
       // Initialization
       FileInsertionDialog.prototype.initialize = function() {
          FileInsertionDialog.super.prototype.initialize.call(this);
         this.panel = new OO.ui.PanelLayout({
           padded: true,
           expanded: false
         });
         this.fileMetaContent = new OO.ui.FieldsetLayout();
         this.alignmentContent = new OO.ui.FieldsetLayout();
         this.formatContent = new OO.ui.FieldsetLayout();
         this.fileNameInput = new OO.ui.TextInputWidget({
           indicator: "required"
         });
         this.fileNameField = new OO.ui.FieldLayout(this.fileNameInput, {
           label: mw.msg("wikieditor-toolbar-file-target"),
           align: "top"
         });
         this.fileTitleInput = new OO.ui.TextInputWidget();
         this.fileTitleField = new OO.ui.FieldLayout(this.fileTitleInput, {
           label: mw.msg("wikieditor-toolbar-file-caption"),
           align: "top"
         });
         this.sizeInput = new OO.ui.TextInputWidget();
         this.sizeField = new OO.ui.FieldLayout(this.sizeInput, {
           label: mw.msg("wikieditor-toolbar-file-size"),
           align: "top"
         });
         this.fileMetaContent.addItems([this.fileNameField, this.fileTitleField, this.sizeField]);
         var alignOptionDefault = new OO.ui.ButtonOptionWidget({
           data: "default",
           label: mw.msg("wikieditor-toolbar-file-default"),
           title: mw.msg("wikieditor-toolbar-file-default")
         });
         var alignOptionNone = new OO.ui.ButtonOptionWidget({
           data: "none",
           label: mw.msg("wikieditor-toolbar-file-format-none"),
           title: mw.msg("wikieditor-toolbar-file-format-none")
         });
         var magicWords = mw.config.get("wgWikiEditorMagicWords");
         var alignOptionMid = new OO.ui.ButtonOptionWidget({
            data: "center",
           label: magicWords.img_center,
           title: magicWords.img_center
         });
         var alignOptionLeft = new OO.ui.ButtonOptionWidget({
           data: "left",
           label: magicWords.img_left,
           title: magicWords.img_left
         });
         var alignOptionRight = new OO.ui.ButtonOptionWidget({
           data: "right",
           label: magicWords.img_right,
           title: magicWords.img_right
         });
         this.alignmentSelect = new OO.ui.ButtonSelectWidget({
           items: [alignOptionNone, alignOptionDefault, alignOptionMid, alignOptionLeft, alignOptionRight]
         });
         this.alignmentField = new OO.ui.FieldLayout(this.alignmentSelect, {
           label: mw.msg("wikieditor-toolbar-file-float"),
           align: "top"
         });
         this.alignmentContent.addItems([this.alignmentField]);
         var formatOptionThumbnail = new OO.ui.ButtonOptionWidget({
           data: "thumbnail",
           label: magicWords.img_thumbnail,
           title: magicWords.img_thumbnail
         });
         var formatOptionFramed = new OO.ui.ButtonOptionWidget({
           data: "framed",
           label: magicWords.img_framed,
           title: magicWords.img_framed
         });
         var formatOptionFrameless = new OO.ui.ButtonOptionWidget({
           data: "frameless",
           label: magicWords.img_frameless,
           title: magicWords.img_frameless
         });
         var formatOptionNone = new OO.ui.ButtonOptionWidget({
           data: "default",
           label: magicWords.img_none,
           title: magicWords.img_none
         });
         this.formatSelect = new OO.ui.ButtonSelectWidget({
           items: [formatOptionThumbnail, formatOptionFramed, formatOptionFrameless, formatOptionNone]
         });
         this.formatField = new OO.ui.FieldLayout(this.formatSelect, {
           label: mw.msg("wikieditor-toolbar-file-format"),
           align: "top"
         });
         this.formatContent.addItems([this.formatField]);
         this.panel.$element.append(this.fileMetaContent.$element);
         this.panel.$element.append(this.alignmentContent.$element);
         this.panel.$element.append(this.formatContent.$element);
         this.$body.append(this.panel.$element);
         this.fileNameInput.connect(this, {
            change: "onFileNameChange"
         });
       };
       // Specify the dialog height (or don"t to use the automatically generated height).
       FileInsertionDialog.prototype.getBodyHeight = function() {
         return this.panel.$element.outerHeight(true);
       };
       // Name validation
       FileInsertionDialog.prototype.onFileNameChange = function(value) {
         this.actions.setAbilities({
           insert: !!value.length
         });
       };
       // Default state initialization
       FileInsertionDialog.prototype.getSetupProcess = function(data) {
         data = data || {};
         return FileInsertionDialog.super.prototype.getSetupProcess.call(this, data).next(function() {
           this.actions.setAbilities({
             insert: false
           });
           this.fileNameInput.setValue("");
           this.fileTitleInput.setValue("");
           this.sizeInput.setValue("");
           this.alignmentSelect.selectItemByData("default");
           this.formatSelect.selectItemByData("thumbnail");
         }, this);
       };
       // Context setup
       FileInsertionDialog.prototype.setContext = function(context) {
         this.editorContext = context;
       };
       // Specify processes to handle the actions.
       FileInsertionDialog.prototype.getActionProcess = function(action) {
         if (action === "insert") {
           return new OO.ui.Process(function() {
             this.insertImage();
           }, this);
          }
          }
          // Fallback to parent handler
          $(this).remove();
         return FileInsertionDialog.super.prototype.getActionProcess.call(this, action);
        });
        };
        if (isNaN(defaultTab) || defaultTab <= 0 || defaultTab > tabLabel.children(".TabLabelText").length) {
        // Handles image insertion.
          defaultTab = 1;
       FileInsertionDialog.prototype.insertImage = function() {
       }
         if (!this.editorContext) return;
       tabLabel.children(".TabLabelText").on("click", function () {
         var fileName, caption, fileFloat, fileFormat, fileSize, fileTitle, options, fileUse, hasPxRgx = /.+px$/,
         var label = $(this);
           magicWordsI18N = mw.config.get("wgWikiEditorMagicWords");
          label.addClass("selected").siblings().removeClass("selected").css({
         fileName = this.fileNameInput.getValue();
            "border-color": "transparent",
          caption = this.fileTitleInput.getValue();
            "background-color": "inherit",
         fileSize = this.sizeInput.getValue();
         fileFloat = this.alignmentSelect.getSelectedItem().data;
         fileFormat = this.formatSelect.getSelectedItem().data;
         // Append px to end to size if not already contains it
         if (fileSize !== "" && !hasPxRgx.test(fileSize)) {
           fileSize += "px";
          }
         if (fileName !== "") {
           fileTitle = new mw.Title(fileName);
           // Append file namespace prefix to filename if not already contains it
           if (fileTitle.getNamespaceId() !== 6) {
             fileTitle = new mw.Title(fileName, 6);
            }
           fileName = fileTitle.toText();
         }
         options = [fileSize, fileFormat, fileFloat];
         // Filter empty values
         options = $.grep(options, function(val) {
            return val.length && val !== "default";
          });
          });
          if (caption.length) {
          tabContent.children(".TabContentText").eq(tabLabel.children(".TabLabelText").index(label)).addClass("selected").siblings().removeClass("selected").removeAttr("style");
           options.push(caption);
         if (getOwnPropertyNamesLength(styleSheet.label) > 0) {
         }
           label.css(styleSheet.label);
         fileUse = options.length === 0 ? fileName : fileName + "|" + options.join("|");
         $.wikiEditor.modules.toolbar.fn.doAction(this.editorContext, {
           type: "replace",
           options: {
             pre: "[[",
             peri: fileUse,
             post: "]]",
             ownline: true
           }
         });
         this.close();
       };
       // Remove legacy file insertion
       $("#wpTextbox1").wikiEditor("removeFromToolbar", {
         section: "main",
         group: "insert",
         tool: "file"
       });
       $("#wpTextbox1").wikiEditor("addToToolbar", {
         section: "main",
         group: "insert",
         tools: {
           "file-alt": {
             label: mw.msg("wikieditor-toolbar-tool-file-title"),
             type: "button",
             icon: "https://img.moegirl.org/common/3/3e/Insert-file.svg",
             offset: [2, -1438],
             action: {
               type: "callback",
               execute: function(context) {
                 var windowManager = new OO.ui.WindowManager();
                 $("body").append(windowManager.$element);
                 var fileInsertionDialog = new FileInsertionDialog();
                 fileInsertionDialog.setContext(context);
                 windowManager.addWindows([fileInsertionDialog]);
                 windowManager.openWindow(fileInsertionDialog);
               }
             }
           }
          }
          }
       }).eq(defaultTab - 1).click();
       if (labelPadding) {
         tabLabel.children(".TabLabelText").css("padding", labelPadding);
       }
       ["labelBorderColor", "labelBackgroundColor", "textPadding", "textBorderColor", "textBackgroundColor"].forEach(function (n) {
         var target = /^label/.test(n) ? "label" : "text",
           key = toLowerFirstCase(n.replace(target, ""));
         styleSheet[target][key] = data[n];
        });
        });
       if (labelColor) {
         styleSheet.label["border" + labelColorName + "Color"] = labelColor;
       } else if (styleSheet.label.borderColor) {
         styleSheet.label["border" + labelColorName + "Color"] = "green";
       }
       tabLabel.find(".selected").click();
       if (getOwnPropertyNamesLength(styleSheet.text) > 0) {
         tabContent.css(styleSheet.text);
       }
       if (data.autoWidth === "yes") {
         self.addClass("AutoWidth");
       }
       if (data.float === "left") {
         self.addClass("FloatLeft");
       }
       if (data.float === "right") {
         self.addClass("FloatRight");
       }
      });
      });
    });
    });
});
//萌百条目
$(function(){
   $('#ca-view').after('<li id="ca-editmoegirl"><span class="mw-editmoegirl"><a href="//zh.moegirl.org.cn/index.php?title='+mw.util.wikiUrlencode(mw.config.get('wgPageName'))+'&action=edit" title="前往萌娘百科编辑此条目">在萌娘百科编辑</a></span></li>');
   $('#ca-editmoegirl').after('<li id="ca-editlocal"><span class="mw-editlocal"><a href="//www.hmoegirl.com/index.php?title='+mw.util.wikiUrlencode(mw.config.get('wgPageName'))+'&action=edit" title="编辑本页[alt-shift-e]">添加本地化差异</a></span></li>');
});
});

2021年6月17日 (四) 18:25的版本

/* Tabs */
/* eslint-disable no-var */
/* eslint-disable no-magic-numbers */
/* global OO, mediaWiki, jQuery */
/* eslint-disable comma-dangle */
/* eslint-disable prefer-arrow-callback */
/* eslint-disable no-var */
"use strict";
$(function () {
    var defaultStyle = {
        purple: {
            labelColor: " ", //anti check
            labelBackgroundColor: "#9070c0",
            labelBorderColor: "#b090e0 #7050a0 #9070c0 #b090e0",
            labelPadding: ".2em .3em .2em .3em",
            textBorderColor: "#9070c0",
            textBackgroundColor: "#f0edf5",
            textPadding: "1em",
        },
        green: {
            labelColor: " ",
            labelBackgroundColor: "#75c045",
            labelBorderColor: "#90d060 #60b030 #75c045 #90d060",
            labelPadding: ".2em .3em .2em .3em",
            textBorderColor: "#75c045 #60b030 #60b030 #75c045",
            textBackgroundColor: "#f5fffa",
            textPadding: "1em",
        },
        red: {
            labelColor: " ",
            labelBackgroundColor: "#FF0000",
            labelBorderColor: "#FF8888 #CC0000 #FF0000 #FF8888",
            labelPadding: ".2em .3em .2em .3em",
            textBorderColor: "#FF0000 #CC0000 #CC0000 #FF0000",
            textBackgroundColor: "#fffafa",
            textPadding: "1em",
        },
        blue: {
            labelColor: " ",
            labelBackgroundColor: "#5b8dd6",
            labelBorderColor: "#88abde #3379de #5b8dd6 #88abde",
            labelPadding: ".2em .3em .2em .3em",
            textBackgroundColor: "#f0f8ff",
            textBorderColor: "#5b8dd6 #3379de #3379de #5b8dd6",
            textPadding: "1em",
        },
        yellow: {
            labelColor: " ",
            labelBackgroundColor: "#ffe147",
            labelBorderColor: "#ffe977 #ffd813 #ffe147 #ffe977",
            labelPadding: ".2em .3em .2em .3em",
            textBackgroundColor: "#fffce8",
            textBorderColor: "#ffe147 #ffd813 #ffd813 #ffe147",
            textPadding: "1em",
        },
        orange: {
            labelColor: " ",
            labelBackgroundColor: "#ff9d42",
            labelBorderColor: "#ffac5d #ff820e #ff9d42 #ffac5d",
            labelPadding: ".2em .3em .2em .3em",
            textBackgroundColor: "#ffeedd",
            textBorderColor: "#ff9d42 #ff820e #ff820e #ff9d42",
            textPadding: "1em",
        },
        black: {
            labelColor: " ",
            labelBackgroundColor: "#7f7f7f",
            labelBorderColor: "#999999 #4c4c4c #7f7f7f #999999",
            labelPadding: ".2em .3em .2em .3em",
            textBackgroundColor: "#e5e5e5",
            textBorderColor: "#7f7f7f #4c4c4c #4c4c4c #7f7f7f",
            textPadding: "1em",
        },
    };
    var sides = {
        top: {
            className: "tabLabelTop",
            labelColorSide: "top",
            labelBorderSide: ["left", "right"],
            labelColorSideReverse: "bottom",
            dividerSizeType: "height"
        },
        bottom: {
            className: "tabLabelBottom",
            labelColorSide: "bottom",
            labelBorderSide: ["left", "right"],
            labelColorSideReverse: "top",
            dividerSizeType: "height"
        },
        left: {
            className: "tabLabelLeft",
            labelColorSide: "left",
            labelBorderSide: ["top", "bottom"],
            labelColorSideReverse: "right",
            dividerSizeType: "width"
        },
        right: {
            className: "tabLabelRight",
            labelColorSide: "right",
            labelBorderSide: ["top", "bottom"],
            labelColorSideReverse: "left",
            dividerSizeType: "width"
        }
    };
    var truthy = ["1", "on", "true", "yes"];
    $("body").addClass("tab");
    function getOwnPropertyNamesLength(obj) {
        return Object.getOwnPropertyNames(obj).length;
    }
    function toLowerFirstCase(str) {
        return str.substring(0, 1).toLowerCase() + str.substring(1);
    }
    function toUpperFirstCase(str) {
        return str.substring(0, 1).toUpperCase() + str.substring(1);
    }
    mw.hook("wikipage.content").add(function () {
        $(".Tabs").each(function () {
            if ($(this).children(".TabLabel")[0]) {
                return true;
            }
            var self = $(this),
                classList = Array.from(this.classList).filter(function (n) {
                    return n in defaultStyle;
                }),
                data = $.extend({
                    labelPadding: "2px",
                    labelBorderColor: "#aaa",
                    labelColor: "green",
                    labelBackgroundColor: $("#content").css("background-color"),
                    textPadding: "20px 30px",
                    textBorderColor: "#aaa",
                    textBackgroundColor: "white",
                    defaultTab: 1,
                }, classList[0] ? defaultStyle[classList[0]] || {} : {}, this.dataset || {}),
                tabLabel = self.append('<div class="TabLabel"></div>').children(".TabLabel"),
                tabDivider = self.append('<div class="TabDivider"></div>').children(".TabDivider"),
                tabContent = self.append('<div class="TabContent"></div>').children(".TabContent"),
                labelPadding = data.labelPadding,
                labelColor = data.labelColor,
                styleSheet = {
                    label: {},
                    text: {},
                },
                labelSide = data.labelSide in sides ? data.labelSide : "top",
                side = sides[labelSide],
                labelColorSideReverse = truthy.includes(data.labelColorSideReverse),
                dividerSize = parseInt(data.dividerSize),
                defaultTab = parseInt(data.defaultTab);
            if(labelSide==="top"){
                tabLabel.after(tabDivider);
                tabDivider.after(tabContent);
            }else if(labelSide==="bottom"){
                tabContent.after(tabDivider);
                tabDivider.after(tabLabel);
            }
            if (!isNaN(dividerSize) && dividerSize > 0) {
                self.find(".TabDivider")[side.dividerSizeType](dividerSize);
            }
            var labelColorName = toUpperFirstCase(labelColorSideReverse ? side.labelColorSideReverse : side.labelColorSide);
            self.addClass(side.className);
            if (labelColorSideReverse) {
                self.addClass("reverse");
            }
            self.children(".Tab").each(function () {
                if ($(this).children(".TabLabelText").text().replace(/\s/g, "").length || $(this).children(".TabLabelText").children().length) {
                    $(this).children(".TabLabelText").appendTo(tabLabel);
                    $(this).children(".TabContentText").appendTo(self.children(".TabContent"));
                }
                $(this).remove();
            });
            if (isNaN(defaultTab) || defaultTab <= 0 || defaultTab > tabLabel.children(".TabLabelText").length) {
                defaultTab = 1;
            }
            tabLabel.children(".TabLabelText").on("click", function () {
                var label = $(this);
                label.addClass("selected").siblings().removeClass("selected").css({
                    "border-color": "transparent",
                    "background-color": "inherit",
                });
                tabContent.children(".TabContentText").eq(tabLabel.children(".TabLabelText").index(label)).addClass("selected").siblings().removeClass("selected").removeAttr("style");
                if (getOwnPropertyNamesLength(styleSheet.label) > 0) {
                    label.css(styleSheet.label);
                }
            }).eq(defaultTab - 1).click();
            if (labelPadding) {
                tabLabel.children(".TabLabelText").css("padding", labelPadding);
            }
            ["labelBorderColor", "labelBackgroundColor", "textPadding", "textBorderColor", "textBackgroundColor"].forEach(function (n) {
                var target = /^label/.test(n) ? "label" : "text",
                    key = toLowerFirstCase(n.replace(target, ""));
                styleSheet[target][key] = data[n];
            });
            if (labelColor) {
                styleSheet.label["border" + labelColorName + "Color"] = labelColor;
            } else if (styleSheet.label.borderColor) {
                styleSheet.label["border" + labelColorName + "Color"] = "green";
            }
            tabLabel.find(".selected").click();
            if (getOwnPropertyNamesLength(styleSheet.text) > 0) {
                tabContent.css(styleSheet.text);
            }
            if (data.autoWidth === "yes") {
                self.addClass("AutoWidth");
            }
            if (data.float === "left") {
                self.addClass("FloatLeft");
            }
            if (data.float === "right") {
                self.addClass("FloatRight");
            }

        });
    });
});
//萌百条目
$(function(){
    $('#ca-view').after('<li id="ca-editmoegirl"><span class="mw-editmoegirl"><a href="//zh.moegirl.org.cn/index.php?title='+mw.util.wikiUrlencode(mw.config.get('wgPageName'))+'&action=edit" title="前往萌娘百科编辑此条目">在萌娘百科编辑</a></span></li>');
    $('#ca-editmoegirl').after('<li id="ca-editlocal"><span class="mw-editlocal"><a href="//www.hmoegirl.com/index.php?title='+mw.util.wikiUrlencode(mw.config.get('wgPageName'))+'&action=edit" title="编辑本页[alt-shift-e]">添加本地化差异</a></span></li>');
});