User:Animum/reset.js: Difference between revisions

Content deleted Content added
Animum (talk | contribs)
+cmt
Animum (talk | contribs)
Hmmm testing
Line 1:
// [[User:Animum/reset.js]] by Animum
 
importScript('User:Voice of All/Addtabs/monobook.js');
 
function resetSandbox() {
if(UrlParameters["sandboxreset"] == "1") {
document.editform.wpTextbox1.value = "\{\{Please leave this line alone (sandbox heading)\}\}\n" +
"<!-- Hello! Feel free to try your formatting and editing skills below this line\. As this page is for editing experiments, this page will automatically be cleaned every 12 hours. -->"; //Add the base text for the sandbox
document.editform.wpSummary.value = "[[User:Animum/reset.js|JS EDIT]]: Reset the Sandbox"; //Make a descriptive edit summary
document.editform.wpMinoredit.checked = true; //Make it a minor edit
window.setTimeout(function() { document.editform.wpSave.click(); }, 1000); //Submit it after 1 second's delay! }
}
addOnloadHook(function addResetTab() {
addToolboxLink('http://en.wikipedia.org/w/index.php?title=Wikipedia:Sandbox&action=edit&sandboxreset=1', 'Reset the Sandbox', '', '', '');
if( wgPageName == "Wikipedia:Sandbox" && ( wgAction == "edit" || wgAction == "submit" ) ) //Add the tab for previews, edit conflicts, and bare editing of the sandbox
});
{ addPortletLink('p-cactions', 'javascript:resetSandbox()', 'reset', 'ca-reset', "Reset the Sandbox"); }
}
 
addOnloadHook(addResetTab);