From 23a5063e8401bc43006bffaf9cb82a0dcf84990d Mon Sep 17 00:00:00 2001 From: Florian Zeitz Date: Sat, 20 Jun 2009 22:06:56 +0200 Subject: [PATCH] Add title to bubbles * Title in bubbles * Check whether to insert
--- css/standard.css | 5 +++++ scripts/basic.js | 11 ++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) 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(); -- 2.39.2