From 7303f83ac4937931e7e48f150ef78a9ee0229b50 Mon Sep 17 00:00:00 2001 From: Florian Zeitz Date: Wed, 22 Jul 2009 17:17:41 +0200 Subject: [PATCH] Small layout fixes * Add maximal width for roster entries * Nicer looking padding * Use random IDs * Update strophejs version used --- css/standard.css | 5 ++++- scripts/basic.js | 11 ++++++----- scripts/strophejs | 2 +- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/css/standard.css b/css/standard.css index 47fa53a..b6c3b8e 100644 --- a/css/standard.css +++ b/css/standard.css @@ -20,7 +20,9 @@ } #friends { + display: none; max-width: 50%; + padding: 1em; background: grey; float: left; } @@ -31,8 +33,9 @@ .friend { float: left; - margin: 2em; + margin: 0.5em; text-align: center; + max-width: 10em; } .friend img, #vCard_container img { diff --git a/scripts/basic.js b/scripts/basic.js index 128ba20..e4a63cf 100644 --- a/scripts/basic.js +++ b/scripts/basic.js @@ -122,7 +122,7 @@ function _cbOwnVCard(e) { } function getVCard(jid) { - var id = 'getvCard'+jid2id(jid); + var id = connection.getUniqueId('vCardGet'); if (roster[jid2id(jid)].vCard == "") { var vCardiq = $iq({'to':jid, 'id':id, @@ -136,7 +136,7 @@ function getVCard(jid) { } function getOwnInfo() { - var id = 'getvCard'+jid2id(connection.jid); + var id = connection.getUniqueId('vCardGet'); var vCardiq = $iq({'to': Strophe.getBareJidFromJid(connection.jid), 'id': id, 'type': 'get'} @@ -144,7 +144,6 @@ function getOwnInfo() { connection.addHandler(_cbOwnVCard, null, 'iq', 'result', id); connection.send(vCardiq.tree()); } - function addFriend(jid, nick) { roster[jid2id(jid)] = new Buddy(nick, jid); $('#friends').append('

'+nick+'
'); @@ -175,11 +174,13 @@ function _cbRoster(e) { var initialPresence = $pres().c('show').t('online').up().c('status').t('Hy, I am an socialXMPP instance').up().c('priority').t('1').up().c('c', {xmlns: NS_CAPS, hash: 'sha-1', node: 'http://jabber.babelmonkeys.de', ver: genCaps()}).up(); connection.send(initialPresence.tree()); + $('#friends').show(); + return false; } function getRoster() { - var id = 'getRoster'; + var id = connection.getUniqueId('roster'); var rosteriq = $iq({'id':id, 'type':'get'} @@ -331,7 +332,7 @@ function showConnect() { $('#log').empty(); $('#ownInfo').hide(); $('#vCard_container').empty(); - $('#friends').empty(); + $('#friends').hide(); $('.chat').remove(); $('label').show(); jid.show(); diff --git a/scripts/strophejs b/scripts/strophejs index b3177bf..869a007 160000 --- a/scripts/strophejs +++ b/scripts/strophejs @@ -1 +1 @@ -Subproject commit b3177bf164e2a8d26f18535d117a18f935340379 +Subproject commit 869a007c919936756c3f00cd298450e6a6b27a7a -- 2.39.5