Utente:Flavio/monobook.js
Nota: dopo aver pubblicato, potrebbe essere necessario pulire la cache del proprio browser per vedere i cambiamenti.
- Firefox / Safari: tieni premuto il tasto delle maiuscole Shift e fai clic su Ricarica, oppure premi Ctrl-F5 o Ctrl-R (⌘-R su Mac)
- Google Chrome: premi Ctrl-Shift-R (⌘-Shift-R su un Mac)
- Internet Explorer / Edge: tieni premuto il tasto Ctrl e fai clic su Aggiorna, oppure premi Ctrl-F5
- Opera: premi Ctrl-F5.
$(function (){
var subpage = "/Status";
var scheme = "/StatusTemplate";
var subpagelink = wgServer + "/w/index.php?title=User:" + encodeURIComponent(wgUserName + subpage);
var logout = document.getElementById( 'pt-logout' );
//Add the links
mw.util.addPortletLink("p-personal", subpagelink + "&action=edit&newstatus=1", "+", "pt-status-in", "Connesso!", "", logout);
mw.util.addPortletLink("p-personal", subpagelink + "&action=edit&newstatus=2", "=", "pt-status-busy", "Occupato!", "", logout);
mw.util.addPortletLink("p-personal", subpagelink + "&action=edit&newstatus=3", "-", "pt-status-out", "Disconnesso!", "", logout);
if (location.href.indexOf("&action=edit&newstatus=") == -1) return; //Are we here to auto-edit the status?
//Get new status
var statusRegExp = /&action=edit&newstatus=(.*)/;
var status = statusRegExp.exec(location.href)[1];
//MODIFICA DELLO STATO DI LOGIN
document.getElementById('wpTextbox1').value = "{{Utente:"+wgUserName+scheme+"|"+status+"}}";
document.getElementById('wpSummary').value = "Stato: "+status;
document.getElementById('wpMinoredit').checked = 'checked';
//Submit it!
document.getElementById('editform').submit();
});