diff --git a/apihub-root/lightweight-pwa/css/main.css b/apihub-root/lightweight-pwa/css/main.css index 597b7e8..163fdb9 100644 --- a/apihub-root/lightweight-pwa/css/main.css +++ b/apihub-root/lightweight-pwa/css/main.css @@ -37,7 +37,7 @@ url('../fonts/dm-sans-v11-latin-ext_latin-700.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */ url('../fonts/dm-sans-v11-latin-ext_latin-700.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ } -@media only screen and (min-device-width: 480px) and (max-device-width: 3000px) { +@media only screen and (min-device-width: 900px) and (max-device-width: 3000px) { body { padding: 0; max-width: 414px; @@ -230,7 +230,8 @@ font-size: 16px; font-weight: 700; } - .go-back-button{ + + .go-back-button { font-weight: 700; font-size: 14px; line-height: 140%; @@ -241,7 +242,7 @@ } -@media only screen and (max-device-width: 480px) { +@media only screen and (max-device-width: 900px) { .welcome-container { font-size: 3rem; @@ -438,7 +439,8 @@ font-size: 1.5rem; font-weight: 700; } - .go-back-button{ + + .go-back-button { font-weight: 700; font-size: 1.5rem; line-height: 140%; @@ -448,6 +450,15 @@ } } +@media only screen and (orientation: landscape) { + body { + min-height: 1000px; + width: 100%; + max-width: 600px; + margin: auto; + } +} + body { font-family: "DM Sans"; } @@ -744,6 +755,7 @@ body { background: #fff; position: relative; overflow: auto; + color: #04313B; } .modal-content .languages-container { diff --git a/apihub-root/lightweight-pwa/js/controllers/ScanController.js b/apihub-root/lightweight-pwa/js/controllers/ScanController.js index c861df2..f7a714c 100644 --- a/apihub-root/lightweight-pwa/js/controllers/ScanController.js +++ b/apihub-root/lightweight-pwa/js/controllers/ScanController.js @@ -14,9 +14,14 @@ function ScanController() { await this.startScanning(); } + this.closeModal = function (modalId) { + document.querySelector("#"+modalId).setAttribute('style', 'display:none !important'); + } + this.redirectToError = function (err) { console.log("Error on scanService ", err); - goToPage("error.html") + document.querySelector("#scan-error").setAttribute('style', 'display:flex !important'); + // goToPage("error.html") } this.cancelHandler = function () { diff --git a/apihub-root/lightweight-pwa/js/services/ScanService.js b/apihub-root/lightweight-pwa/js/services/ScanService.js index 90e73fe..07e35f9 100644 --- a/apihub-root/lightweight-pwa/js/services/ScanService.js +++ b/apihub-root/lightweight-pwa/js/services/ScanService.js @@ -149,6 +149,9 @@ class ScanService { onStatusChanged(status) { console.log(`Status has changed to "${status}"`); + if (status && status === "Access to the camera was denied!") { + throw new Error(status) + } } } diff --git a/apihub-root/lightweight-pwa/js/translations.js b/apihub-root/lightweight-pwa/js/translations.js index 7a38f4c..05113e9 100644 --- a/apihub-root/lightweight-pwa/js/translations.js +++ b/apihub-root/lightweight-pwa/js/translations.js @@ -1,45 +1,136 @@ export const translations = { - "en": { - "welcome": "Welcome to Pharmaledger", - "scan_explain": "Find the 2D code on your medicine to scan and view information", - "scan_button": "Scan 2D Code", - "app_name": "Pharmaledger", - "cancel": "Cancel", - "change_camera": "Change camera", - "scan_again": "Scan Again", - "error_title": "Not Recognized", - "error_subtitle": "unverified product", - "error_text": "
Unfortunately, we are unable to verify the authenticity of this product
Nisi quis tellus risus dui scelerisque et commodo, blandit.
What does this mean?
Tortor adipiscing proin sit auctor nulla posuere ornare adipiscing at. Viverra dictum netus sollicitudin elit risus leo sapien.
What should you do next?
Sed et ac habitant id. Mattis hac nisi, pellentesque erat tempus integer erat. Vestibulum sapien justo cras turpis.
", - "leaflet_expired_title": "Expired", - "leaflet_expired_subtitle": "This item is Expired", - "leaflet_expired_message": "In ut dignissim elit risus. Nisi quis tellus risus dui scelerisque et commodo, blandit. Feugiat adipiscing posuere maecenas quis egestas odio et nunc. Tortor adipiscing proin sit auctor nulla posuere ornare adipiscing at. Viverra dictum netus sollicitudin elit risus leo sapien. Enim, volutpat sit magna quis sit vitae nunc dis laoreet. Dis pellentesque adipiscing sit pellentesque. Et id ut imperdiet pulvinar tincidunt eget nibh. Dis pellentesque adipiscing sit pellentesque. Et id ut imperdiet pulvinar tincidunt eget nibh.", - "select_lang_title": "Leaflet unavailable", - "select_lang_subtitle": "Language Missing", - "leaflet_lang_select_message": "We are sorry but for your current language leaflet is unavailable. You can choose form the available language list.", - "lang_proceed": "Proceed", - "go_home": "Go Back Home" - }, - "de": { - "header": "German header", - "paragraf": "German paragraf" - } + "en": { + "welcome": "Welcome to Pharmaledger", + "scan_explain": "Find the 2D code on your medicine to scan and view information", + "scan_button": "Scan 2D Code", + "app_name": "Pharmaledger", + "cancel": "Cancel", + "change_camera": "Change camera", + "scan_again": "Scan Again", + "error_title": "Not Recognized", + "error_subtitle": "unverified product", + "error_text": "Unfortunately we can't verify the authenticity of this product
The barcode is unreadable. For your own safety, please contact the pharmacy or doctor who issued the package of medicines.
", + "leaflet_expired_title": "Expired", + "leaflet_expired_subtitle": "This item is Expired", + "leaflet_expired_message": "This product has been identified as expired .
Expired medical products may be less effective and may pose a risk to the patient due to changes in composition. Once the expiration date has passed, there is no guarantee that the medicine is safe and effective. Replace expired medicines to make sure you are using the latest product with the latest instructions for use.
", + "select_lang_title": "Leaflet unavailable", + "select_lang_subtitle": "Language Missing", + "scan_error_title": "Scan error", + "scan_error_subtitle": "Can't access camera", + "camera_error_message": "Something went wrong and selected camera can not be accessed properly. Please check your device camera settings or try to change camera form the menu", + "leaflet_lang_select_message": "We are sorry but for your current language leaflet is unavailable. You can choose form the available language list.", + "lang_proceed": "Proceed", + "go_home": "Go Back Home" + }, + "de": { + "welcome": "Willkommen bei Pharmaledger", + "scan_explain": "Finden Sie den 2D-Code auf Ihrem Medikament, um Informationen zu scannen und anzuzeigen", + "scan_button": "2D-Code scannen", + "app_name": "Pharmaledger", + "cancel": "stornieren", + "change_camera": "Kamera wechseln", + "scan_again": "Erneut scannen", + "error_title": "Nicht erkannt", + "error_subtitle": "nicht verifiziertes Produkt", + "error_text": "Leider können wir die Echtheit dieses Produkts nicht überprüfen
Der Strichcode ist nicht lesbar. Wenden Sie sich zu Ihrer eigenen Sicherheit bitte an die Apotheke oder den Arzt, der Arzneimittelpaket ausgegeben.
", + "leaflet_expired_title": "Abgelaufen", + "leaflet_expired_subtitle": "Dieser Artikel ist abgelaufen", + "leaflet_expired_message": "Dieses Produkt wurde als abgelaufen identifiziert .
Abgelaufene Arzneimittel können weniger wirksam sein und aufgrund von Änderungen in der Zusammensetzung ein Risiko für den Patienten darstellen . Nach Ablauf des Verfallsdatums gibt es keine Garantie dafür, dass das Arzneimittel sicher und wirksam ist. Ersetzen Sie abgelaufene Arzneimittel, um sicherzustellen, dass Sie das neueste Produkt mit der neuesten Gebrauchsanweisung verwenden.
", + "select_lang_title": "Broschüre nicht verfügbar", + "select_lang_subtitle": "Sprache fehlt", + "scan_error_title": "Scan-Fehler", + "scan_error_subtitle": "Kann nicht auf die Kamera zugreifen", + "camera_error_message": "Etwas ist schief gelaufen und auf die ausgewählte Kamera kann nicht richtig zugegriffen werden. Bitte überprüfen Sie die Kameraeinstellungen Ihres Geräts oder versuchen Sie, die Kamera über das Menü zu ändern", + "leaflet_lang_select_message": "Es tut uns leid, aber Ihre aktuelle Sprachbroschüre ist nicht verfügbar. Sie können aus der Liste der verfügbaren Sprachen auswählen.", + "lang_proceed": "Fortfahren", + "go_home": "Zurück nach Hause" + }, + "fr": { + "welcome": "Bienvenue dans Pharmaledger", + "scan_explain": "Trouvez le code 2D sur votre médicament pour scanner et afficher les informations", + "scan_button": "Scanner le code 2D", + "app_name": "Pharmaledger", + "cancel": "Annuler", + "change_camera": "Changer de caméra", + "scan_again": "Analyser à nouveau", + "error_title": "Non reconnu", + "error_subtitle": "produit non vérifié", + "error_text": "Malheureusement, nous ne pouvons pas vérifier l'authenticité de ce produit
Le code-barres est illisible. Pour votre propre sécurité, veuillez contacter la pharmacie ou le médecin qui a délivré le paquet de médicaments.
", + "leaflet_expired_title": "Expiré", + "leaflet_expired_subtitle": "Cet article est expiré", + "leaflet_expired_message": "Ce produit a été identifié comme périmé .
Les produits médicaux périmés peuvent être moins efficaces et peuvent présenter un risque pour le patient en raison de changements de composition . Une fois la date de péremption passée, rien ne garantit que le médicament est sûr et efficace. Remplacez les médicaments périmés pour vous assurer que vous utilisez le produit le plus récent avec les dernières instructions d'utilisation.
", + "select_lang_title": "Dépliant indisponible", + "select_lang_subtitle": "Langue manquante", + "scan_error_title": "Erreur d'analyse", + "scan_error_subtitle": "Impossible d'accéder à la caméra", + "camera_error_message": "Quelque chose s'est mal passé et la caméra sélectionnée n'est pas accessible correctement. Veuillez vérifier les paramètres de la caméra de votre appareil ou essayez de changer la caméra depuis le menu", + "leaflet_lang_select_message": "Nous sommes désolés mais pour votre langue actuelle, la brochure n'est pas disponible. Vous pouvez choisir dans la liste des langues disponibles.", + "lang_proceed": "Continuer", + "go_home": "Retour à la maison" + }, + "nl": { + "welcome": "Welkom bij Pharmaledger", + "scan_explain": "Zoek de 2D-code op uw medicijn om informatie te scannen en te bekijken", + "scan_button": "Scan 2D-code", + "app_name": "Pharmaledger", + "cancel": "Annuleren", + "change_camera": "Verander camera", + "scan_again": "Opnieuw scannen", + "error_title": "Niet herkend", + "error_subtitle": "niet-geverifieerd product", + "error_text": "Helaas kunnen we de echtheid van dit product niet controleren
De barcode is onleesbaar. Neem voor uw eigen veiligheid contact op met de apotheek of arts die het pakket medicijnen uitgegeven.
", + "leaflet_expired_title": "Verlopen", + "leaflet_expired_subtitle": "Dit artikel is verlopen", + "leaflet_expired_message": "Dit product is geïdentificeerd als verlopen .
Verlopen medische producten kunnen minder effectief zijn en kunnen een risico vormen voor de patiënt als gevolg van veranderingen in samenstelling . Zodra de houdbaarheidsdatum is verstreken, is er geen garantie dat het geneesmiddel veilig en effectief is. Vervang verlopen geneesmiddelen om er zeker van te zijn dat u het nieuwste product gebruikt met de meest recente gebruiksaanwijzing.
", + "select_lang_title": "Folder niet beschikbaar", + "select_lang_subtitle": "Taal ontbreekt", + "scan_error_title": "Scanfout", + "scan_error_subtitle": "Geen toegang tot camera", + "camera_error_message": "Er is iets misgegaan en de geselecteerde camera is niet goed toegankelijk. Controleer de camera-instellingen van uw apparaat of probeer de camera in het menu te wijzigen", + "leaflet_lang_select_message": "Het spijt ons, maar uw huidige taalfolder is niet beschikbaar. U kunt kiezen uit de beschikbare talenlijst.", + "lang_proceed": "Doorgaan", + "go_home": "Ga terug naar huis" + }, + "ro": { + "welcome": "Bine ați venit la Pharmaledger", + "scan_explain": "Găsiți codul 2D pe medicament pentru a scana și vizualiza informații", + "scan_button": "Scanați codul 2D", + "app_name": "Pharmaledger", + "cancel": "Anulează", + "change_camera": "Schimbați camera", + "scan_again": "Scanați din nou", + "error_title": "Nerecunoscut", + "error_subtitle": "produs neverificat", + "error_text": "Din păcate, nu putem verifica autenticitatea acestui produs
Codul de bare nu poate fi citit. Pentru siguranța dumneavoastră, vă rugăm să contactați farmacia sau medicul de la care ați procurat medicamentul.
", + "leaflet_expired_title": "Expirat", + "leaflet_expired_subtitle": "Acest articol a expirat", + "leaflet_expired_message": "Acest produs a fost identificat ca fiind expirat .
Produsele medicale expirate pot fi mai puțin eficiente și pot prezenta un risc pentru pacient din cauza modificărilor compoziției . Odată ce data de expirare a trecut, nu există nicio garanție că medicamentul este sigur și eficient. Înlocuiți medicamentele expirate pentru a vă asigura că utilizați cel mai recent produs cu cele mai recente instrucțiuni de utilizare.
", "select_lang_title": "Prospectul indisponibil", + "select_lang_subtitle": "Limba lipsește", + "scan_error_title": "Eroare de scanare", + "scan_error_subtitle": "Nu pot accesa camera", + "camera_error_message": "Ceva a mers prost și camera selectată nu poate fi accesată corect. Verificați setările camerei dispozitivului dvs. sau încercați să schimbați camera din meniu", + "leaflet_lang_select_message": "Ne pare rău, dar broșura în limba dvs. actuală nu este disponibilă. Puteți alege din lista de limbi disponibile.", + "lang_proceed": "Continuați", + "go_home": "Întoarceți-vă acasă" + } } export function changeLanguage(newLang) { - let languages = Object.keys(translations); - if (languages.find(lang => lang === newLang)) { - window.currentLanguage = newLang; - translate(); - } + let languages = Object.keys(translations); + if (languages.find(lang => lang === newLang)) { + window.currentLanguage = newLang; + translate(); + } } export function translate() { - if (!window.currentLanguage) { - window.currentLanguage = window.navigator.language.slice(0, 2); - } - let matches = document.querySelectorAll("[translate]"); - matches.forEach((item) => { - item.innerHTML = translations[currentLanguage][item.getAttribute('translate')]; - }); + if (!window.currentLanguage) { + let userLang = window.navigator.language.slice(0, 2); + window.currentLanguage = translations[userLang] ? userLang : "en" + } + let matches = document.querySelectorAll("[translate]"); + matches.forEach((item) => { + item.innerHTML = translations[window.currentLanguage][item.getAttribute('translate')]; + }); } diff --git a/apihub-root/lightweight-pwa/leaflet.html b/apihub-root/lightweight-pwa/leaflet.html index 98dca30..91ae5d5 100644 --- a/apihub-root/lightweight-pwa/leaflet.html +++ b/apihub-root/lightweight-pwa/leaflet.html @@ -22,7 +22,6 @@ - diff --git a/apihub-root/lightweight-pwa/scan.html b/apihub-root/lightweight-pwa/scan.html index c832e70..3fc66f4 100644 --- a/apihub-root/lightweight-pwa/scan.html +++ b/apihub-root/lightweight-pwa/scan.html @@ -9,12 +9,24 @@ +