From: Florian Zeitz Date: Sat, 20 Jun 2009 20:06:56 +0000 (+0200) Subject: Add title to bubbles X-Git-Url: https://git.babelmonkeys.de/?a=commitdiff_plain;h=23a5063e8401bc43006bffaf9cb82a0dcf84990d;p=socialXMPP.git Add title to bubbles * Title in bubbles * Check whether to insert
--- diff --git a/css/standard.css b/css/standard.css index 62dbe00..47fa53a 100644 --- a/css/standard.css +++ b/css/standard.css @@ -59,3 +59,8 @@ .chatForm { width: 100%; } + +.chatTitle { + font-size: 15pt; + font-weight: bold; +} diff --git a/scripts/basic.js b/scripts/basic.js index aecaa7e..23a5faa 100644 --- a/scripts/basic.js +++ b/scripts/basic.js @@ -209,7 +209,9 @@ function sendMessage(form, to) { var id = jid2id(to) + 'Chat'; var message = $msg({'type': 'chat', 'to': to}).c('body').t(form.text.value); connection.send(message.tree()); - $('#' + id + ' p').append('
'); + if ($('#' + id + ' p *').length > 0) { + $('#' + id + ' p').append('
'); + } $('#' + id + ' p').append('' + localJID + ': '); $('#' + id + ' p').append(form.text.value); form.text.value = ''; @@ -220,7 +222,8 @@ function sendMessage(form, to) { function createBubble(jid) { var id = jid2id(jid) + 'Chat'; - $('body').append('
Close

'); + $('body').append('
Close' + + ' ' + jid + '

'); $('#' + id).append('
') $('#' + id).css( 'top', $('#' + jid2id(jid)).position().top + 40); $('#' + id).css( 'left', $('#' + jid2id(jid)).position().left + 40); @@ -242,7 +245,9 @@ function _cbMessage(msg) { if ($('#' + id).length <= 0) { createBubble(jid); } - $('#' + id + ' p').append('
'); + if ($('#' + id + ' p *').length > 0) { + $('#' + id + ' p').append('
'); + } $('#' + id + ' p').append('' + jid + ': '); $('#' + id + ' p').append(body); $('#' + id).show();