User:Pecoes/global.js

var talkNameSpaces = [1,3,5,7,9,11,13,15,110,111,401,500,501,502,503];

var extraMenu = { url: '#', img: 'http://images4.wikia.nocookie.net/dev/images/5/50/Bookmark16.png', sub: [{ url: 'http://jadeempire-modding.wikia.com/', title: 'JE Modding', sub: [{ url: 'http://jadeempire-modding.wikia.com/wiki/User:Pecoes/Sandbox', title: 'Sandbox' }, {           url: 'http://jadeempire-modding.wikia.com/wiki/MediaWiki:Wikia.css', title: 'Wikia.css' }, {           url: 'http://jadeempire-modding.wikia.com/wiki/MediaWiki:Common.js', title: 'Common.js' }]   }, {        url: 'http://community.wikia.com/', title: 'Community Central', sub: [{ url: 'http://community.wikia.com/wiki/Admin_Central:Forum', title: 'Admin Forum' }]   }, {        url: 'http://dev.wikia.com/', title: 'dev' }] };

function addExtraMenu (extraMenu, depth) { if (undefined == depth) depth = 1; var ulClass = aClass = ""; switch (depth) { case 1: ulClass = ' class="subnav-2 accent" style="visibility: visible; display: none;"'; break; case 2: aClass = ' class="subnav-2a"'; ulClass = ' class="subnav subnav-3"'; break; case 3: aClass = ' class="subnav-3a"'; break; default: return ""; }   var caption = ''; if (undefined != extraMenu.img) caption += ''; if (undefined != extraMenu.title) caption += (caption.length ? ' ' : '') + extraMenu.title; if (!caption.length) throw new Error ('neither image nor title provided'); if (undefined == extraMenu.url) throw new Error('no url provided'); var html = '' + caption; if (undefined != extraMenu.sub && extraMenu.sub instanceof Array) { if (2 == depth) html += ''; html += ''; html += ''; for (var i = 0; i < extraMenu.sub.length; i++) { html += addExtraMenu(extraMenu.sub[i], depth + 1); }       html += ""; }   else html += ''; html += ''; return html; }

$('#WikiHeader nav ul:first').append(addExtraMenu(extraMenu)); $('#WikiHeader > nav').css({ width: "580" }); var navWidth = 0; $('#WikiHeader > nav > ul > li').each(function { navWidth += $(this).width; }); if (560 < navWidth) $('#WikiHeader > nav > ul > li > a').css({ paddingLeft: "11px", paddingRight: "11px" });

$(function {

/*   // wikimarks: if (undefined != extraMenu) { $('#WikiHeader nav ul:first').append(addExtraMenu(extraMenu)); }   */

/*   if (undefined != window.wgNamespaceNumber && -1 < $.inArray(wgNamespaceNumber, talkNameSpaces)) { function appendSignature { var edits = $('#cke_contents_wpTextbox1 iframe').contents.find('#bodyContent :last-child'); $(edits[edits.length-1]).before(' -- &#126;~'); }       $('#editform').submit(appendSignature); $('#publish').click(appendSignature); }   */    });