User:SaoMikoto/common.js: Difference between revisions

From Test Wiki
Jump to navigation Jump to search
Content deleted Content added
// Edit via InPageEdit
m // Edit via InPageEdit
 
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
function loadMyGadget(gadget) {
/** InPageEdit Preferences */
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");

// InPageEdit Preferences
(window.InPageEdit = window.InPageEdit || {}).myPreference = {
(window.InPageEdit = window.InPageEdit || {}).myPreference = {
"doNotCollectMyInfo": false,
"doNotCollectMyInfo": false,
"editMinor": true,
"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',
})
)

Latest revision as of 13:37, 25 October 2025

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");

// InPageEdit Preferences
(window.InPageEdit = window.InPageEdit || {}).myPreference = {
  "doNotCollectMyInfo": false,
  "editMinor": true,
  "editSummary": "$section$oldid // Edit via InPageEdit",
  "lockToolBox": true,
  "redLinkQuickEdit": false,
  "outSideClose": true,
  "watchList": "preferences",
  "noConfirmEdit": true,
  "plugins": [
    "toolbox.js",
    "wiki-editor.js",
    "quick-thank.js",
    "color-preview.js",
    "code-mirror/cm6.js",
    "edit-any-page.js",
    "fix-double-entrance.js"
  ]
}

// InPageEdit NEXT
document.body.append(
  Object.assign(document.createElement('script'), {
    src: 'https://unpkg.com/@inpageedit/core',
    type: 'module',
  })
)