From c68aa1eacf66ca594052b41d03d00f395961bde6 Mon Sep 17 00:00:00 2001 From: Skylar Ittner Date: Sat, 30 Apr 2022 22:27:04 -0600 Subject: [PATCH] Add notary info page and service area map --- www/assets/js/dropandsend.js | 2 +- www/assets/js/main.js | 3 + www/assets/js/map.js | 10 +- www/assets/js/platform.js | 6 +- www/assets/js/serviceareamap.js | 185 ++++++++++++++++++++++++++++++++ www/index.html | 1 + www/pages/notary.html | 55 ++++++++++ www/pages/servicearea.html | 32 ++++++ www/routes.js | 27 ++++- 9 files changed, 315 insertions(+), 6 deletions(-) create mode 100644 www/assets/js/serviceareamap.js create mode 100644 www/pages/notary.html create mode 100644 www/pages/servicearea.html diff --git a/www/assets/js/dropandsend.js b/www/assets/js/dropandsend.js index c211959..82739d6 100644 --- a/www/assets/js/dropandsend.js +++ b/www/assets/js/dropandsend.js @@ -136,7 +136,7 @@ $("body").on("popup:open", "#dasLocationMapPopup", function () { }); } } else { - // Fall back to something + showWebGLErrorMessage(); } trackPageView("/dropandsend/locations_popup", $("#dasLocationMapPopup .navbar .navbar-inner .title").first().text()); diff --git a/www/assets/js/main.js b/www/assets/js/main.js index 6ca1c0a..a775c21 100644 --- a/www/assets/js/main.js +++ b/www/assets/js/main.js @@ -26,6 +26,9 @@ var app = new Framework7({ touch: { tapHold: true }, + statusbar: { + enabled: false + }, init: false, initOnDeviceReady: false, routes: routes diff --git a/www/assets/js/map.js b/www/assets/js/map.js index 13e5f91..7ca6d66 100644 --- a/www/assets/js/map.js +++ b/www/assets/js/map.js @@ -5,4 +5,12 @@ */ -var dropboxMap = null; \ No newline at end of file +var dropboxMap = null; +var serviceAreaMap = null; + +function showWebGLErrorMessage() { + app.dialog.alert("Well, this is awkward. Your device doesn't support displaying the map. If your \n\ +device is less than 5 years old, that's not normal. Some hints for a tech expert: WebGL 3D support \n\ +not detected in system embedded browser. Check the system webview is up to date and \n\ +working. WebGL is often broken in the official Android Emulator.", "Sorry!"); +} \ No newline at end of file diff --git a/www/assets/js/platform.js b/www/assets/js/platform.js index a9580ba..184b38c 100644 --- a/www/assets/js/platform.js +++ b/www/assets/js/platform.js @@ -288,7 +288,7 @@ function initCordova() { evt.preventDefault(); }); - $("body").on("click", "a[href^='tel:'],a[href^='sms:']", function (evt) { + $("body").on("click", "a[href^='tel:'],a[href^='sms:'],a[href^='mailto:']", function (evt) { window.open($(this).attr("href"), "_system"); evt.preventDefault(); }); @@ -338,7 +338,7 @@ function initNW() { evt.preventDefault(); }); - $("body").on("click", "a[href^='tel:'],a[href^='sms:']", function (evt) { + $("body").on("click", "a[href^='tel:'],a[href^='sms:'],a[href^='mailto:']", function (evt) { require('nw.gui').Shell.openExternal($(this).attr("href")); evt.preventDefault(); }); @@ -370,7 +370,7 @@ function initBrowser() { evt.preventDefault(); }); - $("body").on("click", "a[href^='tel:'],a[href^='sms:']", function (evt) { + $("body").on("click", "a[href^='tel:'],a[href^='sms:'],a[href^='mailto:']", function (evt) { window.open($(this).attr("href"), "_blank"); evt.preventDefault(); }); diff --git a/www/assets/js/serviceareamap.js b/www/assets/js/serviceareamap.js new file mode 100644 index 0000000..152a5d4 --- /dev/null +++ b/www/assets/js/serviceareamap.js @@ -0,0 +1,185 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + + +function loadServiceAreaMap() { + if (MapControl.supported()) { + if (serviceAreaMap == null) { + var mapboxel = document.getElementById("mapbox-servicearea"); + serviceAreaMap = new MapControl(mapboxel, true); + serviceAreaMap.reloadMap(); + serviceAreaMap.mapObj.on('load', function () { + serviceAreaMap.mapObj.jumpTo({center: [-112.005, 46.589], zoom: 9}); + serviceAreaMap.mapObj.addSource('servicearea', { + 'type': 'geojson', + 'data': { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "label": "Notary" + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -111.94158554077148, + 46.75621029973824 + ], + [ + -112.09058761596678, + 46.73880181507399 + ], + [ + -112.11393356323242, + 46.594849313729064 + ], + [ + -112.13109970092773, + 46.53135096527468 + ], + [ + -112.05350875854492, + 46.51410624997797 + ], + [ + -111.92647933959961, + 46.50819926727706 + ], + [ + -111.83721542358398, + 46.537491596723235 + ], + [ + -111.79738998413086, + 46.63800459887636 + ], + [ + -111.86948776245116, + 46.738095947110935 + ], + [ + -111.94158554077148, + 46.75621029973824 + ] + ] + ] + } + }, + { + "type": "Feature", + "properties": { + "label": "Courier" + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -111.40274047851562, + 46.2957133089894 + ], + [ + -111.42059326171874, + 46.49082901981415 + ], + [ + -111.62109375, + 46.64755071082884 + ], + [ + -111.80923461914062, + 46.800999519926314 + ], + [ + -111.92184448242188, + 46.991494313050424 + ], + [ + -111.90261840820312, + 47.09537035351024 + ], + [ + -112.02346801757812, + 47.15236927446393 + ], + [ + -112.24456787109375, + 47.09163058564968 + ], + [ + -112.38704681396484, + 46.93901161506044 + ], + [ + -112.39013671875, + 46.72856582519053 + ], + [ + -112.36953735351562, + 46.53052428878426 + ], + [ + -112.16285705566406, + 46.430285240839964 + ], + [ + -112.02896118164061, + 46.35522171093644 + ], + [ + -111.6815185546875, + 46.31089291474789 + ], + [ + -111.47415161132812, + 46.29761098988109 + ], + [ + -111.40274047851562, + 46.2957133089894 + ] + ] + ] + } + } + ] + } + }); + serviceAreaMap.mapObj.addLayer({ + 'id': 'courierservicearea', + 'type': 'fill', + 'source': 'servicearea', + 'paint': { + 'fill-color': '#005387', + 'fill-opacity': 0.4 + }, + 'filter': ['==', 'label', 'Courier'] + }); + serviceAreaMap.mapObj.addLayer({ + 'id': 'notaryservicearea', + 'type': 'fill', + 'source': 'servicearea', + 'paint': { + 'fill-color': '#008733', + 'fill-opacity': 0.4 + }, + 'filter': ['==', 'label', 'Notary'] + }); + }); + } + } else { + showWebGLErrorMessage(); + } +} + +function openServiceAreaExtraChargeInfo() { + app.dialog.alert("If you need a notary outside the green zone, the travel fee will be calculated \n\ +using the current IRS mileage rate. If you need courier service outside the blue zone, we can accomodate \n\ +but our delivery window guarantees will not apply.", "Info"); +} \ No newline at end of file diff --git a/www/index.html b/www/index.html index 76c7db8..0433fea 100644 --- a/www/index.html +++ b/www/index.html @@ -67,6 +67,7 @@ + diff --git a/www/pages/notary.html b/www/pages/notary.html new file mode 100644 index 0000000..a6527cb --- /dev/null +++ b/www/pages/notary.html @@ -0,0 +1,55 @@ + + +
+ + + +
+
+
+
+
+

Get a notary public anywhere in the Helena area on your schedule. + $10 per document plus a $10 travel fee per trip. +

In the same visit we can send your notarized documents via tracked First Class mail, + Certified Mail, our same-day or one-hour express courier services, + or a variety of guaranteed overnight services from USPS, FedEx, and UPS. +

Got a PDF to sign? Don't print it out, we can notarize electronically! + Just email it to notary@helena.express + any time before your appointment. +

+ + +
+

The travel fee is an amount not determined by law. By scheduling an + appointment, you agree to pay the travel fee described. We are not + licensed to practice law. We are not allowed to draft legal + records, give advice on legal matters, including immigration, or charge + a fee for those activities. +

+
+
+
+
+
\ No newline at end of file diff --git a/www/pages/servicearea.html b/www/pages/servicearea.html new file mode 100644 index 0000000..97c2a6d --- /dev/null +++ b/www/pages/servicearea.html @@ -0,0 +1,32 @@ + + +
+ + + +
+
+ Legend: + Notary + Courier + Outside Service Area? +
+
+ +
+
+
+
\ No newline at end of file diff --git a/www/routes.js b/www/routes.js index bb036c1..43f6a2d 100644 --- a/www/routes.js +++ b/www/routes.js @@ -9,6 +9,8 @@ var pagesToCompile = [ "home", "send", "welcome", + "notary", + "servicearea", "appointment", "dropandsend", "pickup", @@ -97,7 +99,7 @@ var routes = [ }, { title: "Notarize a Document", - href: "/appointment/notary", + href: "/notary", icon: "fa-duotone fa-file-signature", text: "Book a mobile notary visit." }, @@ -160,6 +162,29 @@ var routes = [ }, {}); } }, + { + path: '/notary', + content: compiledPages.notary(), + name: 'notary', + on: { + pageAfterIn: function () { + + } + } + }, + { + path: '/servicearea', + content: compiledPages.servicearea(), + name: 'servicearea', + on: { + pageAfterIn: function () { + loadServiceAreaMap(); + }, + pageAfterOut: function () { + serviceAreaMap = null; + } + } + }, { path: '/appointment', name: 'appointment',