From: samhemelryk Date: Thu, 17 Sep 2009 06:17:05 +0000 (+0000) Subject: chat MDL-16673 Clean up inline script and output calls X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=0eaf2f249db77f9209678fc5f54aa9a5b721c546;p=moodle.git chat MDL-16673 Clean up inline script and output calls --- diff --git a/mod/chat/gui_header_js/chat_gui_header.js b/mod/chat/gui_header_js/chat_gui_header.js index c9c9b7039d..e4172c33a5 100644 --- a/mod/chat/gui_header_js/chat_gui_header.js +++ b/mod/chat/gui_header_js/chat_gui_header.js @@ -43,4 +43,8 @@ function update() { } } timer = setTimeout("update()", f*1000); +} + +function insert_redirect() { + parent.jsupdate.location.href = parent.jsupdate.document.anchors[0].href; } \ No newline at end of file diff --git a/mod/chat/gui_header_js/chatinput.php b/mod/chat/gui_header_js/chatinput.php index cd52b35bb7..45117f2d11 100644 --- a/mod/chat/gui_header_js/chatinput.php +++ b/mod/chat/gui_header_js/chatinput.php @@ -22,7 +22,9 @@ if (!$cm = get_coursemodule_from_instance('chat', $chat->id, $course->id)) { 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); //Get the user theme diff --git a/mod/chat/gui_header_js/insert.php b/mod/chat/gui_header_js/insert.php index 08cc3d5eba..d92a45f3d6 100644 --- a/mod/chat/gui_header_js/insert.php +++ b/mod/chat/gui_header_js/insert.php @@ -62,20 +62,11 @@ if ($chatuser->version == 'header_js') { /// force msg referesh ASAP - if ($CFG->chat_normal_updatemode == 'jsupdated') { // See bug MDL-6791 - echo ''; - } else { - echo ''; + echo $PAGE->requires->js('mod/chat/gui_header_js/chat_gui_header.js')->asap(); + if ($CFG->chat_normal_updatemode != 'jsupdated') { // See bug MDL-6791 + echo $PAGE->requires->js_function_call('insert_redirect')->asap();; } + echo $PAGE->requires->js_function_call('parent.input.enableForm')->asap(); } redirect('../empty.php');