User:CirTap/monobook.js

From Joomla! Documentation

Jump to: navigation, search

Note: After saving, you may have to bypass your browser's cache to see the changes. Mozilla / Firefox / Safari: hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (Command-R on a Macintosh); Konqueror: click Reload or press F5; Opera: clear the cache in Tools → Preferences; Internet Explorer: hold Ctrl while clicking Refresh, or press Ctrl-F5.

// on editable pages only 
if (window.wgIsArticle) { addOnloadHook( function () {
var pageUrl = window.wgServer+window.wgScript+'?title='+window.wgPageName;
// add tab BEFORE "Edit" tab
var myActs = document.getElementById('p-cactions').getElementsByTagName('UL')[0];
var myEdit = document.getElementById('ca-edit');
var myEditLead = myEdit.cloneNode(true);
var myEditA = myEditLead.getElementsByTagName('A')[0];
/* add "Edit Lead Section" tab */
myEditLead.id = 'ca-editlead';
myEditA.href += '&section=0';
myEditA.innerHTML = '0';
myEditA.title = 'Edit lead section';
myEditA.accesskey = null;
myActs.insertBefore(myEditLead, myEdit)
 
/* addPortletLink(portlet-id, href, text, id, tooltip, accesskey, nextnode) */
// purge tab
addPortletLink('p-cactions', pageUrl+'&action=purge', 'Purge', 'ca-purge', 'Purge page cache', null, 'SMACK');
 
});} // if
 
// e.o.f. User:CirTap/monobook.js
Personal tools