Jump to content

User:Cacycle/monobook.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Cacycle (talk | contribs) at 21:23, 18 June 2006. 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.
/* <pre><nowiki> */

// Include a local JavaScript file (UTF-8):
// With Mozilla or Firefox, there is a security feature:
// 1. Enter "about:config" in the location bar.
// 2. Find the "security.checkloaduri" option and double-click on it
// 3. Set to "false"

// document.write('<script type="text/javascript" src="file:///C:/monobook.js"></script>');

// loads each tool after loading the page
window.onload = function Main() {
//  SetupEditor();
//  addLink('p-personal', '/wiki/User:Cacycle/monobook.css', 'My monobook.css', 'pt-monobookcss', 'monobook.css is used for storing user CSS styles', '', '');
  addLink('p-personal', '/wiki/User:Cacycle/monobook.js',  'My monobook.js',  'pt-monobookjs',  'monobook.js is used for storing user javascripts', '', '');
  addLink('p-personal', '/wiki/User:Cacycle/editor.js',  'editor.js',  'pt-monobookjs',  '', '', '');
  addLink('p-personal', '/wiki/User:Cacycle/editor_dev.js',  'editor_dev.js',  'pt-monobookjs',  '', '', '');
  if (document.getElementById('ca-edit')) {
    document.getElementById('ca-edit').firstChild.innerHTML = 'edit';
  }
//  unwatchlinks();
}


// include scripts from other pages from [[User:Quarl/monobook.js]]
function winc(s) {
  document.write('<script type="text/javascript" src="'
    + 'http://en.wikipedia.org/w/index.php?title=' + s
    + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
}

// loads the editor

// preset for combo box select options
presetOptions = [];
presetOptions['summary'] = [
  'Copyedit',
  'Linkfix',
  'Reverting vandalism',
  'Formatting source text',
  'Capitalizing (link) lists as per [[Wikipedia:List]] and [[Wikipedia:Manual_of_Style]]',
  'Improving source text examples as per [[Wikipedia_talk:Manual_of_Style/Archive_39#Improving_the_source_text | Wikipedia_talk:Manual_of_Style]]'
];

// Live Preview [[User:Pilaf/livepreview.js]]
wpUserName   = 'Cacycle'; // User name to display in signatures
wpShowImages = true;      // Enable downloading and displaying of images


// 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' 
  + '&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' 
  + '&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' 
  + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');

// [[User:Lupin]]'s crazy navigation popups [[User:Lupin/popups.js]]
// (http://en.wikipedia.org/wiki/Wikipedia:Tools#Navigation_popups)
popupDelay = 0.5;
popupAdminLinks = true;
popupFixRedirs = true;
popupFixDabs = true;
popupStructure = 'original'
imagePopupsForImages=false;
winc('User:Lupin/popups.js');

// shows difference between my last edit and current version ([[Wikipedia:WikiProject User scripts/Scripts/Changes since I last edited]])
//winc('User:Cacycle/monobook.js/addsincetab.js');

// [[User:Quarl/watchlist.js]] adds an unwatch link after each entry on the regular watchlist. (Original by Omegatron, AJAX version by Quarl)
winc('User:Quarl/watchlist.js');

// a helper function to add extra navigation links, from [[User:Trilobite/Tools]] and [[Wikipedia:WikiProject User scripts/Scripts/Add LI link]]
// winc('User:Cacycle/monobook.js/addlink.js');
// from [[User:Omegatron/monobook.js/addlink.js]]
function addLink(where, url, name, id, title, key, after) {
  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);
  var tabs = document.getElementById(where).getElementsByTagName('ul')[0];
  if (after) {
    tabs.insertBefore(li,document.getElementById(after));
  }
  else {
    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;
}

/* </nowiki></pre> */