1
0
mirror of https://github.com/nextcloud/ocsms.git synced 2026-08-17 03:13:07 +00:00

Add photo into update and fix HTML generator

This commit is contained in:
Loic Blot
2015-01-05 19:54:50 +00:00
parent 6fa1bfe17f
commit 19bd6adcca
2 changed files with 10 additions and 3 deletions
+6 -2
View File
@@ -88,8 +88,13 @@ var checkNewMessages = function() {
}
if ($.inArray(peerLabel, bufferedContacts) == -1) {
$("div[mailbox-avatar='" + peerLabel + "']").remove();
$("a[mailbox-label='" + peerLabel + "']").remove();
peerListBuf = '<li><a href="#" mailbox-navigation="' + idxVal2 + '" style="font-weight: bold;" mailbox-label="' + peerLabel + '">' + peerLabel + ' (' + val + ')</a></li>';
peerListBuf += '<li><div class="ocsms-plavatar"';
if (typeof jsondata['photos'][peerLabel] != 'undefined') {
peerListBuf += 'style="background-image: url(' + jsondata['photos'][peerLabel] + ');"';
}
peerListBuf = '></div><a href="#" mailbox-navigation="' + idxVal2 + '" style="font-weight: bold;" mailbox-label="' + peerLabel + '">' + peerLabel + ' (' + val + ')</a></li>';
$('#app-mailbox-peers ul').prepend(peerListBuf);
bufferedContacts.push(peerLabel);
@@ -289,7 +294,6 @@ function fetchInitialPeerList(jsondata) {
peerLabel = fn;
}
if ($.inArray(peerLabel, bufferedContacts) == -1) {
//peerListBuf += '<li><a href="#" mailbox-navigation="' + idxVal2 + '" mailbox-label="' + peerLabel + '">' + peerLabel + '</a></li>';
peerListBuf += '<li><div class="ocsms-plavatar"';
if (typeof jsondata['photos'][peerLabel] != 'undefined') {
peerListBuf += 'style="background-image: url(' + jsondata['photos'][peerLabel] + ');"';