-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathplaces-demo-graphql.htm
More file actions
190 lines (176 loc) · 7.7 KB
/
places-demo-graphql.htm
File metadata and controls
190 lines (176 loc) · 7.7 KB
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
<!doctype html>
<html
lang="en"
data-show-errors
data-i18n-default="en"
data-i18n-locales="en,ja,es,pt-BR,ar,fr,zh-CN"
data-i18n-file="countries"
data-graphql-url="https://www.dataformsjs.com/graphql">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title data-i18n="Countries Demo | GraphQL"></title>
<link rel="stylesheet" href="css/countries.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/semantic-ui-flag@2.4.0/flag.min.css">
<link rel="canonical" href="https://www.dataformsjs.com/examples/places-demo-hbs.htm">
</head>
<body>
<div id="view" dir="auto"></div>
<script type="text/x-template" data-engine="handlebars" id="loading-screen">
<h3>{{i18n 'Loading...'}}</h3>
</script>
<script type="text/x-template" data-engine="handlebars" id="error-screen">
<h3 class="error">{{i18n 'Error'}} - {{errorMessage}}</h3>
</script>
<template id="loading-spinner-screen">
<div class="loading">
<div class="lds-roller"><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div></div>
</div>
</template>
<!--
GraphQL Queries can be both included on the page or downloaded.
In this example scripts that use [data-graphql-id] point to the embedded
queries while scripts that use [data-graphql-src] download the queries.
-->
<script type="application/graphql" id="graphql-countries">
{
countries {
iso
country
area_km
population
continent
}
}
</script>
<script type="application/graphql" id="graphql-regions">
query ($country: String!) {
regions(country: $country) {
geonames_id
country_code
admin1_code
name
ascii_name
population
elevation
timezone
modification_date
}
}
</script>
<script
type="text/x-template"
data-engine="handlebars"
data-default-route
data-route="/:lang/"
data-page="jsonData"
data-load-only-once
data-graphql-id="graphql-countries"
src="html/countries-hbs.htm">
</script>
<script
type="text/x-template"
data-engine="handlebars"
data-route="/:lang/regions/:country"
data-page="jsonData"
data-load-only-once
data-graphql-id="graphql-regions"
src="html/regions-hbs.htm">
</script>
<script
type="text/x-template"
data-engine="handlebars"
data-route="/:lang/cities/:country/:region"
data-page="jsonData"
data-load-only-once
data-graphql-src="graphql/cities.graphql"
src="html/cities-hbs.htm">
</script>
<script
type="text/x-template"
data-engine="handlebars"
data-route="/:lang/city/:id"
data-page="jsonData"
data-load-only-once
data-graphql-src="graphql/place.graphql"
data-lazy-load="leafletCss, leafletJs, leafletPlugin"
src="html/place-hbs.htm">
</script>
<script
type="text/x-template"
data-engine="handlebars"
data-route="/:lang/search"
data-page="jsonData"
data-graphql-src="graphql/country-names.graphql"
data-load-only-once
data-lazy-load="json_data, keydownAction, chosen, chosenPlugin"
src="html/search-places-graphql.htm">
</script>
<script
type="text/x-template"
data-engine="handlebars"
id="places-search-results-hbs"
src="html/search-places-results-hbs.htm">
</script>
<script
type="text/x-template"
data-engine="handlebars"
data-route="/:lang/info"
data-src="html/places-info-hbs.htm">
</script>
<!--
See detailed comments in the file [places-demo-hbs.htm] for info on how this
HTML control works. On the other page it uses the same [id]: "download-links"
-->
<script type="text/x-template" data-engine="handlebars" id="download-links">
<span class="download">{{i18n 'Download'}}</span>
<img class="download"
src="img/Excel.svg"
height="16"
width="16"
alt="{{i18n 'Download to Excel'}}"
title="{{i18n 'Download to Excel'}}"
data-export-excel-selector="table"
data-export-file-name="{{i18n fileName}}.xlsx">
<img class="download"
src="img/CSV.svg"
height="16"
width="16"
alt="{{i18n 'Download to CSV'}}"
title="{{i18n 'Download to CSV'}}"
data-export-csv-selector="table"
data-export-file-name="{{i18n fileName}}.csv">
</script>
<script src="https://cdn.jsdelivr.net/npm/dataformsjs@5/js/DataFormsJS.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/dataformsjs@5/js/pages/jsonData.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/dataformsjs@5/js/extensions/handlebars-helpers.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/dataformsjs@5/js/plugins/filter.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/dataformsjs@5/js/plugins/sort.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/dataformsjs@5/js/plugins/i18n.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/handlebars@4.7.6/dist/handlebars.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/dataformsjs@5/js/plugins/clickToHighlight.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/dataformsjs@5/js/plugins/exportToCsv.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/dataformsjs@5/js/plugins/exportToExcel.min.js"></script>
<script>
// See comments in [places-demo-hbs.htm], this is related to the attribute [data-lazy-load]
app.lazyLoad = {
chosen: [
'https://code.jquery.com/jquery-3.4.1.min.js',
'https://cdn.jsdelivr.net/npm/chosen-js@1.8.7/chosen.css',
'https://cdn.jsdelivr.net/npm/chosen-js@1.8.7/chosen.jquery.min.js',
'css/countries-chosen.css',
],
chosenPlugin: [
'https://cdn.jsdelivr.net/npm/dataformsjs@5/js/plugins/dataBind.min.js',
'https://cdn.jsdelivr.net/npm/dataformsjs@5/js/plugins/chosen.min.js',
],
keydownAction: 'https://cdn.jsdelivr.net/npm/dataformsjs@5/js/plugins/keydownAction.min.js',
json_data: 'https://cdn.jsdelivr.net/npm/dataformsjs@5/js/controls/json-data.min.js',
leafletCss: 'https://cdn.jsdelivr.net/npm/leaflet@1.5.1/dist/leaflet.css',
leafletJs: 'https://cdn.jsdelivr.net/npm/leaflet@1.5.1/dist/leaflet.js',
leafletPlugin: 'https://cdn.jsdelivr.net/npm/dataformsjs@5/js/plugins/leaflet.min.js',
};
app.settings.lazyTemplateSelector = '#loading-spinner-screen';
</script>
</body>
</html>