Jump to content

User:AVIosad/monobook.js

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by AVIosad (talk | contribs) at 02:03, 7 June 2007. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
importScript('User:AzaToth/twinkle.js');



// install [[User:Cacycle/wikEd]] in-browser text editor
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Cacycle/wikEd.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');

addOnloadHook(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
  addPortletLink("p-personal", subpagelink + "&action=edit&newstatus=online", "online", "pt-status-online", "", logout);
  addPortletLink("p-personal", subpagelink + "&action=edit&newstatus=busy", "Busy", "pt-status-busy", "", logout);
  addPortletLink("p-personal", subpagelink + "&action=edit&newstatus=offline", "offline", "pt-status-offline", "", 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();
});

//