User:John4d252/common.js

/* RLQ.push(function { var url_hash = location.hash;  var hash_tab = $(url_hash).closest('.tabbertab');  console.log('location.hash', location.hash);  console.log('hash_tab', hash_tab);  console.log('is hash tab displayed?', !(hash_tab.css('display') == 'block'));  if (location.hash && hash_tab && !(hash_tab.css('display') == 'block')) {    var nav = $('.tabbernav');    var cur_tab = $('.tabbertab').filter(function {return $(this).css('display') == 'block';}).first;    cur_tab.hide;    hash_tab.show;    nav.find('.tabberactive').removeClass('tabberactive');    nav.find('a[title="' + $(hash_tab).attr('title') + '"]').parent.addClass('tabberactive');    location.hash = url_hash;  } });

/* $("a").click(function {    console.log('local JS running');    if ($(this)[0].pathname !== location.pathname) { return; }    var link_hash = $(this)[0].hash;    if (!link_hash) { return; }

var tab_content = $('.tabbertab'); var nav = $('.tabbernav'); var cur_tab = tab_content.filter(function {return $(this).css('display') == 'block';}).first;

var nav_link = nav.find('a[title="' + link_hash.substring(1) + '"]'); if (nav_link.length > 0) { var link_tab = tab_content.filter(function {return $(this).attr('title') == link_hash.substring(1);}).first; cur_tab.hide; link_tab.show; nav.find('.tabberactive').removeClass('tabberactive'); nav_link.parent.addClass('tabberactive'); nav_link.parent[0].scrollIntoView; return; }

var link_tab = $(link_hash).closest('.tabbertab'); if ($(cur_tab).attr('title') !== $(link_tab).attr('title')) { cur_tab.hide; link_tab.show; nav.find('.tabberactive').removeClass('tabberactive'); nav.find('a[title="' + $(link_tab).attr('title') + '"]').parent.addClass('tabberactive'); console.log(nav.find('a[title="' + $(link_tab).attr('title') + '"]').parent); } });