forked from frankli0324/ctfd-whale
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate.js
30 lines (29 loc) · 900 Bytes
/
create.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Markdown Preview
if ($ === undefined) $ = CTFd.lib.$
$('#desc-edit').on('shown.bs.tab', function(event) {
if (event.target.hash == '#desc-preview') {
var editor_value = $('#desc-editor').val();
$(event.target.hash).html(
CTFd._internal.challenge.render(editor_value)
);
}
});
$('#new-desc-edit').on('shown.bs.tab', function(event) {
if (event.target.hash == '#new-desc-preview') {
var editor_value = $('#new-desc-editor').val();
$(event.target.hash).html(
CTFd._internal.challenge.render(editor_value)
);
}
});
$("#solve-attempts-checkbox").change(function() {
if (this.checked) {
$('#solve-attempts-input').show();
} else {
$('#solve-attempts-input').hide();
$('#max_attempts').val('');
}
});
$(document).ready(function() {
$('[data-toggle="tooltip"]').tooltip();
});