User:Effan R/common.js

require(['wikia.window', 'jquery', 'mw'], function (window, $, mw) {   window.AnchorInTabView = window.AnchorInTabView || {};    if (typeof window.AnchorInTabView.Load !== 'undefined' || $('body').hasClass('editor')) {        return; // prevent second load.    }    window.AnchorInTabView = $.extend({ Load: true, }, window.AnchorInTabView);

function process($content) { console.log('Href:' + location.href); $elem = [].slice.call($('.tabs>li>a').filter(function { return ($(this).find('span:first').text === "Event #22-#40"); }))[0];       console.log($elem);

}

/*$elem = [].slice.call($('.tabs>li>a').filter(function { return ($(this).find('span:first').text === "Event #22-#40"); }))[0];

var loc = location.hash.replace("#", "").replace(/\./g, "%"); if (loc !== "") {

console.log("Hash:" + loc); $(".tabs a").filter(function {               console.log("Tab:" + loc + "\n Text:" + $(this).text);                return false;//(mw.util.wikiUrlencode($(this).id) == loc);            }).click; }*/

mw.hook('wikipage.content').add(process); });