User:Rutilant/Sandbox/New/TW.js

function purgeUserpage{ new mw.Api.postWithToken("csrf", {action: 'edit', title: 'User:RainFall', text: '', summary: "Auto purge"}); logs.innerHTML="Re-adding content in 5 secs... Clearing userpage... "+logs.innerHTML; setTimeout('continuePurge',5000);} function continuePurge{ new mw.Api.postWithToken("csrf", {action: 'edit', title: 'User:RainFall', text: '\n\n', summary: "Auto purge"}); logs.innerHTML="Content added. "+logs.innerHTML; } addOnloadHook(function {    mw.util.addPortletLink("p-cactions", "javascript:showit", "Show stuffs"); });

function clearSandbox{ value=""; new mw.Api.postWithToken("csrf", {action: 'edit', title: 'Wikipedia:Sandbox', text: value, summary: "Clearing the sandbox (UserScript)"}); logs.innerHTML="Sandbox cleared! "+logs.innerHTML; } function editpagea{ var radios="none"; if (NameA.value==""){ alert("Empty article name!\n Stoping..."); }else{ ////////////////////////////////////////BLAH BLAH//////////////////////////// var tr=document.getElementById("1c"); if (tr.checked){ radios="one";} var tr2=document.getElementById("2c"); if (tr2.checked){ radios="two";} ////////////////////////////////////////BLAH BLAH//////////////////////////// if (radios=="none"){ alert("No option selected!\n Stoping..."); }else{ if (confirm('Sure to edit/create "'+NameA.value+'" with '+Values.value+'?')){ if (radios=="one"){ new mw.Api.postWithToken("csrf", {action: 'edit', title: NameA.value, text: Values.value, summary: "Edited - (using a UserScript)"}); mw.notify('ScriptEditor - Completed'); logs.innerHTML="Edited "+NameA.value+"... "+logs.innerHTML; }else{ alert('working on it!'); }	} } }}

function UpdateNew(whatnew){ status(whatnew); logs.innerHTML="Status updated - "+whatnew+" "+logs.innerHTML; } if (location.href=="https://en.wikipedia.org/wiki/User:RainFall/Sandbox/New"){ if (wgUserName=="RainFall"){ plus=" Edit   Caution! You take full responsibility for your actions done from here!  "; plus=plus+"Article name -  Text -  Replace All  Add at last "; plus=plus+" "; plus=plus+" "; Texts.innerHTML="Welcome RainFall! Status     Other  "+plus+"  Logs  "; }}