User:Animum/reset.js: Difference between revisions

Content deleted Content added
Animum (talk | contribs)
...
Animum (talk | contribs)
bleh
Line 1:
// [[User:Animum/reset.js]] by Animum
 
importScript('User:Voice of All/Addtabs/monobook.js');
 
function resetSandbox() {
document.forms["editform"].wpTextbox1.value = "\{\{Please leave this line alone (sandbox heading)\}\}\n" +
if(UrlParameters["editformaction"] == 'reset') {
document.forms["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.forms["editform"].wpSummary.value = "[[User:Animum/reset.js|JS EDIT]]: Reset the Sandbox"; //Make a descriptive edit summary
document.forms["editform"].wpMinoredit.checked = true; //Make it a minor edit
window.setTimeout(function() { document.forms["editform"].wpSave.click(); }, 1000); } //Submit it after 1 second's delay!
}
addOnloadHook(function addResetTab() {
if( wgPageName == "Wikipedia:Sandbox" && ( wgAction == "edit" || wgAction == "submit" ) ) //Add the tab for previews, edit conflicts, and bare editing of the sandbox
addToolboxLink("http://en.wikipedia.org/w/index.php?title=Wikipedia%3ASandbox&action=edit&editformaction=reset", 'Reset the Sandbox', '', '', '');
{ addPortletLink('p-cactions', 'javascript:resetSandbox()', 'reset', 'ca-reset', "Reset the Sandbox"); }
});
}
 
addOnloadHook(addResetTab);