Skip to content

Commit 61a0bcd

Browse files
committed
fix #27
1 parent d6f35fd commit 61a0bcd

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

js/requirements.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/**
22
* These are the requirements to successfully leave a page
3+
* and the links on the top, marked or unmarked.
34
*/
45

56
var requirements = [];
@@ -9,11 +10,18 @@ function required(callable) {
910
}
1011

1112
function getId() {
12-
return "requirements.js-" + current_page_id;
13+
return getCookieId(current_page_id);
1314
}
1415

1516
function getLinkId(link) {
16-
return "requirements.js-" + link.id
17+
return getCookieId(link.id);
18+
}
19+
20+
function getCookieId(page_id) {
21+
/* The id of pages for the cookies */
22+
var numbering_regex = /\d+-\d+/;
23+
var numbering = numbering_regex.exec(page_id);
24+
return "requirements.js-step-" + numbering[0];
1725
}
1826

1927
function updateRequirements() {

0 commit comments

Comments
 (0)