User:Cuckooman4/statustabs.js

//Made by cuckooman4. // //See /doc //

if(!statuspageurl) var statuspageurl = "Status" if(!statustemplateurl) var statustemplateurl = "StatusTemplate" if(!statussyntax) var statussyntax = "" if(!statustabs) var statustabs = ["on","off"]

addOnloadHook( function {    var i = 0    while(i < statustabs.length) {      mw.util.addPortletLink('p-cactions', mw.config.get('wgServer') + mw.config.get('wgScript') + "?title=User:" + wgUserName + "/" + statuspageurl + "&action=edit&autostatus=" + encodeURIComponent(statustabs[i]), statustabs[i], 'ca-status' + i)      i++    }

if(location.href.indexOf("&autostatus=") != -1) { var statusurlvar = location.href.split("&autostatus=")[1] document.getElementById("wpTextbox1").innerText = statussyntax.split("%STATUSPARAMS%")[0] + statusurlvar + statussyntax.split("%STATUSPARAMS%")[1] document.getElementById("wpSummary").value = "Changing status: " + statusurlvar document.getElementById("wpMinoredit").checked = false document.getElementById("editform").submit } } )

//