-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FEATURE: chat integration and usability improvements (#22)
- Added integration with Discourse Chat to allow creating a link within the options of a chat window - Open plain meeting links in a new browser tab rather than overwriting the current tab - Added settings for the new chat button integration - Separated template from javascript for better maintainability - Added new settings for choose the default options in regards to iframes
- Loading branch information
1 parent
c5ca2de
commit fc2885d
Showing
6 changed files
with
182 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
module.exports = require("@discourse/lint-configs/eslint"); | ||
module.exports = require("@discourse/lint-configs/eslint"); |
103 changes: 0 additions & 103 deletions
103
javascripts/discourse/components/modal/insert-jitsi.gjs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<DModal | ||
@title={{theme-i18n "modal.title"}} | ||
class="insert-jitsi" | ||
@closeModal={{@closeModal}} | ||
> | ||
<:body> | ||
<div class="insert-jitsi-form"> | ||
<div class="insert-jitsi-input"> | ||
<label> | ||
{{theme-i18n "room_label"}} | ||
</label> | ||
<TextField | ||
@value={{this.jitsiRoom}} | ||
@autofocus="autofocus" | ||
@autocomplete="off" | ||
/> | ||
<div class="desc">{{theme-i18n "modal.room_field_description"}}</div> | ||
</div> | ||
|
||
{{#unless @model.plainText}} | ||
|
||
<div class="insert-jitsi-input"> | ||
<label> | ||
{{theme-i18n "button_text_label"}} | ||
</label> | ||
<TextField | ||
@value={{this.buttonText}} | ||
@placeholderKey={{theme-prefix "launch_jitsi"}} | ||
/> | ||
</div> | ||
|
||
{{#unless (theme-setting "hide_iframe_buttons")}} | ||
<div class="insert-jitsi-input"> | ||
<label class="checkbox-label"> | ||
<Input @type="checkbox" @checked={{this.mobileIframe}} /> | ||
{{theme-i18n "modal.mobile_iframe"}} | ||
</label> | ||
</div> | ||
|
||
<div class="insert-bbb-input"> | ||
<label class="checkbox-label"> | ||
<Input @type="checkbox" @checked={{this.desktopIframe}} /> | ||
{{theme-i18n "modal.desktop_iframe"}} | ||
</label> | ||
</div> | ||
{{/unless}} | ||
{{/unless}} | ||
</div> | ||
</:body> | ||
<:footer> | ||
<DButton | ||
class="btn-primary" | ||
@disabled={{this.insertDisabled}} | ||
@label={{theme-prefix "modal.insert"}} | ||
@action={{this.insert}} | ||
/> | ||
</:footer> | ||
</DModal> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/*eslint no-undef:0 */ | ||
|
||
import Component from "@glimmer/component"; | ||
import { tracked } from "@glimmer/tracking"; | ||
import { action } from "@ember/object"; | ||
|
||
export default class InsertJitsiComponent extends Component { | ||
@tracked mobileIframe = settings.default_mobile_iframe; | ||
@tracked desktopIframe = settings.default_desktop_iframe; | ||
@tracked jitsiRoom = ""; | ||
@tracked buttonText = ""; | ||
|
||
keyDown(e) { | ||
if (e.keyCode === 13) { | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
return false; | ||
} | ||
} | ||
|
||
randomID() { | ||
return Math.random().toString(36).slice(-8); | ||
} | ||
|
||
@action | ||
insert() { | ||
const btnTxt = this.buttonText ? ` label="${this.buttonText}"` : ""; | ||
const roomID = this.jitsiRoom || this.randomID(); | ||
|
||
let text; | ||
|
||
if (this.args.model.plainText) { | ||
const domain = settings.meet_jitsi_domain; | ||
text = `https://${domain}/${roomID}`; | ||
} else { | ||
text = `[wrap=discourse-jitsi room="${roomID}"${btnTxt} mobileIframe="${this.mobileIframe}" desktopIframe="${this.desktopIframe}"][/wrap]`; | ||
} | ||
|
||
this.args.model.insertMeeting(text); | ||
this.args.closeModal(); | ||
} | ||
|
||
@action | ||
cancel() { | ||
this.args.closeModal(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters