Skip to content

Commit 47bb1c4

Browse files
committed
make a nicer config api
1 parent 5da4373 commit 47bb1c4

File tree

4 files changed

+25
-2
lines changed

4 files changed

+25
-2
lines changed

.gitignore

-1
This file was deleted.

client/config-angie-zinken.json

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"serverUrl": "http://pi.thure.org:9165/?lon=18.05&lat=59.32&sites=9296",
3+
"departures":[
4+
{"stoppoint":"9296.2.1", "id":"13"},
5+
{"stoppoint":"9296.2.1", "id":"14"},
6+
{"stoppoint":"9296.2.2", "id":"13"},
7+
{"stoppoint":"9296.2.2", "id":"14"},
8+
{"stoppoint":"10656", "id":"4"},
9+
{"stoppoint":"10655", "id":"4"}
10+
11+
],
12+
"topology":{
13+
"9296.2.1": {"walk":120, "run":6, "stay":3, "unit":"second" },
14+
"9296.2.2": {"walk":120, "run":6, "stay":3, "unit":"second" },
15+
"10656": {"walk":120, "run":6, "stay":3, "unit":"second" },
16+
"10655": {"walk":120, "run":6, "stay":3, "unit":"second" }
17+
},
18+
"weather":{
19+
"steps":"12",
20+
"unit":"hour",
21+
"unitShort":"h"
22+
}
23+
}
File renamed without changes.

client/index.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<script>
2020
var data = null;
2121
var config = null;
22+
var user = window.location.search.substr(1);
2223

2324
// define constants (they update on resize)
2425
var DEPARTURES_WIDTH_GRAPH = null;
@@ -85,7 +86,7 @@
8586

8687

8788

88-
d3.json("config.json", function(error, json){
89+
d3.json("config-"+(user!=""?user:"martin-hem")+".json", function(error, json){
8990
config = json;
9091

9192
init();

0 commit comments

Comments
 (0)