“用户:星海子/common.js”的版本间的差异

来自萌娘文库
跳转至: 导航搜索
(// Edit Via InPageEdit)
 
(未显示另一用户的1个中间版本)
第1行: 第1行:
mw.loader.load('https://cdn.jsdelivr.net/npm/mediawiki-inpageedit@latest/dist/InPageEdit.min.js');
+
//InPageEdit
window.InPageEdit = window.InPageEdit || {}; // Keep this line
+
mw.loader.load('https://fastly.jsdelivr.net/npm/mediawiki-inpageedit');
InPageEdit.myPreference = {"outSideClose":true,"editMinor":true,"editSummary":"    // Edit Via InPageEdit $section$oldid","plugins":["toolbox.js","edit-any-page.js"],"redLinkQuickEdit":false,"doNotShowLocalWarn":false}; // InPageEdit preference
+
window.InPageEdit = window.InPageEdit || {};
 +
InPageEdit.myPreference = {
 +
"outSideClose":true, "editMinor":true, "noConfirmEdit": true, "redLinkQuickEdit":false,
 +
"editSummary":"    $section$oldid // Edit Via InPageEdit", "watchList": "nochange",
 +
"plugins":["toolbox.js","edit-any-page.js","quick-thank.js","code-mirror/script.js","wiki-editor.js"],
 +
"codeMirrorTheme": (mw.config.get("wgNamespaceNumber")%2 == 0 && (mw.config.get("wgTitle").includes(".js") || mw.config.get("wgTitle").includes(".css") || mw.config.get("wgNamespaceNumber") === 274)) ? "solarized" : "juejin"
 +
};
 
mw.hook("InPageEdit").add(function (ctx) {
 
mw.hook("InPageEdit").add(function (ctx) {
    var InPageEdit = ctx.InPageEdit,
+
var InPageEdit = ctx.InPageEdit, _msg = ctx._msg, wgPageName = mw.config.get("wgRelevantPageName"), wgRevisionId = mw.config.get("wgRevisionId");
        _msg = ctx._msg,
+
$("#ca-edit").after(
        wgPageName = mw.config.get("wgPageName"),
+
$("<li>", { id: "ca-quick-edit", "class": "collapsible"}).append(
        wgRevisionId = mw.config.get("wgRevisionId");
+
$("<span>").append( $("<a>", { href: "javascript:void(0)", text: _msg("quick-edit") })
    $("#ca-edit").after(
+
.on("click", function () { InPageEdit.quickEdit({ page: wgPageName, revision: wgRevisionId || undefined });
        $("<li>", {
+
})
            id: "ca-quick-edit",
+
)
            "class": "collapsible"
+
)
        }).append(
+
);
            $("<span>").append(
 
                $("<a>", {
 
                    href: "javascript:void(0)",
 
                    text: _msg("quick-edit")
 
                }).on("click", function () {
 
                    InPageEdit.quickEdit({
 
                        page: wgPageName,
 
                        revision: wgRevisionId
 
                    });
 
                })
 
            )
 
        )
 
    );
 
 
});
 
});
 +
$.when( mw.loader.using( ['mediawiki.util'] ), $.ready )
 +
.then( function () {
 +
mw.util.addPortletLink("p-navigation","/index.php?title=Special:Newpages&hideredirs=0&namespace=all","所有新页面",null,null,null,"#n-sidebar-newfiles");
 +
mw.util.addPortletLink("p-navigation", "/Special:Contributions/机娘星海酱","机器人贡献",null,null,null,"#n-sidebar-newfiles");
 +
mw.util.addPortletLink("p-navigation", "/Special:Log/星海-adminbot","机器人日志",null,null,null,"#n-sidebar-newfiles");
 +
mw.util.addPortletLink("p-navigation", "/Special:AbuseFilter","AbuseFilter");
 +
$("#t-sidebar-delete a, #t-sidebar-expandtemplates a, #t-sidebar-changecontentmodel a").attr("target","_blank");
 +
if ( mw.config.get("wgNamespaceNumber") === 14 || mw.config.get("wgCanonicalSpecialPageName") === "Whatlinkshere" ){
 +
$( mw.util.addPortletLink("p-cactions", $("#ca-masseditregex a").attr('href') , "批量正则编辑", "ca-MassEditRegex", "批量正则编辑") ).attr("class","patroller-show"); //MassEditRegex
 +
}
 +
if ( mw.config.get("wgNamespaceNumber") === 14 ){
 +
mw.loader.load('https://fastly.jsdelivr.net/gh/lovelyCARDINAL/moegirl/NEC.min.js'); //NullEditInCategory
 +
}
 +
});
 +
mw.loader.load('https://zh.moegirl.org.cn/index.php?title=User:星海子/js/markblocked.js&action=raw&ctype=text/javascript');//封禁用户标识
 +
mw.loader.load('https://fastly.jsdelivr.net/gh/lovelyCARDINAL/moegirl/MR.min.js');//批量回退&撤销
 +
/* Hotcat */
 
window.hotcat_use_category_links = false;
 
window.hotcat_use_category_links = false;
 
mw.loader.using("mediawiki.user", function () {
 
mw.loader.using("mediawiki.user", function () {
  $('body').delegate('#hotcatCommitForm', 'submit', function () {
+
$('body').delegate('#hotcatCommitForm', 'submit', function () {
    var submitType = this.wpDiff;
+
var submitType = this.wpDiff;
    if (submitType && (!this.oldid || this.oldid.value == '0')) {
+
if (submitType && (!this.oldid || this.oldid.value == '0')) {
      this.wpEditToken.value = mw.user.tokens.get("csrfToken");
+
this.wpEditToken.value = mw.user.tokens.get("csrfToken");
      submitType.name = submitType.value = 'wpSave';
+
submitType.name = submitType.value = 'wpSave';
    }
+
}
    return true;
+
return true;
  });
+
});
 
});
 
});
 +
/* Popups */
 +
window.popupStructure = 'menus';
 +
window.popupHideDelay = '0.1';
 +
window.popupActionsMenu = false;
 +
window.popupShortcutKeys = true;
 +
window.popupImages = false;
 +
window.popupFixRedirs = true;
 +
window.popupRedirAutoClick = 'wpSave';
 +
window.popupFixDabs = true;
 +
window.popupDabsAutoClick = 'wpSave';
 +
window.popupImageLinks = false;

2022年5月20日 (五) 03:02的最新版本

//InPageEdit
mw.loader.load('https://fastly.jsdelivr.net/npm/mediawiki-inpageedit');
window.InPageEdit = window.InPageEdit || {};
InPageEdit.myPreference = {
	"outSideClose":true, "editMinor":true, "noConfirmEdit": true, "redLinkQuickEdit":false,
	"editSummary":"    $section$oldid // Edit Via InPageEdit", "watchList": "nochange",
	"plugins":["toolbox.js","edit-any-page.js","quick-thank.js","code-mirror/script.js","wiki-editor.js"],
	"codeMirrorTheme": (mw.config.get("wgNamespaceNumber")%2 == 0 && (mw.config.get("wgTitle").includes(".js") || mw.config.get("wgTitle").includes(".css") || mw.config.get("wgNamespaceNumber") === 274)) ? "solarized" : "juejin"
};
mw.hook("InPageEdit").add(function (ctx) {
	var InPageEdit = ctx.InPageEdit, _msg = ctx._msg, wgPageName = mw.config.get("wgRelevantPageName"), wgRevisionId = mw.config.get("wgRevisionId");
	$("#ca-edit").after(
		$("<li>", { id: "ca-quick-edit", "class": "collapsible"}).append(
			$("<span>").append( $("<a>", { href: "javascript:void(0)", text: _msg("quick-edit") })
			.on("click", function () { InPageEdit.quickEdit({ page: wgPageName, revision: wgRevisionId || undefined });
			})
			)
		)
	);
});
$.when( mw.loader.using( ['mediawiki.util'] ), $.ready )
.then( function () { 
	mw.util.addPortletLink("p-navigation","/index.php?title=Special:Newpages&hideredirs=0&namespace=all","所有新页面",null,null,null,"#n-sidebar-newfiles");
	mw.util.addPortletLink("p-navigation", "/Special:Contributions/机娘星海酱","机器人贡献",null,null,null,"#n-sidebar-newfiles");
	mw.util.addPortletLink("p-navigation", "/Special:Log/星海-adminbot","机器人日志",null,null,null,"#n-sidebar-newfiles");
	mw.util.addPortletLink("p-navigation", "/Special:AbuseFilter","AbuseFilter");
	$("#t-sidebar-delete a, #t-sidebar-expandtemplates a, #t-sidebar-changecontentmodel a").attr("target","_blank");
	if ( mw.config.get("wgNamespaceNumber") === 14 || mw.config.get("wgCanonicalSpecialPageName") === "Whatlinkshere" ){
		$( mw.util.addPortletLink("p-cactions", $("#ca-masseditregex a").attr('href') , "批量正则编辑", "ca-MassEditRegex", "批量正则编辑") ).attr("class","patroller-show"); //MassEditRegex
	}
	if ( mw.config.get("wgNamespaceNumber") === 14 ){
		mw.loader.load('https://fastly.jsdelivr.net/gh/lovelyCARDINAL/moegirl/NEC.min.js'); //NullEditInCategory
	}
});
mw.loader.load('https://zh.moegirl.org.cn/index.php?title=User:星海子/js/markblocked.js&action=raw&ctype=text/javascript');//封禁用户标识
mw.loader.load('https://fastly.jsdelivr.net/gh/lovelyCARDINAL/moegirl/MR.min.js');//批量回退&撤销
/* Hotcat */
window.hotcat_use_category_links = false;
mw.loader.using("mediawiki.user", function () {
	$('body').delegate('#hotcatCommitForm', 'submit', function () {
		var submitType = this.wpDiff;
		if (submitType && (!this.oldid || this.oldid.value == '0')) {
			this.wpEditToken.value = mw.user.tokens.get("csrfToken");
			submitType.name = submitType.value = 'wpSave';
		}
		return true;
	});
});
/* Popups */
window.popupStructure = 'menus';
window.popupHideDelay = '0.1';
window.popupActionsMenu = false;
window.popupShortcutKeys = true;
window.popupImages = false;
window.popupFixRedirs = true;
window.popupRedirAutoClick = 'wpSave';
window.popupFixDabs = true;
window.popupDabsAutoClick = 'wpSave';
window.popupImageLinks = false;