User:SaoMikoto/common.js: Difference between revisions
From Test Wiki
Content deleted Content added
// Edit via InPageEdit |
m // Edit via InPageEdit |
||
| (13 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
function loadMyGadget(gadget) { |
|||
| ⚫ | |||
mw.loader.load(`https://testwiki.wiki/index.php?title=User:SaoMikoto/js/${gadget}.js&action=raw&ctype=text/javascript`); |
|||
} |
|||
// loadMyGadget("InPageEdit"); |
|||
loadMyGadget("Usergroup"); |
|||
loadMyGadget("CleanDeleteReasons"); |
|||
| ⚫ | |||
(window.InPageEdit = window.InPageEdit || {}).myPreference = { |
(window.InPageEdit = window.InPageEdit || {}).myPreference = { |
||
"doNotCollectMyInfo": false, |
"doNotCollectMyInfo": false, |
||
"editMinor": |
"editMinor": true, |
||
"editSummary": "$section // Edit via InPageEdit", |
"editSummary": "$section$oldid // Edit via InPageEdit", |
||
"lockToolBox": true, |
"lockToolBox": true, |
||
"redLinkQuickEdit": false, |
"redLinkQuickEdit": false, |
||
| Line 19: | Line 27: | ||
] |
] |
||
} |
} |
||
mw.loader.load('https://cdn.jsdelivr.net/npm/mediawiki-inpageedit'); |
|||
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: typeof Wikiplus !== "undefined" ? "".concat(_msg("quick-edit"), "(IPE)") : _msg("quick-edit") |
|||
}).on("click", function () { |
|||
InPageEdit.quickEdit({ |
|||
page: wgPageName, |
|||
revision: wgRevisionId || undefined |
|||
}); |
|||
})))); |
|||
}); |
|||
// InPageEdit NEXT |
|||
importScript('User:SaoMikoto/js/Usergroup.js'); // Backlink: [[User:SaoMikoto/js/Usergroup.js]] |
|||
document.body.append( |
|||
importScript('User:SaoMikoto/js/CleanDeleteReasons.js'); // Backlink: [[User:SaoMikoto/js/CleanDeleteReasons.js]] |
|||
Object.assign(document.createElement('script'), { |
|||
src: 'https://unpkg.com/@inpageedit/core', |
|||
type: 'module', |
|||
}) |
|||
) |
|||