Procházet zdrojové kódy

DEV: Use angle bracket syntax (#2)

Isaac Janzen před 1 rokem
rodič
revize
86b488188c

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

@@ -24,9 +24,7 @@ export default Controller.extend(ModalFunctionality, {
   },
 
   randomID() {
-    return Math.random()
-      .toString(36)
-      .slice(-8);
+    return Math.random().toString(36).slice(-8);
   },
 
   @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);
     });
 }
@@ -52,7 +52,7 @@ function attachStatus($elem, helper) {
   ajax(`/bbb/status/${data.meetingID}.json`).then((res) => {
     if (res.avatars) {
       status.html(`<span>On the call: </span>`);
-      res.avatars.forEach(function(avatar) {
+      res.avatars.forEach(function (avatar) {
         status.append(
           `<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">
-  {{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>