Content deleted Content added
DemonDays64 (talk | contribs) Revert to https://en.wikipedia.org/w/index.php?title=User:DemonDays64/Scripts/Dumb_quotes.js&oldid=950073978 |
DemonDays64 (talk | contribs) Update (I'm making progress on my library) |
||
Line 3:
$(document).ready(function () {
var modifiedPage;
//add a tab on the left
Line 8 ⟶ 10:
$(dumbQuotesLink).click(function (event) {
event.preventDefault();
});
function setEditSummary() {▼
document.editform.wpMinoredit.checked = true;▼
document.editform.wpSummary.value = 'Replaced smart quotes with dumb. Problem? [[User talk:DemonDays64|Tell me]].';▼
}
▲ function setDumbQuotes() {
var singleQuoteRegex = {▼
find: /(‘|’)/g,▼
replace: "'"▼
}▼
function makeAndRunRegex(findRegex, replace) {
find: /(“|”)/g,▼
}
runRegex(regexObject);
var originalPage = document.editform.wpTextbox1.value;▼
function doEdit() {
▲ var modifiedPage = originalPage;
▲ modifiedPage = modifiedPage.replace(singleQuoteRegex.find, singleQuoteRegex.replace);
document.editform.wpTextbox1.value = modifiedPage;
}
▲ function setEditSummary(summary, isMinor) {
document.editform.wpSummary.value = summary;
}
function showDiff() {
document.editform.diff();
}
function editPage() {
modifiedPage = pageBeforeEdit;
doEdit();
▲
showDiff();
}
});
|