Commit 36c2a2ac authored by JC Brand's avatar JC Brand

Add option to hide the toolbar

parent ac3ac98c
...@@ -62,6 +62,7 @@ ...@@ -62,6 +62,7 @@
this.allow_otr = true; this.allow_otr = true;
this.prebind = false; this.prebind = false;
this.show_controlbox_by_default = false; this.show_controlbox_by_default = false;
this.show_toolbar = true;
this.testing = false; // Exposes sensitive data for testing. Never set to true in production systems! this.testing = false; // Exposes sensitive data for testing. Never set to true in production systems!
this.xhr_custom_status = false; this.xhr_custom_status = false;
this.xhr_user_search = false; this.xhr_user_search = false;
...@@ -83,6 +84,7 @@ ...@@ -83,6 +84,7 @@
'prebind', 'prebind',
'rid', 'rid',
'show_controlbox_by_default', 'show_controlbox_by_default',
'show_toolbar',
'sid', 'sid',
'testing', 'testing',
'xhr_custom_status', 'xhr_custom_status',
...@@ -516,7 +518,9 @@ ...@@ -516,7 +518,9 @@
'</div>' + '</div>' +
'<div class="chat-content"></div>' + '<div class="chat-content"></div>' +
'<form class="sendXMPPMessage" action="" method="post">' + '<form class="sendXMPPMessage" action="" method="post">' +
'{[ if ('+converse.show_toolbar+') { ]}' +
'<ul class="chat-toolbar no-text-select"></ul>'+ '<ul class="chat-toolbar no-text-select"></ul>'+
'{[ } ]}' +
'<textarea ' + '<textarea ' +
'type="text" ' + 'type="text" ' +
'class="chat-textarea" ' + 'class="chat-textarea" ' +
...@@ -746,11 +750,10 @@ ...@@ -746,11 +750,10 @@
]; ];
this.showHelpMessages(msgs); this.showHelpMessages(msgs);
return; return;
}
else if ((converse.allow_otr) || (match[1] === "otr")) {
return this.model.initiateOTR();
} else if ((converse.allow_otr) || (match[1] === "endotr")) { } else if ((converse.allow_otr) || (match[1] === "endotr")) {
return this.endOTR(); return this.endOTR();
} else if ((converse.allow_otr) || (match[1] === "otr")) {
return this.model.initiateOTR();
} }
} }
if (_.contains([UNVERIFIED, VERIFIED], this.model.get('otr_status'))) { if (_.contains([UNVERIFIED, VERIFIED], this.model.get('otr_status'))) {
...@@ -957,6 +960,7 @@ ...@@ -957,6 +960,7 @@
}, },
renderToolbar: function () { renderToolbar: function () {
if (converse.show_toolbar) {
var data = this.model.toJSON(); var data = this.model.toJSON();
if (data.otr_status == UNENCRYPTED) { if (data.otr_status == UNENCRYPTED) {
data.otr_tooltip = __('Your messages are not encrypted. Click here to enable OTR encryption.'); data.otr_tooltip = __('Your messages are not encrypted. Click here to enable OTR encryption.');
...@@ -971,6 +975,7 @@ ...@@ -971,6 +975,7 @@
data.otr_translated_status = OTR_TRANSLATED_MAPPING[data.otr_status]; data.otr_translated_status = OTR_TRANSLATED_MAPPING[data.otr_status];
data.otr_status_class = OTR_CLASS_MAPPING[data.otr_status]; data.otr_status_class = OTR_CLASS_MAPPING[data.otr_status];
this.$el.find('.chat-toolbar').html(this.toolbar_template(data)); this.$el.find('.chat-toolbar').html(this.toolbar_template(data));
}
return this; return this;
}, },
......
...@@ -192,16 +192,16 @@ ...@@ -192,16 +192,16 @@
<script> <script>
require(['converse'], function (converse) { require(['converse'], function (converse) {
converse.initialize({ converse.initialize({
allow_otr: true,
auto_list_rooms: false, auto_list_rooms: false,
auto_subscribe: false, auto_subscribe: false,
allow_otr: true,
bosh_service_url: 'https://bind.opkode.im', // Please use this connection manager only for testing purposes bosh_service_url: 'https://bind.opkode.im', // Please use this connection manager only for testing purposes
debug: true ,
hide_muc_server: false, hide_muc_server: false,
i18n: locales['fr'], // Refer to ./locale/locales.js to see which locales are supported i18n: locales['fr'], // Refer to ./locale/locales.js to see which locales are supported
prebind: false, prebind: false,
show_controlbox_by_default: true, show_controlbox_by_default: true,
xhr_user_search: false, xhr_user_search: false,
debug: true
}); });
}); });
</script> </script>
......
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