-
Notifications
You must be signed in to change notification settings - Fork 16
/
index.html
214 lines (188 loc) · 8.55 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Meta -->
<meta charset="utf-8" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<!-- Use the .htaccess and remove these lines to avoid edge case issues.
More info: h5bp.com/i/378 -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<!-- Our site title and description -->
<title>TransforMap-Viewer</title>
<meta name="description" content="TransforMap Viewer allows you to visualize the myriads of alternatives to the dominant economic system." />
<meta name="keywords" content="openstreetmap, OSM, Free Software, Open Source, mapping, leaflet, linked data, mapping taxonomy, open data, solidarity economy, alternative economy" />
<meta name="author" content="TransforMap Community" />
<meta property="og:title" content="TransforMap-Viewer" />
<meta property="og:type" content="website" />
<meta property="og:description" content="TransforMap Viewer allows you to visualize the myriads of alternatives to the dominant economic system." />
<meta property="og:url" content="https://github.com/TransforMap/transformap-viewer" />
<!-- Mobile viewport optimized: h5bp.com/viewport -->
<meta name="viewport" content="width=device-width" />
<!-- Icons -->
<link rel="shortcut icon" href="http://transformap.co/images/favicon.png">
<!-- Shims: IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script async src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!-- Fixme: only load if fetch/promises not supported... -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script>
<script>
if(! Modernizr.promises) {
document.write('<script src="https://www.promisejs.org/polyfills/promise-7.0.4.min.js"></scr'+'ipt>');
document.write('<script src="bower_components/fetch/fetch.js"></sc'+'ript>');
}
</script>
<!-- Styles -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=PT+Sans:400,400italic,700,700italic&subset=latin,latin-ext" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:400,400italic,700,700italic&subset=latin,latin-ext" />
<link rel="stylesheet" href="bower_components/leaflet/dist/leaflet.css" />
<link rel="stylesheet" href="bower_components/PruneCluster/dist/LeafletStyleSheet.css" />
<link rel="stylesheet" href="styles/css/style.css" />
</head>
<body id="map">
<!-- Content -->
<script type='template' id='menuCategoryTemplate'>
<li class="list-group-item category <%- id %>">
<span class="toggle" onClick="clickOnCat('<%- id %>')" title='<%- description %>'><%- itemLabel %>
<form class="expert_mode off">
<input type=checkbox onClick="toggleFilterItem('<%- id %>',this)"/>
</form>
</span>
<ul class="subcategories"></ul>
<ul class="type-of-initiative"></ul>
</li>
</script>
<script type='template' id='menuTypeOfInitiativeTemplate'>
<li class="list-group-item empty <%- id %>" onClick="clickOnInitiative('<%- id %>')" title='<%- description %>'>
<%- itemLabel %>
<form class="expert_mode off">
<input type=checkbox />
</form>
</li>
</script>
<script type='template' id='popUpTemplate'>
<h1>
<%- properties.name %>
</h1>
<% if (properties['image']) { %>
<p>
<a href="<%- properties.image %>" target=_blank>
<img src="<%- checkForMWimages(properties.image) %>">
</a>
<br>
<em><%- properties['image:license'] %> <%- properties['image:credit'] %></em>
</p>
<% } %>
<p>
<%- getDescriptionText(properties) %>
</p>
<% if(properties['addr:housenumber'] || properties['addr:housename'] || properties['addr:street'] || properties['addr:postcode'] || properties['addr:city']) { %>
<h3><%- T("address") %></h3>
<p>
<span
<% if(properties['addr:housenumber_source'] == "osm") { %> class='osm' <% } %>
> <%- properties['addr:housenumber'] %> </span>
<%- (properties['addr:housename']) ? properties['addr:housename'] + "," : "" %> <%- properties['addr:street'] %><br>
<%- properties['addr:postcode'] %> <%- properties['addr:city'] %> <%- (properties['addr:country']) ? "," : "" %> <%- properties['addr:country'] %>
</p>
<% } %>
<% if ((properties['contact:email']) || (properties['contact:website']) || (properties['contact:phone']) || (properties['website'])) { %>
<h3><%- T("contact") %></h3>
<p class=contact>
<% if (properties['contact:website']) { %>
<img src="assets/globe64.png" alt="website:" /> <a href="<%- properties['contact:website'] %>" target=_blank><%- trimWebsiteUri(properties['contact:website']) %></a>
<br>
<% } %>
<% if (properties['website']) { %>
<img src="assets/globe64.png" alt="website:" /> <a href="<%- properties['website'] %>" target=_blank><%- trimWebsiteUri(properties['website']) %></a>
<br>
<% } %>
<% if (properties['contact:email']) { %>
<img src="assets/envelope64.png" alt="email:" /> <a href="mailto:<%- properties['contact:email'] %>"><%- properties['contact:email'] %></a>
<br>
<% } %>
<% if (properties['contact:phone']) { %>
<img src="assets/phone64.png" alt="phone:" /> <a href="tel:<%- properties['contact:phone'] %>"><%- properties['contact:phone'] %></a>
<% } %>
</p>
<% } %>
<% if (properties['opening_hours:url']) { %>
<h3><%- T("opening_hours") %></h3>
<p>
<a href="<%- properties['opening_hours:url'] %>" target=_blank><%- properties['opening_hours:url'] %></a>
</p>
<% } %>
<h3><%- T("type_of_initiative") %></h3>
<p>
<%
var tois_array = createToiArray(properties['type_of_initiative']);
var trans_array = tois_array.map(function(obj){
var qnr = tax_hashtable.toistr_to_qnr[obj];
return (qnr) ? tax_hashtable.toi_qindex[qnr].itemLabel.value : obj;
});
var desc_array = tois_array.map(function(obj){
var qnr = tax_hashtable.toistr_to_qnr[obj];
return (qnr) ? ( (tax_hashtable.toi_qindex[qnr].description) ? tax_hashtable.toi_qindex[qnr].description.value : "" ) : "";
});
var wikipedia_array = tois_array.map(function(obj){
var qnr = tax_hashtable.toistr_to_qnr[obj];
return (qnr) ? ( (tax_hashtable.toi_qindex[qnr].wikipedia) ? tax_hashtable.toi_qindex[qnr].wikipedia.value : "" ) : "";
});
%>
<% for (var i = 0; i < trans_array.length; i++) { %>
<span class='wp' title='<%- desc_array[i] %>' > <%- trans_array[i] %><% if(wikipedia_array[i]) { %>
(<a href='<%- wikipedia_array[i] %>' target=_blank title='View Wikipedia article for this type of initiative'><img src='assets/wikipedia-48.png' class=wp alt='View Wikipedia article for this type of initiative' /></a>)<% } %><%- (i < trans_array.length - 1 ) ? ',' : '' %>
</span> <% } %>
</p>
<h3><%- T("creation_date") %></h3>
<p>
<%- created %>
</p>
<h3><%- T("modification_date") %></h3>
<p>
<%- modified %>
</p>
<h3><%- T("linked_data") %></h3>
<table>
<% if (properties['osm']) { %>
<tr>
<td>
<a href='<%- properties['osm'] %>' target='_blank'>OpenStreetMap</a>
</td>
<td>
</td>
</tr>
<% } %>
<tr>
<td>
<a href='<%- properties['_uri'] %>' target='_blank'>TransforMap</a> (JSON)
</td>
<td>
</td>
</tr>
</table>
</script>
<div id="map-menu-container">
<div class=top>
<ul id="map-menu" class="list-group">
</ul>
</div>
<div class=bottom>
</div>
</div>
<div>
<div id='map-template'>
<div id="map-tiles"></div>
<div id="showfilters" title="show filters" onClick="switchToMenu();"></div>
</div>
</div>
<!-- Scripts -->
<script defer="defer" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.10.2/jquery.js"></script>
<script defer="defer" src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-min.js"></script>
<script defer="defer" src="bower_components/leaflet/dist/leaflet.js"></script>
<script defer="defer" src="scripts/leaflet-hash.js"></script>
<script defer="defer" src="bower_components/PruneCluster/dist/PruneCluster.min.js"></script>
<script defer="defer" src="scripts/red_fetch.js"></script>
<script defer="defer" src="scripts/map.js"></script>
</body>
</html>