|  | @@ -1,5 +1,7 @@
 | 
											
												
													
														|  |  import Controller from "@ember/controller";
 |  |  import Controller from "@ember/controller";
 | 
											
												
													
														|  |  import ModalFunctionality from "discourse/mixins/modal-functionality";
 |  |  import ModalFunctionality from "discourse/mixins/modal-functionality";
 | 
											
												
													
														|  | 
 |  | +import discourseComputed from "discourse-common/utils/decorators";
 | 
											
												
													
														|  | 
 |  | +import { isEmpty } from "@ember/utils";
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  export default Controller.extend(ModalFunctionality, {
 |  |  export default Controller.extend(ModalFunctionality, {
 | 
											
												
													
														|  |    keyDown(e) {
 |  |    keyDown(e) {
 | 
											
										
											
												
													
														|  | @@ -21,11 +23,26 @@ export default Controller.extend(ModalFunctionality, {
 | 
											
												
													
														|  |      });
 |  |      });
 | 
											
												
													
														|  |    },
 |  |    },
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | 
 |  | +  randomID() {
 | 
											
												
													
														|  | 
 |  | +    return Math.random()
 | 
											
												
													
														|  | 
 |  | +      .toString(36)
 | 
											
												
													
														|  | 
 |  | +      .slice(-8);
 | 
											
												
													
														|  | 
 |  | +  },
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +  @discourseComputed("meetingID")
 | 
											
												
													
														|  | 
 |  | +  insertDisabled(meetingID) {
 | 
											
												
													
														|  | 
 |  | +    return isEmpty(meetingID);
 | 
											
												
													
														|  | 
 |  | +  },
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |    actions: {
 |  |    actions: {
 | 
											
												
													
														|  |      insert() {
 |  |      insert() {
 | 
											
												
													
														|  |        const btnTxt = this.buttonText ? ` label="${this.buttonText}"` : "";
 |  |        const btnTxt = this.buttonText ? ` label="${this.buttonText}"` : "";
 | 
											
												
													
														|  |        this.toolbarEvent.addText(
 |  |        this.toolbarEvent.addText(
 | 
											
												
													
														|  | -        `[wrap=discourse-bbb meetingID="${this.meetingID}"${btnTxt} attendeePW="${this.attendeePW}" moderatorPW="${this.moderatorPW}" mobileIframe="${this.mobileIframe}" desktopIframe="${this.desktopIframe}"][/wrap]`
 |  | 
 | 
											
												
													
														|  | 
 |  | +        `[wrap=discourse-bbb meetingID="${
 | 
											
												
													
														|  | 
 |  | +          this.meetingID
 | 
											
												
													
														|  | 
 |  | +        }"${btnTxt} attendeePW="${this.randomID()}" moderatorPW="${this.randomID()}" mobileIframe="${
 | 
											
												
													
														|  | 
 |  | +          this.mobileIframe
 | 
											
												
													
														|  | 
 |  | +        }" desktopIframe="${this.desktopIframe}"][/wrap]`
 | 
											
												
													
														|  |        );
 |  |        );
 | 
											
												
													
														|  |        this.send("closeModal");
 |  |        this.send("closeModal");
 | 
											
												
													
														|  |      },
 |  |      },
 |