MDL-21400 converted message JS to new coding style, I was unable to test this because...
[moodle.git] / message / module.js
CommitLineData
5f3bf83f
PS
1M.core_message = {};
2
3M.core_message.init_focus = function(Y.eid) {
4 document.getElementById(eid).focus();
5}
6
7M.core_message.init_refresh_parent_frame = function(Y, msgcount, msg) {
8
9 var add_message = function (messagestr) {
10 var messageblock = parent.messages.document.getElementById('messages');
11 var message = document.createElement('div');
12 message.innerHTML = messagestr;
13 messageblock.appendChild(message);
14 }
15
16 if (msgcount>0) {
17 for (var i=0; i < msgcount; i++) {
18 add_message(msg[i])
19 }
20 }
21 parent.messages.scroll(1,5000000);
22 parent.send.focus();
23}
24
25M.core_message.init_refresh_page = function(Y, delay, url) {
26 var delay_callback = function() {
27 document.location.replace(url);
28 }
29 setTimeout(delay_callback, delay);
30}