mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
chat MDL-16673 Clean up inline script and output calls
This commit is contained in:
parent
e2c803396d
commit
0eaf2f249d
3 changed files with 11 additions and 14 deletions
|
@ -44,3 +44,7 @@ function update() {
|
||||||
}
|
}
|
||||||
timer = setTimeout("update()", f*1000);
|
timer = setTimeout("update()", f*1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function insert_redirect() {
|
||||||
|
parent.jsupdate.location.href = parent.jsupdate.document.anchors[0].href;
|
||||||
|
}
|
|
@ -23,6 +23,8 @@
|
||||||
error('Course Module ID was incorrect');
|
error('Course Module ID was incorrect');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$PAGE->set_url(new moodle_url($CFG->wwwroot.'/mod/chat/gui_header_js/chatinput.php', array('chat_sid'=>$chat_sid, 'chat_id'=>$chatid)));
|
||||||
|
|
||||||
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
|
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
|
||||||
|
|
||||||
//Get the user theme
|
//Get the user theme
|
||||||
|
|
|
@ -62,20 +62,11 @@
|
||||||
|
|
||||||
if ($chatuser->version == 'header_js') {
|
if ($chatuser->version == 'header_js') {
|
||||||
/// force msg referesh ASAP
|
/// force msg referesh ASAP
|
||||||
if ($CFG->chat_normal_updatemode == 'jsupdated') { // See bug MDL-6791
|
echo $PAGE->requires->js('mod/chat/gui_header_js/chat_gui_header.js')->asap();
|
||||||
echo '<script type="text/javascript">'.
|
if ($CFG->chat_normal_updatemode != 'jsupdated') { // See bug MDL-6791
|
||||||
"//<![CDATA[ \n".
|
echo $PAGE->requires->js_function_call('insert_redirect')->asap();;
|
||||||
' parent.input.enableForm();'.
|
|
||||||
"//]]> \n".
|
|
||||||
'</script>';
|
|
||||||
} else {
|
|
||||||
echo '<script type="text/javascript">'.
|
|
||||||
"//<![CDATA[ \n".
|
|
||||||
' parent.jsupdate.location.href = parent.jsupdate.document.anchors[0].href;'.
|
|
||||||
' parent.input.enableForm();'.
|
|
||||||
"//]]> \n".
|
|
||||||
'</script>';
|
|
||||||
}
|
}
|
||||||
|
echo $PAGE->requires->js_function_call('parent.input.enableForm')->asap();
|
||||||
}
|
}
|
||||||
|
|
||||||
redirect('../empty.php');
|
redirect('../empty.php');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue