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(); this.bindEvents();
}, },
bindEvents: function () { bindEvents: function () {
$('.smiley').click(function (event) { $('.smiley').click($.proxy(function (event) {
alert($(event.target).attr('alt')); this.insertText($(event.target).attr('alt'));
}); }, this));
// $(window).bind('beforeunload', function() { // $(window).bind('beforeunload', function() {
// return false; // return false;
@ -116,10 +116,14 @@ if (typeof TimWolla.WCF == 'undefined') TimWolla.WCF = {};
} }
$('.chatMessage').animate({scrollTop: $('.chatMessage ul').height()}, 10000); $('.chatMessage').animate({scrollTop: $('.chatMessage ul').height()}, 10000);
}, },
insertText: function (text) {
// TODO: Add options here
$('#chatInput').val(text);
},
toggleUserMenu: function (target) { toggleUserMenu: function (target) {
liUserID = '#' + target.parent().attr('id'); liUserID = '#' + target.parent().attr('id');
if ($(liUserID).hasClass('activeMenuItem')) { if ($(liUserID).hasClass('activeMenuItem')) {
$(liUserID + ' .chatUserMenu').wcfBlindOut('vertical', function() { $(liUserID + ' .chatUserMenu').wcfBlindOut('vertical', function () {
$(liUserID).removeClass('activeMenuItem'); $(liUserID).removeClass('activeMenuItem');
}); });
} }