]> cgit.babelmonkeys.de Git - socialXMPP.git/commitdiff
Small layout fixes
authorFlorian Zeitz <florob@babelmonkeys.de>
Wed, 22 Jul 2009 15:17:41 +0000 (17:17 +0200)
committerFlorian Zeitz <florob@babelmonkeys.de>
Fri, 24 Jul 2009 13:20:20 +0000 (15:20 +0200)
* Add maximal width for roster entries
* Nicer looking padding
* Use random IDs
* Update strophejs version used

css/standard.css
scripts/basic.js
scripts/strophejs

index 47fa53ab19551afb2eac4c819845546ce2e49f46..b6c3b8e27a9f8a23a3fd48ab41fb0e753f4973db 100644 (file)
@@ -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 {
index 128ba202041f0c9fb8f76ef9d2f23230226173f3..e4a63cf114cbf309b0d4cccee1ce78beef3481ad 100644 (file)
@@ -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('<div class="friend" id="'+jid2id(jid)+'"><img src="imgs/none.png" /><br /><a class="nick">'+nick+'</a></div>');
@@ -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();
index b3177bf164e2a8d26f18535d117a18f935340379..869a007c919936756c3f00cd298450e6a6b27a7a 160000 (submodule)
@@ -1 +1 @@
-Subproject commit b3177bf164e2a8d26f18535d117a18f935340379
+Subproject commit 869a007c919936756c3f00cd298450e6a6b27a7a