summaryrefslogtreecommitdiffstats
path: root/src/js/app.js
diff options
context:
space:
mode:
authorHumberto Alfonso Díaz <humberto.alfonso@asvito.es>2019-12-05 12:42:48 +0100
committerLorenzo Tilve <ltilve@igalia.com>2020-02-04 19:20:13 +0100
commit9a25f5f94900b0474b6c5f2fff254a3418ca7f38 (patch)
treee4e252d0f5a7d289fed6db04fca3d32534426ab4 /src/js/app.js
parent20e04b702f96bf05ff957a8e3c4296d76a2e7656 (diff)
FUNCT Add bootstrap support
Diffstat (limited to 'src/js/app.js')
-rw-r--r--src/js/app.js28
1 files changed, 21 insertions, 7 deletions
diff --git a/src/js/app.js b/src/js/app.js
index f95852d..458a5d4 100644
--- a/src/js/app.js
+++ b/src/js/app.js
@@ -1,12 +1,26 @@
-import { init as init_bluetooth } from './bluetooth';
+import * as bluetooth from './bluetooth';
import { init as init_wifi } from './wifi';
+import { load as load_template } from './templates';
+import Mustache from 'mustache';
-import { api } from 'agl-js-api';
+var template;
+var page = {
+ bluetooth: true,
+ wifi: false
+};
-export function init() {
- api.init();
- init_bluetooth();
- init_wifi();
+export function show() {
+ page.bluetooth = bluetooth.getState();
+ document.body.innerHTML = Mustache.render(template, page);
}
-window.api = api; \ No newline at end of file
+export function init() {
+ load_template('main.template.html').then(function(result) {
+ template = result;
+ Mustache.parse(template);
+ show();
+ bluetooth.init();
+ }, function(error) {
+ console.error('ERRROR loading main template', error);
+ });
+} \ No newline at end of file