Browse Source

DEV: Use angle bracket syntax (#2)

Isaac Janzen 1 year ago
parent
commit
86b488188c

+ 1 - 3
assets/javascripts/discourse-bbb/controllers/insert-bbb.js.es6

@@ -24,9 +24,7 @@ export default Controller.extend(ModalFunctionality, {
   },
   },
 
 
   randomID() {
   randomID() {
-    return Math.random()
-      .toString(36)
-      .slice(-8);
+    return Math.random().toString(36).slice(-8);
   },
   },
 
 
   @discourseComputed("meetingID")
   @discourseComputed("meetingID")

+ 2 - 2
assets/javascripts/discourse/initializers/bbb.js.es6

@@ -29,7 +29,7 @@ function launchBBB($elem) {
         }
         }
       }
       }
     })
     })
-    .catch(function(error) {
+    .catch(function (error) {
       popupAjaxError(error);
       popupAjaxError(error);
     });
     });
 }
 }
@@ -52,7 +52,7 @@ function attachStatus($elem, helper) {
   ajax(`/bbb/status/${data.meetingID}.json`).then((res) => {
   ajax(`/bbb/status/${data.meetingID}.json`).then((res) => {
     if (res.avatars) {
     if (res.avatars) {
       status.html(`<span>On the call: </span>`);
       status.html(`<span>On the call: </span>`);
-      res.avatars.forEach(function(avatar) {
+      res.avatars.forEach(function (avatar) {
         status.append(
         status.append(
           `<img src="${avatar.avatar_url}" class="avatar" width="25" height="25" title="${avatar.name}" />`
           `<img src="${avatar.avatar_url}" class="avatar" width="25" height="25" title="${avatar.name}" />`
         );
         );

+ 36 - 27
assets/javascripts/discourse/templates/modal/insert-bbb.hbs

@@ -1,33 +1,42 @@
-{{#d-modal-body title="bbb.modal.title" class="insert-bbb"}}
-<div class="insert-bbb-form">
-  <div class="insert-bbb-input">
-    <label>{{i18n "bbb.meetingID"}}</label>
-    {{text-field value=meetingID}}
-  </div>
+<DModalBody @title="bbb.modal.title" @class="insert-bbb">
+  <div class="insert-bbb-form">
+    <div class="insert-bbb-input">
+      <label>{{i18n "bbb.meetingID"}}</label>
+      <TextField @value={{meetingID}} />
+    </div>
 
 
-  <div class="insert-bbb-input bbb-button-text">
-    <label>{{i18n "bbb.button_text"}}</label>
-    {{text-field value=buttonText placeholderKey="bbb.launch"}}
-  </div>
+    <div class="insert-bbb-input bbb-button-text">
+      <label>{{i18n "bbb.button_text"}}</label>
+      <TextField @value={{buttonText}} @placeholderKey="bbb.launch" />
+    </div>
 
 
-  <div class="insert-bbb-input">
-    <label class='checkbox-label'>
-      {{input type="checkbox" checked=mobileIframe}}
-      {{i18n "bbb.modal.mobile_iframe"}}
-    </label>
-  </div>
+    <div class="insert-bbb-input">
+      <label class="checkbox-label">
+        {{input type="checkbox" checked=mobileIframe}}
+        {{i18n "bbb.modal.mobile_iframe"}}
+      </label>
+    </div>
 
 
-  <div class="insert-bbb-input">
-    <label class='checkbox-label'>
-      {{input type="checkbox" checked=desktopIframe}}
-      {{i18n "bbb.modal.desktop_iframe"}}
-    </label>
-  </div>
+    <div class="insert-bbb-input">
+      <label class="checkbox-label">
+        {{input type="checkbox" checked=desktopIframe}}
+        {{i18n "bbb.modal.desktop_iframe"}}
+      </label>
+    </div>
 
 
-</div>
-{{/d-modal-body}}
+  </div>
+</DModalBody>
 
 
 <div class="modal-footer">
 <div class="modal-footer">
-  {{d-button class="btn-primary" disabled=insertDisabled label="bbb.modal.insert" action=(action "insert")}}
-  {{d-button class="btn-danger" label="bbb.modal.cancel" action=(action "cancel")}}
-</div>
+  <DButton
+    @class="btn-primary"
+    @disabled={{insertDisabled}}
+    @label="bbb.modal.insert"
+    @action={{action "insert"}}
+  />
+  <DButton
+    @class="btn-danger"
+    @label="bbb.modal.cancel"
+    @action={{action "cancel"}}
+  />
+</div>