Skip to content

Commit 5b7c307

Browse files
observer stuff
1 parent 7020192 commit 5b7c307

5 files changed

Lines changed: 14 additions & 6 deletions

File tree

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,23 @@
11
import $ from "jquery";
22

33
window.Alpine.data("Hintpoints",()=>({
4-
4+
55
idx: 0,
66
challengevalue: '',
77
async hintpointvalue(id){
88
const url = `/api/hintpoint/challengevalue/${id}`;
99
const res = await $.get(url);
1010
this.challengevalue = res.data;
11-
idx = id;
11+
this.idx = id;
1212
}
1313
}))
1414

15+
//challenge view
16+
const observer = new MutationObserver(callback);
17+
const woppy = $("#challenge-window")[0];
18+
if (woppy) {
19+
observer.observe(woppy,{attributes: true});
20+
}
21+
22+
1523
window.Alpine.start()

CTFd/plugins/hintpointdelay/staticAssets/assets/js/hintpoint-Bq66IX_i.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

CTFd/plugins/hintpointdelay/staticAssets/assets/js/hintpoint-DC_WRxR3.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CTFd/plugins/hintpointdelay/staticAssets/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
]
1818
},
1919
"assets/js/hintpoint.js": {
20-
"file": "assets/js/hintpoint-Bq66IX_i.js",
20+
"file": "assets/js/hintpoint-DC_WRxR3.js",
2121
"name": "js/hintpoint",
2222
"src": "assets/js/hintpoint.js",
2323
"isEntry": true,

CTFd/plugins/hintpointdelay/templates/hintchallenge.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ <h3 class="challenge-value text-center" x-text="challengevalue">
8686
</small>
8787
{% endif %}
8888

89-
<span class="challenge-desc">{% block description %}{{ challenge.html }}{% endblock %}</span>
89+
<span class="challenge-desc">{% block description %}{{ challenge.html | safe }}{% endblock %}</span>
9090

9191
{% if challenge.connection_info %}
9292
<div class="mb-2">
@@ -115,7 +115,7 @@ <h3 class="challenge-value text-center" x-text="challengevalue">
115115
<div>{{ hint.html | safe }}</div>
116116
</details>
117117
{% else %}
118-
<details @toggle="await showHint(event); hintpointvalue({{challenge.id}});>
118+
<details @toggle="showHint(event)">
119119
{% if hint.title %}
120120
<summary>{{ hint.title }} (Cost: {{ hint.cost }} point{{ hint.cost|pluralize }})</summary>
121121
{% else %}

0 commit comments

Comments
 (0)