()
| 180 | } |
| 181 | |
| 182 | parseFragment() { |
| 183 | let hash = document.location.hash.slice(1) |
| 184 | let valid = /^(\d+)(?:\.(\d+.*))?$/.exec(hash) |
| 185 | let chapter, exercise |
| 186 | if (valid) { |
| 187 | chapter = getChapter(Number(valid[1])) |
| 188 | exercise = chapter && valid[2] && findExercise(hash, chapter) |
| 189 | if (!chapter || valid[2] && !exercise) valid = null |
| 190 | } |
| 191 | if (valid) { |
| 192 | let perValue = exercise ? hash : "box", setPer = false |
| 193 | if (this.chapters.value != valid[1]) { |
| 194 | this.chapters.value = valid[1] |
| 195 | this.selectChapter(Number(valid[1]), perValue) |
| 196 | setPer = true |
| 197 | } |
| 198 | if (this.per.value != perValue) { |
| 199 | this.per.value = perValue |
| 200 | if (!setPer) this.selectContext(perValue) |
| 201 | } |
| 202 | return true |
| 203 | } |
| 204 | } |
| 205 | } |
| 206 | |
| 207 | function hasIncludes(code, include) { |
no test coverage detected