Content deleted Content added
Polygnotus (talk | contribs) no changes made |
Polygnotus (talk | contribs) No edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1:
//This userscript was written by BilledMammal
//https://en.wikipedia.org/wiki/User:BilledMammal/MovePlus.js
//I made some minor changes as requested over at https://en.wikipedia.org/wiki/Wikipedia:User_scripts/Requests#User:BilledMammal/MovePlus.js_and_User:Frost/moveplus.js
const WATCHLISTPAGES = false;
//movePlus
//<nowiki>
Line 725 ⟶ 732:
var talkpage = new Morebits.wiki.page(movePlus.talktitle, 'Closing move.');
if (WATCHLISTPAGES) {
talkpage.setWatchlist('watch');
}
talkpage.load(function(talkpage) {
var text = talkpage.getPageText();
Line 1,770 ⟶ 1,782:
let pageToMove = new Morebits.wiki.page(from, `Moving ${from} to ${to}.`);
if (WATCHLISTPAGES) {
pageToMove.setWatchlist('watch');
}
pageToMove.setMoveDestination(to);
pageToMove.setMoveSubpages(config.moveSubpages);
Line 2,060 ⟶ 2,076:
console.log(`Updating links at ${item.title}`);
let page = new Morebits.wiki.page(item.title, `Updating links at ${item.title}`);
if (WATCHLISTPAGES) {
page.setWatchlist('watch');
}
page.load(function(linkCorrection) {
let originalText = page.getPageText();
Line 2,177 ⟶ 2,199:
const editTask = () => {
let redirect = new Morebits.wiki.page(page, `Creating redirect to ${target}`);
if (WATCHLISTPAGES) {
redirect.setWatchlist('watch');
}
redirect.load(function(redirect) {
redirect.setPageText(`#REDIRECT [[${target}]]\n{{Rcat shell|\n{{R from move}}\n}}`);
Line 2,525 ⟶ 2,552:
}
};
movePlus.notifyListOnTalkPage = function(wikiProjectsNotified) {
Line 2,548 ⟶ 2,576:
if (wikiProjectsNotified.length == 1) {
var wikiProjectToNotify = wikiProjectsNotified[0];
var displayName = wikiProjectToNotify.startsWith("Wikipedia talk:") ?
discussionPageText = discussionPageText.replace(regex, ':<small>Note: [[' + wikiProjectToNotify + '|' + wikiProjectToNotify.slice(15) + ']] has been notified of this discussion. ~~~~</small>\n\n' + line);▼
wikiProjectToNotify.substring("Wikipedia talk:".length) :
wikiProjectToNotify;
▲ discussionPageText = discussionPageText.replace(regex, ':<small>Note: [[' + wikiProjectToNotify + '|' +
} else {
var textToInsert = ':<small>Note: ';
for (var j=0; j<wikiProjectsNotified.length; j++) {
var wikiProjectToNotify = wikiProjectsNotified[j];
wikiProjectToNotify.substring("Wikipedia talk:".length) :
wikiProjectToNotify;
textToInsert += '[[' + wikiProjectToNotify + '|' + displayName + ']]';
if (j == wikiProjectsNotified.length-2) {
if (wikiProjectsNotified.length == 2) {
Line 2,575 ⟶ 2,609:
if (wikiProjectsNotified.length == 1) {
var wikiProjectToNotify = wikiProjectsNotified[0];
var displayName = wikiProjectToNotify.startsWith("Wikipedia talk:") ?
discussionPageText+='\n:<small>Note: [[' + wikiProjectToNotify + '|' + wikiProjectToNotify.slice(15) + ']] has been notified of this discussion. ~~~~</small>';▼
wikiProjectToNotify.substring("Wikipedia talk:".length) :
wikiProjectToNotify;
▲ discussionPageText+='\n:<small>Note: [[' + wikiProjectToNotify + '|' +
} else {
discussionPageText += '\n:<small>Note: ';
for (var j=0; j<wikiProjectsNotified.length; j++) {
var wikiProjectToNotify = wikiProjectsNotified[j];
wikiProjectToNotify.substring("Wikipedia talk:".length) :
wikiProjectToNotify;
discussionPageText += '[[' + wikiProjectToNotify + '|' + displayName + ']]';
if (j == wikiProjectsNotified.length-2) {
if (wikiProjectsNotified.length == 2) {
Line 2,601 ⟶ 2,641:
});
};
//Queues
|