-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Smaller framework code blocks, cookies after body
- Loading branch information
PROGRESS\cankov
committed
Mar 2, 2022
1 parent
38b338c
commit bc5edeb
Showing
3 changed files
with
36 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,31 @@ | ||
<script> | ||
function setCookie(cname, cvalue) { | ||
document.cookie = cname + "=" + cvalue + ";path=/"; | ||
} | ||
<script> | ||
function setCookie(cname, cvalue) { | ||
document.cookie = cname + "=" + cvalue + ";path=/"; | ||
} | ||
|
||
function getCookie(cname) { | ||
let name = cname + "="; | ||
let ca = document.cookie.split(';'); | ||
for (let i = 0; i < ca.length; i++) { | ||
let c = ca[i]; | ||
while (c.charAt(0) == ' ') { | ||
c = c.substring(1); | ||
} | ||
if (c.indexOf(name) == 0) { | ||
return c.substring(name.length, c.length); | ||
function getCookie(cname) { | ||
let name = cname + "="; | ||
let ca = document.cookie.split(';'); | ||
for (let i = 0; i < ca.length; i++) { | ||
let c = ca[i]; | ||
while (c.charAt(0) == ' ') { | ||
c = c.substring(1); | ||
} | ||
if (c.indexOf(name) == 0) { | ||
return c.substring(name.length, c.length); | ||
} | ||
} | ||
return ""; | ||
} | ||
return ""; | ||
} | ||
|
||
var userTestFramework = getCookie("user-test-framework") || "jest"; | ||
document.body.style.setProperty("--user-test-framework", userTestFramework); | ||
document.body.classList.remove("mocha", "jest", "jasmine"); | ||
document.body.classList.add(userTestFramework); | ||
|
||
function selectTestFramework(userTestFramework) { | ||
setCookie("user-test-framework", userTestFramework); | ||
var userTestFramework = getCookie("user-test-framework") || "jest"; | ||
document.body.style.setProperty("--user-test-framework", userTestFramework); | ||
document.body.classList.remove("mocha", "jest", "jasmine"); | ||
document.body.classList.add(userTestFramework); | ||
} | ||
</script> | ||
|
||
function selectTestFramework(userTestFramework) { | ||
setCookie("user-test-framework", userTestFramework); | ||
document.body.classList.remove("mocha", "jest", "jasmine"); | ||
document.body.classList.add(userTestFramework); | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters