| 27 | } |
| 28 | |
| 29 | function getAllPaths(router) { |
| 30 | var paths = []; |
| 31 | |
| 32 | Docsify.dom.findAll('.sidebar-nav a:not(.section-link):not([data-nosearch])').forEach(function (node) { |
| 33 | var href = node.href; |
| 34 | var originHref = node.getAttribute('href'); |
| 35 | var path = router.parse(href).path; |
| 36 | |
| 37 | if ( |
| 38 | path && |
| 39 | paths.indexOf(path) === -1 && |
| 40 | !Docsify.util.isAbsolutePath(originHref) |
| 41 | ) { |
| 42 | paths.push(path); |
| 43 | } |
| 44 | }); |
| 45 | |
| 46 | return paths |
| 47 | } |
| 48 | |
| 49 | function saveData(maxAge, expireKey, indexKey) { |
| 50 | localStorage.setItem(expireKey, Date.now() + maxAge); |