|
|
@ -173,9 +173,31 @@
|
|
|
|
<script type="text/javascript">
|
|
|
|
<script type="text/javascript">
|
|
|
|
document.getElementById('sidebar-toggle').setAttribute('aria-expanded', sidebar === 'visible');
|
|
|
|
document.getElementById('sidebar-toggle').setAttribute('aria-expanded', sidebar === 'visible');
|
|
|
|
document.getElementById('sidebar').setAttribute('aria-hidden', sidebar !== 'visible');
|
|
|
|
document.getElementById('sidebar').setAttribute('aria-hidden', sidebar !== 'visible');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Get viewed page store
|
|
|
|
|
|
|
|
var viewed_key = 'mdbook-viewed';
|
|
|
|
|
|
|
|
var viewed_map = {};
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
var viewed_storage = localStorage.getItem(viewed_key);
|
|
|
|
|
|
|
|
if (viewed_storage) {
|
|
|
|
|
|
|
|
viewed_map = JSON.parse(viewed_storage)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} catch (e) { }
|
|
|
|
|
|
|
|
|
|
|
|
Array.from(document.querySelectorAll('#sidebar a')).forEach(function(link) {
|
|
|
|
Array.from(document.querySelectorAll('#sidebar a')).forEach(function(link) {
|
|
|
|
link.setAttribute('tabIndex', sidebar === 'visible' ? 0 : -1);
|
|
|
|
link.setAttribute('tabIndex', sidebar === 'visible' ? 0 : -1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Apply viewed style
|
|
|
|
|
|
|
|
if (viewed_map[link.pathname]) {
|
|
|
|
|
|
|
|
link.classList.add('md-viewed')
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Mark viewed after 30s
|
|
|
|
|
|
|
|
setTimeout(function() {
|
|
|
|
|
|
|
|
viewed_map[location.pathname] = 1;
|
|
|
|
|
|
|
|
localStorage.setItem(viewed_key, JSON.stringify(viewed_map));
|
|
|
|
|
|
|
|
}, 30000)
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<div id="content" class="content">
|
|
|
|
<div id="content" class="content">
|
|
|
|