aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/index.js3
-rw-r--r--src/js/agl_stubs_lowcan.js5
-rw-r--r--src/js/app.js2
-rw-r--r--src/js/templates.js4
4 files changed, 8 insertions, 6 deletions
diff --git a/src/index.js b/src/index.js
index 9c4ff26..47ffd3d 100644
--- a/src/index.js
+++ b/src/index.js
@@ -16,12 +16,9 @@
/* JS */
import * as app from './js/app';
-import { api } from 'agl-js-api';
-
/* CSS */
import './styles/app.scss';
window.app = app;
-api.init();
app.init();
diff --git a/src/js/agl_stubs_lowcan.js b/src/js/agl_stubs_lowcan.js
new file mode 100644
index 0000000..172fc00
--- /dev/null
+++ b/src/js/agl_stubs_lowcan.js
@@ -0,0 +1,5 @@
+export function list() {
+ return new Promise((resolve, reject) => {
+ resolve([]);
+ });
+}
diff --git a/src/js/app.js b/src/js/app.js
index e9ba104..29d8abb 100644
--- a/src/js/app.js
+++ b/src/js/app.js
@@ -1,7 +1,7 @@
import { load as load_template } from './templates';
import Mustache from 'mustache';
-import { lowcan } from 'agl-js-api';
+import * as lowcan from './agl_stubs_lowcan';
var template;
var page = {
diff --git a/src/js/templates.js b/src/js/templates.js
index 2513722..4b71638 100644
--- a/src/js/templates.js
+++ b/src/js/templates.js
@@ -2,12 +2,12 @@ export function load(template) {
return new Promise(function(resolve, reject){
var xhr = new XMLHttpRequest();
- xhr.open('GET', '/templates/'+template);
+ xhr.open('GET', './templates/'+template);
xhr.send();
xhr.onload = function() {
- if (xhr.status != 200) {
+ if (xhr.status != 200 && xhr.status != 0) {
console.error('Error loading template', xhr.status, xhr.statusText);
reject(xhr.status);
} else {