User:AFigureOfBlue/dazzle/vectortab.js

//

if( typeof( DazzleConfig ) == 'undefined' ) { DazzleConfig = {}; } if( typeof( DazzleConfig.vector_tab ) == 'undefined' ) { DazzleConfig.vector_tab = true; }

var useVectorTab = function{ if (mw.config.get('skin') == "vector" && DazzleConfig.vector_tab === true) { return true; } else { return false; } };

function addDazzleVectorTab{ var dazzle_menu = document.createElement("div"); dazzle_menu.id = "p-dazzle"; dazzle_menu.className = "vectorMenu"; dazzle_menu.style.backgroundImage = "url(//en.wikipedia.org/w/thumb.php?f=Dazzle!%20tab%20icon.svg&width=16)"; dazzle_menu.innerHTML = " Dazzle!   "; var rightnav = id("right-navigation"); var searchbox = id("p-search"); var new_menu = rightnav.insertBefore(dazzle_menu, searchbox); }

function addDazzleLink(url, title, identification, tooltip, accesskey, nextnode){ if(typeof id === 'undefined') return; if (useVectorTab) { if (!id("p-dazzle")) { addDazzleVectorTab; } var loc = "p-dazzle"; } else { var loc = "p-cactions"; } addPortletLink(loc, url, title, identification, tooltip, accesskey, nextnode); } //