From 30c5d4d21d5580d022f3e38408ace05f3c48b4ee Mon Sep 17 00:00:00 2001
From: Bertrand Presles <bertrand.presles.externe@capgemini.com>
Date: Tue, 27 Apr 2021 00:03:17 +0200
Subject: [PATCH] feat(ios): Implemented support for QRCode on iPad. Bumped
 version to 1.6.13

---
 config.xml                               |  2 +-
 install.sh                               |  2 +-
 package.json                             |  2 +-
 resources/web-ext/manifest.json          |  2 +-
 scss/ionic.app.scss                      |  4 ++++
 www/js/config.js                         | 14 +-------------
 www/js/services/device-services.js       | 10 +++++-----
 www/manifest.json                        |  2 +-
 www/templates/login/popover_methods.html |  2 +-
 9 files changed, 16 insertions(+), 24 deletions(-)

diff --git a/config.xml b/config.xml
index 8f1cacd27..cd18fca75 100644
--- a/config.xml
+++ b/config.xml
@@ -1,5 +1,5 @@
 <?xml version='1.0' encoding='utf-8'?>
-<widget android-versionCode="106120" id="fr.duniter.cesium" ios-CFBundleIdentifier="org.duniter.cesium" version="1.6.12" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0">
+<widget android-versionCode="106130" id="fr.duniter.cesium" ios-CFBundleIdentifier="org.duniter.cesium" version="1.6.13" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0">
     <name>Cesium</name>
     <description>
     An simple App for Duniter wallet
diff --git a/install.sh b/install.sh
index 960563ee9..04aaa067f 100755
--- a/install.sh
+++ b/install.sh
@@ -15,7 +15,7 @@ if [ "_$CESIUM_DIR" = "_" ]; then
 fi
 
 latest_version() {
-  echo "v1.6.12" #lastest
+  echo "v1.6.13" #lastest
 }
 
 api_release_url() {
diff --git a/package.json b/package.json
index 7cb527ff0..090b11c42 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "cesium",
-  "version": "1.6.12",
+  "version": "1.6.13",
   "description": "Cesium Wallet for G1 libre currency",
   "author": "Benoit Lavenier <benoit.lavenier@e-is.pro>",
   "license": "AGPL-3.0",
diff --git a/resources/web-ext/manifest.json b/resources/web-ext/manifest.json
index f08c71c28..f561d1d79 100644
--- a/resources/web-ext/manifest.json
+++ b/resources/web-ext/manifest.json
@@ -1,7 +1,7 @@
 {
   "name": "Cesium",
   "short_name": "Cesium",
-  "version": "1.6.12",
+  "version": "1.6.13",
   "description": "Manage your Duniter Wallet on a libre currency, like Äž1",
   "background": {
     "scripts": ["background.js"]
diff --git a/scss/ionic.app.scss b/scss/ionic.app.scss
index f03116338..c26db8b3b 100644
--- a/scss/ionic.app.scss
+++ b/scss/ionic.app.scss
@@ -2419,6 +2419,10 @@ body.demo {
   height: 204px;
 }
 
+.popover.popover-login-methods.auth.scan {
+  height: 252px;
+}
+
 @media (max-width: $screen-xs-max) {
   .popover.popover-login-methods {
     height: 256px;
diff --git a/www/js/config.js b/www/js/config.js
index 0027636ef..6240d63b8 100644
--- a/www/js/config.js
+++ b/www/js/config.js
@@ -70,14 +70,6 @@ angular.module("cesium.config", [])
 			"host": "g1.presles.fr",
 			"port": 443
 		},
-		{
-			"host": "g1.le-sou.org",
-			"port": 443
-		},
-		{
-			"host": "duniter.normandie-libre.fr",
-			"port": 443
-		},
 		{
 			"host": "g1.duniter.org",
 			"port": 443
@@ -101,10 +93,6 @@ angular.module("cesium.config", [])
 					"host": "g1.data.presles.fr",
 					"port": 443
 				},
-				{
-					"host": "g1.data.le-sou.org",
-					"port": 443
-				},
 				{
 					"host": "g1.data.mithril.re",
 					"port": 443
@@ -120,7 +108,7 @@ angular.module("cesium.config", [])
 		}
 	},
 	"version": "1.6.12",
-	"build": "2021-03-03T20:44:36.248Z",
+	"build": "2021-04-26T21:45:11.899Z",
 	"newIssueUrl": "https://git.duniter.org/clients/cesium-grp/cesium/issues/new"
 })
 
diff --git a/www/js/services/device-services.js b/www/js/services/device-services.js
index a756a437d..51da188d0 100644
--- a/www/js/services/device-services.js
+++ b/www/js/services/device-services.js
@@ -230,14 +230,14 @@ angular.module('cesium.device.services', ['cesium.utils.services', 'cesium.setti
         }
       };
 
-      exports.isIOS = function() {
-        return !!navigator.userAgent.match(/iPhone | iPad | iPod/i) || ionic.Platform.isIOS();
-      };
-
       exports.isOSX = function() {
         return !!navigator.userAgent.match(/Macintosh/i) || ionic.Platform.is("osx");
       };
 
+      exports.isIOS = function() {
+        return !!navigator.userAgent.match(/iPhone | iPad | iPod/i) || (!!navigator.userAgent.match(/Mobile/i) && !!navigator.userAgent.match(/Macintosh/i)) || ionic.Platform.isIOS();
+      };
+
       exports.isDesktop = function() {
         if (!angular.isDefined(cache.isDesktop)) {
           try {
@@ -269,7 +269,7 @@ angular.module('cesium.device.services', ['cesium.utils.services', 'cesium.setti
             if (exports.enable){
               exports.camera.enable = !!navigator.camera;
               exports.keyboard.enable = cordova && cordova.plugins && !!cordova.plugins.Keyboard;
-              exports.barcode.enable = cordova && cordova.plugins && !!cordova.plugins.barcodeScanner && !exports.isOSX();
+              exports.barcode.enable = cordova && cordova.plugins && !!cordova.plugins.barcodeScanner && (!exports.isOSX() || exports.isIOS());
               exports.clipboard.enable = cordova && cordova.plugins && !!cordova.plugins.clipboard;
               exports.intent.enable = window && !!window.plugins.launchmyapp;
 
diff --git a/www/manifest.json b/www/manifest.json
index df7030dba..6a2303881 100644
--- a/www/manifest.json
+++ b/www/manifest.json
@@ -2,7 +2,7 @@
   "short_name": "Cesium",
   "name": "Cesium",
   "manifest_version": 1,
-  "version": "1.6.12",
+  "version": "1.6.13",
   "default_locale": "fr",
   "description": "Cesium Wallet for Äž1 libre currency",
   "icons": [
diff --git a/www/templates/login/popover_methods.html b/www/templates/login/popover_methods.html
index 3c0a5dde7..15252f6bb 100644
--- a/www/templates/login/popover_methods.html
+++ b/www/templates/login/popover_methods.html
@@ -1,5 +1,5 @@
 <ion-popover-view class="fit has-header popover-login-methods"
-  ng-class="{'auth': isAuth}">
+  ng-class="{'auth': isAuth, 'scan': $root.device.barcode.enable}">
   <ion-header-bar>
     <h1 class="title" translate>LOGIN.METHOD_POPOVER_TITLE</h1>
   </ion-header-bar>
-- 
GitLab