Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes.
A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the
appropriate village pump. This code will be executed when previewing this page.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see
Wikipedia:Bypass your cache.
// See the documentation! Hope you like the script :-)// NOTE: Uses a regex feature implemented fairly recently in some browsers (https://caniuse.com/?search=Lookbehind):// Chrome: 10/2017 | Firefx: 6/2020 | Edge: 1/2020 | Safari: 3/2023 | Opera: 11/2017// If running older browsers I believe it will work normally except that it will modify File links. The previous versions did not have this feature and used widely-supported Regex.mw.loader.using('mediawiki.util',function(){$(document).ready(function(){varpageBeforeEdit;varmodifiedPage;varpreviousSummary;//add a tab on the leftvardumbQuotesLink=mw.util.addPortletLink("p-tb","#","Dumb quotes","t-dumb-quotes","Convert curly to straight quotes");$(dumbQuotesLink).click(function(event){event.preventDefault();editPage();});functionrunRegex(regex,thingToRegex){modifiedPage=thingToRegex.replace(regex.find,regex.replace);}functionmakeAndRunRegex(findRegex,replace){varregexObject={find:findRegex,replace:replace};runRegex(regexObject,modifiedPage);}functiondoEdit(){document.editform.wpTextbox1.value=modifiedPage;}functionsetEditSummary(summary,isMinor){document.editform.wpMinoredit.checked=isMinor;previousSummary=document.editform.wpSummary.value;if(previousSummary!==""){if(!previousSummary.includes(summary)){document.editform.wpSummary.value=document.editform.wpSummary.value+" | "+summary;}}else{document.editform.wpSummary.value=summary;}}functionshowDiff(){if(typeofdoaction!=='undefined')doaction("diff");}functioneditPage(){pageBeforeEdit=document.editform.wpTextbox1.value;modifiedPage=pageBeforeEdit;makeAndRunRegex(/(?<!File:[^\]]*[^\]]*)(‘|’)/g,"'");makeAndRunRegex(/(?<!File:[^\]]*[^\]]*)(“|”)/g,'"');doEdit();setEditSummary("Replaced curly quotes with straight with [[User:DemonDays64/Scripts/Dumb quotes.js|script]] per [[MOS:CQ]].",true);showDiff();}});});
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes.
A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the
appropriate village pump. This code will be executed when previewing this page.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see
Wikipedia:Bypass your cache.
// See the documentation! Hope you like the script :-)// NOTE: Uses a regex feature implemented fairly recently in some browsers (https://caniuse.com/?search=Lookbehind):// Chrome: 10/2017 | Firefx: 6/2020 | Edge: 1/2020 | Safari: 3/2023 | Opera: 11/2017// If running older browsers I believe it will work normally except that it will modify File links. The previous versions did not have this feature and used widely-supported Regex.mw.loader.using('mediawiki.util',function(){$(document).ready(function(){varpageBeforeEdit;varmodifiedPage;varpreviousSummary;//add a tab on the leftvardumbQuotesLink=mw.util.addPortletLink("p-tb","#","Dumb quotes","t-dumb-quotes","Convert curly to straight quotes");$(dumbQuotesLink).click(function(event){event.preventDefault();editPage();});functionrunRegex(regex,thingToRegex){modifiedPage=thingToRegex.replace(regex.find,regex.replace);}functionmakeAndRunRegex(findRegex,replace){varregexObject={find:findRegex,replace:replace};runRegex(regexObject,modifiedPage);}functiondoEdit(){document.editform.wpTextbox1.value=modifiedPage;}functionsetEditSummary(summary,isMinor){document.editform.wpMinoredit.checked=isMinor;previousSummary=document.editform.wpSummary.value;if(previousSummary!==""){if(!previousSummary.includes(summary)){document.editform.wpSummary.value=document.editform.wpSummary.value+" | "+summary;}}else{document.editform.wpSummary.value=summary;}}functionshowDiff(){if(typeofdoaction!=='undefined')doaction("diff");}functioneditPage(){pageBeforeEdit=document.editform.wpTextbox1.value;modifiedPage=pageBeforeEdit;makeAndRunRegex(/(?<!File:[^\]]*[^\]]*)(‘|’)/g,"'");makeAndRunRegex(/(?<!File:[^\]]*[^\]]*)(“|”)/g,'"');doEdit();setEditSummary("Replaced curly quotes with straight with [[User:DemonDays64/Scripts/Dumb quotes.js|script]] per [[MOS:CQ]].",true);showDiff();}});});