22,568
edits
No edit summary |
mNo edit summary |
||
(11 intermediate revisions by the same user not shown) | |||
Line 62: | Line 62: | ||
sections[seci] = {}; | sections[seci] = {}; | ||
legends[0].className = 'mainTab'; | legends[0].className = 'mainTab'; | ||
sections[seci].html = legends[0].innerHTML; | |||
sections[seci].secid = children[i].id; | sections[seci].secid = children[i].id; | ||
seci++; | seci++; | ||
Line 88: | Line 84: | ||
a.href = '#' + sections[i].secid; | a.href = '#' + sections[i].secid; | ||
a.onmousedown = a.onclick = uncoverTabSection; | a.onmousedown = a.onclick = uncoverTabSection; | ||
a. | a.innerHTML = sections[i].html; | ||
a.tc = tc; | a.tc = tc; | ||
a.secid = sections[i].secid; | a.secid = sections[i].secid; | ||
Line 107: | Line 103: | ||
$(window).scroll(); | $(window).scroll(); | ||
$(window).resize(); | $(window).resize(); | ||
ul.selectedid = this.secid; | ul.selectedid = this.secid; | ||
var lis = ul.getElementsByTagName( 'li' ); | var lis = ul.getElementsByTagName( 'li' ); | ||
Line 114: | Line 109: | ||
} | } | ||
this.parentNode.className = 'selected'; | this.parentNode.className = 'selected'; | ||
setTimeout(function() { $('.slideshow-current').click(); }, 100); | |||
} | } | ||
return false; | return false; | ||
} | } | ||
/* Fix hidden section links */ | |||
window.onhashchange = function() { | |||
escapedHash = $.escapeSelector(decodeURI(location.hash.split('#').pop())); | |||
tabId = $('#' + escapedHash).closest('.tabsection').attr('id'); | |||
if (tabId) { | |||
$('a[href="#' + tabId + '"]').click(); | |||
} | |||
hiddenParents = $('#' + escapedHash).parents('.mw-collapsed'); | |||
if (hiddenParents.length) { | |||
hiddenParents.each(function() { | |||
$(this).find('.mw-collapsible-toggle-collapsed').first().click(); | |||
}); | |||
} | |||
if (tabId || hiddenParents.length) { | |||
location.href = location.hash; | |||
} | |||
} | |||
setTimeout(function() { | |||
if (location.hash) { | |||
window.dispatchEvent(new HashChangeEvent('hashchange')); | |||
} | |||
}, 100); | |||
$( tabSystem ); | $( tabSystem ); |