User:Cuckooman4/statustabs.js: Difference between revisions

Content deleted Content added
Cuckooman4 (talk | contribs)
Made script
 
m Maintenance: Replacing addPortletLink() with mw.util.addPortletLink() (mw:ResourceLoader/Migration_guide_(users)#addPortletLink)
 
(8 intermediate revisions by 2 users not shown)
Line 4:
//<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(
Line 13:
var i = 0
while(i < statustabs.length) {
mw.util.addPortletLink('p-cactions', mw.config.get('wgServer') + mw.config.get('wgScript') + "?title=User:" + encodeURIComponent(wgPageName)wgUserName + "/" + statuspageurl + "&action=edit&autostatus=" + encodeURIComponent(statustabs[i]), statustabs[i], 'ca-status' + i)
i++
}
Line 22:
document.getElementById("wpSummary").value = "Changing status: " + statusurlvar
document.getElementById("wpMinoredit").checked = false
document.getElementById("editform").submit()
}
}