From 70d6aba9a9fd73bb21a17ad5b50e942d4d21090f Mon Sep 17 00:00:00 2001 From: Matthias Harrer Date: Sat, 12 Jan 2019 16:20:52 +0100 Subject: [PATCH] Integrate /zone map into OnsenUI - replace hammerjs by own implementation - removes zone/goto coordinates to eliminate dependency on html - allows to define multiple zones - allows to modify the zones --- client/index.html | 431 +++++--------- client/js/geometry-polyfill.js | 715 +++++++++++++++++++++++ client/zone/hammer.min.js | 7 - client/zone/index.html | 48 +- client/zone/js-modules/locations.js | 4 +- client/zone/js-modules/map-drawer.js | 4 +- client/zone/js-modules/path-drawer.js | 2 +- client/zone/js-modules/touch-handling.js | 232 ++++++++ client/zone/js-modules/vacuum-map.js | 260 ++++----- client/zone/main.js | 54 +- 10 files changed, 1279 insertions(+), 478 deletions(-) create mode 100644 client/js/geometry-polyfill.js delete mode 100644 client/zone/hammer.min.js create mode 100644 client/zone/js-modules/touch-handling.js diff --git a/client/index.html b/client/index.html index 45e9297476f..dae7afd948d 100644 --- a/client/index.html +++ b/client/index.html @@ -5,6 +5,7 @@ + @@ -456,7 +457,7 @@ function handleGoToButton() { window.clearTimeout(currentRefreshTimer); var options = [] - + for(var i=0; i < config.spots.length; i++){ options.push(config.spots[i][0]); } @@ -478,7 +479,7 @@ }), "PUT", function (err) { if (err) { ons.notification.toast(err, { buttonLabel: 'Dismiss', timeout: 1500 }) - } + } window.setTimeout(function () { updateHomePage(); }, 3000); @@ -494,7 +495,7 @@ function handleAreaButton() { window.clearTimeout(currentRefreshTimer); var options = [] - + for(var i=0; i < config.areas.length; i++){ options.push(config.areas[i][0]); } @@ -515,7 +516,7 @@ ), "PUT", function (err) { if (err) { ons.notification.toast(err, { buttonLabel: 'Dismiss', timeout: 1500 }) - } + } window.setTimeout(function () { updateHomePage(); }, 3000); @@ -603,7 +604,7 @@ goToButton.removeAttribute("disabled"); if(config.areas) if(config.areas.length > 0) - areaButton.removeAttribute("disabled"); + areaButton.removeAttribute("disabled"); }); updateHomePage(); }; @@ -689,7 +690,7 @@ fn.requestWithPayload("api/start_cleaning_zone", JSON.stringify(zones), "PUT", function (err) { if (err) { ons.notification.toast(err, { buttonLabel: 'Dismiss', timeout: 1500 }) - } + } loadingBarZones.removeAttribute("indeterminate"); }); } @@ -723,7 +724,7 @@ zonesList.innerHTML = out; } } - + }); }; @@ -732,7 +733,7 @@ - + - + - +