Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
M.core_message = M.core_message || {};
2
 
3
M.core_message.init_focus = function(Y, eid) {
4
    document.getElementById(eid).focus();
5
};
6
 
7
M.core_message.init_refresh_page = function(Y, delay, url) {
8
    var delay_callback = function() {
9
        document.location.replace(url);
10
    };
11
    setTimeout(delay_callback, delay);
12
};
13
 
14
M.core_message.combinedsearchgotfocus = function(e) {
15
    if (e.target.get('value')==this.defaultsearchterm) {
16
        e.target.select();
17
    }
18
};
19
 
20
M.core_message.init_editsettings = function(Y) {
21
    var editsettings = {
22
 
23
        init : function() {
24
            var disableall = Y.one(".disableallcheckbox");
25
            disableall.on('change', editsettings.changeState);
26
            disableall.simulate("change");
27
        },
28
 
29
        changeState : function(e) {
30
            Y.all('.notificationpreference').each(function(node) {
31
                var disabled = e.target.get('checked');
32
 
33
                node.removeAttribute('disabled');
34
                if (disabled) {
35
                    node.setAttribute('disabled', 1)
36
                }
37
            }, this);
38
        }
39
    }
40
 
41
    editsettings.init();
42
}