From e8a4928dddd3a28cd9a75fc3589301242d4ec8d6 Mon Sep 17 00:00:00 2001 From: Dongsheng Cai Date: Mon, 9 Aug 2010 08:31:39 +0000 Subject: [PATCH] "MDL-23375, fixed chat action links and beep sound" --- mod/chat/chat_ajax.php | 3 +++ mod/chat/gui_ajax/module.js | 9 ++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/mod/chat/chat_ajax.php b/mod/chat/chat_ajax.php index 36231394daa..1a8ea6629ec 100644 --- a/mod/chat/chat_ajax.php +++ b/mod/chat/chat_ajax.php @@ -132,6 +132,9 @@ case 'update': if ($html = chat_format_message_theme($message, $chatuser->course, $USER, $theme)) { $message->mymessage = ($USER->id == $message->userid); $message->message = $html->html; + if (!empty($html->type)) { + $message->type = $html->type; + } } else { unset($messages[$n]); } diff --git a/mod/chat/gui_ajax/module.js b/mod/chat/gui_ajax/module.js index 13895394efb..6e6068a2c42 100644 --- a/mod/chat/gui_ajax/module.js +++ b/mod/chat/gui_ajax/module.js @@ -177,7 +177,8 @@ M.mod_chat_ajax.init = function(Y, cfg) { }, this.cfg.timer, this); }, - talkto : function (name) { + talkto: function (e, name) { + console.info(name); this.messageinput.set('value', "To "+name+": "); this.messageinput.focus(); }, @@ -241,8 +242,10 @@ M.mod_chat_ajax.init = function(Y, cfg) { li.all('td').item(1).append(Y.Node.create(''+ users[i].name+'')); } else { li.all('td').item(1).append(Y.Node.create('
'+users[i].name+'
')); - var talk = Y.Node.create(''+M.str.chat.talk+'').on('click', this.talkto, this, users[i].name); - var beep = Y.Node.create(''+M.str.chat.beep+'').on('click', this.send, this, users[i].id); + var talk = Y.Node.create(''+M.str.chat.talk+' '); + talk.on('click', this.talkto, this, users[i].name); + var beep = Y.Node.create(''+M.str.chat.beep+''); + beep.on('click', this.send, this, users[i].id); li.all('td').item(1).append(Y.Node.create('
').append(talk).append(beep)); } list.append(li);