Jump to content

User:Auscompgeek/monobook.js: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Remove "the free encyclopedia" from the title
updated scripts, migrated deprecated functions
Line 1: Line 1:
/**
importScriptURI("http://meta.wikimedia.org/enwiki/w/index.php?title=User:Pathoschild/Scripts/Regex_menu_framework.js&action=raw&ctype=text/javascript");
* TemplateScript adds configurable templates and scripts to the sidebar, and adds an example regex editor.
function rmflinks(){
* @see https://meta.wikimedia.org/wiki/TemplateScript
regexTool("Custom regex","custom()"); //a default tool which performs regex input in a dynamic form
* @update-token [[File:pathoschild/templatescript.js]]
regexTool("Cleanup web jargon","cleanJargon()")
*/
}
$.ajax('//tools-static.wmflabs.org/meta/scripts/pathoschild.templatescript.js', { dataType:'script', cache:true }).then(function() {
function cleanJargon(){
pathoschild.TemplateScript.add([
regex(/\bi\b/g,"I");
{
regex(/\bu\b/g,"you");
name: 'Cleanup web jargon',
regex(/\by?ur\b/g,"your");
script: function(context) {
regex(/\byoure\b/g,"you're");
context.helper
regex(/\bwhats\b/g,"what's");
regex(/\bthats\b/g,"that's");
.replace(/\bi\b/g,"I")
regex(/\bpl[ea]{0,2}(s|z)\b/g,"please");
.replace(/\bu\b/g,"you")
regex(/\b(than(x|z)|thx)\b/g,"thanks");
.replace(/\by?ur\b/g,"your")
regex(/\b(ty|thank ?(you|u|ya|ye)|ta)\b/g,"thank you");
.replace(/\byoure\b/g,"you're")
regex(/\bsrr?y\b/g,"sorry");
.replace(/\bwhats\b/g,"what's")
regex(/\bdont\b/g,"don't");
.replace(/\bthats\b/g,"that's")
regex(/\bb4\b/g,"before");
.replace(/\bpl[ea]{0,2}(s|z)\b/g,"please")
regex(/\bi\'?m\b/g,"I'm");
.replace(/\b(than(x|z)|thx)\b/g,"thanks")
.replace(/\b(ty|thank ?(you|u|ya|ye)|ta)\b/g,"thank you")
regex(/\bdunno\b/g,"don't know");
regex(/\bbrb\b/g,"be right back");
.replace(/\bsrr?y\b/g,"sorry")
regex(/\bi ?dk\b/g,"I don't know");
.replace(/\bdont\b/g,"don't")
regex(/\bi ?dr\b/g,"I don't remember");
.replace(/\bb4\b/g,"before")
regex(/\b(b?cuz)|(b\/c(uz)?)\b/g,"because");
.replace(/\bi\'?m\b/g,"I'm")
regex(/\bdat\b/g,"that");
.replace(/\bdunno\b/g,"don't know")
regex(/\br\b/g,"are");
.replace(/\bbrb\b/g,"be right back")
regex(/\biirc\b/g,"if I recall/remember correctly");
.replace(/\bi ?dk\b/g,"I don't know")
regex(/\bd\/l\b/g,"download");
.replace(/\bi ?dr\b/g,"I don't remember")
regex(/\bawsome\b/g,"awesome");
.replace(/\b(b?cuz)|(b\/c(uz)?)\b/g,"because")
.replace(/\bdat\b/g,"that")
setReason("Cleaned up 'web jargon'","appendonce")
.replace(/\br\b/g,"are")
}
.replace(/\biirc\b/g,"if I recall/remember correctly")
document.title=document.title.replace(/, the free encyclopedia$/,"")
.replace(/\bd\/l\b/g,"download")
.replace(/\bawsome\b/g,"awesome")
.appendEditSummary("Cleaned up 'web jargon'");
}
},
]);
});

document.title = document.title.replace(/, the free encyclopedia$/, "");

Revision as of 03:51, 9 August 2015

/**
 * TemplateScript adds configurable templates and scripts to the sidebar, and adds an example regex editor.
 * @see https://meta.wikimedia.org/wiki/TemplateScript
 * @update-token [[File:pathoschild/templatescript.js]]
 */
$.ajax('//tools-static.wmflabs.org/meta/scripts/pathoschild.templatescript.js', { dataType:'script', cache:true }).then(function() {
	pathoschild.TemplateScript.add([
		{
			name: 'Cleanup web jargon',
			script: function(context) {
				context.helper
					.replace(/\bi\b/g,"I")
					.replace(/\bu\b/g,"you")
					.replace(/\by?ur\b/g,"your")
					.replace(/\byoure\b/g,"you're")
					.replace(/\bwhats\b/g,"what's")
					.replace(/\bthats\b/g,"that's")
					.replace(/\bpl[ea]{0,2}(s|z)\b/g,"please")
					.replace(/\b(than(x|z)|thx)\b/g,"thanks")
					.replace(/\b(ty|thank ?(you|u|ya|ye)|ta)\b/g,"thank you")
					.replace(/\bsrr?y\b/g,"sorry")
					.replace(/\bdont\b/g,"don't")
					.replace(/\bb4\b/g,"before")
					.replace(/\bi\'?m\b/g,"I'm")
					.replace(/\bdunno\b/g,"don't know")
					.replace(/\bbrb\b/g,"be right back")
					.replace(/\bi ?dk\b/g,"I don't know")
					.replace(/\bi ?dr\b/g,"I don't remember")
					.replace(/\b(b?cuz)|(b\/c(uz)?)\b/g,"because")
					.replace(/\bdat\b/g,"that")
					.replace(/\br\b/g,"are")
					.replace(/\biirc\b/g,"if I recall/remember correctly")
					.replace(/\bd\/l\b/g,"download")
					.replace(/\bawsome\b/g,"awesome")
					.appendEditSummary("Cleaned up 'web jargon'");
			}
		},
	]);
});

document.title = document.title.replace(/, the free encyclopedia$/, "");