forked from moodle/moodle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDL-21400 converted message JS to new coding style, I was unable to t…
…est this because th UI is a bit borked now
- Loading branch information
Showing
5 changed files
with
34 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
M.core_message = {}; | ||
|
||
M.core_message.init_focus = function(Y.eid) { | ||
document.getElementById(eid).focus(); | ||
} | ||
|
||
M.core_message.init_refresh_parent_frame = function(Y, msgcount, msg) { | ||
|
||
var add_message = function (messagestr) { | ||
var messageblock = parent.messages.document.getElementById('messages'); | ||
var message = document.createElement('div'); | ||
message.innerHTML = messagestr; | ||
messageblock.appendChild(message); | ||
} | ||
|
||
if (msgcount>0) { | ||
for (var i=0; i < msgcount; i++) { | ||
add_message(msg[i]) | ||
} | ||
} | ||
parent.messages.scroll(1,5000000); | ||
parent.send.focus(); | ||
} | ||
|
||
M.core_message.init_refresh_page = function(Y, delay, url) { | ||
var delay_callback = function() { | ||
document.location.replace(url); | ||
} | ||
setTimeout(delay_callback, delay); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters