From 3b77d1230b70a8d1d25c08c6fead5b8d4d852bcf Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Sun, 29 Mar 2015 00:38:51 +0100 Subject: [PATCH] load config using requirejs --- config.json => lib/config.js | 4 ++-- lib/main.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) rename config.json => lib/config.js (86%) diff --git a/config.json b/lib/config.js similarity index 86% rename from config.json rename to lib/config.js index 746c5ac..d43bd81 100644 --- a/config.json +++ b/lib/config.js @@ -1,4 +1,4 @@ -{ +define({ "dataPath": "https://map.luebeck.freifunk.net/data/", "showContact": true -} \ No newline at end of file +}) diff --git a/lib/main.js b/lib/main.js index 04ab10b..e3081d5 100644 --- a/lib/main.js +++ b/lib/main.js @@ -1,11 +1,11 @@ -require(["router", "map", "sidebar", "tabs", "container", "meshstats", "linklist", "nodelist", "simplenodelist", "infobox/main"], -function (Router, Map, Sidebar, Tabs, Container, Meshstats, Linklist, Nodelist, SimpleNodelist, Infobox) { +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) { /* Required for Intl shim */ if ("__addLocaleData" in Intl) getJSON("vendor/de-DE.json").then(Intl.__addLocaleData) - getJSON("config.json").then(main) + main(Config) function main(config) { var linklist, lostnodeslist, map, meshstats, newnodeslist, nodelist, router