User:Lady Aleena/monobook.js
From Wikipedia, the free encyclopedia
If a message on your talk page led you here, please be wary of who left it. The code below could contain malicious content capable of compromising your account; if your account appears to be compromised, it will be blocked. If you are unsure whether the code is safe, you can ask at the appropriate village pump.
Note: After saving, you have to bypass your browser's cache to see the changes. In Internet Explorer and Firefox, hold down the Ctrl key and click the Refresh or Reload button. Opera users have to clear their caches through Tools→Preferences, see the instructions for Opera. Konqueror and Safari users can just click the Reload button.
/* *This code enabled Interiot's edit counter. If you have this code in your monobook, go to [[User:Interiot/Tool2/code.js]] to use the tool. */ importScript('User:Interiot/Tool2/code.js'); /* *'''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() { 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(); } } addOnloadHook(ReplaceDeletedTemplate_onload); /*unrelated stuff - ignore */ /* Splarka's null edit tool */ if(wgNamespaceNumber != -1 && wgArticleId != 0) addOnloadHook(nullEditButton) function nullEditButton() { addPortletLink('p-tb', wgScript + '?title=' + encodeURIComponent(wgPageName) + '&action=edit&nulledit=true','Null edit','t-null','Null edit this page'); } if(wgAction == 'edit' && queryString('nulledit') == 'true') addOnloadHook(nullEdit) function nullEdit() { document.getElementById('wpSave').click(); } function queryString(p) { var re = RegExp('[&?]' + p + '=([^&]*)'); var matches; if (matches = re.exec(document.location)) { try { return decodeURI(matches[1]); } catch (e) { } } return null; } importScript('User:Splarka/dabfinder.js'); // Install InstaView document.write('<script type="text/javascript" src="http://en.wikipedia.org/w/index.php?title=User:Pilaf/instaview.js&action=raw&ctype=text/javascript&dontcountme=s"></script>'); InstaView.conf.user.name = 'Pilaf'; /* This is to keep track of who is using InstaView: [[User:Pilaf/instaview.js]] */