Show all available room features

when clicking the info icon next to a room's name
This commit is contained in:
JC Brand 2013-05-11 08:50:01 +02:00
parent ee47b031ba
commit c392a4e598
3 changed files with 81 additions and 18 deletions

View File

@ -4,22 +4,27 @@ Changelog
0.3 (unreleased) 0.3 (unreleased)
---------------- ----------------
- Add vCard support [jcbrand] - Add vCard support
- Remember custom status messages upon reload. [jcbrand] [jcbrand]
- Remove jquery-ui dependency. [jcbrand] - Remember custom status messages upon reload.
[jcbrand]
- Remove jquery-ui dependency.
[jcbrand]
- Use backbone.localStorage to store the contacts roster, open chatboxes and - Use backbone.localStorage to store the contacts roster, open chatboxes and
chat messages. [jcbrand] chat messages.
- Fixed user status handling, which wasn't 100% according to the [jcbrand]
spec. [jcbrand] - Fixed user status handling, which wasn't 100% according to the spec.
- Separate messages according to day in chats. [jcbrand] [jcbrand]
- Separate messages according to day in chats.
[jcbrand]
- Add support for specifying the BOSH bind URL as configuration setting. - Add support for specifying the BOSH bind URL as configuration setting.
[jcbrand] [jcbrand]
- Improve the message counter to only increment when the window is not focused - Improve the message counter to only increment when the window is not focused
[witekdev] [witekdev]
- Make fetching of list of chatrooms on a server a configuration option. - Make fetching of list of chatrooms on a server a configuration option.
[jcbrand] [jcbrand]
- Use service discovery to show whether a chatroom is password protected as - Use service discovery to show all available features on a room.
well as its number of occupents. [jcbrand] [jcbrand]
0.2 (2013-03-28) 0.2 (2013-03-28)

View File

@ -468,12 +468,15 @@ dd.available-chatroom,
text-shadow: 0 1px 0 rgba(250, 250, 250, 1); text-shadow: 0 1px 0 rgba(250, 250, 250, 1);
} }
p.room-info { .room-info {
margin: 0;
padding: 0;
font-size: 11px; font-size: 11px;
font-style: normal; font-style: normal;
font-weight: normal; font-weight: normal;
}
p.room-info {
margin: 0;
padding: 0;
display: block; display: block;
white-space: normal; white-space: normal;
} }

View File

@ -697,9 +697,41 @@
'<div class="room-info">'+ '<div class="room-info">'+
'<p class="room-info"><strong>Description:</strong> {{desc}}</p>' + '<p class="room-info"><strong>Description:</strong> {{desc}}</p>' +
'<p class="room-info"><strong>Occupants:</strong> {{occ}}</p>' + '<p class="room-info"><strong>Occupants:</strong> {{occ}}</p>' +
'{[ if (locked) { ]}' + '<p class="room-info"><strong>Features:</strong> <ul>'+
'<p class="room-info locked">Requires authentication</p>' + '{[ if (passwordprotected) { ]}' +
'<li class="room-info locked">Requires authentication</li>' +
'{[ } ]}' + '{[ } ]}' +
'{[ if (hidden) { ]}' +
'<li class="room-info">Hidden</li>' +
'{[ } ]}' +
'{[ if (membersonly) { ]}' +
'<li class="room-info">Requires an invitation</li>' +
'{[ } ]}' +
'{[ if (moderated) { ]}' +
'<li class="room-info">Moderated</li>' +
'{[ } ]}' +
'{[ if (nonanonymous) { ]}' +
'<li class="room-info">Non-anonymous</li>' +
'{[ } ]}' +
'{[ if (open) { ]}' +
'<li class="room-info">Open room</li>' +
'{[ } ]}' +
'{[ if (persistent) { ]}' +
'<li class="room-info">Permanent room</li>' +
'{[ } ]}' +
'{[ if (publicroom) { ]}' +
'<li class="room-info">Public</li>' +
'{[ } ]}' +
'{[ if (semianonymous) { ]}' +
'<li class="room-info">Semi-anonymous</li>' +
'{[ } ]}' +
'{[ if (temporary) { ]}' +
'<li class="room-info">Temporary room</li>' +
'{[ } ]}' +
'{[ if (unmoderated) { ]}' +
'<li class="room-info">Unmoderated</li>' +
'{[ } ]}' +
'</p>' +
'</div>' '</div>'
), ),
@ -788,14 +820,36 @@
$(target).attr('data-room-jid'), $(target).attr('data-room-jid'),
null, null,
$.proxy(function (stanza) { $.proxy(function (stanza) {
var desc = $(stanza).find('field[var="muc#roominfo_description"] value').text(); var $stanza = $(stanza);
var occ = $(stanza).find('field[var="muc#roominfo_occupants"] value').text(); // All MUC features shown here: http://xmpp.org/registrar/disco-features.html
var locked = $(stanza).find('feature[var="muc_passwordprotected"]').length; var desc = $stanza.find('field[var="muc#roominfo_description"] value').text();
var occ = $stanza.find('field[var="muc#roominfo_occupants"] value').text();
var hidden = $stanza.find('feature[var="muc_hidden"]').length;
var membersonly = $stanza.find('feature[var="muc_membersonly"]').length;
var moderated = $stanza.find('feature[var="muc_moderated"]').length;
var nonanonymous = $stanza.find('feature[var="muc_nonanonymous"]').length;
var open = $stanza.find('feature[var="muc_open"]').length;
var passwordprotected = $stanza.find('feature[var="muc_passwordprotected"]').length;
var persistent = $stanza.find('feature[var="muc_persistent"]').length;
var publicroom = $stanza.find('feature[var="muc_public"]').length;
var semianonymous = $stanza.find('feature[var="muc_semianonymous"]').length;
var temporary = $stanza.find('feature[var="muc_temporary"]').length;
var unmoderated = $stanza.find('feature[var="muc_unmoderated"]').length;
$dd.find('img.spinner').replaceWith( $dd.find('img.spinner').replaceWith(
this.room_description_template({ this.room_description_template({
'desc':desc, 'desc':desc,
'occ':occ, 'occ':occ,
'locked':locked 'hidden':hidden,
'membersonly':membersonly,
'moderated':moderated,
'nonanonymous':nonanonymous,
'open':open,
'passwordprotected':passwordprotected,
'persistent':persistent,
'publicroom': publicroom,
'semianonymous':semianonymous,
'temporary':temporary,
'unmoderated':unmoderated
})); }));
}, this)); }, this));
} }
@ -1958,6 +2012,7 @@
* This collection stores Feature Models, representing features * This collection stores Feature Models, representing features
* provided by available XMPP entities (e.g. servers) * provided by available XMPP entities (e.g. servers)
* See XEP-0030 for more details: http://xmpp.org/extensions/xep-0030.html * See XEP-0030 for more details: http://xmpp.org/extensions/xep-0030.html
* All features are shown here: http://xmpp.org/registrar/disco-features.html
*/ */
model: converse.Feature, model: converse.Feature,
initialize: function () { initialize: function () {