mirror of
https://github.com/ConnectedHumber/Air-Quality-Web
synced 2024-11-22 06:23:01 +00:00
Make remaining whitespace changes
This commit is contained in:
parent
77a776caeb
commit
f3a7d8f766
3 changed files with 40 additions and 40 deletions
|
@ -7,7 +7,7 @@ class Tour {
|
||||||
constructor(in_map_manager) {
|
constructor(in_map_manager) {
|
||||||
this.map_manager = in_map_manager;
|
this.map_manager = in_map_manager;
|
||||||
}
|
}
|
||||||
|
|
||||||
create_tour() {
|
create_tour() {
|
||||||
this.tour = new Sheperd.Tour({
|
this.tour = new Sheperd.Tour({
|
||||||
useModalOverlay: true,
|
useModalOverlay: true,
|
||||||
|
@ -15,12 +15,12 @@ class Tour {
|
||||||
// Default settings for steps go here
|
// Default settings for steps go here
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.tour.addStep("welcome", {
|
this.tour.addStep("welcome", {
|
||||||
text: "Welcome to the air quality web interface! Press next to get a short tour.",
|
text: "Welcome to the air quality web interface! Press next to get a short tour.",
|
||||||
buttons: this.get_buttons(true, false)
|
buttons: this.get_buttons(true, false)
|
||||||
});
|
});
|
||||||
|
|
||||||
this.tour.addStep("map", {
|
this.tour.addStep("map", {
|
||||||
text: "Each device has a blue marker. The shape a marker is located in changes colour depending on the value of the measure it reported.",
|
text: "Each device has a blue marker. The shape a marker is located in changes colour depending on the value of the measure it reported.",
|
||||||
attachTo: {
|
attachTo: {
|
||||||
|
@ -37,7 +37,7 @@ class Tour {
|
||||||
},
|
},
|
||||||
buttons: this.get_buttons()
|
buttons: this.get_buttons()
|
||||||
});
|
});
|
||||||
|
|
||||||
this.tour.addStep("reading-type", {
|
this.tour.addStep("reading-type", {
|
||||||
text: "Devices report multiple types of measurement. <strong>Change to another reading type now.</strong>",
|
text: "Devices report multiple types of measurement. <strong>Change to another reading type now.</strong>",
|
||||||
attachTo: {
|
attachTo: {
|
||||||
|
@ -60,7 +60,7 @@ class Tour {
|
||||||
},
|
},
|
||||||
buttons: this.get_buttons()
|
buttons: this.get_buttons()
|
||||||
});
|
});
|
||||||
|
|
||||||
this.tour.addStep("map-controls", {
|
this.tour.addStep("map-controls", {
|
||||||
text: "You can control the zoom level and go fullscreen here. You can also zoom with your mouse wheel if you have one, and pan by clicking and dragging.",
|
text: "You can control the zoom level and go fullscreen here. You can also zoom with your mouse wheel if you have one, and pan by clicking and dragging.",
|
||||||
attachTo: {
|
attachTo: {
|
||||||
|
@ -69,7 +69,7 @@ class Tour {
|
||||||
},
|
},
|
||||||
buttons: this.get_buttons()
|
buttons: this.get_buttons()
|
||||||
});
|
});
|
||||||
|
|
||||||
this.tour.addStep("device-graph", {
|
this.tour.addStep("device-graph", {
|
||||||
text: "By clicking a blue marker, you can view additional information about that device. Not all device are actively reporting data. <strong>Try clicking one now.</strong>",
|
text: "By clicking a blue marker, you can view additional information about that device. Not all device are actively reporting data. <strong>Try clicking one now.</strong>",
|
||||||
attachTo: {
|
attachTo: {
|
||||||
|
@ -77,11 +77,11 @@ class Tour {
|
||||||
on: "top"
|
on: "top"
|
||||||
},
|
},
|
||||||
buttons: this.get_buttons(false)
|
buttons: this.get_buttons(false)
|
||||||
|
|
||||||
}).on("show", (() => {
|
}).on("show", (() => {
|
||||||
this.map_manager.device_markers.once("marker-popup-opened", this.tour.next.bind(this.tour));
|
this.map_manager.device_markers.once("marker-popup-opened", this.tour.next.bind(this.tour));
|
||||||
}).bind(this));
|
}).bind(this));
|
||||||
|
|
||||||
this.tour.addStep("device-graph-a", {
|
this.tour.addStep("device-graph-a", {
|
||||||
text: "This is a device information popup. By default it displays recent data that the device has reported on the line graph, but you can control this with the blue buttons.",
|
text: "This is a device information popup. By default it displays recent data that the device has reported on the line graph, but you can control this with the blue buttons.",
|
||||||
attachTo: {
|
attachTo: {
|
||||||
|
@ -99,8 +99,8 @@ class Tour {
|
||||||
advanceOn: { selector: ".tabs :first-child a", event: "click" },
|
advanceOn: { selector: ".tabs :first-child a", event: "click" },
|
||||||
buttons: this.get_buttons(false)
|
buttons: this.get_buttons(false)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
this.tour.addStep("report-bug", {
|
this.tour.addStep("report-bug", {
|
||||||
text: "If you find a bug, you can report it by clicking this button.",
|
text: "If you find a bug, you can report it by clicking this button.",
|
||||||
attachTo: {
|
attachTo: {
|
||||||
|
@ -117,32 +117,32 @@ class Tour {
|
||||||
},
|
},
|
||||||
buttons: this.get_buttons()
|
buttons: this.get_buttons()
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
this.tour.addStep("complete", {
|
this.tour.addStep("complete", {
|
||||||
text: "Tour complete!\nIf you need any additional assistance, let us know :-)",
|
text: "Tour complete!\nIf you need any additional assistance, let us know :-)",
|
||||||
buttons: this.get_buttons(false, true, true)
|
buttons: this.get_buttons(false, true, true)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
run_once() {
|
run_once() {
|
||||||
if(window.localStorage.getItem("completed_tour") === null)
|
if(window.localStorage.getItem("completed_tour") === null)
|
||||||
this.run();
|
this.run();
|
||||||
|
|
||||||
//window.localStorage.setItem("completed_tour", (new Date()).toISOString()); -- removed due to an accidental refresh possiblity
|
//window.localStorage.setItem("completed_tour", (new Date()).toISOString()); -- removed due to an accidental refresh possiblity
|
||||||
}
|
}
|
||||||
|
|
||||||
run() {
|
run() {
|
||||||
if(typeof this.tour == "undefined")
|
if(typeof this.tour == "undefined")
|
||||||
this.create_tour();
|
this.create_tour();
|
||||||
this.tour.start();
|
this.tour.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
completed_tour()
|
completed_tour()
|
||||||
{
|
{
|
||||||
window.localStorage.setItem("completed_tour", (new Date()).toISOString());
|
window.localStorage.setItem("completed_tour", (new Date()).toISOString());
|
||||||
}
|
}
|
||||||
|
|
||||||
get_buttons(isContinue = true, isPrev = true, isEnd = false) {
|
get_buttons(isContinue = true, isPrev = true, isEnd = false) {
|
||||||
let next = { text: "Next", action: this.tour.next },
|
let next = { text: "Next", action: this.tour.next },
|
||||||
prev = { text: "Previous", action: this.tour.back },
|
prev = { text: "Previous", action: this.tour.back },
|
||||||
|
|
|
@ -23,13 +23,13 @@ async function show_changelog(only_if_changed) {
|
||||||
console.log("[UI] Not showing changelog.");
|
console.log("[UI] Not showing changelog.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("[UI] Showing changelog");
|
console.log("[UI] Showing changelog");
|
||||||
await show_nanomodal(await GetFromUrl(`${Config.api_root}?action=changelog`), {
|
await show_nanomodal(await GetFromUrl(`${Config.api_root}?action=changelog`), {
|
||||||
classes: "reverse",
|
classes: "reverse",
|
||||||
autoRemove: true
|
autoRemove: true
|
||||||
});
|
});
|
||||||
|
|
||||||
localStorage.setItem("last_seen_version", current_version);
|
localStorage.setItem("last_seen_version", current_version);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -38,20 +38,20 @@ class UI {
|
||||||
constructor(in_config, in_map_manager) {
|
constructor(in_config, in_map_manager) {
|
||||||
this.config = in_config;
|
this.config = in_config;
|
||||||
this.map_manager = in_map_manager;
|
this.map_manager = in_map_manager;
|
||||||
|
|
||||||
this.ui_panel = new SmartSettings("Settings");
|
this.ui_panel = new SmartSettings("Settings");
|
||||||
// this.ui_panel.watch((event) => console.log(event));
|
// this.ui_panel.watch((event) => console.log(event));
|
||||||
|
|
||||||
this.tour = new Tour(this.map_manager);
|
this.tour = new Tour(this.map_manager);
|
||||||
}
|
}
|
||||||
|
|
||||||
async setup() {
|
async setup() {
|
||||||
await show_changelog(true);
|
await show_changelog(true);
|
||||||
|
|
||||||
this.reading_types = JSON.parse(
|
this.reading_types = JSON.parse(
|
||||||
await GetFromUrl(`${this.config.api_root}?action=list-reading-types`)
|
await GetFromUrl(`${this.config.api_root}?action=list-reading-types`)
|
||||||
);
|
);
|
||||||
|
|
||||||
this.ui_panel.loadConfig([
|
this.ui_panel.loadConfig([
|
||||||
{
|
{
|
||||||
type: "select",
|
type: "select",
|
||||||
|
@ -59,8 +59,8 @@ class UI {
|
||||||
items: this.reading_types.map((type) => type.friendly_text),
|
items: this.reading_types.map((type) => type.friendly_text),
|
||||||
callback: (async (event) => {
|
callback: (async (event) => {
|
||||||
let new_type = this.reading_types.find((type) => type.friendly_text == event.target.value).short_descr;
|
let new_type = this.reading_types.find((type) => type.friendly_text == event.target.value).short_descr;
|
||||||
|
|
||||||
|
|
||||||
document.querySelector("main").classList.add("working-visual");
|
document.querySelector("main").classList.add("working-visual");
|
||||||
await this.map_manager.overlay.update_reading_type(new_type);
|
await this.map_manager.overlay.update_reading_type(new_type);
|
||||||
document.querySelector("main").classList.remove("working-visual");
|
document.querySelector("main").classList.remove("working-visual");
|
||||||
|
@ -82,7 +82,7 @@ class UI {
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
this.ui_panel.setIndex("Reading Type", this.reading_types.findIndex((type) => type.short_descr == "PM25"));
|
this.ui_panel.setIndex("Reading Type", this.reading_types.findIndex((type) => type.short_descr == "PM25"));
|
||||||
|
|
||||||
await this.tour.run_once();
|
await this.tour.run_once();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
26
package-lock.json
generated
26
package-lock.json
generated
|
@ -394,7 +394,7 @@
|
||||||
"chart.js": {
|
"chart.js": {
|
||||||
"version": "2.8.0",
|
"version": "2.8.0",
|
||||||
"resolved": "https://registry.npmjs.org/chart.js/-/chart.js-2.8.0.tgz",
|
"resolved": "https://registry.npmjs.org/chart.js/-/chart.js-2.8.0.tgz",
|
||||||
"integrity": "sha1-twOxDQ9OxQeerv3NbKMtyPgm4Ok=",
|
"integrity": "sha512-Di3wUL4BFvqI5FB5K26aQ+hvWh8wnP9A3DWGvXHVkO13D3DSnaSsdZx29cXlEsYKVkn1E2az+ZYFS4t0zi8x0w==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"chartjs-color": "^2.1.0",
|
"chartjs-color": "^2.1.0",
|
||||||
"moment": "^2.10.2"
|
"moment": "^2.10.2"
|
||||||
|
@ -403,7 +403,7 @@
|
||||||
"chartjs-color": {
|
"chartjs-color": {
|
||||||
"version": "2.3.0",
|
"version": "2.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/chartjs-color/-/chartjs-color-2.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/chartjs-color/-/chartjs-color-2.3.0.tgz",
|
||||||
"integrity": "sha1-Dn4ejbo36uhBX9PbOL9XIAfdlY8=",
|
"integrity": "sha512-hEvVheqczsoHD+fZ+tfPUE+1+RbV6b+eksp2LwAhwRTVXEjCSEavvk+Hg3H6SZfGlPh/UfmWKGIvZbtobOEm3g==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"chartjs-color-string": "^0.6.0",
|
"chartjs-color-string": "^0.6.0",
|
||||||
"color-convert": "^0.5.3"
|
"color-convert": "^0.5.3"
|
||||||
|
@ -419,7 +419,7 @@
|
||||||
"chartjs-color-string": {
|
"chartjs-color-string": {
|
||||||
"version": "0.6.0",
|
"version": "0.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/chartjs-color-string/-/chartjs-color-string-0.6.0.tgz",
|
"resolved": "https://registry.npmjs.org/chartjs-color-string/-/chartjs-color-string-0.6.0.tgz",
|
||||||
"integrity": "sha1-HfCWYhwOcHIKZPQTXqFx0FFAL3E=",
|
"integrity": "sha512-TIB5OKn1hPJvO7JcteW4WY/63v6KwEdt6udfnDE9iCAZgy+V4SrbSxoIbTw/xkUIapjEI4ExGtD0+6D3KyFd7A==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"color-name": "^1.0.0"
|
"color-name": "^1.0.0"
|
||||||
}
|
}
|
||||||
|
@ -427,7 +427,7 @@
|
||||||
"chroma-js": {
|
"chroma-js": {
|
||||||
"version": "2.0.4",
|
"version": "2.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/chroma-js/-/chroma-js-2.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/chroma-js/-/chroma-js-2.0.4.tgz",
|
||||||
"integrity": "sha1-Ua2lknSFZBFjDUXqUz1xcBhVTOo="
|
"integrity": "sha512-gk71qOrSdBTLbsd0DIUO3QjZL8tTvMwpG1EoXYScy7rI4rcO4EyYH6zGuvCgUDumKumqg0pt6Ua+vWnMJsTYhw=="
|
||||||
},
|
},
|
||||||
"class-utils": {
|
"class-utils": {
|
||||||
"version": "0.3.6",
|
"version": "0.3.6",
|
||||||
|
@ -1059,7 +1059,7 @@
|
||||||
"element-matches": {
|
"element-matches": {
|
||||||
"version": "0.1.2",
|
"version": "0.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/element-matches/-/element-matches-0.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/element-matches/-/element-matches-0.1.2.tgz",
|
||||||
"integrity": "sha1-c0XLcellvSsS9yXlJFkcECGYNho="
|
"integrity": "sha512-yWh1otcs3OKUWDvu/IxyI36ZI3WNaRZlI0uG/DK6fu0pap0VYZ0J5pEGTk1zakme+hT0OKHwhlHc0N5TJhY6yQ=="
|
||||||
},
|
},
|
||||||
"emojis-list": {
|
"emojis-list": {
|
||||||
"version": "2.1.0",
|
"version": "2.1.0",
|
||||||
|
@ -1682,7 +1682,7 @@
|
||||||
"iso8601-js-period": {
|
"iso8601-js-period": {
|
||||||
"version": "0.2.1",
|
"version": "0.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/iso8601-js-period/-/iso8601-js-period-0.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/iso8601-js-period/-/iso8601-js-period-0.2.1.tgz",
|
||||||
"integrity": "sha1-8X6h5FrhR4GwLx1wi1q0V/1xdKA="
|
"integrity": "sha512-iDyz2TQFBd5WhCZjruOwHj01JkQGu7YbVLCVdpA7lCGEcBzE3ffCPAhLh/M8TAp//kCixPpYN4XU54WHCxvD2Q=="
|
||||||
},
|
},
|
||||||
"isobject": {
|
"isobject": {
|
||||||
"version": "3.0.1",
|
"version": "3.0.1",
|
||||||
|
@ -1757,7 +1757,7 @@
|
||||||
"leaflet": {
|
"leaflet": {
|
||||||
"version": "1.5.1",
|
"version": "1.5.1",
|
||||||
"resolved": "https://registry.npmjs.org/leaflet/-/leaflet-1.5.1.tgz",
|
"resolved": "https://registry.npmjs.org/leaflet/-/leaflet-1.5.1.tgz",
|
||||||
"integrity": "sha1-mvudlj1myHAGaxNC56BvkoQPRr8="
|
"integrity": "sha512-ekM9KAeG99tYisNBg0IzEywAlp0hYI5XRipsqRXyRTeuU8jcuntilpp+eFf5gaE0xubc9RuSNIVtByEKwqFV0w=="
|
||||||
},
|
},
|
||||||
"leaflet-fullscreen": {
|
"leaflet-fullscreen": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
|
@ -1767,7 +1767,7 @@
|
||||||
"leaflet.markercluster": {
|
"leaflet.markercluster": {
|
||||||
"version": "1.4.1",
|
"version": "1.4.1",
|
||||||
"resolved": "https://registry.npmjs.org/leaflet.markercluster/-/leaflet.markercluster-1.4.1.tgz",
|
"resolved": "https://registry.npmjs.org/leaflet.markercluster/-/leaflet.markercluster-1.4.1.tgz",
|
||||||
"integrity": "sha1-tT8sTyynMG3asdu28YYdXoqmxeU="
|
"integrity": "sha512-ZSEpE/EFApR0bJ1w/dUGwTSUvWlpalKqIzkaYdYB7jaftQA/Y2Jav+eT4CMtEYFj+ZK4mswP13Q2acnPBnhGOw=="
|
||||||
},
|
},
|
||||||
"loader-utils": {
|
"loader-utils": {
|
||||||
"version": "0.2.17",
|
"version": "0.2.17",
|
||||||
|
@ -1938,7 +1938,7 @@
|
||||||
"moment": {
|
"moment": {
|
||||||
"version": "2.24.0",
|
"version": "2.24.0",
|
||||||
"resolved": "https://registry.npmjs.org/moment/-/moment-2.24.0.tgz",
|
"resolved": "https://registry.npmjs.org/moment/-/moment-2.24.0.tgz",
|
||||||
"integrity": "sha1-DQVdU/UFKqZTyfbraLtdEr9cK1s="
|
"integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg=="
|
||||||
},
|
},
|
||||||
"ms": {
|
"ms": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
|
@ -2162,7 +2162,7 @@
|
||||||
"popper.js": {
|
"popper.js": {
|
||||||
"version": "1.15.0",
|
"version": "1.15.0",
|
||||||
"resolved": "https://registry.npmjs.org/popper.js/-/popper.js-1.15.0.tgz",
|
"resolved": "https://registry.npmjs.org/popper.js/-/popper.js-1.15.0.tgz",
|
||||||
"integrity": "sha1-VWC5m7rXZH6fqkdca4BWYh9aT/I="
|
"integrity": "sha512-w010cY1oCUmI+9KwwlWki+r5jxKfTFDVoadl7MSrIujHU5MJ5OR6HTDj6Xo8aoR/QsA56x8jKjA59qGH4ELtrA=="
|
||||||
},
|
},
|
||||||
"posix-character-classes": {
|
"posix-character-classes": {
|
||||||
"version": "0.1.1",
|
"version": "0.1.1",
|
||||||
|
@ -4012,12 +4012,12 @@
|
||||||
"smartsettings": {
|
"smartsettings": {
|
||||||
"version": "1.2.3",
|
"version": "1.2.3",
|
||||||
"resolved": "https://registry.npmjs.org/smartsettings/-/smartsettings-1.2.3.tgz",
|
"resolved": "https://registry.npmjs.org/smartsettings/-/smartsettings-1.2.3.tgz",
|
||||||
"integrity": "sha1-IUi7BZY6ohd7Sk8b8FiHyut/hTs="
|
"integrity": "sha512-IPylE5IllnSAwKoA2To1otDrs40fdaQOnxCDXwjUCwnIHPr27Z+pjGpkbQqwhObb0poDnzldpbwa+5TYK107/g=="
|
||||||
},
|
},
|
||||||
"smoothscroll-polyfill": {
|
"smoothscroll-polyfill": {
|
||||||
"version": "0.4.4",
|
"version": "0.4.4",
|
||||||
"resolved": "https://registry.npmjs.org/smoothscroll-polyfill/-/smoothscroll-polyfill-0.4.4.tgz",
|
"resolved": "https://registry.npmjs.org/smoothscroll-polyfill/-/smoothscroll-polyfill-0.4.4.tgz",
|
||||||
"integrity": "sha1-OiWRMdxpMObKgAA+HLA7YDtpq/g="
|
"integrity": "sha512-TK5ZA9U5RqCwMpfoMq/l1mrH0JAR7y7KRvOBx0n2869aLxch+gT9GhN3yUfjiw+d/DiF1mKo14+hd62JyMmoBg=="
|
||||||
},
|
},
|
||||||
"snapdragon": {
|
"snapdragon": {
|
||||||
"version": "0.8.2",
|
"version": "0.8.2",
|
||||||
|
@ -4346,7 +4346,7 @@
|
||||||
"tippy.js": {
|
"tippy.js": {
|
||||||
"version": "4.3.4",
|
"version": "4.3.4",
|
||||||
"resolved": "https://registry.npmjs.org/tippy.js/-/tippy.js-4.3.4.tgz",
|
"resolved": "https://registry.npmjs.org/tippy.js/-/tippy.js-4.3.4.tgz",
|
||||||
"integrity": "sha1-mpH9XOjEAfGBt62qaywn89EF87o=",
|
"integrity": "sha512-O2ukxHOJTLVYZ/TfHjNd8WgAWoefX9uk5QiWRdHfX2PR2lBpUU4BJQLl7U2Ykc8K7o16gTeHEElpuRfgD5b0aA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"popper.js": "^1.14.7"
|
"popper.js": "^1.14.7"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue