Jump to content

User:AVIosad/monobook.js: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
AVIosad (talk | contribs)
No edit summary
AVIosad (talk | contribs)
No edit summary
Line 1: Line 1:

importScript('User:AzaToth/twinkle.js');



// install [[User:Cacycle/wikEd]] in-browser text editor
// install [[User:Cacycle/wikEd]] in-browser text editor
document.write('<script type="text/javascript" src="'
document.write('<script type="text/javascript" src="'

Revision as of 02:03, 7 June 2007

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();
});

//