From de659f41714001b77638be26cb68ebfa841935aa Mon Sep 17 00:00:00 2001 From: Mickael Matuchak Date: Sat, 14 Apr 2018 19:50:47 +0200 Subject: [PATCH 01/19] Add class "landscape" when device ZenPad 10" --- www/css/boussole.css | 4 ++++ www/js/App.js | 9 ++++++++- www/js/class/Compass.js | 2 ++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/www/css/boussole.css b/www/css/boussole.css index aa3189f..be4cbc3 100644 --- a/www/css/boussole.css +++ b/www/css/boussole.css @@ -3,6 +3,10 @@ background-size: 70%; } +.landscape * { + transform: rotate(90deg); +} + .compass_logo { width: 50%; padding-top: 5px; diff --git a/www/js/App.js b/www/js/App.js index b4dfbd6..98de89c 100644 --- a/www/js/App.js +++ b/www/js/App.js @@ -14,7 +14,7 @@ var app = { indiceEntrepreneur: [], isTimerLoaded: false, -// Initialisation cache les indices et affiche la vue actuelle + // Initialisation cache les indices et affiche la vue actuelle initialize: function () { $('.indice').hide(); @@ -135,6 +135,13 @@ var app = { startTimer(); } + // Si le device est une tablette une ZenPad 10", la boussole est orentiée pour être gérée en landscape + if (device.model == "P028") { + var divCompass = document.getElementById('compass'); + // Ajoute un id landscape sur la balise section pour modifier l'affichage en css + divCompass.setAttribute('class', 'landscape'); + } + // Affiche le message (dist min 50m) document.getElementById('conseilHide').style['display'] = 'block'; // Cache l'indice diff --git a/www/js/class/Compass.js b/www/js/class/Compass.js index 339dba7..8bd5248 100755 --- a/www/js/class/Compass.js +++ b/www/js/class/Compass.js @@ -55,9 +55,11 @@ var compass = { var angle = compass.data.actualPosition.bearingTo(compass.data.destination) - compass.data.heading.magneticHeading; // Gestion de la tablette 10" Asus ZenPad qui configure la boussole en format paysage. + /* if (device.model == "P028") { angle = angle + 90; } + */ rotate(Math.round(angle)); } From fe19e6ba9eb1d09676f31575d89d10e66e0054ed Mon Sep 17 00:00:00 2001 From: Benjamin Bermont Date: Sat, 14 Apr 2018 21:29:25 +0200 Subject: [PATCH 02/19] Display the compass view in landscape for asus --- config.xml | 1 + www/css/boussole.css | 4 ---- www/js/App.js | 7 +++---- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/config.xml b/config.xml index d930cea..6c31b4e 100644 --- a/config.xml +++ b/config.xml @@ -23,5 +23,6 @@ + diff --git a/www/css/boussole.css b/www/css/boussole.css index be4cbc3..aa3189f 100644 --- a/www/css/boussole.css +++ b/www/css/boussole.css @@ -3,10 +3,6 @@ background-size: 70%; } -.landscape * { - transform: rotate(90deg); -} - .compass_logo { width: 50%; padding-top: 5px; diff --git a/www/js/App.js b/www/js/App.js index 98de89c..3c6300a 100644 --- a/www/js/App.js +++ b/www/js/App.js @@ -135,11 +135,9 @@ var app = { startTimer(); } - // Si le device est une tablette une ZenPad 10", la boussole est orentiée pour être gérée en landscape + // Si le device est une tablette une ZenPad 10", la boussole est réglée pour être tenue en landscape if (device.model == "P028") { - var divCompass = document.getElementById('compass'); - // Ajoute un id landscape sur la balise section pour modifier l'affichage en css - divCompass.setAttribute('class', 'landscape'); + window.screen.orientation.lock('landscape'); } // Affiche le message (dist min 50m) @@ -166,6 +164,7 @@ var app = { // Affiche le scanner de QRCode showQrCodeView: function () { + window.screen.orientation.lock('portrait'); var markToFind = 'codeBalise:' + this.infosParcours[this.currentMark]['Balise'].id; cordova.plugins.barcodeScanner.scan( From 871eb7ae21efdca1dded29e7cf23f6fd07451c75 Mon Sep 17 00:00:00 2001 From: Benjamin Bermont Date: Sun, 15 Apr 2018 00:11:12 +0200 Subject: [PATCH 03/19] Optimize accuracy and the display of the compass --- www/js/class/Compass.js | 6 ++++++ www/js/functions.js | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/www/js/class/Compass.js b/www/js/class/Compass.js index 8bd5248..54b64b5 100755 --- a/www/js/class/Compass.js +++ b/www/js/class/Compass.js @@ -60,8 +60,14 @@ var compass = { angle = angle + 90; } */ + console.log('avant : ' + Math.round(angle)); + // envoyer uniquement un angle positif + if(Math.sign(angle) === -1){ + angle = 360+angle; + } rotate(Math.round(angle)); + console.log("après : " + Math.round(angle)); } }, diff --git a/www/js/functions.js b/www/js/functions.js index 9e6ee8c..84ed621 100644 --- a/www/js/functions.js +++ b/www/js/functions.js @@ -69,12 +69,12 @@ function rotate(angle) { } if (ancienAngle == null || ancienneAngleBalise != app.currentMark) { - ancienAngle = angle + ancienAngle = angle; } var newAngle = 0.5 * ancienAngle + 0.5 * angle; - $('#compass_elt').rotate(newAngle); + $('#compass_elt').rotate(Math.round(newAngle)); ancienAngle = newAngle; } From b4a9402ec5354ba7b351fd7aece34692362a3c22 Mon Sep 17 00:00:00 2001 From: Benjamin Bermont Date: Sun, 15 Apr 2018 00:21:08 +0200 Subject: [PATCH 04/19] Make the needle move smooth --- www/css/boussole.css | 1 + 1 file changed, 1 insertion(+) diff --git a/www/css/boussole.css b/www/css/boussole.css index aa3189f..580c0e4 100644 --- a/www/css/boussole.css +++ b/www/css/boussole.css @@ -99,4 +99,5 @@ #compass_elt { clear: both; margin-top: 120px; + transition: all 1s ease; } \ No newline at end of file From df9f80a1d5e3ebdc464e17ea5e0d8051acbf3c5f Mon Sep 17 00:00:00 2001 From: Benjamin Bermont Date: Sun, 15 Apr 2018 00:49:23 +0200 Subject: [PATCH 05/19] Make angle type integer --- www/js/class/Compass.js | 7 +++---- www/js/functions.js | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/www/js/class/Compass.js b/www/js/class/Compass.js index 54b64b5..99c5669 100755 --- a/www/js/class/Compass.js +++ b/www/js/class/Compass.js @@ -60,14 +60,13 @@ var compass = { angle = angle + 90; } */ - console.log('avant : ' + Math.round(angle)); + // envoyer uniquement un angle positif - if(Math.sign(angle) === -1){ +/* if(Math.sign(angle) === -1){ angle = 360+angle; - } + }*/ rotate(Math.round(angle)); - console.log("après : " + Math.round(angle)); } }, diff --git a/www/js/functions.js b/www/js/functions.js index 84ed621..f8d74df 100644 --- a/www/js/functions.js +++ b/www/js/functions.js @@ -69,10 +69,10 @@ function rotate(angle) { } if (ancienAngle == null || ancienneAngleBalise != app.currentMark) { - ancienAngle = angle; + ancienAngle = Math.round(angle); } - var newAngle = 0.5 * ancienAngle + 0.5 * angle; + var newAngle = Math.round(0.5 * ancienAngle + 0.5 * angle); $('#compass_elt').rotate(Math.round(newAngle)); From 5df11e9ce96414b28b30e3b4eecf85d0072e0efd Mon Sep 17 00:00:00 2001 From: Benjamin Bermont Date: Sun, 15 Apr 2018 14:08:20 +0200 Subject: [PATCH 06/19] Fix bad calculation of the needle --- www/js/functions.js | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/www/js/functions.js b/www/js/functions.js index f8d74df..1ac44a1 100644 --- a/www/js/functions.js +++ b/www/js/functions.js @@ -59,24 +59,9 @@ function startTimer() { } } -var ancienAngle = null; -var ancienneAngleBalise = null; - // Rotate boussole function rotate(angle) { - if (ancienneAngleBalise == null) { - ancienneAngleBalise = app.currentMark; - } - - if (ancienAngle == null || ancienneAngleBalise != app.currentMark) { - ancienAngle = Math.round(angle); - } - - var newAngle = Math.round(0.5 * ancienAngle + 0.5 * angle); - - $('#compass_elt').rotate(Math.round(newAngle)); - - ancienAngle = newAngle; + $('#compass_elt').rotate(Math.round(angle)); } var ancienneDistance = null; From 0e1595a1ebf0802d97ab16656395a95c53ff0965 Mon Sep 17 00:00:00 2001 From: Mickael Matuchak Date: Sun, 15 Apr 2018 15:19:49 +0200 Subject: [PATCH 07/19] Begin design landscape --- www/css/boussole.css | 53 +++++++++++++++++++++++++++++++++++++++++ www/index.html | 3 +-- www/js/App.js | 5 ++-- www/js/class/Compass.js | 6 +++-- 4 files changed, 61 insertions(+), 6 deletions(-) diff --git a/www/css/boussole.css b/www/css/boussole.css index 580c0e4..e77d692 100644 --- a/www/css/boussole.css +++ b/www/css/boussole.css @@ -100,4 +100,57 @@ clear: both; margin-top: 120px; transition: all 1s ease; +} + +/* boussole design paysage */ +section.landscape { + background-color: red; +} + +section.landscape .entete .score, section.landscape .entete .temps { + vertical-align: middle; + float: right; +} + +section.landscape .entete .score, section.landscape .entete .temps { + width: 20%; + margin-right: 6px; + text-align: center; +} + +section.landscape .entete .score p, section.landscape .entete .temps p { + display: inline-block; + text-align: center; +} + +section.landscape .entete .score p:first-child, section.landscape .entete .temps p:first-child { + display: block; + height: 60px; + vertical-align: middle; +} + +section.landscape .entete .temps p:first-child { + margin-bottom: 10px; +} + +section.landscape .entete .logo { + width: 40%; + float: left; + display: inline-block; + vertical-align: top; + margin-left: 6px; +} + +section.landscape .conseil .banniere_balise { + line-height: 40px; + height: 40px; +} + +section.landscape .conseil .indice_icone { + float: left; + margin-left: 6px; +} + +section.landscape .conseil #conseilHide, section.landscape .conseil p.valeur { + text-align: left; } \ No newline at end of file diff --git a/www/index.html b/www/index.html index a4829de..9184c6d 100644 --- a/www/index.html +++ b/www/index.html @@ -134,10 +134,9 @@

Parcours :

BALISE /

-

Lorem ipsum sit amet, consectetur adipiscing elit.

-

indice

INDICE CACHÉ 50 m(minimum)

+

Lorem ipsum sit amet, consectetur adipiscing elit.

diff --git a/www/js/App.js b/www/js/App.js index 3c6300a..e6aad9c 100644 --- a/www/js/App.js +++ b/www/js/App.js @@ -136,9 +136,10 @@ var app = { } // Si le device est une tablette une ZenPad 10", la boussole est réglée pour être tenue en landscape - if (device.model == "P028") { +// if (device.model == "P028") { + document.getElementById('compass').setAttribute('class', 'landscape'); window.screen.orientation.lock('landscape'); - } +// } // Affiche le message (dist min 50m) document.getElementById('conseilHide').style['display'] = 'block'; diff --git a/www/js/class/Compass.js b/www/js/class/Compass.js index 99c5669..d74a58d 100755 --- a/www/js/class/Compass.js +++ b/www/js/class/Compass.js @@ -62,9 +62,11 @@ var compass = { */ // envoyer uniquement un angle positif -/* if(Math.sign(angle) === -1){ + /* + if(Math.sign(angle) === -1){ angle = 360+angle; - }*/ + } + */ rotate(Math.round(angle)); } From d2fc3a518b8a0d203230a17e9b5a07f3d567c802 Mon Sep 17 00:00:00 2001 From: Benjamin Bermont Date: Sun, 15 Apr 2018 15:25:24 +0200 Subject: [PATCH 08/19] Fix the rotation problem for negative angles --- www/js/functions.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/www/js/functions.js b/www/js/functions.js index 1ac44a1..b5a1954 100644 --- a/www/js/functions.js +++ b/www/js/functions.js @@ -59,9 +59,21 @@ function startTimer() { } } +var newAngle = 0; +var actualAngle; + // Rotate boussole function rotate(angle) { - $('#compass_elt').rotate(Math.round(angle)); + + // algorithme pour empêcher l'aiguille de faire des tours complets lorsque du passage d'angles positifs à négatif + newAngle = newAngle || 0; + actualAngle = newAngle % 360; + if ( actualAngle < 0 ) { actualAngle += 360; } + if ( actualAngle < 180 && (angle > (actualAngle + 180)) ) { newAngle -= 360; } + if ( actualAngle >= 180 && (angle <= (actualAngle - 180)) ) { newAngle += 360; } + newAngle += (angle - actualAngle); + + $('#compass_elt').rotate(Math.round(newAngle)); } var ancienneDistance = null; From 0ac1fd6854e4acf78bf9c76bddbb7d9ab12269d6 Mon Sep 17 00:00:00 2001 From: Mickael Matuchak Date: Sun, 15 Apr 2018 15:33:35 +0200 Subject: [PATCH 09/19] Update design landscape --- config.xml | 2 +- www/css/boussole.css | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/config.xml b/config.xml index 6c31b4e..a5beecc 100644 --- a/config.xml +++ b/config.xml @@ -24,5 +24,5 @@ - + diff --git a/www/css/boussole.css b/www/css/boussole.css index e77d692..a608d52 100644 --- a/www/css/boussole.css +++ b/www/css/boussole.css @@ -147,10 +147,19 @@ section.landscape .conseil .banniere_balise { } section.landscape .conseil .indice_icone { - float: left; - margin-left: 6px; + float: right; + margin-right: 6px; +} + +section.landscape .conseil { + float: right; + width: 70%; } section.landscape .conseil #conseilHide, section.landscape .conseil p.valeur { - text-align: left; + text-align: right; +} + +section.landscape .boussole { + margin: 170px auto auto; } \ No newline at end of file From 0b26270331fdcef84b0b01c8af355297f372cbcd Mon Sep 17 00:00:00 2001 From: Mickael Matuchak Date: Sun, 15 Apr 2018 15:50:00 +0200 Subject: [PATCH 10/19] Update design landscape --- www/css/boussole.css | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/www/css/boussole.css b/www/css/boussole.css index a608d52..71c2f1b 100644 --- a/www/css/boussole.css +++ b/www/css/boussole.css @@ -104,7 +104,7 @@ /* boussole design paysage */ section.landscape { - background-color: red; + text-align: center; } section.landscape .entete .score, section.landscape .entete .temps { @@ -113,7 +113,7 @@ section.landscape .entete .score, section.landscape .entete .temps { } section.landscape .entete .score, section.landscape .entete .temps { - width: 20%; + width: 15%; margin-right: 6px; text-align: center; } @@ -134,7 +134,7 @@ section.landscape .entete .temps p:first-child { } section.landscape .entete .logo { - width: 40%; + width: 30%; float: left; display: inline-block; vertical-align: top; @@ -148,12 +148,12 @@ section.landscape .conseil .banniere_balise { section.landscape .conseil .indice_icone { float: right; - margin-right: 6px; + margin-right: 6px !important; } section.landscape .conseil { float: right; - width: 70%; + width: 100%; } section.landscape .conseil #conseilHide, section.landscape .conseil p.valeur { @@ -161,5 +161,15 @@ section.landscape .conseil #conseilHide, section.landscape .conseil p.valeur { } section.landscape .boussole { - margin: 170px auto auto; + margin: 190px auto auto; +} + +section.landscape .informations_balise { + margin-top: -100px; +} + +section.landscape #btn_pass, section.landscape #btn_flash { + width: 20%; + margin-left: 14%; + margin-right: 14%; } \ No newline at end of file From 2412b0ca56659e1d4cda7a4d6872601bc6bd4df8 Mon Sep 17 00:00:00 2001 From: Mickael Matuchak Date: Sun, 15 Apr 2018 16:02:16 +0200 Subject: [PATCH 11/19] Design landscape --- www/css/boussole.css | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/www/css/boussole.css b/www/css/boussole.css index 71c2f1b..ecebade 100644 --- a/www/css/boussole.css +++ b/www/css/boussole.css @@ -161,15 +161,27 @@ section.landscape .conseil #conseilHide, section.landscape .conseil p.valeur { } section.landscape .boussole { - margin: 190px auto auto; + margin: 195px auto auto; +} + +section.landscape #compass_elt { + margin-top: 70px; } section.landscape .informations_balise { - margin-top: -100px; + margin-top: -150px; } section.landscape #btn_pass, section.landscape #btn_flash { width: 20%; - margin-left: 14%; - margin-right: 14%; +} + +section.landscape #btn_pass { + float: left; + margin-left: 10%; +} + +section.landscape #btn_flash { + float: right; + margin-right: 10%; } \ No newline at end of file From 6e36af30767bc14363dd18e5bd3de0a5ec48a864 Mon Sep 17 00:00:00 2001 From: Mickael Matuchak Date: Sun, 15 Apr 2018 16:28:46 +0200 Subject: [PATCH 12/19] Landscape option only on Zenpad 10" --- www/css/boussole.css | 13 ++++++++++--- www/js/App.js | 13 ++++++++++--- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/www/css/boussole.css b/www/css/boussole.css index ecebade..32e3a70 100644 --- a/www/css/boussole.css +++ b/www/css/boussole.css @@ -107,6 +107,11 @@ section.landscape { text-align: center; } +section .entete { + margin-top: 10px; +} + + section.landscape .entete .score, section.landscape .entete .temps { vertical-align: middle; float: right; @@ -165,7 +170,7 @@ section.landscape .boussole { } section.landscape #compass_elt { - margin-top: 70px; + margin-top: 50px; } section.landscape .informations_balise { @@ -177,11 +182,13 @@ section.landscape #btn_pass, section.landscape #btn_flash { } section.landscape #btn_pass { + margin-top: -30px; float: left; - margin-left: 10%; + margin-left: 5%; } section.landscape #btn_flash { + margin-top: -30px; float: right; - margin-right: 10%; + margin-right: 5%; } \ No newline at end of file diff --git a/www/js/App.js b/www/js/App.js index e6aad9c..b436be5 100644 --- a/www/js/App.js +++ b/www/js/App.js @@ -136,10 +136,10 @@ var app = { } // Si le device est une tablette une ZenPad 10", la boussole est réglée pour être tenue en landscape -// if (device.model == "P028") { + if (device.model == "P028") { document.getElementById('compass').setAttribute('class', 'landscape'); window.screen.orientation.lock('landscape'); -// } + } // Affiche le message (dist min 50m) document.getElementById('conseilHide').style['display'] = 'block'; @@ -171,9 +171,16 @@ var app = { cordova.plugins.barcodeScanner.scan( function (result) { // Balise vide - if (result.text == '') + if (result.text == '') { navigator.notification.confirm('Aucun code flashé', null, 'Resultat QR Code', ['OK']); + // Si le device est une tablette une ZenPad 10", la boussole est réglée pour être tenue en landscape + if (device.model == "P028") { + document.getElementById('compass').setAttribute('class', 'landscape'); + window.screen.orientation.lock('landscape'); + } + } + // Bonne balise else if (result.text == markToFind) { // Si dernière question on affiche l'entrepreneur à trouver From a5ee89fd1c187d1c1adb053734e151381eac4286 Mon Sep 17 00:00:00 2001 From: Benjamin Bermont Date: Sun, 15 Apr 2018 16:44:37 +0200 Subject: [PATCH 13/19] Fix centering of the needle --- config.xml | 2 +- www/css/boussole.css | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/config.xml b/config.xml index a5beecc..6c31b4e 100644 --- a/config.xml +++ b/config.xml @@ -24,5 +24,5 @@ - + diff --git a/www/css/boussole.css b/www/css/boussole.css index 32e3a70..c0930eb 100644 --- a/www/css/boussole.css +++ b/www/css/boussole.css @@ -170,7 +170,7 @@ section.landscape .boussole { } section.landscape #compass_elt { - margin-top: 50px; + margin-top: 67px; } section.landscape .informations_balise { @@ -182,13 +182,11 @@ section.landscape #btn_pass, section.landscape #btn_flash { } section.landscape #btn_pass { - margin-top: -30px; float: left; margin-left: 5%; } section.landscape #btn_flash { - margin-top: -30px; float: right; margin-right: 5%; } \ No newline at end of file From 8bdfb37fe4d14f254c738a704f6338794183eb44 Mon Sep 17 00:00:00 2001 From: Mickael Matuchak Date: Sun, 15 Apr 2018 17:45:51 +0200 Subject: [PATCH 14/19] Fix design time and score for landscape --- www/css/boussole.css | 4 ++++ www/index.html | 2 +- www/js/App.js | 23 +++++++++++++++-------- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/www/css/boussole.css b/www/css/boussole.css index c0930eb..eb9c9a2 100644 --- a/www/css/boussole.css +++ b/www/css/boussole.css @@ -138,6 +138,10 @@ section.landscape .entete .temps p:first-child { margin-bottom: 10px; } +section.landscape .entete .temps #title-time { + margin-top: 6px; +} + section.landscape .entete .logo { width: 30%; float: left; diff --git a/www/index.html b/www/index.html index 9184c6d..a56011c 100644 --- a/www/index.html +++ b/www/index.html @@ -129,7 +129,7 @@

Parcours :

temps

-

TEMPS

+

TEMPS

diff --git a/www/js/App.js b/www/js/App.js index b436be5..ef35c17 100644 --- a/www/js/App.js +++ b/www/js/App.js @@ -137,7 +137,7 @@ var app = { // Si le device est une tablette une ZenPad 10", la boussole est réglée pour être tenue en landscape if (device.model == "P028") { - document.getElementById('compass').setAttribute('class', 'landscape'); + document.getElementById('compass').setAttribute('class', 'view landscape'); window.screen.orientation.lock('landscape'); } @@ -165,20 +165,21 @@ var app = { // Affiche le scanner de QRCode showQrCodeView: function () { - window.screen.orientation.lock('portrait'); var markToFind = 'codeBalise:' + this.infosParcours[this.currentMark]['Balise'].id; + window.screen.orientation.lock('portrait'); + cordova.plugins.barcodeScanner.scan( function (result) { + // Si le device est une tablette une ZenPad 10", la boussole est réglée pour être tenue en landscape + if (device.model == "P028") { + document.getElementById('compass').setAttribute('class', 'view landscape'); + window.screen.orientation.lock('landscape'); + } + // Balise vide if (result.text == '') { navigator.notification.confirm('Aucun code flashé', null, 'Resultat QR Code', ['OK']); - - // Si le device est une tablette une ZenPad 10", la boussole est réglée pour être tenue en landscape - if (device.model == "P028") { - document.getElementById('compass').setAttribute('class', 'landscape'); - window.screen.orientation.lock('landscape'); - } } // Bonne balise @@ -196,6 +197,12 @@ var app = { }, function (error) { + // Si le device est une tablette une ZenPad 10", la boussole est réglée pour être tenue en landscape + if (device.model == "P028") { + document.getElementById('compass').setAttribute('class', 'view landscape'); + window.screen.orientation.lock('landscape'); + } + navigator.notification.confirm('Erreur du scanner: ' + error, null, 'Resultat QR Code', ['OK']); } ); From 0c1c5bcfcc9ab666db4b6d71127bf55242f4ee87 Mon Sep 17 00:00:00 2001 From: Mickael Matuchak Date: Sun, 15 Apr 2018 18:00:23 +0200 Subject: [PATCH 15/19] Landscape Zenpad 10" for all pages --- www/js/App.js | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/www/js/App.js b/www/js/App.js index ef35c17..ea0c1fe 100644 --- a/www/js/App.js +++ b/www/js/App.js @@ -135,12 +135,6 @@ var app = { startTimer(); } - // Si le device est une tablette une ZenPad 10", la boussole est réglée pour être tenue en landscape - if (device.model == "P028") { - document.getElementById('compass').setAttribute('class', 'view landscape'); - window.screen.orientation.lock('landscape'); - } - // Affiche le message (dist min 50m) document.getElementById('conseilHide').style['display'] = 'block'; // Cache l'indice @@ -167,16 +161,8 @@ var app = { showQrCodeView: function () { var markToFind = 'codeBalise:' + this.infosParcours[this.currentMark]['Balise'].id; - window.screen.orientation.lock('portrait'); - cordova.plugins.barcodeScanner.scan( function (result) { - // Si le device est une tablette une ZenPad 10", la boussole est réglée pour être tenue en landscape - if (device.model == "P028") { - document.getElementById('compass').setAttribute('class', 'view landscape'); - window.screen.orientation.lock('landscape'); - } - // Balise vide if (result.text == '') { navigator.notification.confirm('Aucun code flashé', null, 'Resultat QR Code', ['OK']); @@ -197,12 +183,6 @@ var app = { }, function (error) { - // Si le device est une tablette une ZenPad 10", la boussole est réglée pour être tenue en landscape - if (device.model == "P028") { - document.getElementById('compass').setAttribute('class', 'view landscape'); - window.screen.orientation.lock('landscape'); - } - navigator.notification.confirm('Erreur du scanner: ' + error, null, 'Resultat QR Code', ['OK']); } ); @@ -645,5 +625,11 @@ function onDeviceReady() { // Evenement boutons Android document.addEventListener('backbutton', onBackKeyDown, false); + // Si le device est une tablette une ZenPad 10", la boussole est réglée pour être tenue en landscape +// if (device.model == "P028") { + document.getElementById('compass').setAttribute('class', 'view landscape'); + window.screen.orientation.lock('landscape'); +// } + window.plugins.insomnia.keepAwake(); } \ No newline at end of file From b9a26786e2eabb7d7e84464707024de6995a5b0b Mon Sep 17 00:00:00 2001 From: Mickael Matuchak Date: Sun, 15 Apr 2018 18:08:58 +0200 Subject: [PATCH 16/19] Landscape only for compass view and QRCode scanner --- www/js/App.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/www/js/App.js b/www/js/App.js index ea0c1fe..c967a40 100644 --- a/www/js/App.js +++ b/www/js/App.js @@ -135,6 +135,12 @@ var app = { startTimer(); } + // Si le device est une tablette une ZenPad 10", la boussole est réglée pour être tenue en landscape + if (device.model == "P028") { + document.getElementById('compass').setAttribute('class', 'view landscape'); + window.screen.orientation.lock('landscape'); + } + // Affiche le message (dist min 50m) document.getElementById('conseilHide').style['display'] = 'block'; // Cache l'indice @@ -190,6 +196,8 @@ var app = { // Affiche la question d'une balise showQuestionView: function () { + window.screen.orientation.lock('portrait'); + this.team.nbMarksFind++; var q = this.infosParcours[this.currentMark]['Question']; @@ -380,6 +388,8 @@ var app = { // Question sur l'entrepreneur mystère si on est sur la dernière balise showQuestionEntrepreneurView: function () { + window.screen.orientation.lock('portrait'); + this.team.nbMarksFind++; for (var i = 0; i < this.entrepreneurs.length; i++) { @@ -625,11 +635,5 @@ function onDeviceReady() { // Evenement boutons Android document.addEventListener('backbutton', onBackKeyDown, false); - // Si le device est une tablette une ZenPad 10", la boussole est réglée pour être tenue en landscape -// if (device.model == "P028") { - document.getElementById('compass').setAttribute('class', 'view landscape'); - window.screen.orientation.lock('landscape'); -// } - window.plugins.insomnia.keepAwake(); } \ No newline at end of file From 22d929539c454b42eb90cbe85b808e1e30a285cc Mon Sep 17 00:00:00 2001 From: Mickael Matuchak Date: Sun, 15 Apr 2018 18:58:39 +0200 Subject: [PATCH 17/19] Merge 'develop' into 'master' --- config.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.xml b/config.xml index 6c31b4e..a5beecc 100644 --- a/config.xml +++ b/config.xml @@ -24,5 +24,5 @@ - + From 6f7340f7143e846c9f97ae529dcb535478420ac6 Mon Sep 17 00:00:00 2001 From: Mickael Matuchak Date: Sun, 15 Apr 2018 19:19:59 +0200 Subject: [PATCH 18/19] Fix build.gradle travis --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 27c9dba..56be2d2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,6 +29,7 @@ install: before_script: - cordova platform rm android - cordova platform add android@6.3.0 +- echo "configurations.all {\nresolutionStrategy.force 'com.android.support:support-v4:26.0.0'\n}" >> platforms/android/build.gradle script: - cordova prepare - cordova build android --release From 2db738c51286fe3627491af5ea688376044f8c4b Mon Sep 17 00:00:00 2001 From: Mickael Matuchak Date: Sun, 15 Apr 2018 19:31:11 +0200 Subject: [PATCH 19/19] Fix build.gradle travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 56be2d2..ec367b9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,7 +29,7 @@ install: before_script: - cordova platform rm android - cordova platform add android@6.3.0 -- echo "configurations.all {\nresolutionStrategy.force 'com.android.support:support-v4:26.0.0'\n}" >> platforms/android/build.gradle +- cordova plugin add cordova-android-support-gradle-release --variable ANDROID_SUPPORT_VERSION=24.0.0 script: - cordova prepare - cordova build android --release