Commit b470d2a5 authored by JC Brand's avatar JC Brand

More work towards making chatroom configurable

Added a form with inputs for the configuration options (not yet usable)
parent 0914887b
...@@ -63,6 +63,12 @@ img.spinner { ...@@ -63,6 +63,12 @@ img.spinner {
background-color: #2D617A; background-color: #2D617A;
} }
.chatroom .chat-body {
height: 272px;
background-color: white;
border-radius: 4px;
}
.chatroom .chat-area { .chatroom .chat-area {
float: left; float: left;
width: 200px; width: 200px;
...@@ -376,6 +382,34 @@ a.configure-chatroom-button { ...@@ -376,6 +382,34 @@ a.configure-chatroom-button {
padding-top: 0.5em; padding-top: 0.5em;
} }
.configure-chatroom-container {
color: #666;
padding: 5px;
height: 262px;
overflow-y: auto;
border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px;
}
.configure-chatroom {
background: white;
font-size: 12px;
padding: 0;
}
.configure-chatroom legend {
font-size: 14px;
font-weight: bold;
}
.configure-chatroom label {
font-weight: bold;
}
.configure-chatroom input {
display: block;
}
#converse-roster dd.odd { #converse-roster dd.odd {
background-color: #DCEAC5; /* Make this difference */ background-color: #DCEAC5; /* Make this difference */
} }
...@@ -557,6 +591,8 @@ dd.available-chatroom:hover a.open-room { ...@@ -557,6 +591,8 @@ dd.available-chatroom:hover a.open-room {
height:272px; height:272px;
width: 199px; width: 199px;
padding: 0; padding: 0;
border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px;
} }
.oc-chat-content dd { .oc-chat-content dd {
...@@ -672,6 +708,8 @@ div#settings { ...@@ -672,6 +708,8 @@ div#settings {
font-size: 14px; font-size: 14px;
width: 199px; width: 199px;
background-color: white; background-color: white;
border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px;
} }
form.sendXMPPMessage { form.sendXMPPMessage {
......
...@@ -1044,7 +1044,7 @@ ...@@ -1044,7 +1044,7 @@
'<div class="chat-title"> {{ name }} </div>' + '<div class="chat-title"> {{ name }} </div>' +
'<p class="chatroom-topic"><p/>' + '<p class="chatroom-topic"><p/>' +
'</div>' + '</div>' +
'<div>' + '<div class="chat-body">' +
'<div class="chat-area">' + '<div class="chat-area">' +
'<div class="chat-content"></div>' + '<div class="chat-content"></div>' +
'<form class="sendXMPPMessage" action="" method="post">' + '<form class="sendXMPPMessage" action="" method="post">' +
...@@ -1084,23 +1084,33 @@ ...@@ -1084,23 +1084,33 @@
showRoomConfigOptions: function (stanza) { showRoomConfigOptions: function (stanza) {
// FIXME: Show a proper configuration form // FIXME: Show a proper configuration form
var $chat_content = this.$el.find('.chat-content'), var $form= this.$el.find('form.configure-chatroom'),
$stanza = $(stanza), $stanza = $(stanza),
$fields = $stanza.find('field'), $fields = $stanza.find('field'),
title = $stanza.find('title').text(), title = $stanza.find('title').text(),
instructions = $stanza.find('instructions').text(), instructions = $stanza.find('instructions').text(),
i; i;
$chat_content.append(title); $form.append($('<legend>').text(title));
$chat_content.append(instructions); if (instructions != title) {
$form.append($('<p>').text(instructions));
}
for (i=0; i<$fields.length; i++) { for (i=0; i<$fields.length; i++) {
$field = $($fields[i]); $field = $($fields[i]);
$chat_content.append('<label>'+$field.attr('label')+'</label>'); if ($field.attr('label')) {
// $chat_content.append('<input type="text" name=">'+$field.attr('label')+'</label>'); $form.append('<label>'+$field.attr('label')+'</label>');
$form.append('<input type="text">');
}
} }
}, },
configureChatRoom: function (ev) { configureChatRoom: function (ev) {
ev.preventDefault(); ev.preventDefault();
this.$el.find('.chat-area').hide();
this.$el.find('.participants').hide();
this.$el.find('.chat-body').append(
$('<div class="configure-chatroom-container">'+
'<form class="configure-chatroom"></form>'+
'</div>'));
converse.connection.muc.configure( converse.connection.muc.configure(
this.model.get('jid'), this.model.get('jid'),
$.proxy(this.showRoomConfigOptions, this) $.proxy(this.showRoomConfigOptions, this)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment