]> git.mjollnir.org Git - moodle.git/commitdiff
Merging latest changes from MOODLE_14_STABLE.
authordefacer <defacer>
Wed, 25 Aug 2004 11:00:27 +0000 (11:00 +0000)
committerdefacer <defacer>
Wed, 25 Aug 2004 11:00:27 +0000 (11:00 +0000)
mod/chat/gui_sockets/chatinput.php
mod/chat/gui_sockets/index.php

index 990c43d3be68229456b6233039accfa561fb896e..514a5b2016fee0432553ff9da56d6d2957c398c6 100644 (file)
@@ -27,8 +27,9 @@ optional_variable($chat_pretext, '');
 
 <?php include("$CFG->javascript"); ?>
 
-<script language="Javascript">
+<script type="text/javascript">
 <!--
+
 scroll_active = true;
 function empty_field_and_submit() {
     cf = document.getElementById('chatform');
@@ -39,27 +40,36 @@ function empty_field_and_submit() {
     document.f.chat_message.focus();
     return false;
 }
+function prepareusers() {
+    var frm = window.parent.frames;
+    for(i = 0; i < frm.length; ++i) {
+        if(frm(i).name == "users") {
+            window.userFrame = frm(i);
+            window.setTimeout("reloadusers();", <?php echo $CFG->chat_refresh_userlist; ?> * 1000);
+        }
+    }
+}
+function reloadusers() {
+    if(window.userFrame) {
+        window.userFrame.location.reload();
+        window.setTimeout("reloadusers();", <?php echo $CFG->chat_refresh_userlist; ?> * 1000);
+    }
+}
 // -->
 </script>
 </head>
 
-<body bgcolor="<?php echo $THEME->body ?>" onload="document.f.chat_message.focus();document.f.chat_message.select();">
+<body bgcolor="<?php echo $THEME->body ?>" onload="document.f.chat_message.focus();document.f.chat_message.select(); prepareusers();">
 
 <!--
 <form action="<?php echo "http://$CFG->chat_serverhost:$CFG->chat_serverport"; ?>" method="GET" target="empty" name="f" onsubmit="return empty_field_and_submit()">
 -->
-<form action="../insert.php" method="GET" target="empty" name="f" onsubmit="return empty_field_and_submit()">
-
-&gt;&gt;<input type="text" name="chat_message" size="60" value="<?php echo $chat_pretext; ?>">
+<form action="../insert.php" method="get" target="empty" name="f" onsubmit="return empty_field_and_submit()">
+&gt;&gt; <input type="text" name="chat_message" size="60" value="<?php echo $chat_pretext; ?>">
 <?php helpbutton("chatting", get_string("helpchatting", "chat"), "chat", true, false); ?>
 </form>
 
-
-
-<form action="<?php echo "http://$CFG->chat_serverhost:$CFG->chat_serverport/"; ?>" method="GET" target="empty" id="chatform">
-<!--
-<form action="../insert.php" method="GET" target="empty" id="chatform" onsubmit="return empty_field_and_submit()">
--->
+<form action="<?php echo "http://$CFG->chat_serverhost:$CFG->chat_serverport/"; ?>" method="get" target="empty" id="chatform">
     <input type="hidden" name="win" value="message" />
     <input type="hidden" name="chat_version" value="sockets" />
     <input type="hidden" name="chat_message" value="" />
@@ -67,7 +77,6 @@ function empty_field_and_submit() {
     <input type="hidden" name="chat_sid" value="<?php echo $chat_sid ?>" />
     <input type="hidden" name="groupid" value="<?php echo $groupid ?>" />
 </form>
-
 </body>
 
 </html>
index 2b5783d506c6d01f2de3272d1048bca60ee53011..b55d38fbba6cbf98e775b1ee3b786b641ef763fb 100644 (file)
@@ -66,8 +66,8 @@
    <frame src="<?php echo "http://$CFG->chat_serverhost:$CFG->chat_serverport?win=chat&amp;$params"; ?>" NAME="msg" scrolling="auto" noresize marginwidth="2" marginheight="0">
    <frame src="chatinput.php?<?php echo $params ?>" name="input" scrolling="no" marginwidth="2" marginheight="1">
   </frameset>
-  <frame src="<?php echo "http://$CFG->chat_serverhost:$CFG->chat_serverport?win=users&amp;$params"; ?>" name="users" scrolling="auto" marginwidth="5" marginheight="5"> 
-  <!--  
+  <frame src="<?php echo "http://$CFG->chat_serverhost:$CFG->chat_serverport?win=users&amp;$params"; ?>" name="users" scrolling="auto" marginwidth="5" marginheight="5">
+  <!--
   <frame src="../users.php?<?php echo $params ?>" name="users" scrolling="auto" marginwidth="5" marginheight="5">
   -->
  </frameset>