Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
/* global HVPSettingsHideKey */
2
/**
3
 * Prepares for hiding of the Site Key setting since you cannot modify attributes and such in Moodle.
4
 */
5
(function($) {
6
    $(document).ready(function() {
7
        if (!window.HVPSettingsHideKey) {
8
            return;
9
        }
10
 
11
        var $input = $('#' + HVPSettingsHideKey.input);
12
        if (!$input.length) {
13
            return;
14
        }
15
 
16
        var placeHolder = $input.val() || HVPSettingsHideKey.value ? HVPSettingsHideKey.placeholder : HVPSettingsHideKey.empty;
17
        $input.attr('maxlength', 36)
18
            .attr('placeholder', placeHolder)
19
            .data('value', HVPSettingsHideKey.value)
20
            .val('');
21
 
22
        $('<button/>', {
23
            'type': 'button',
24
            'class': 'h5p-reveal-value',
25
            'text': HVPSettingsHideKey.reveal,
26
            'data': {
27
                'control': HVPSettingsHideKey.input,
28
                'hide': HVPSettingsHideKey.hide
29
            },
30
            insertAfter: $input
31
        });
32
    });
33
})(H5P.jQuery);