Jump to content

Wikipedia:AutoEd/formatter.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by AFigureOfBlue (talk | contribs) at 15:31, 12 June 2009 (Multilingual compatibility). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

//

document.write('<script src="http://en.wikipedia.org/w/index.php?title=Wikipedia:AutoEd/core.js&action=raw&ctype=text/javascript"></script>'); //Imports the "framework" script needed to make this function

//Sets variable configuration
autoEdTag = "Formatting using [[WP:AutoEd|AutoEd]]"; //Tweaks edit summary
autoEdLinkName = "format"; //Changes the link name at the top of the page
autoEdLinkHover = "Run AutoEd to format page"; //When user hovers over link

//Import individual modules for use
document.write('<script src="http://en.wikipedia.org/w/index.php?title=Wikipedia:AutoEd/unicodify.js&action=raw&ctype=text/javascript"></script>'); // autoEdUnicodify() converts HTML entities to WikiText
document.write('<script src="http://en.wikipedia.org/w/index.php?title=Wikipedia:AutoEd/whitespace.js&action=raw&ctype=text/javascript"></script>'); // autoEdWhitespace() cleans up whitespace
document.write('<script src="http://en.wikipedia.org/w/index.php?title=Wikipedia:AutoEd/wikilinks.js&action=raw&ctype=text/javascript"></script>'); // autoEdWikilinks() simplifies and shortens wikilinks where appropriate
document.write('<script src="http://en.wikipedia.org/w/index.php?title=Wikipedia:AutoEd/htmltowikitext.js&action=raw&ctype=text/javascript"></script>'); // autoEdHTMLtoWikitext() converts HTML to wikitext
document.write('<script src="http://en.wikipedia.org/w/index.php?title=Wikipedia:AutoEd/headlines.js&action=raw&ctype=text/javascript"></script>'); // autoEdHeadlines() fixes common headline errors and renames some headers
document.write('<script src="http://en.wikipedia.org/w/index.php?title=Wikipedia:AutoEd/unicodecontrolchars.js&action=raw&ctype=text/javascript"></script>'); // autoEdUnicodeControlChars() converts HTML to wikitext
document.write('<script src="http://en.wikipedia.org/w/index.php?title=Wikipedia:AutoEd/links.js&action=raw&ctype=text/javascript"></script>'); // autoEdLinks() cleans up common link errors

function autoEdFunctions() { //Activates individual modules when "auto ed" tab is clicked
    var txt = document.editform.wpTextbox1;
    txt.value = autoEdUnicodify(txt.value);
    txt.value = autoEdWhitespace(txt.value);
    txt.value = autoEdWikilinks(txt.value);
    txt.value = autoEdHTMLtoWikitext(txt.value);
    txt.value = autoEdHeadlines(txt.value);
    txt.value = autoEdUnicodeControlChars(txt.value);
    txt.value = autoEdLinks(txt.value);
}

//