Commit b6b00887 authored by JC Brand's avatar JC Brand

Export BootstrapModal

parent c9f29f76
...@@ -6,8 +6,9 @@ ...@@ -6,8 +6,9 @@
import "converse-chatboxviews"; import "converse-chatboxviews";
import "converse-message-view"; import "converse-message-view";
import "converse-modal"; import "converse-modal";
import { debounce, get, isString } from "lodash"; import { BootstrapModal } from "./converse-modal.js";
import { Overview } from "skeletor.js/src/overview"; import { Overview } from "skeletor.js/src/overview";
import { debounce, get, isString } from "lodash";
import { html, render } from "lit-html"; import { html, render } from "lit-html";
import converse from "@converse/headless/converse-core"; import converse from "@converse/headless/converse-core";
import log from "@converse/headless/log"; import log from "@converse/headless/log";
...@@ -72,7 +73,7 @@ converse.plugins.add('converse-chatview', { ...@@ -72,7 +73,7 @@ converse.plugins.add('converse-chatview', {
}); });
_converse.UserDetailsModal = _converse.BootstrapModal.extend({ _converse.UserDetailsModal = BootstrapModal.extend({
id: "user-details-modal", id: "user-details-modal",
events: { events: {
...@@ -81,7 +82,7 @@ converse.plugins.add('converse-chatview', { ...@@ -81,7 +82,7 @@ converse.plugins.add('converse-chatview', {
}, },
initialize () { initialize () {
_converse.BootstrapModal.prototype.initialize.apply(this, arguments); BootstrapModal.prototype.initialize.apply(this, arguments);
this.model.rosterContactAdded.then(() => this.registerContactEventHandlers()); this.model.rosterContactAdded.then(() => this.registerContactEventHandlers());
this.listenTo(this.model, 'change', this.render); this.listenTo(this.model, 'change', this.render);
this.registerContactEventHandlers(); this.registerContactEventHandlers();
......
...@@ -7,7 +7,9 @@ import "./utils/html"; ...@@ -7,7 +7,9 @@ import "./utils/html";
import "@converse/headless/converse-emoji"; import "@converse/headless/converse-emoji";
import URI from "urijs"; import URI from "urijs";
import converse from "@converse/headless/converse-core"; import converse from "@converse/headless/converse-core";
import { BootstrapModal } from "./converse-modal.js";
import { debounce } from 'lodash' import { debounce } from 'lodash'
import { render } from "lit-html";
import filesize from "filesize"; import filesize from "filesize";
import log from "@converse/headless/log"; import log from "@converse/headless/log";
import tpl_csn from "templates/csn.html"; import tpl_csn from "templates/csn.html";
...@@ -69,7 +71,7 @@ converse.plugins.add('converse-message-view', { ...@@ -69,7 +71,7 @@ converse.plugins.add('converse-message-view', {
'allow_message_retraction': 'all' 'allow_message_retraction': 'all'
}); });
_converse.MessageVersionsModal = _converse.BootstrapModal.extend({ _converse.MessageVersionsModal = BootstrapModal.extend({
id: "message-versions-modal", id: "message-versions-modal",
toHTML () { toHTML () {
return tpl_message_versions_modal(this.model.toJSON()); return tpl_message_versions_modal(this.model.toJSON());
......
This diff is collapsed.
...@@ -9,6 +9,7 @@ import "@converse/headless/utils/muc"; ...@@ -9,6 +9,7 @@ import "@converse/headless/utils/muc";
import { Model } from 'skeletor.js/src/model.js'; import { Model } from 'skeletor.js/src/model.js';
import { View } from 'skeletor.js/src/view.js'; import { View } from 'skeletor.js/src/view.js';
import { get, head, isString, isUndefined } from "lodash"; import { get, head, isString, isUndefined } from "lodash";
import { BootstrapModal } from "./converse-modal.js";
import { render } from "lit-html"; import { render } from "lit-html";
import { __ } from '@converse/headless/i18n'; import { __ } from '@converse/headless/i18n';
import converse from "@converse/headless/converse-core"; import converse from "@converse/headless/converse-core";
...@@ -223,12 +224,12 @@ converse.plugins.add('converse-muc-views', { ...@@ -223,12 +224,12 @@ converse.plugins.add('converse-muc-views', {
} }
_converse.ModeratorToolsModal = _converse.BootstrapModal.extend({ _converse.ModeratorToolsModal = BootstrapModal.extend({
id: "converse-modtools-modal", id: "converse-modtools-modal",
initialize (attrs) { initialize (attrs) {
this.chatroomview = attrs.chatroomview; this.chatroomview = attrs.chatroomview;
_converse.BootstrapModal.prototype.initialize.apply(this, arguments); BootstrapModal.prototype.initialize.apply(this, arguments);
this.listenTo(this.model, 'change:role', () => { this.listenTo(this.model, 'change:role', () => {
this.users_with_role = this.getUsersWithRole(); this.users_with_role = this.getUsersWithRole();
...@@ -412,7 +413,7 @@ converse.plugins.add('converse-muc-views', { ...@@ -412,7 +413,7 @@ converse.plugins.add('converse-muc-views', {
}); });
_converse.ListChatRoomsModal = _converse.BootstrapModal.extend({ _converse.ListChatRoomsModal = BootstrapModal.extend({
id: "list-chatrooms-modal", id: "list-chatrooms-modal",
events: { events: {
...@@ -424,7 +425,7 @@ converse.plugins.add('converse-muc-views', { ...@@ -424,7 +425,7 @@ converse.plugins.add('converse-muc-views', {
}, },
initialize () { initialize () {
_converse.BootstrapModal.prototype.initialize.apply(this, arguments); BootstrapModal.prototype.initialize.apply(this, arguments);
if (_converse.muc_domain && !this.model.get('muc_domain')) { if (_converse.muc_domain && !this.model.get('muc_domain')) {
this.model.save('muc_domain', _converse.muc_domain); this.model.save('muc_domain', _converse.muc_domain);
} }
...@@ -544,7 +545,7 @@ converse.plugins.add('converse-muc-views', { ...@@ -544,7 +545,7 @@ converse.plugins.add('converse-muc-views', {
}); });
_converse.AddChatRoomModal = _converse.BootstrapModal.extend({ _converse.AddChatRoomModal = BootstrapModal.extend({
id: 'add-chatroom-modal', id: 'add-chatroom-modal',
events: { events: {
...@@ -554,7 +555,7 @@ converse.plugins.add('converse-muc-views', { ...@@ -554,7 +555,7 @@ converse.plugins.add('converse-muc-views', {
}, },
initialize () { initialize () {
_converse.BootstrapModal.prototype.initialize.apply(this, arguments); BootstrapModal.prototype.initialize.apply(this, arguments);
this.listenTo(this.model, 'change:muc_domain', this.render); this.listenTo(this.model, 'change:muc_domain', this.render);
this.muc_roomid_policy_error_msg = null; this.muc_roomid_policy_error_msg = null;
}, },
...@@ -637,11 +638,11 @@ converse.plugins.add('converse-muc-views', { ...@@ -637,11 +638,11 @@ converse.plugins.add('converse-muc-views', {
}); });
_converse.RoomDetailsModal = _converse.BootstrapModal.extend({ _converse.RoomDetailsModal = BootstrapModal.extend({
id: "room-details-modal", id: "room-details-modal",
initialize () { initialize () {
_converse.BootstrapModal.prototype.initialize.apply(this, arguments); BootstrapModal.prototype.initialize.apply(this, arguments);
this.listenTo(this.model, 'change', this.render); this.listenTo(this.model, 'change', this.render);
this.listenTo(this.model.features, 'change', this.render); this.listenTo(this.model.features, 'change', this.render);
this.listenTo(this.model.occupants, 'add', this.render); this.listenTo(this.model.occupants, 'add', this.render);
...@@ -2224,11 +2225,11 @@ converse.plugins.add('converse-muc-views', { ...@@ -2224,11 +2225,11 @@ converse.plugins.add('converse-muc-views', {
}); });
_converse.MUCInviteModal = _converse.BootstrapModal.extend({ _converse.MUCInviteModal = BootstrapModal.extend({
id: "muc-invite-modal", id: "muc-invite-modal",
initialize () { initialize () {
_converse.BootstrapModal.prototype.initialize.apply(this, arguments); BootstrapModal.prototype.initialize.apply(this, arguments);
this.listenTo(this.model, 'change', this.render); this.listenTo(this.model, 'change', this.render);
this.initInviteWidget(); this.initInviteWidget();
}, },
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
import "@converse/headless/converse-status"; import "@converse/headless/converse-status";
import "@converse/headless/converse-vcard"; import "@converse/headless/converse-vcard";
import "converse-modal"; import "converse-modal";
import { BootstrapModal } from "./converse-modal.js";
import bootstrap from "bootstrap.native"; import bootstrap from "bootstrap.native";
import converse from "@converse/headless/converse-core"; import converse from "@converse/headless/converse-core";
import log from "@converse/headless/log"; import log from "@converse/headless/log";
...@@ -34,7 +35,7 @@ converse.plugins.add('converse-profile', { ...@@ -34,7 +35,7 @@ converse.plugins.add('converse-profile', {
}); });
_converse.ProfileModal = _converse.BootstrapModal.extend({ _converse.ProfileModal = BootstrapModal.extend({
id: "user-profile-modal", id: "user-profile-modal",
events: { events: {
'change input[type="file"': "updateFilePreview", 'change input[type="file"': "updateFilePreview",
...@@ -44,7 +45,7 @@ converse.plugins.add('converse-profile', { ...@@ -44,7 +45,7 @@ converse.plugins.add('converse-profile', {
initialize () { initialize () {
this.listenTo(this.model, 'change', this.render); this.listenTo(this.model, 'change', this.render);
_converse.BootstrapModal.prototype.initialize.apply(this, arguments); BootstrapModal.prototype.initialize.apply(this, arguments);
/** /**
* Triggered when the _converse.ProfileModal has been created and initialized. * Triggered when the _converse.ProfileModal has been created and initialized.
* @event _converse#profileModalInitialized * @event _converse#profileModalInitialized
...@@ -128,7 +129,7 @@ converse.plugins.add('converse-profile', { ...@@ -128,7 +129,7 @@ converse.plugins.add('converse-profile', {
}); });
_converse.ChatStatusModal = _converse.BootstrapModal.extend({ _converse.ChatStatusModal = BootstrapModal.extend({
id: "modal-status-change", id: "modal-status-change",
events: { events: {
"submit form#set-xmpp-status": "onFormSubmitted", "submit form#set-xmpp-status": "onFormSubmitted",
...@@ -180,7 +181,7 @@ converse.plugins.add('converse-profile', { ...@@ -180,7 +181,7 @@ converse.plugins.add('converse-profile', {
} }
}); });
_converse.ClientInfoModal = _converse.BootstrapModal.extend({ _converse.ClientInfoModal = BootstrapModal.extend({
id: "converse-client-info-modal", id: "converse-client-info-modal",
toHTML () { toHTML () {
......
...@@ -7,6 +7,7 @@ import "@converse/headless/converse-chatboxes"; ...@@ -7,6 +7,7 @@ import "@converse/headless/converse-chatboxes";
import "@converse/headless/converse-roster"; import "@converse/headless/converse-roster";
import "converse-modal"; import "converse-modal";
import { compact, debounce, has, isString, uniq, without } from "lodash"; import { compact, debounce, has, isString, uniq, without } from "lodash";
import { BootstrapModal } from "./converse-modal.js";
import { View } from 'skeletor.js/src/view.js'; import { View } from 'skeletor.js/src/view.js';
import { Model } from 'skeletor.js/src/model.js'; import { Model } from 'skeletor.js/src/model.js';
import { OrderedListView } from "skeletor.js/src/overview"; import { OrderedListView } from "skeletor.js/src/overview";
...@@ -56,14 +57,14 @@ converse.plugins.add('converse-rosterview', { ...@@ -56,14 +57,14 @@ converse.plugins.add('converse-rosterview', {
}; };
_converse.AddContactModal = _converse.BootstrapModal.extend({ _converse.AddContactModal = BootstrapModal.extend({
id: "add-contact-modal", id: "add-contact-modal",
events: { events: {
'submit form': 'addContactFromForm' 'submit form': 'addContactFromForm'
}, },
initialize () { initialize () {
_converse.BootstrapModal.prototype.initialize.apply(this, arguments); BootstrapModal.prototype.initialize.apply(this, arguments);
this.listenTo(this.model, 'change', this.render); this.listenTo(this.model, 'change', this.render);
}, },
......
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