Maintain location history (reflecting current mode in url),
and refresh on reload to support browser navigation.
- footer style option to top position/button?
- top-left header (logo to root)?
conflicts with Esc key positioning
- footer style option to top position/button?
- top-left header (logo to root)?
conflicts with Esc key positioning
-function setmode(classname) {
+function setmode(classname, restore) {
// set style for each #rows>li>ul>li to display:none unless it matches classname
var showclass = classname ? '^mode '+classname+'(?!\\w)' : '^(?!mode)';
var rows = document.getElementById('rows').getElementsByTagName('TR');
// set style for each #rows>li>ul>li to display:none unless it matches classname
var showclass = classname ? '^mode '+classname+'(?!\\w)' : '^(?!mode)';
var rows = document.getElementById('rows').getElementsByTagName('TR');
if (h3s[i].parentNode.style.display != 'block') continue;
var header = h3s[i].firstChild.data;
document.getElementsByTagName('H2')[0].innerHTML = header;
if (h3s[i].parentNode.style.display != 'block') continue;
var header = h3s[i].firstChild.data;
document.getElementsByTagName('H2')[0].innerHTML = header;
+ if (restore) break;
+ history.pushState(null, header, classname ? '#'+classname : '#');
+window.addEventListener('hashchange', function(e) {
+ setmode(location.hash.slice(1), true);
+});
- setmode(location.hash.slice(1));
+ setmode(location.hash.slice(1), true);
}
var keyfocus = undefined;
}
var keyfocus = undefined;