|
|
| (未显示同一用户的4个中间版本) |
| 第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'); |
| //Others
| | importStylesheet('User:Qinyongr/toc.css'); |
| importScript("User:Qinyongr/toc.js");
| | importStylesheet('User:Qinyongr/hidesub.css'); |
| //Test1
| | importStylesheet('User:Qinyongr/Qsign.css'); |
| 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('<', '<').replace('>', '>').replace('"', '"').replace("'", "'") + '" />');
| |
| });
| |
| })(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);
| |
| }
| |
| | |
| });
| |
| | |
| });
| |
//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');