Ver Fonte

More documenation

Andrew Chalkley há 9 anos atrás
pai
commit
3cd0d30ffd
3 ficheiros alterados com 18 adições e 8 exclusões
  1. 3 1
      front-end/index.html
  2. 2 3
      front-end/js/app.js
  3. 13 4
      front-end/js/port_select.js

+ 3 - 1
front-end/index.html

@@ -25,8 +25,10 @@
             
             
             </select>
             </select>
         </div>
         </div>
-    </div>
+        <div id="progress_bars" class="padded-more">
 
 
+        </div>
+    </div>
     <footer class="toolbar toolbar-footer">
     <footer class="toolbar toolbar-footer">
         <div class="toolbar-actions">
         <div class="toolbar-actions">
            <span id="status">
            <span id="status">

+ 2 - 3
front-end/js/app.js

@@ -66,7 +66,7 @@ function processJSON(response) {
  * Handle UI
  * Handle UI
 ************************/
 ************************/
 
 
-flashButton.addEventListener("click", event => {
+flashButton.addEventListener("click", (event) => {
     disableInputs();
     disableInputs();
     fetch(manifestsSelect.value)
     fetch(manifestsSelect.value)
         .then(processJSON)
         .then(processJSON)
@@ -87,7 +87,7 @@ serialScanner.on("deviceAdded", (port) => {
     new Notification(`Added: ${port}!`);
     new Notification(`Added: ${port}!`);
 });
 });
 
 
-serialScanner.on("deviceRemoved", (port ) => {
+serialScanner.on("deviceRemoved", (port) => {
     portsSelect.remove(port);
     portsSelect.remove(port);
     new Notification(`Removed: ${port}!`);
     new Notification(`Removed: ${port}!`);
 });
 });
@@ -172,7 +172,6 @@ function flashWithManifest(manifest) {
 
 
             return promise.then(() => esp.close())
             return promise.then(() => esp.close())
                 .then((result) => {
                 .then((result) => {
-                    appStatus.textContent = `Flashing finished!`;
                     new Notification("Flash Finished!");
                     new Notification("Flash Finished!");
                     readyToFlash();
                     readyToFlash();
                     log.info("Flashed to latest Espruino build!", result);
                     log.info("Flashed to latest Espruino build!", result);

+ 13 - 4
front-end/js/port_select.js

@@ -1,6 +1,10 @@
 "use strict";
 "use strict";
 
 
-module.exports = class PortSelect {
+class PortSelect {
+    /**
+     * PortSelect constructor. Requires an HTML select element.
+     * @param selectElement an HTMLSelectElement.
+     */
     constructor(selectElement) {
     constructor(selectElement) {
         this.selectElement = selectElement;
         this.selectElement = selectElement;
         this.map = {}; // Cache matching the text value of a port to OPTION element.
         this.map = {}; // Cache matching the text value of a port to OPTION element.
@@ -37,7 +41,6 @@ module.exports = class PortSelect {
         });
         });
     }
     }
 
 
-
     /**
     /**
      * Creates option with the port text and value.
      * Creates option with the port text and value.
      * @param port
      * @param port
@@ -58,8 +61,14 @@ module.exports = class PortSelect {
     set disabled (value) {
     set disabled (value) {
         this.selectElement.disabled = value;
         this.selectElement.disabled = value;
     }
     }
-    
+
+    /**
+     * Pass through
+     * @returns the selectElememnt's value.
+     */
     get value() {
     get value() {
         return this.selectElement.value;
         return this.selectElement.value;
     }
     }
-};
+};
+
+module.exports = PortSelect;