User:Cuckooman4/statustabs.js: Difference between revisions

Content deleted Content added
Cuckooman4 (talk | contribs)
Changing status: on
Cuckooman4 (talk | contribs)
Oops, made it edit current page, not status page >_> (revert)
Line 1:
//Made by cuckooman4.
{{User:Cuckooman4/StatusTemplate|s=on}}
//
//See /doc
//<pre><nowiki>
 
if(!statuspageurl) var statuspageurl = "Status"
if(!statustemplateurl) var statustemplateurl = "StatusTemplate"
if(!statussyntax) var statussyntax = "{{User:" + wgUserName + "/" + statustemplateurl + "|%STATUSPARAMS%}}"
if(!statustabs) var statustabs = ["on","off"]
 
addOnloadHook(
function() {
var i = 0
while(i < statustabs.length) {
addPortletLink('p-cactions', wgServer + wgScript + "?title=" + encodeURIComponent(wgPageName) + "&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()
}
}
)
 
//</nowiki></pre>