forked from h5p/moodle-mod_hvp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings-hide-key.js
31 lines (28 loc) · 949 Bytes
/
settings-hide-key.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
31
/**
* Prepares for hiding of the Site Key setting since you cannot modify attributes and such in Moodle.
*/
(function ($) {
$(document).ready(function () {
if (!window.HVPSettingsHideKey) {
return;
}
var $input = $('#' + HVPSettingsHideKey.input);
if (!$input.length) {
return;
}
$input.attr('maxlength', 36)
.attr('placeholder', $input.val() || HVPSettingsHideKey.value ? HVPSettingsHideKey.placeholder : HVPSettingsHideKey.empty)
.data('value', HVPSettingsHideKey.value)
.val('');
$('<button/>', {
'type': 'button',
'class': 'h5p-reveal-value',
'text': HVPSettingsHideKey.reveal,
'data': {
'control': HVPSettingsHideKey.input,
'hide': HVPSettingsHideKey.hide
},
insertAfter: $input
});
});
})(H5P.jQuery);