Skip to content

Commit 53e2cdd

Browse files
committed
(TBR)Jingle modal
1 parent 6319f52 commit 53e2cdd

File tree

4 files changed

+58
-0
lines changed

4 files changed

+58
-0
lines changed

src/plugins/jingle/constants.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
export const JINGLE_CALL_STATUS = {
3+
PENDING: 0,
4+
ACTIVE: 1,
5+
ENDED: 2
6+
};
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import BootstrapModal from "plugins/modal/base.js";
2+
import tpl_start_jingle_call from "../templates/jingle-call.js";
3+
4+
export default BootstrapModal.extend({
5+
id: "start-jingle-call-modal",
6+
persistent: true,
7+
8+
initialize () {
9+
this.items = [];
10+
this.loading_items = false;
11+
12+
BootstrapModal.prototype.initialize.apply(this, arguments);
13+
},
14+
15+
toHTML () {
16+
return tpl_start_jingle_call();
17+
}
18+
});
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { html } from 'lit';
2+
import { __ } from 'i18n';
3+
4+
const modal_close_button = html`<button type="button" class="btn btn-secondary" data-dismiss="modal">${__('Close')}</button>`;
5+
6+
export default () => {
7+
const i18n_modal_title = __('Jingle Call');
8+
return html`
9+
<div class="modal-dialog" role="document">
10+
<div class="modal-content">
11+
<div class="modal-header">
12+
<h5 class="modal-title" id="muc-list-modal-label">${i18n_modal_title}</h5>
13+
</div>
14+
<div class="modal-body d-flex flex-column">
15+
<span class="modal-alert"></span>
16+
<ul class="available-chatrooms list-group">
17+
</ul>
18+
</div>
19+
<div class="container text-center cl-2">
20+
<button type="button" class="btn btn-success">Audio Call</button>
21+
<button type="button" class="btn btn-primary">Video Call</button>
22+
</div>
23+
<div class="modal-footer">${modal_close_button}</div>
24+
</div>
25+
</div>
26+
`;
27+
}

src/plugins/jingle/utils.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { _converse } from "@converse/headless/core";
2+
import { JINGLE_CALL_STATUS } from "./constants.js";
3+
4+
export function startJingleCall(jid) {
5+
const model = _converse.chatboxes.get(jid);
6+
model.save('jingle_status', JINGLE_CALL_STATUS.PENDING);
7+
}

0 commit comments

Comments
 (0)