User:Auscompgeek/monobook.js: Difference between revisions
Appearance
Content deleted Content added
Auscompgeek (talk | contribs) Remove "the free encyclopedia" from the title |
Pathoschild (talk | contribs) 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]] |
|||
⚫ | |||
*/ |
|||
} |
|||
$.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"); |
|||
⚫ | |||
regex(/\by?ur\b/g,"your"); |
|||
script: function(context) { |
|||
regex(/\byoure\b/g,"you're"); |
|||
context.helper |
|||
regex(/\bwhats\b/g,"what's"); |
|||
.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") |
|||
regex(/\bdunno\b/g,"don't know"); |
|||
.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") |
|||
⚫ | |||
} |
|||
}, |
|||
]); |
|||
}); |
|||
⚫ |
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$/, "");