User:DemonDays64/Scripts/Dumb quotes.js: Difference between revisions

Content deleted Content added
I don't know if this works but maybe
Improvements to summary setting
Line 5:
var pageBeforeEdit;
var modifiedPage;
var previousSummary;
 
//add a tab on the left
Line 29 ⟶ 30:
function setEditSummary(summary, isMinor) {
document.editform.wpMinoredit.checked = isMinor;
previousSummary = document.editform.wpSummary.value = summary;
if (previousSummary !== "") {
if (!previousSummary.includes(summary)) {
document.editform.wpSummary.value = document.editform.wpSummary.value + " | " + summary;
}
}
else {
document.editform.diff()wpSummary.value = summary;
}
}
function showDiff() {
doaction("diff");
document.editform.diff();
}
function editPage() {
 
pageBeforeEdit = document.editform.wpTextbox1.value;
modifiedPage = pageBeforeEdit;
Line 42 ⟶ 50:
makeAndRunRegex(/(“|”)/g, '"');
doEdit();
showDiff();
setEditSummary("Replaced smart quotes with dumb. Problem? [[User talk:DemonDays64|Tell me]].", true);
}