Jump to content

User:Deyyaz/monobook.js

From Wikipedia, the free encyclopedia
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.
/* This function is used to include scripts from other Wikipedia pages in mine.  I got it from [[User:Quarl/monobook.js]]. */

// Include scripts from the [[de:]]
function dinc(s) {
    mw.loader.load( '//de.wikipedia.org/w/index.php?title=' + encodeURIComponent(s) +  '&action=raw&ctype=text/javascript' );
}

importScript('User:Lupin/popups.js');
importScript('User:Lupin/recent2.js'); // Lupin's [[User:Lupin/Anti-vandal_tool]]
importScript('User:Ais523/editcount.js'); // Count a user's edits

// STATUS CHANGER
addOnloadHook(function (){
  var subpage = "/Status";
  var linkprefix = wgScript + "?title=User:";
  var user = encodeURIComponent( wgUserName );
  var logout = document.getElementById( 'pt-logout' );

  //Add the links
  mw.util.addPortletLink( 'p-personal', linkprefix+user+subpage+"&action=edit&newstatus=Online", "Online", "pt-status-in", "Online", null, logout);
  mw.util.addPortletLink( 'p-personal', linkprefix+user+subpage+"&action=edit&newstatus=Busy", "Busy", "pt-status-busy", "Busy", null, logout);
  mw.util.addPortletLink( 'p-personal', linkprefix+user+subpage+"&action=edit&newstatus=Offline", "Offline", "pt-status-out", "Offline", null, 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 = status;
  document.getElementById('wpSummary').value = "Status: "+status;
  document.getElementById('wpMinoredit').checked = 'checked';

  //Submit it!
  document.getElementById('editform').submit();
});

dinc('Benutzer:ASM/quickedit.js');

importScript('User:Dr_pda/prosesize.js'); //[[User:Dr_pda/prosesize.js]]