From 8fbc874a6968cab37cd50616b121746a3b054367 Mon Sep 17 00:00:00 2001 From: Florian Zeitz Date: Mon, 23 Mar 2009 16:18:36 +0100 Subject: [PATCH] Show own vCard. Nicer style. --- css/standard.css | 24 +++++++++++++++++++++++- index.html | 13 +++++++++++++ scripts/basic.js | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 69 insertions(+), 1 deletion(-) diff --git a/css/standard.css b/css/standard.css index 53313c8..31a1782 100644 --- a/css/standard.css +++ b/css/standard.css @@ -7,13 +7,35 @@ } #vCard_container { - clear: both; + float: left; display: none; margin: 1em; } +#ownInfo { + display: none; + background: lightgrey; + float: left; + padding: 1em; +} + +#friends { + max-width: 50%; + background: grey; + float: left; +} + +.vCardName { + font-weight: bold; +} + .friend { float: left; margin: 2em; text-align: center; } + +.friend img, #vCard_container img { + max-width: 70px; + max-height: 70px; +} diff --git a/index.html b/index.html index d808d12..f68b777 100644 --- a/index.html +++ b/index.html @@ -21,6 +21,19 @@ +
+
Avatar:
+
Full Name:
+
Last Name:
+
First Name:
+
Middle Name:
+
Nickname:
+
Birthday:
+
Telephone (Work):
+
Telephone (Home):
+
Country:
+
E-Mail:
+
diff --git a/scripts/basic.js b/scripts/basic.js index 9a1584e..cc4fde5 100644 --- a/scripts/basic.js +++ b/scripts/basic.js @@ -64,6 +64,27 @@ function _cbVCard(e) { return false; } +function _cbOwnVCard(e) { + var easy_cases = new Array('FN', 'FAMILY', 'MIDDLE', 'GIVEN', 'NICKNAME', 'BDAY', 'CTRY', 'USERID'); + for (var i=0; i
'+nick+'
'); @@ -188,6 +219,7 @@ function onConnect(status) { } else if (status == Strophe.Status.CONNECTED) { log('Strophe is connected.'); + getOwnInfo(); getRoster(); connection.addHandler(_cbDisco, Strophe.NS.DISCO_INFO, 'iq', 'get'); } @@ -199,6 +231,7 @@ function showConnect() { var button = $('#connect').get(0); $('#log').empty(); + $('#ownInfo').empty(); $('#vCard_container').empty(); $('#friends').empty(); $('label').show(); -- 2.39.5