Fix hints
This commit is contained in:
1 parent
517e8092e8
commit
9154046e43
2 files changed
+11
-7
No files matched your search
+1
-1
@@ -8,7 +8,7 @@
|
|||||||
<link href="/static/css/style.css" rel="stylesheet" type="text/css">
|
<link href="/static/css/style.css" rel="stylesheet" type="text/css">
|
||||||
<script type="text/javascript" src="/static/js/jquery-2.1.0.min.js"></script>
|
<script type="text/javascript" src="/static/js/jquery-2.1.0.min.js"></script>
|
||||||
<script type="text/javascript" src="/static/js/jquery.base64.min.js"></script>
|
<script type="text/javascript" src="/static/js/jquery.base64.min.js"></script>
|
||||||
<script type="text/javascript" src="/static/js/quiz.js"></script>
|
<script type="text/javascript" src="/static/js/quiz.js" defer></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
+10
-6
@@ -3,18 +3,22 @@ $(function () {
|
|||||||
var changed = false;
|
var changed = false;
|
||||||
|
|
||||||
// Hints
|
// Hints
|
||||||
$('.hint').replaceWith(function () {
|
|
||||||
return '<div><a href="#" class="hintlink" onclick="$(this).next().slideToggle(); return false;">Bekijk hint</a>' + $(this).hide()[0].outerHTML + '</div>';
|
|
||||||
});
|
function processHints() {
|
||||||
|
$('.hint').replaceWith(function () {
|
||||||
|
return '<div><a href="#" class="hintlink" onclick="$(this).next().slideToggle(); return false;">Bekijk hint</a>' + $(this).hide()[0].outerHTML + '</div>';
|
||||||
|
});
|
||||||
|
$('#difficulty').trigger('change');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$('#difficulty').change(function (e) {
|
$('#difficulty').change(function (e) {
|
||||||
var option = $(this).find(':selected').val();
|
var option = $(this).find(':selected').val();
|
||||||
|
|
||||||
|
|
||||||
$('.hintlink').toggle(option == 'normal');
|
$('.hintlink').toggle(option == 'normal');
|
||||||
$('.hint').toggle(option == 'easy');
|
$('.hint').toggle(option == 'easy');
|
||||||
|
|
||||||
|
|
||||||
window.localStorage.setItem('difficulty', option);
|
window.localStorage.setItem('difficulty', option);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -31,7 +35,7 @@ $(function () {
|
|||||||
$('#difficulty').trigger('change');
|
$('#difficulty').trigger('change');
|
||||||
|
|
||||||
function loadPage(page) {
|
function loadPage(page) {
|
||||||
$('#quiz').load('/' + page + '.html?cachebuster=' + Math.random());
|
$('#quiz').load('/' + page + '.html?cachebuster=' + Math.random(), processHints);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getPage(link) {
|
function getPage(link) {
|
||||||
|
|||||||
Reference in new issue
Block a user