From 304a32ff55fe711e84fd2ca5ad0860adcf5e4a1b Mon Sep 17 00:00:00 2001 From: Florian Zeitz Date: Sun, 29 Mar 2009 00:32:22 +0100 Subject: [PATCH] Some vCard work --- index.html | 11 ----------- scripts/basic.js | 32 +++++++++++++++++++++++++++++++- vCard.html | 4 +++- 3 files changed, 34 insertions(+), 13 deletions(-) diff --git a/index.html b/index.html index f68b777..e06ee7d 100644 --- a/index.html +++ b/index.html @@ -22,17 +22,6 @@
-
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 cc4fde5..934308c 100644 --- a/scripts/basic.js +++ b/scripts/basic.js @@ -47,6 +47,18 @@ function populateVCard(e, jid) { $("#"+jid2id(jid)+" img").attr('src', 'data:'+mime+';base64,'+binval); $("#PHOTO img").attr('src', 'data:'+mime+';base64,'+binval); } + $(e).find('TEL:has(HOME)').each(function() { + $('#TELHOME').append(Strophe.xmlTextNode($(this).find('NUMBER').text())); + }); + $(e).find('TEL:has(WORK)').each(function() { + $('#TELWORK').append(Strophe.xmlTextNode($(this).find('NUMBER').text())); + }); + $(e).find('EMAIL:has(HOME)').each(function() { + $('#EMAILHOME').append(Strophe.xmlTextNode($(this).find('USERID').text())); + }); + $(e).find('EMAIL:has(WORK)').each(function() { + $('#EMAILWORK').append(Strophe.xmlTextNode($(this).find('USERID').text())); + }); $('#vCard_container').slideDown("normal"); } @@ -65,6 +77,11 @@ function _cbVCard(e) { } function _cbOwnVCard(e) { + $('#ownInfo').empty(); + $('#ownInfo').load('vCard.html #vCard', function() { + $('#ownInfo').find('div').each(function() { + $(this).attr('id', 'own' + $(this).attr('id')); + }); var easy_cases = new Array('FN', 'FAMILY', 'MIDDLE', 'GIVEN', 'NICKNAME', 'BDAY', 'CTRY', 'USERID'); for (var i=0; iMiddle Name:
Nickname:
Birthday:
-
Telephone (Work):
Telephone (Home):
+
Telephone (Work):
+
E-Mail (Home):
+
E-Mail (Work):
Country:
E-Mail:
-- 2.39.5