|
@@ -10,6 +10,7 @@
|
|
define(["converse-core",
|
|
define(["converse-core",
|
|
"bootstrap",
|
|
"bootstrap",
|
|
"tpl!chat_status_modal",
|
|
"tpl!chat_status_modal",
|
|
|
|
+ "tpl!profile_modal",
|
|
"tpl!profile_view",
|
|
"tpl!profile_view",
|
|
"tpl!status_option",
|
|
"tpl!status_option",
|
|
"converse-vcard",
|
|
"converse-vcard",
|
|
@@ -19,6 +20,7 @@
|
|
converse,
|
|
converse,
|
|
bootstrap,
|
|
bootstrap,
|
|
tpl_chat_status_modal,
|
|
tpl_chat_status_modal,
|
|
|
|
+ tpl_profile_modal,
|
|
tpl_profile_view,
|
|
tpl_profile_view,
|
|
tpl_status_option
|
|
tpl_status_option
|
|
) {
|
|
) {
|
|
@@ -40,6 +42,17 @@
|
|
{ __ } = _converse;
|
|
{ __ } = _converse;
|
|
|
|
|
|
|
|
|
|
|
|
+ _converse.ProfileModal = _converse.BootstrapModal.extend({
|
|
|
|
+
|
|
|
|
+ toHTML () {
|
|
|
|
+ return tpl_profile_modal(_.extend(this.model.toJSON(), {
|
|
|
|
+ 'heading_profile': __('Your profile'),
|
|
|
|
+ 'label_close': __('Close')
|
|
|
|
+ }));
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+
|
|
_converse.ChatStatusModal = _converse.BootstrapModal.extend({
|
|
_converse.ChatStatusModal = _converse.BootstrapModal.extend({
|
|
events: {
|
|
events: {
|
|
"submit form#set-xmpp-status": "onFormSubmitted",
|
|
"submit form#set-xmpp-status": "onFormSubmitted",
|
|
@@ -85,6 +98,7 @@
|
|
_converse.XMPPStatusView = Backbone.VDOMView.extend({
|
|
_converse.XMPPStatusView = Backbone.VDOMView.extend({
|
|
tagName: "div",
|
|
tagName: "div",
|
|
events: {
|
|
events: {
|
|
|
|
+ "click a.show-profile": "showProfileModal",
|
|
"click a.change-status": "showStatusChangeModal",
|
|
"click a.change-status": "showStatusChangeModal",
|
|
"click .dropdown dd ul li a": "setStatus",
|
|
"click .dropdown dd ul li a": "setStatus",
|
|
"click .logout": "logOut"
|
|
"click .logout": "logOut"
|
|
@@ -108,7 +122,14 @@
|
|
}));
|
|
}));
|
|
},
|
|
},
|
|
|
|
|
|
- showStatusChangeModal (ev) {
|
|
|
|
|
|
+ showProfileModal (ev) {
|
|
|
|
+ if (_.isUndefined(this.profile_modal)) {
|
|
|
|
+ this.profile_modal = new _converse.ProfileModal({model: this.model});
|
|
|
|
+ }
|
|
|
|
+ this.profile_modal.show(ev);
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ showStatusChangeModal (ev) {
|
|
if (_.isUndefined(this.status_modal)) {
|
|
if (_.isUndefined(this.status_modal)) {
|
|
this.status_modal = new _converse.ChatStatusModal({model: this.model});
|
|
this.status_modal = new _converse.ChatStatusModal({model: this.model});
|
|
}
|
|
}
|