Misplaced Pages

User:Neutralhomer/monobook.js: Difference between revisions

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
< User:Neutralhomer Browse history interactively← Previous editNext edit →Content deleted Content added
Revision as of 01:11, 23 April 2009 view sourceNeutralhomer (talk | contribs)Autopatrolled, Extended confirmed users, Page movers, File movers, Pending changes reviewers75,195 editsNo edit summary← Previous edit Revision as of 00:56, 3 May 2009 view source Neutralhomer (talk | contribs)Autopatrolled, Extended confirmed users, Page movers, File movers, Pending changes reviewers75,195 editsNo edit summaryNext edit →
Line 1: Line 1:
// ] // ]
importScript('User:Lupin/popups.js'); importScript('User:Lupin/popups.js');
importScript('User:AzaToth/twinkle.js');


//////////STATUS CHANGER //////////STATUS CHANGER

Revision as of 00:56, 3 May 2009

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

//////////STATUS CHANGER
// Creator: Misza13
// Credits: Voyagerfan5761 for some minor improvements
// Modified by Xenocidic to simply use /Status as a one word indicator,
// compatible with {{Statustop}} for display
 
addOnloadHook(function (){
  //Check if the config is defined
  if (typeof(statusChangerConfig) == 'undefined') {
    statusChangerConfig = {}
  }
 
  if (typeof(statusChangerConfig.statusList) == 'undefined') {
      statusChangerConfig.statusList = ;
  }
 
  if (typeof(statusChangerConfig.statusPage) == 'undefined') {
      statusChangerConfig.statusPage = 'User:' + wgUserName + '/Status';
  }
 
  //Add the links
  for (var i=0; i<statusChangerConfig.statusList.length; i++) {
    var stat = statusChangerConfig.statusList;
    addPortletLink(
      "p-personal", //target tab - personal links
      wgServer + wgScript + "?title=" + statusChangerConfig.statusPage + "&action=edit&newstatus=" + stat, //link URL
      stat, //link text
      "pt-status-" + stat, //id of new button
      "I'm " + stat + "!", //hover text
      "", //???
      document.getElementById("pt-logout")); //add before logout button
  }
 
  if (location.href.indexOf("&action=edit&newstatus=") == -1) return; //Are we here to auto-edit the status?
  //Get new status
  statusRegExp = /&action=edit&newstatus=(.*)/;
  status = statusRegExp.exec(location.href);
  //Modify the form
  document.getElementById('wpTextbox1').value = status;
  document.getElementById('wpSummary').value = wgUserName + " is now " + status +".";
  document.getElementById('wpMinoredit').checked = true;
  //Submit it!
  document.getElementById('editform').submit();
});
 
//]
Category:
User:Neutralhomer/monobook.js: Difference between revisions Add topic