跳转到内容

User:Qinyongr/common.js:修订间差异

计算器百科,非营利的计算器专业知识百科。
Qinyongr留言 | 贡献
| 此編輯使用Wikiplus
Qinyongr留言 | 贡献
无编辑摘要
 
(未显示同一用户的6个中间版本)
第8行: 第8行:
mw.loader.load('https://wikiplus-app.smartgslb.com/Main.js');
mw.loader.load('https://wikiplus-app.smartgslb.com/Main.js');
localStorage.setItem('Wikiplus_Settings', JSON.stringify({
localStorage.setItem('Wikiplus_Settings', JSON.stringify({
"defaultSummary":"function(w){return (w.sectionNumber > 0 && '/*' + w.sectionName + '*/ ' || (w.sectionNumber == 0 && '/* top */ ' || '') ) + '   | 此編輯使用[[Special:参数设置#mw-prefsection-gadgets|Wikiplus]]。' }"
"defaultSummary":"function(w){return (w.sectionNumber > 0 && '/*' + w.sectionName + '*/ ' || (w.sectionNumber == 0 && '/* top */ ' || '') ) + ' +' }"
}));
}));
//Tabs
//Tabs
第19行: 第19行:
importScript("MediaWiki:Gadget-popups.js");
importScript("MediaWiki:Gadget-popups.js");
importStylesheet('MediaWiki:Gadget-popups.css');
importStylesheet('MediaWiki:Gadget-popups.css');
//Google
importStylesheet('User:Qinyongr/toc.css');
importScript("MediaWiki:Gadget-GoogleImages.js");
importStylesheet('User:Qinyongr/hidesub.css');
//TinEye
importStylesheet('User:Qinyongr/Qsign.css');
importScript("MediaWiki:Gadget-Tineye.js");
//Others
//importScript("User:Qinyongr/toc.js");
//Test1
mw.loader.using('ext.gadget.site-lib', function(){
function deletemods(){
if (mw.config.get('wgAction') == "delete") {
var wpReason = document.getElementById("wpReason");
if (!wpReason) return;
var regexp = /(内容为|page was empty|content before blanking was)/i;
if (regexp.test(wpReason.value)){
wpReason.value = "";
}
}
}
});
$(deletemods);
//sectionlink
;(function($){
    $('.mw-headline').each(function(i){
        name = $(this).attr('id');
        $(this).before('<input class="sectionlink" type="text" readonly="readonly" style="background-color:transparent; border: 1px solid #808080; float: right; font-size: 70%;" size="5" onfocus="this.select()" value="' + wgPageName + '#' + decodeURIComponent(name.replace(/\.([A-F0-9][A-F0-9])/g, '%$1')).replace('<', '&lt;').replace('>', '&gt;').replace('"', '&quot;').replace("'", "&apos;") + '" />');
    });
})(jQuery);
/* Any JavaScript here will be loaded for sysops only */
 
 
mw.loader.using('ext.gadget.site-lib', function(){
 
    //保護選項校正
    if (mw.config.get('wgAction') == "protect") {
 
        $(function () {
            var pform = document.getElementById("mw-Protect-Form");
            var timeoptions;
 
            timeoptions = pform["wpProtectExpirySelection-edit"].options;
            if (timeoptions[0].value != "existing") {
                timeoptions[timeoptions.length - 1].selected = true;
                ProtectionForm.updateExpiryList(pform["wpProtectExpirySelection-edit"]);
            }
 
            timeoptions = pform["wpProtectExpirySelection-move"].options;
            if (timeoptions[0].value != "existing") {
                timeoptions[timeoptions.length - 1].selected = true;
                ProtectionForm.updateExpiryList(pform["wpProtectExpirySelection-move"]);
            }
 
        });
 
    }
 
 
    //擷取選單文字按鈕
    $(function () {
 
        var addGetMenuTextButton = function (id, $srcMenu, $targetText, tiptext, afterSelIdx) {
            if($srcMenu.length==0 || $targetText.length==0) return null;
 
            var $btnAdd = $('<input type="button">', {
                'id': id,
                'name': id
            }).attr("value", ((!tiptext) ? "(+)" : tiptext) );
 
            $btnAdd.get(0).srcMenu = $srcMenu.get(0);
            $btnAdd.get(0).targetText = $targetText.get(0);
            $btnAdd.get(0).afterSelIdx = (!afterSelIdx || isNaN(afterSelIdx)) ? 0 : afterSelIdx;
 
            $btnAdd.click( function () {
                this.targetText.value += this.srcMenu.options[this.srcMenu.selectedIndex].value;
                this.srcMenu.selectedIndex = this.afterSelIdx;
            }).insertAfter($srcMenu);
 
            return $btnAdd;
        }
 
 
        if (mw.config.get('wgAction').match(/(?:un)?protect/i)) { //保護理由
            addGetMenuTextButton("wpProtectReasonSelectionAdd", $("form[id='mw-Protect-Form'] select#wpProtectReasonSelection"), $("form[id='mw-Protect-Form'] input[id='mwProtect-reason']"), "加到附加的理由", 0);
        } else if (("" + mw.config.get('wgCanonicalSpecialPageName')).match(/block(?:ip)?/i) ) { //封禁理由
            addGetMenuTextButton("wpBlockReasonListAdd", $("form select[name='wpReason']"), $("form input[name='wpReason-other']"), wgULS("加到附带原因", "加到附帶原因"), $("form select[name='wpReason'] option[value='other']")[0].index);
        }
 
    });
 
});

2016年7月25日 (一) 01:19的最新版本

//UserHighlight
importScript("User:Qinyongr/AGFhighlight.js");
importScript("User:Qinyongr/bhighlight.js");
importScript("User:Qinyongr/adminhighlight.js");
//OnlineAdmin
importScript("User:Qinyongr/onlineadmin.js");
//Wikiplus
mw.loader.load('https://wikiplus-app.smartgslb.com/Main.js');
localStorage.setItem('Wikiplus_Settings', JSON.stringify({
	"defaultSummary":"function(w){return (w.sectionNumber > 0 && '/*' + w.sectionName + '*/ ' || (w.sectionNumber == 0 && '/* top */ ' || '') ) + ' +' }"
}));
//Tabs
importScript("MediaWiki:Gadget-Tabs.js");
//BPanel
importScript("MediaWiki:Gadget-BPanel.js");
//Wordcount
importScript("MediaWiki:Gadget-Wordcount.js");
//popups
importScript("MediaWiki:Gadget-popups.js");
importStylesheet('MediaWiki:Gadget-popups.css');
importStylesheet('User:Qinyongr/toc.css');
importStylesheet('User:Qinyongr/hidesub.css');
importStylesheet('User:Qinyongr/Qsign.css');