Content deleted Content added
DemonDays64 (talk | contribs) m DemonDays64 moved page User:DemonDays64/Dumb quotes.js to User:DemonDays64/Scripts/Dumb quotes.js: Organization |
DemonDays64 (talk | contribs) Switch to User:DemonDays64/Scripts/Quick scripts.js to test |
||
Line 1:
/*
\\\Quick scripts///
* A rudimentary thing to copy and paste to make a regex find and replace script.
* To edit, go to editArticle() and edit makeAndRunRegex(). Call it again to add another search.
* Remember to set portledId, linkURL, linkText, and tooltip (along with the others if you want)
*/
mw.loader.using('mediawiki.util', function () {
var portletId;
var linkUrl;
var linkText;
var linkId; //optional
var tooltip; //technically optional
var accessKey; //optional
var scriptLink = mw.util.addPortletLink(portletId, linkUrl, linkText, linkId, tooltip, accessKey);
editArticle();
});
function setEditSummary(summary) {
document.editform.wpMinoredit.checked = true;
}
function runRegex(regex) {
modifiedPage = modifiedPage.replace(regex.find, regex.replace);
}
function makeAndRunRegex(name, findRegex, replace) {
var name = {
find: findRegex,
▲ $(dumbQuotesLink).click(function (event) {
replace: replace
▲ event.preventDefault();
}
runRegex(name);
}
}
▲ doaction('diff');
function showDiff() {
}
//EDIT HERE
var originalPage = document.editform.wpTextbox1.value;▼
function editArticle() {
var modifiedPage = originalPage;▼
doEdit();
▲ document.editform.wpTextbox1.value = modifiedPage;
showDiff();
▲ document.editform.diff();
}
});
|