用户:星海子/common.js
注意:在保存之后,您可能需要清除浏览器缓存才能看到所作出的变更的影响。
- Firefox或Safari:按住Shift的同时单击刷新,或按Ctrl-F5或Ctrl-R(Mac为⌘-R)
- Google Chrome:按Ctrl-Shift-R(Mac为⌘-Shift-R)
- Internet Explorer:按住Ctrl的同时单击刷新,或按Ctrl-F5
- Opera:前往菜单 → 设置(Mac为Opera → Preferences),然后隐私和安全 → 清除浏览数据 → 缓存的图片和文件。
mw.loader.load('https://cdn.jsdelivr.net/npm/mediawiki-inpageedit@latest/dist/InPageEdit.min.js'); window.InPageEdit = window.InPageEdit || {}; // Keep this line 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 mw.hook("InPageEdit").add(function (ctx) { var InPageEdit = ctx.InPageEdit, _msg = ctx._msg, wgPageName = mw.config.get("wgPageName"), wgRevisionId = mw.config.get("wgRevisionId"); $("#ca-edit").after( $("<li>", { id: "ca-quick-edit", "class": "collapsible" }).append( $("<span>").append( $("<a>", { href: "javascript:void(0)", text: typeof Wikiplus !== "undefined" ? _msg("quick-edit") + "(IPE)" : _msg("quick-edit") }).on("click", function () { InPageEdit.quickEdit({ page: wgPageName, revision: wgRevisionId }); }) ) ) ); }); 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; }); });