User:BrownHairedGirl/monobook.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. |
The accompanying .css page for this skin is at User:BrownHairedGirl/monobook.css. |
// add Script from [[Wikipedia:WikiProject User scripts/Scripts/Replace]]
function wpTextboxReplace()
{
var s = prompt("Search regexp:");
if(s){
var r = prompt("Replace /"+s+"/ with:");
if(!r && r !== '') return;
var txt = document.editform.wpTextbox1;
txt.value = txt.value.replace(new RegExp(s, "mg"), r);
}
}
$.when( mw.loader.using( 'mediawiki.util' ), $.ready).done(function () {
if (document.forms.editform) {
mw.util.addPortletLink('p-cactions', 'javascript:wpTextboxReplace()', 'replace', 'ca-replace',
'Regexp replace for the edit window', 'R', document.getElementById('ca-history'));
}
});
// add Script from [[Wikipedia:WikiProject User scripts/Scripts/Replace]]
function wpTextboxFooReplace()
{
var s = "foo";
if(s){
var r = prompt("Replace /"+s+"/ with:");
if(!r && r !== '') return;
var txt = document.editform.wpTextbox1;
txt.value = txt.value.replace(new RegExp(s, "mg"), r);
}
}
$.when( mw.loader.using( 'mediawiki.util' ), $.ready).done(function () {
if (document.forms.editform) {
mw.util.addPortletLink('p-cactions', 'javascript:wpTextboxFooReplace()', 'foo replace', 'ca-replace',
'foo Regexp replace for the edit window', 'R', document.getElementById('ca-history'));
}
});
// add Script from [[Wikipedia:WikiProject User scripts/Scripts/Replace]]
function wpTextboxFooianReplace()
{
var s = "Fooian";
if(s){
var r = prompt("Replace /"+s+"/ with:");
if(!r && r !== '') return;
var txt = document.editform.wpTextbox1;
txt.value = txt.value.replace(new RegExp(s, "mg"), r);
}
}
$.when( mw.loader.using( 'mediawiki.util' ), $.ready).done(function () {
if (document.forms.editform) {
mw.util.addPortletLink('p-cactions', 'javascript:wpTextboxFooianReplace()', 'Fooian replace', 'ca-replace',
'Fooian Regexp replace for the edit window', 'R', document.getElementById('ca-history'));
}
});
// add Script from [[Wikipedia:WikiProject User scripts/Scripts/Replace]]
function wpTextboxIrishReplace()
{
var s = "Irish";
if(s){
var r = prompt("Replace /"+s+"/ with:");
if(!r && r !== '') return;
var txt = document.editform.wpTextbox1;
txt.value = txt.value.replace(new RegExp(s, "mg"), r);
}
}
$.when( mw.loader.using( 'mediawiki.util' ), $.ready).done(function () {
if (document.forms.editform) {
mw.util.addPortletLink('p-cactions', 'javascript:wpTextboxIrishReplace()', 'Irish replace', 'ca-replace',
'Irish Regexp replace for the edit window', 'R', document.getElementById('ca-history'));
}
});
// add Script from [[Wikipedia:WikiProject User scripts/Scripts/Replace]]
function wpTextboxIrelandReplace()
{
var s = "Ireland";
if(s){
var r = prompt("Replace /"+s+"/ with:");
if(!r && r !== '') return;
var txt = document.editform.wpTextbox1;
txt.value = txt.value.replace(new RegExp(s, "mg"), r);
}
}
$.when( mw.loader.using( 'mediawiki.util' ), $.ready).done(function () {
if (document.forms.editform) {
mw.util.addPortletLink('p-cactions', 'javascript:wpTextboxIrelandReplace()', 'Ireland replace', 'ca-replace',
'Ireland Regexp replace for the edit window', 'R', document.getElementById('ca-history'));
}
});
function wpConvertCatsToLinks()
{
var txt = document.editform.wpTextbox1;
txt.value = txt.value.replace(/\[\[[Cc]ategory:/g, "[[:Category:");
}
$.when( mw.loader.using( 'mediawiki.util' ), $.ready).done(function () {
if (document.forms.editform) {
mw.util.addPortletLink('p-cactions', 'javascript:wpConvertCatsToLinks()', 'Cats to links', 'ca-replace',
'Convert Cats To Links', 'R', document.getElementById('ca-history'));
}
});
// User:BrownHairedGirl/metadata.js - displays WikiProject assessments
// [[User:Outriggr/metadatatest.js]] <nowiki>
// importScript('User:BrownHairedGirl/metadatatest.js');
// assessmentMyTemplateCode = ["{{WikiProject Ireland |class= |importance= |attention= |peer-review= |old-peer-review= |image-needed= |needs-infobox= |listas= }}", "{{WPNI |class= |importance= |attention= |image-needed=yes }}", "{{WPBiography\n|small = \n|living = \n|class = \n|priority = \n|core = \n|attention = \n|past-collaboration = \n|peer-review = \n|old-peer-review = \n|needs-infobox = \n|a&e-work-group = \n|politician-work-group = \n|activepol = \n|british-royalty = \n|royalty-work-group = \n|military-work-group = \n|sports-work-group = \n|s&a-work-group = \n|musician-work-group = \n|peerage-work-group = \n|baronets-work-group = \n|filmbio-work-group = \n|non-bio = \n|removal = \n|listas =\n|needs-photo = \n}}", "{{GaelicGamesProject}}", "{{WikiProject Wales | class= }}", "{{WikiProject Scotland | class = }}", ];
// assessmentDefaultProject = "WikiProject Ireland";
// assessmentMarkAsMinor = true;
// </nowiki>