diff --git a/app.js b/app.js new file mode 100644 index 0000000..9906995 --- /dev/null +++ b/app.js @@ -0,0 +1,21 @@ +require.config({ + urlArgs: "bust=" + (new Date()).getTime(), + baseUrl: "lib", + paths: { + "leaflet": "../bower_components/leaflet/dist/leaflet", + "leaflet.label": "../bower_components/Leaflet.label/dist/leaflet.label", + "chroma-js": "../bower_components/chroma-js/chroma.min", + "moment": "../bower_components/moment/min/moment-with-locales.min", + "tablesort": "../bower_components/tablesort/tablesort.min", + "tablesort.numeric": "../bower_components/tablesort/src/sorts/tablesort.numeric" + }, + shim: { + "leaflet.label": ["leaflet"], + "tablesort": { + exports: "Tablesort" + }, + "tablesort.numeric": ["tablesort"] + } +}) + +require(["main"]) diff --git a/index.html b/index.html index 6342a65..464ada1 100644 --- a/index.html +++ b/index.html @@ -9,15 +9,9 @@ - - - - - - - + diff --git a/lib/infobox/node.js b/lib/infobox/node.js index e03709e..c46a020 100644 --- a/lib/infobox/node.js +++ b/lib/infobox/node.js @@ -1,4 +1,4 @@ -define(function () { +define(["moment", "tablesort", "tablesort.numeric"], function (moment, Tablesort) { return function(config, el, router, d) { var h2 = document.createElement("h2") h2.textContent = d.nodeinfo.hostname diff --git a/lib/linklist.js b/lib/linklist.js index 2856a48..97fe9f4 100644 --- a/lib/linklist.js +++ b/lib/linklist.js @@ -1,4 +1,4 @@ -define(function () { +define(["tablesort", "tablesort.numeric"], function (Tablesort) { return function(linkScale, router) { var self = this var el diff --git a/lib/main.js b/lib/main.js index 4c47767..46f38fb 100644 --- a/lib/main.js +++ b/lib/main.js @@ -1,5 +1,5 @@ -require(["config", "router", "map", "sidebar", "tabs", "container", "meshstats", "linklist", "nodelist", "simplenodelist", "infobox/main"], -function (Config, Router, Map, Sidebar, Tabs, Container, Meshstats, Linklist, Nodelist, SimpleNodelist, Infobox) { +require(["config", "moment", "chroma-js", "router", "map", "sidebar", "tabs", "container", "meshstats", "linklist", "nodelist", "simplenodelist", "infobox/main"], +function (Config, moment, chroma, Router, Map, Sidebar, Tabs, Container, Meshstats, Linklist, Nodelist, SimpleNodelist, Infobox) { main(Config) function main(config) { diff --git a/lib/map.js b/lib/map.js index 2a3577d..a295000 100644 --- a/lib/map.js +++ b/lib/map.js @@ -1,4 +1,4 @@ -define(function () { +define(["leaflet", "moment", "leaflet.label"], function (L, moment) { var options = { worldCopyJump: true, zoomControl: false } diff --git a/lib/meshstats.js b/lib/meshstats.js index 8ee10f7..b8ca925 100644 --- a/lib/meshstats.js +++ b/lib/meshstats.js @@ -1,4 +1,4 @@ -define(function () { +define(["moment"], function (moment) { return function () { var self = this var p diff --git a/lib/nodelist.js b/lib/nodelist.js index 184f113..68869ab 100644 --- a/lib/nodelist.js +++ b/lib/nodelist.js @@ -1,4 +1,4 @@ -define(function () { +define(["tablesort", "tablesort.numeric"], function (Tablesort) { return function(router) { var self = this var el diff --git a/lib/simplenodelist.js b/lib/simplenodelist.js index 11f99f8..5302319 100644 --- a/lib/simplenodelist.js +++ b/lib/simplenodelist.js @@ -1,4 +1,4 @@ -define(function () { +define(["moment"], function (moment) { return function(config, field, router, title) { var self = this var el