User:DomBot/monobook.js

From Wikipedia, the free encyclopedia

If a message on your talk page led you here, please be wary of who left it. The code below could contain malicious content capable of compromising your account; if your account appears to be compromised, it will be blocked. If you are unsure whether the code is safe, you can ask at the appropriate village pump.
Note: After saving, you have to bypass your browser's cache to see the changes. In Internet Explorer and Firefox, hold down the Ctrl key and click the Refresh or Reload button. Opera users have to clear their caches through Tools→Preferences, see the instructions for Opera. Konqueror and Safari users can just click the Reload button.
 function addlilink(tabs, url, name, id, title, key){
    var na = document.createElement('a');
    na.href = url;
    na.appendChild(document.createTextNode(name));
    var li = document.createElement('li');
    if(id) li.id = id;
    li.appendChild(na);
    tabs.appendChild(li);
    if(id)
    {
        if(key && title)
        {
            ta[id] = [key, title];
        }
        else if(key)
        {
            ta[id] = [key, ''];
        }
        else if(title)
        {
            ta[id] = ['', title];
        }
    }
    // re-render the title and accesskeys from existing code in wikibits.js
    akeytt();
    return li;
 }
 
 // 
 
 // STATUS CHANGER
 addOnloadHook(function (){
  var user = "Chidom";
 <!-- added "Chidom;" -->
 <!-- document.getElementById( 'pt-userpage' ).firstChild.firstChild.data; -->
  var subpage = "/Status";
  var scheme = "/StatusTemplate";
  var linkprefix = "http://en.wikipedia.org/w/index.php?title=User:";
  var contribs = document.getElementById( 'pt-mycontris' );
  //Add the links
  addlilink(contribs, linkprefix+user+subpage+"&action=edit&newstatus=in", "In", "pt-status-in", "I'm in!", "");
  addlilink(contribs, linkprefix+user+subpage+"&action=edit&newstatus=busy", "Busy", "pt-status-busy", "I'm busy!", "");
  addlilink(contribs, linkprefix+user+subpage+"&action=edit&newstatus=out", "Out", "pt-status-out", "I'm out!", "");
  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)[1];
  //Modify the form
  document.getElementById('wpTextbox1').value = "{{User:"+user+scheme+"|"+status+"}}";
  document.getElementById('wpSummary').value = "Status: "+status+" ********************************************************************************************************************************************************************************************";
  document.getElementById('wpMinoredit').checked = 'checked';
  //Submit it!
  document.getElementById('editform').submit();
 });
 
 //
 // [[User:Lupin/popups.js]]
 
 document.write('<script type="text/javascript" src="' 
             + 'http://en.wikipedia.org/w/index.php?title=User:Lupin/popups.js' 
             + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
 popupFixDabs=true;
 popupRedlinkRemoval=true;
 popupDelay=2.0
 popupHideDelay=0.0
 
 
 // [[User:Zocky/SearchBox.js]]
 document.write('<script type="text/javascript" src="' 
             + 'http://en.wikipedia.org/w/index.php?title=User:Zocky/SearchBox.js' 
             + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
 
 // include comfortable javascript editor by cacycle
 
 // levels of undo (each level holds the whole text)
 undoBufferMax = 20;
 
 // style for preview box
stylePreviewBox = 'background-color: #f9f9f9;';
 
 // style for custom edit buttons
 styleButtons = 'font-size: smaller; padding-left: 0.1em; padding-right: 0.1em';
 
 // presets for input field dropdown options
 findHistoryLength = 10;
 
 // preset for combo box select options
 presetOptions = [];
 presetOptions['summary'] = [
  'Copyedit',
  'Linkfix',
  'Reverting vandalism',
  'Formatting source text'
 ];
 
 // expiration time span for history cookies in seconds
 cookieExpireSec = (365 * 24 * 60 * 60);
 
 // enable cursor horizontal position memory
 cursorMemory = true;
 
 // show at least this number of lines ahead of cursor movement
 scrollMargin = 1;
 
 // show at least this number of lines ahead of cursor movement for
 findMargin = 2;
 
 // find ahead checkbox selected by default
 findAheadSelected = true;
 
 // css for change indicators
 styleDelete = 'font-weight: normal; text-decoration: none; color: #ffffff; background-color: #990033;';
 styleInsert = 'font-weight: normal; text-decoration: none; color: #ffffff; background-color: #009933;';
 styleMoved  = 'font-weight: bold; vertical-align: text-bottom; font-size: xx-small; padding: 0; border: solid 1px;';
 styleBlock  = [
        'background-color: #ffff44;',
        'background-color: #b0ff90;',
        'background-color: #ffcc99;',
        'background-color: #99ffff;',
        'background-color: #99ccff;',
        'background-color: #cc99ff;',
        'background-color: #ff99cc;',
        'background-color: #ffd040;',
        'background-color: #d0d0d0;'
 ];
 
 // html for change indicators, {number} is replaced by the block number, {block} is replaced by the block style
 htmlMovedRight  = '<input type="button" value=">" style="' + styleMoved + ' {block}">';
 htmlMovedLeft   = '<input type="button" value="<" style="' + styleMoved + ' {block}">';
 
 htmlBlockStart  = '<span style="{block}">';
 htmlBlockEnd    = '</span>';
 
 htmlDeleteStart = '<span style="' + styleDelete + '">';
 htmlDeleteEnd   = '</span>';
 
 htmlInsertStart = '<span style="' + styleInsert + '">';
 htmlInsertEnd   = '</span>';
 
 // minimal number of real words for a moved block (0 for always displaying block move indicators)
 blockMinLength = 3;
 
 // exclude identical sequence starts and endings from change marking
 wordDiff = true;
 
 // enable recursive diff to resolve problematic sequences
 recursiveDiff = true;
 
 // enable block move display
 showBlockMoves = true;
 
 // install [[User:Cacycle/diff]] text diff code
 document.write('<script type="text/javascript" src="' 
  + 'http://en.wikipedia.org/w/index.php?title=User:Cacycle/diff.js' <!--wikEdSpaceLine-->
  + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
 
 // install [[User:Pilaf/Live_Preview]] page preview tool
 document.write('<script type="text/javascript" src="' 
  + 'http://en.wikipedia.org/w/index.php?title=User:Pilaf/livepreview.js' <!--wikEdSpaceLine-->
  + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
 
 // install [[User:Cacycle/editor]] edit tool
 document.write('<script type="text/javascript" src="' 
  + 'http://en.wikipedia.org/w/index.php?title=User:Cacycle/editor.js' <!--wikEdSpaceLine-->
  + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');