User:Jonesey95/AutoEd/pmc.js
Appearance
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. |
Documentation for this user script can be added at User:Jonesey95/AutoEd/pmc. |
// <nowiki>
var AutoEd_baseurl = 'http://en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=User:Jonesey95/AutoEd/';
if (location.protocol === 'https:') {
AutoEd_baseurl = 'https://en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=User:Jonesey95/AutoEd/';
}
mw.loader.load(AutoEd_baseurl + 'core3.js'); //Imports the "framework" script needed to make this function
// ====== Use for one-off replacements ========
//Sets variable configuration
autoEdTag3 = "Fix citation template parameters"; //Tweaks edit summary
autoEdLinkName3 = "AutoEd one-off"; //Changes the link name at the top of the page
autoEdLinkHover3 = "AutoEd one-off"; //When user hovers over link
//Set up function
function ReplaceTemplate(str) { //function to replace a template
//One-off for citation template
str = str.replace(/\|title=\'\'\'\'Encyclopædia Britannica\'\', 9th ed\., Vol\. ([VI]+)\'\' \|/gi, '\|title=Encyclopædia Britannica\|edition=9th\|volume=$1\|');
return str;
}
function autoEdFunctions3() { //Activates individual modules when "auto ed" tab is clicked
var txt = document.editform.wpTextbox1; //This stays as "Textbox1". Do not increment.
txt.value = ReplaceTemplate(txt.value);
// txt.value = autoEdWhitespace(txt.value);
}
// </nowiki>