diff --git a/config.xml b/config.xml index 96dcb81..7a5a6ef 100644 --- a/config.xml +++ b/config.xml @@ -1,8 +1,8 @@ - - Netsyms PC Repair + + Helena Express - Book, track, pay, and manage your computer repair from Netsyms Technologies + Netsyms Technologies @@ -21,6 +21,7 @@ + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/www/assets/images/background.svg b/www/assets/images/background.svg new file mode 100644 index 0000000..a95dc5b --- /dev/null +++ b/www/assets/images/background.svg @@ -0,0 +1,68 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/www/assets/images/bg.jpg b/www/assets/images/bg.jpg deleted file mode 100644 index bee3c71..0000000 Binary files a/www/assets/images/bg.jpg and /dev/null differ diff --git a/www/assets/images/bg_night.jpg b/www/assets/images/bg_night.jpg deleted file mode 100644 index 8050f3d..0000000 Binary files a/www/assets/images/bg_night.jpg and /dev/null differ diff --git a/www/assets/images/companylogo.png b/www/assets/images/companylogo.png new file mode 100644 index 0000000..7a9657d Binary files /dev/null and b/www/assets/images/companylogo.png differ diff --git a/www/assets/images/companylogo.svg b/www/assets/images/companylogo.svg deleted file mode 100644 index 72a22dd..0000000 --- a/www/assets/images/companylogo.svg +++ /dev/null @@ -1,2 +0,0 @@ - -Netsyms wireframe logo diff --git a/www/assets/images/icons/128.png b/www/assets/images/icons/128.png index d2479f9..92dc524 100644 Binary files a/www/assets/images/icons/128.png and b/www/assets/images/icons/128.png differ diff --git a/www/assets/images/icons/144.png b/www/assets/images/icons/144.png index 4794922..5fce38f 100644 Binary files a/www/assets/images/icons/144.png and b/www/assets/images/icons/144.png differ diff --git a/www/assets/images/icons/152.png b/www/assets/images/icons/152.png index 84e11b2..df4484f 100644 Binary files a/www/assets/images/icons/152.png and b/www/assets/images/icons/152.png differ diff --git a/www/assets/images/icons/192.png b/www/assets/images/icons/192.png index ed63566..cd2f398 100644 Binary files a/www/assets/images/icons/192.png and b/www/assets/images/icons/192.png differ diff --git a/www/assets/images/icons/256.png b/www/assets/images/icons/256.png index 67b84f0..39d9f98 100644 Binary files a/www/assets/images/icons/256.png and b/www/assets/images/icons/256.png differ diff --git a/www/assets/images/icons/32.png b/www/assets/images/icons/32.png index 240b7f3..5af2014 100644 Binary files a/www/assets/images/icons/32.png and b/www/assets/images/icons/32.png differ diff --git a/www/assets/images/icons/512.png b/www/assets/images/icons/512.png index 3174eaa..431362a 100644 Binary files a/www/assets/images/icons/512.png and b/www/assets/images/icons/512.png differ diff --git a/www/assets/images/icons/delivered.svg b/www/assets/images/icons/delivered.svg new file mode 100644 index 0000000..4e61ab4 --- /dev/null +++ b/www/assets/images/icons/delivered.svg @@ -0,0 +1,2 @@ + + diff --git a/www/assets/images/icons/exception.svg b/www/assets/images/icons/exception.svg new file mode 100644 index 0000000..dcde85b --- /dev/null +++ b/www/assets/images/icons/exception.svg @@ -0,0 +1,2 @@ + + diff --git a/www/assets/images/icons/info.svg b/www/assets/images/icons/info.svg new file mode 100644 index 0000000..53484ad --- /dev/null +++ b/www/assets/images/icons/info.svg @@ -0,0 +1,2 @@ + + diff --git a/www/assets/images/icons/intransit.svg b/www/assets/images/icons/intransit.svg new file mode 100644 index 0000000..792648b --- /dev/null +++ b/www/assets/images/icons/intransit.svg @@ -0,0 +1,2 @@ + + diff --git a/www/assets/images/icons/logo.svg b/www/assets/images/icons/logo.svg index 807dfdd..ffaddc3 100644 --- a/www/assets/images/icons/logo.svg +++ b/www/assets/images/icons/logo.svg @@ -1,2 +1,2 @@ - + diff --git a/www/assets/images/icons/pretransit.svg b/www/assets/images/icons/pretransit.svg new file mode 100644 index 0000000..fb89786 --- /dev/null +++ b/www/assets/images/icons/pretransit.svg @@ -0,0 +1,2 @@ + + diff --git a/www/assets/js/addresscode.js b/www/assets/js/addresscode.js new file mode 100644 index 0000000..0ad1097 --- /dev/null +++ b/www/assets/js/addresscode.js @@ -0,0 +1,29 @@ +/* + * 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 getAddressQRCode() { + var qrstring = $("#addresscodeform #name").val() + "\t" + + $("#addresscodeform #company").val() + "\t" + + $("#addresscodeform #street1").val() + "\t" + + $("#addresscodeform #street2").val() + "\t" + + $("#addresscodeform #city").val() + "\t" + + $("#addresscodeform #state").val() + "\t" + + $("#addresscodeform #zip").val(); + + var canvas = document.createElement('canvas'); + + bwipjs.toCanvas(canvas, { + bcid: 'qrcode', // Barcode type + text: qrstring, // Text to encode + scale: 5, // 3x scaling factor + includetext: false, // Show human-readable text + textxalign: 'center', // Always good to set this + }); + document.getElementById("addresscode-barcode").src = canvas.toDataURL('image/png'); + + app.popup.create({el: document.getElementById("addresscode-popup")}).open(); +} \ No newline at end of file diff --git a/www/assets/js/linkaccount.js b/www/assets/js/linkaccount.js deleted file mode 100644 index 73c0da2..0000000 --- a/www/assets/js/linkaccount.js +++ /dev/null @@ -1,96 +0,0 @@ -/* - * 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 setupNewAccount(name) { - app.dialog.preloader("Finishing up..."); - - apirequest( - SETTINGS.apis.registernew, - { - name: name - }, - function (resp) { - app.dialog.close(); - if (resp.status == "ERROR") { - app.dialog.alert(resp.msg, "Error"); - return; - } - setStorage("client_uuid", resp.client_uuid); - setStorage("device_uuid", resp.device_uuid); - app.toast.create({ - icon: '', - text: '

Account Set Up!

', - position: 'center', - closeTimeout: 3000 - }).open(); - router.navigate("/home", { - transition: "f7-dive" - }); - }, - function (xhr) { - app.dialog.close(); - try { - var error = $.parseJSON(xhr.responseText); - if (error && typeof error.msg != 'undefined') { - app.dialog.alert(error.msg + " (NEWAC_XHR)", "Error"); - } else { - app.dialog.alert("A server or network error occurred. Try again later. (NEWAC_XHRNOMSG)", "Error"); - } - } catch (ex) { - app.dialog.alert("A server error occurred. Try again later. (NEWAC_XHRBADJSON)", "Error"); - } - }, "POST"); -} - -function setupExistingAccount(email, phone, invoiceid) { - app.dialog.preloader("Finding your account..."); - - apirequest( - SETTINGS.apis.registerexisting, - { - email: email, - phone: phone, - invoiceid: invoiceid - }, - function (resp) { - app.dialog.close(); - if (resp.status == "ERROR") { - app.dialog.alert(resp.msg, "Error"); - return; - } - setStorage("client_uuid", resp.client_uuid); - setStorage("device_uuid", resp.device_uuid); - app.toast.create({ - icon: '', - text: '

Account Linked!

', - position: 'center', - closeTimeout: 3000 - }).open(); - router.navigate("/home", { - transition: "f7-dive" - }); - }, - function (xhr) { - app.dialog.close(); - try { - var error = $.parseJSON(xhr.responseText); - if (error && typeof error.msg != 'undefined') { - app.dialog.alert(error.msg + " (LINKAC_XHR)", "Error"); - } else { - app.dialog.alert("A server or network error occurred. Try again later. (LINKAC_XHRNOMSG)", "Error"); - } - } catch (ex) { - app.dialog.alert("A server error occurred. Try again later. (LINKAC_XHRBADJSON)", "Error"); - } - }, "POST"); -} - -function unlinkAccount() { - localStorage.removeItem("client_uuid"); - localStorage.removeItem("device_uuid"); - restartApplication(); -} \ No newline at end of file diff --git a/www/assets/js/main.js b/www/assets/js/main.js index ef7e927..07f8698 100644 --- a/www/assets/js/main.js +++ b/www/assets/js/main.js @@ -10,8 +10,8 @@ initPlatform(); var app = new Framework7({ root: "#app", - name: "Netsyms PC Repair", - id: "com.netsyms.repairapp", + name: "Helena Express", + id: "com.netsyms.helenaexpress.app", theme: "auto", card: { swipeToClose: false @@ -96,7 +96,7 @@ function setAppTheme(theme) { $("#app").removeClass("theme-dark"); if (platform_type == "cordova" && cordova.platformId == 'android' && typeof StatusBar !== 'undefined') { StatusBar.styleLightContent(); - StatusBar.backgroundColorByHexString("#0D87F6"); + StatusBar.backgroundColorByHexString("#D0F2FC"); } } else if (theme == "dark") { $("#app").addClass("theme-dark"); diff --git a/www/assets/js/offers_services.js b/www/assets/js/offers_services.js deleted file mode 100644 index e96c1d7..0000000 --- a/www/assets/js/offers_services.js +++ /dev/null @@ -1,86 +0,0 @@ -/* - * 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 openOffersAsync(routeTo, routeFrom, resolve, reject) { - app.dialog.preloader("Fetching latest deals..."); - - apirequest( - SETTINGS.apis.offers_services, - {}, - function (resp) { - app.dialog.close(); - if (resp.status == "ERROR") { - app.dialog.alert(resp.msg, "Error"); - reject(); - } else { - var context = { - offers: [] - }; - - for (var i = 0; i < resp.offers.length; i++) { - if (resp.offers[i].valid === true) { - // no expiration - resp.offers[i].expires = "Limited time offer"; - } else { - resp.offers[i].expires = "Expires " + formatTimestamp("l F j, Y", resp.offers[i].valid.to); - } - context.offers.push(resp.offers[i]); - } - - resolve({ - templateUrl: "pages/offers.html", - }, { - context: context - }); - } - }, - function (xhr) { - app.dialog.close(); - var error = $.parseJSON(xhr.responseText); - if (error && typeof error.msg != 'undefined') { - app.dialog.alert(error.msg, "Error"); - } else { - app.dialog.alert("A server or network error occurred.", "Error"); - } - reject(); - }, "GET"); -} - -function openServicesAsync(routeTo, routeFrom, resolve, reject) { - app.dialog.preloader("Just a second..."); - - apirequest( - SETTINGS.apis.offers_services, - {}, - function (resp) { - app.dialog.close(); - if (resp.status == "ERROR") { - app.dialog.alert(resp.msg, "Error"); - reject(); - } else { - var context = { - services: resp.services - }; - - resolve({ - templateUrl: "pages/services.html", - }, { - context: context - }); - } - }, - function (xhr) { - app.dialog.close(); - var error = $.parseJSON(xhr.responseText); - if (error && typeof error.msg != 'undefined') { - app.dialog.alert(error.msg, "Error"); - } else { - app.dialog.alert("A server or network error occurred.", "Error"); - } - reject(); - }, "GET"); -} \ No newline at end of file diff --git a/www/assets/js/track.js b/www/assets/js/track.js index e949fb5..a3c98b3 100644 --- a/www/assets/js/track.js +++ b/www/assets/js/track.js @@ -4,46 +4,23 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -function openTrackingInfoPage(id) { - if (typeof id == "undefined" || id == null || id == "") { - app.input.validate("#deviceid"); +function openTrackingInfoPage(code) { + if (typeof code == "undefined" || code == null || code == "") { + app.input.validate("#trackingcode"); return; } - router.navigate("/track/" + id); + router.navigate("/track/" + code); } -function addClientMachineSuggestions() { - $("#client-link-account-message").addClass("display-none"); - $("#client-machine-suggestion-list").addClass("display-none"); - $("#client-machine-suggestion-list-preloader").addClass("display-none"); - $("#client-machine-suggestion-list ul").html(""); - if (inStorage("client_uuid")) { - $("#client-machine-suggestion-list-preloader").removeClass("display-none"); - apirequest( - SETTINGS.apis.getmachines, - { - clientuuid: getStorage("client_uuid") - }, - function (resp) { - if (resp.status == "OK") { - if (resp.machines.length > 0) { - for (var i = 0; i < resp.machines.length; i++) { - var id = resp.machines[i].id; - var type = resp.machines[i].type.label; - var icon = resp.machines[i].icon; - $("#client-machine-suggestion-list ul").append('
  • ' - + '
    ' - + ' ' + type + " #" + id - + '
  • '); - } - $("#client-machine-suggestion-list").removeClass("display-none"); - } - $("#client-machine-suggestion-list-preloader").addClass("display-none"); - } - }, "GET"); - } else { - $("#client-link-account-message").removeClass("display-none"); +function addTrackingSuggestions() { + $("#tracking-suggestion-list ul").html(""); + var history = getTrackingHistory(); + for (var i = 0; i < history.length; i++) { + $("#tracking-suggestion-list ul").append('
  • ' + + '
    ' + + history[i] + + '
  • '); } } @@ -53,27 +30,51 @@ function trackOpenAsync(routeTo, routeFrom, resolve, reject) { apirequest( SETTINGS.apis.track, { - id: routeTo.params.id, + code: routeTo.params.code, format: "json" }, function (resp) { app.dialog.close(); - if (resp.status == "ERROR") { - app.dialog.alert(resp.msg, "Error"); - reject(); - } else { - addToTrackingHistory(resp.id); + if (resp.status == "OK") { + addToTrackingHistory(resp.code); - var context = {}; - context.info = resp.info; - context.events = resp.events; - context.components = resp.components; + var context = { + code: resp.code, + info: [ + {label: "Tracking Code", value: resp.code} + ], + events: [] + }; + if (resp.info.statustext) { + context.info.push({label: "Status", value: resp.info.statustext}); + } + if (resp.info.carrier) { + context.info.push({label: "Carrier", value: resp.info.carrier}); + } + if (resp.info.delivery_date) { + var deliverydatelabel = "Estimated delivery on"; + if (resp.info.status == "DELIVERED") { + deliverydatelabel = "Delivered on"; + } + context.info.push({label: deliverydatelabel, value: formatTimestamp("F j Y", resp.info.delivery_date_unixtime)}); + } + + for (var i = 0; i < resp.events.length; i++) { + context.events.push({ + text: resp.events[i].text, + date: formatTimestamp("F j g:i a", resp.events[i].unixtime), + icon: "./assets/images/icons/" + resp.events[i].icon + ".svg" + }); + } resolve({ templateUrl: "pages/trackresult.html", }, { context: context }); + } else { + app.dialog.alert(resp.msg, "Error"); + reject(); } }, function (xhr) { @@ -89,7 +90,7 @@ function trackOpenAsync(routeTo, routeFrom, resolve, reject) { } function getTrackingHistory() { - var history = getStorage("trackhistory"); + var history = getStorage("trackinghistory"); if (history != null) { return JSON.parse(history); } else { @@ -97,19 +98,19 @@ function getTrackingHistory() { } } -function addToTrackingHistory(id) { +function addToTrackingHistory(code) { var history = getTrackingHistory(); for (var i = 0; i < history.length; i++) { - if (history[i] == id) { + if (history[i] == code) { history.splice(i, 1); } } // Add the code back to the list so it's at the top - history.push(id); + history.push(code); while (history.length > 10) { history.shift(); } - setStorage("trackhistory", JSON.stringify(history)); + setStorage("trackinghistory", JSON.stringify(history)); } \ No newline at end of file diff --git a/www/index.html b/www/index.html index 85b4ece..a39de38 100644 --- a/www/index.html +++ b/www/index.html @@ -19,7 +19,7 @@ -
    +
    @@ -44,9 +44,8 @@ - - + \ No newline at end of file diff --git a/www/manifest.json b/www/manifest.json index b1c9e45..c9f411a 100644 --- a/www/manifest.json +++ b/www/manifest.json @@ -1,6 +1,6 @@ { - "name": "Netsyms PC Repair", - "short_name": "PC Repair", + "name": "Helena Express", + "short_name": "Helena Express", "icons": [ { "src": "assets/images/icons/32.png", @@ -45,13 +45,13 @@ "related_applications": [ { "platform": "play", - "url": "https://play.google.com/store/apps/details?id=com.netsyms.repairapp", - "id": "com.netsyms.repairapp" + "url": "https://play.google.com/store/apps/details?id=com.netsyms.helenaexpress.app", + "id": "com.netsyms.helenaexpress.app" } ], "start_url": "index.html", "display": "standalone", - "background_color": "#0D87F6", - "theme_color": "#0D87F6", + "background_color": "#d0f2fc", + "theme_color": "#d0f2fc", "iarc_rating_id": "" } \ No newline at end of file diff --git a/www/package.json b/www/package.json index f20854c..5694ed2 100644 --- a/www/package.json +++ b/www/package.json @@ -1,5 +1,5 @@ { - "name": "NetsymsPCRepair", + "name": "HelenaExpressApp", "version": "1.0.0", "main": "index.html", "license": "MPL-2.0", diff --git a/www/pages/linkaccount_new.html b/www/pages/addresscode.html similarity index 57% rename from www/pages/linkaccount_new.html rename to www/pages/addresscode.html index f620055..ff853d5 100644 --- a/www/pages/linkaccount_new.html +++ b/www/pages/addresscode.html @@ -2,56 +2,59 @@ - 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/. --> -
    +