1
0
mirror of https://github.com/wbbaddons/Tims-Chat.git synced 2024-12-22 21:40:08 +00:00

Adding insertText method

This commit is contained in:
Tim Düsterhus 2011-12-11 13:01:35 +01:00
parent df68fbc889
commit f8024bbf2b

View File

@ -18,9 +18,9 @@ if (typeof TimWolla.WCF == 'undefined') TimWolla.WCF = {};
this.bindEvents();
},
bindEvents: function () {
$('.smiley').click(function (event) {
alert($(event.target).attr('alt'));
});
$('.smiley').click($.proxy(function (event) {
this.insertText($(event.target).attr('alt'));
}, this));
// $(window).bind('beforeunload', function() {
// return false;
@ -116,6 +116,10 @@ if (typeof TimWolla.WCF == 'undefined') TimWolla.WCF = {};
}
$('.chatMessage').animate({scrollTop: $('.chatMessage ul').height()}, 10000);
},
insertText: function (text) {
// TODO: Add options here
$('#chatInput').val(text);
},
toggleUserMenu: function (target) {
liUserID = '#' + target.parent().attr('id');
if ($(liUserID).hasClass('activeMenuItem')) {