"MDL-23375, fixed chat action links and beep sound"

This commit is contained in:
Dongsheng Cai
2010-08-09 08:31:39 +00:00
parent 8fb1c9af08
commit e8a4928ddd
2 changed files with 9 additions and 3 deletions
+3
View File
@@ -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]);
}
+6 -3
View File
@@ -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('<strong><a target="_blank" href="'+users[i].url+'">'+ users[i].name+'</a></strong>'));
} else {
li.all('td').item(1).append(Y.Node.create('<div><a target="_blank" href="'+users[i].url+'">'+users[i].name+'</a></div>'));
var talk = Y.Node.create('<a href="###">'+M.str.chat.talk+'</a>').on('click', this.talkto, this, users[i].name);
var beep = Y.Node.create('<a href="###">'+M.str.chat.beep+'</a>').on('click', this.send, this, users[i].id);
var talk = Y.Node.create('<a href="###">'+M.str.chat.talk+'</a>&nbsp;');
talk.on('click', this.talkto, this, users[i].name);
var beep = Y.Node.create('<a href="###">'+M.str.chat.beep+'</a>');
beep.on('click', this.send, this, users[i].id);
li.all('td').item(1).append(Y.Node.create('<div></div>').append(talk).append(beep));
}
list.append(li);