From 8ab94a36fe4956fba5d487732834339318d1d07c Mon Sep 17 00:00:00 2001 From: samhemelryk Date: Fri, 26 Jun 2009 05:55:55 +0000 Subject: [PATCH] mod-chat MDL-16706 Removed inline JS and replaced with new PAGE methods --- mod/chat/gui_header_js/chat_gui_header.js | 24 +++++++++++ mod/chat/gui_header_js/chatinput.php | 2 +- mod/chat/gui_header_js/users.php | 52 ++++------------------- 3 files changed, 33 insertions(+), 45 deletions(-) diff --git a/mod/chat/gui_header_js/chat_gui_header.js b/mod/chat/gui_header_js/chat_gui_header.js index 7c7540054d..ddfe2614a3 100644 --- a/mod/chat/gui_header_js/chat_gui_header.js +++ b/mod/chat/gui_header_js/chat_gui_header.js @@ -18,4 +18,28 @@ function enableForm() { waitFlag = false; input_chat_message.className = ''; input_chat_message.focus(); +} + +var timer = null +var f = 1; //seconds +function stop() { + clearTimeout(timer) +} + +function start() { + timer = setTimeout("update()", f*1000); +} + +function update() { + for(i=0; iset_course($course); - $PAGE->requires->js('mod/chat/gui_header_js/chat_gui_header.js'); + $PAGE->requires->js('mod/chat/gui_header_js/chat_gui_header.js')->in_head(); print_header('', '', '', 'input_chat_message', '', false); diff --git a/mod/chat/gui_header_js/users.php b/mod/chat/gui_header_js/users.php index a8f976b695..18f2beb762 100644 --- a/mod/chat/gui_header_js/users.php +++ b/mod/chat/gui_header_js/users.php @@ -57,54 +57,18 @@ print_error('errornousers', 'chat'); } - ob_start(); - ?> - - requires->data_for_js('uidles', $uidles)->in_head(); + $PAGE->requires->js('mod/chat/gui_header_js/chat_gui_header.js')->in_head(); // Use ob to support Keep-Alive ob_start(); - print_header('', '', '', '', $meta, false, '', '', false, 'onload="start()" onunload="stop()"'); + print_header('', '', '', '', '', false, '', '', false, 'onload="start()" onunload="stop()"'); /// Print user panel body -- 2.39.5