Korisnik:Benko/monobook.js

S Wikipedije, slobodne enciklopedije

Napomena: Nakon što objavite izmjene, možda ćete morati osvježiti keš preglednika da biste vidjeli izmjene.

  • Firefox / Safari: Držite Shift i kliknite na Reload ili pritisnite Ctrl-F5 ili Ctrl-R (⌘-R na Macu)
  • Google Chrome: Pritisnite Ctrl-Shift-R (⌘-Shift-R na Macu)
  • Internet Explorer / Edge: Držite Ctrl i kliknite na Refresh ili pritisnite Ctrl-F5
  • Opera: Pritisnite Ctrl-F5.
//-- funkciju napisao: en:User:Misza13
// STATUS CHANGER
$(function (){
  var subpage = "/Status";
  var scheme = "/StatusŠablon";
  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=in", "In", "pt-status-in", "I'm in!", "", logout);
  mw.util.addPortletLink("p-personal", subpagelink + "&action=edit&newstatus=busy", "Busy", "pt-status-busy", "I'm busy!", "", logout);
  mw.util.addPortletLink("p-personal", subpagelink + "&action=edit&newstatus=out", "Out", "pt-status-out", "I'm out!", "", 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];
  //Modify the form
  document.getElementById('wpTextbox1').value = "{{User:"+wgUserName+scheme+"|"+status+"}}";
  document.getElementById('wpSummary').value = "Status: "+status;
  document.getElementById('wpMinoredit').checked = 'checked';
  //Submit it!
  document.getElementById('editform').submit();
});

//