From 3d870e976a9f0cb79d3f7c734442fd9c2bbaccf5 Mon Sep 17 00:00:00 2001
From: blavenie <benoit.lavenier@e-is.pro>
Date: Wed, 6 Sep 2017 16:10:45 +0200
Subject: [PATCH] [fix] Copy pubkey using a clipboard cordova plugin - fix #552

---
 package.json                                          | 3 ++-
 www/i18n/locale-fr-FR.json                            | 2 +-
 www/js/directives.js                                  | 2 +-
 www/js/services/device-services.js                    | 5 +++--
 www/plugins/es/js/controllers/registry-controllers.js | 4 ++--
 5 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/package.json b/package.json
index d2e14bc0..6034216c 100644
--- a/package.json
+++ b/package.json
@@ -110,7 +110,8 @@
       "id": "phonegap-plugin-barcodescanner"
     },
     "cordova-plugin-inappbrowser",
-    "cordova-plugin-x-toast"
+    "cordova-plugin-x-toast",
+    "cordova-clipboard"
   ],
   "cordovaPlatforms": [
     "android",
diff --git a/www/i18n/locale-fr-FR.json b/www/i18n/locale-fr-FR.json
index 81c59f4f..c58d0f52 100644
--- a/www/i18n/locale-fr-FR.json
+++ b/www/i18n/locale-fr-FR.json
@@ -656,7 +656,7 @@
     "CERTIFICATION_DONE": "Certification envoyée",
     "NOT_ENOUGH_CREDIT": "Crédit insuffisant",
     "TRANSFER_SENT": "Virement envoyé",
-    "COPY_TO_CLIPBOARD_DONE": "Copie effectuée",
+    "COPY_TO_CLIPBOARD_DONE": "Copié dans le presse-papier",
     "MEMBERSHIP_OUT_SENT": "Résiliation envoyée",
     "NOT_NEED_MEMBERSHIP": "Vous êtes déjà membre.",
     "IDENTITY_WILL_MISSING_CERTIFICATIONS": "Cette identité va bientôt manquer de certification (au moins {{willNeedCertificationCount}}).",
diff --git a/www/js/directives.js b/www/js/directives.js
index f7f9c58e..5749e74b 100644
--- a/www/js/directives.js
+++ b/www/js/directives.js
@@ -73,7 +73,7 @@ angular.module('cesium.directives', [])
             // copy to clipboard
             Device.clipboard.copy(value)
               .then(function(){
-                UIUtils.toast.show('INFO.COPY_TO_CLIPBOARD_DONE');
+                 UIUtils.toast.show('INFO.COPY_TO_CLIPBOARD_DONE');
               })
               .catch(UIUtils.onError('ERROR.COPY_CLIPBOARD'));
           }
diff --git a/www/js/services/device-services.js b/www/js/services/device-services.js
index 8bfe85de..799818d1 100644
--- a/www/js/services/device-services.js
+++ b/www/js/services/device-services.js
@@ -158,13 +158,14 @@ angular.module('cesium.device.services', ['cesium.utils.services', 'cesium.setti
               exports.camera.enable = !!navigator.camera;
               exports.keyboard.enable = cordova && cordova.plugins && !!cordova.plugins.Keyboard;
               exports.barcode.enable = cordova && cordova.plugins && !!cordova.plugins.barcodeScanner;
+              exports.clipboard.enable = cordova && cordova.plugins && !!cordova.plugins.clipboard;
 
               if (exports.keyboard.enable) {
                 angular.extend(exports.keyboard, cordova.plugins.Keyboard);
               }
 
-              console.debug('[device] Ionic platform ready, with [camera: {0}] [barcode scanner: {1}] [keyboard: {2}]'
-                .format(exports.camera.enable, exports.barcode.enable, exports.keyboard.enable));
+              console.debug('[device] Ionic platform ready, with [camera: {0}] [barcode scanner: {1}] [keyboard: {2}] [clipboard: {3}]'
+                .format(exports.camera.enable, exports.barcode.enable, exports.keyboard.enable, exports.clipboard.enable));
 
               if (cordova.InAppBrowser) {
                 console.debug('[device] Enabling InAppBrowser');
diff --git a/www/plugins/es/js/controllers/registry-controllers.js b/www/plugins/es/js/controllers/registry-controllers.js
index 82f858b3..f43e87cc 100644
--- a/www/plugins/es/js/controllers/registry-controllers.js
+++ b/www/plugins/es/js/controllers/registry-controllers.js
@@ -634,8 +634,8 @@ function ESRegistryRecordEditController($scope, esRegistry, UIUtils, $state, $q,
         }
         else {
           if (json.thumbnail) {
-            // FIXME: this is a workaround to allow content deletion
-            // Is it a bug in the ES attachment-mapper ?
+            // Workaround to allow content deletion, because of a bug in the ES attachment-mapper:
+            // get error (in ES node) : MapperParsingException[No content is provided.] - AttachmentMapper.parse(AttachmentMapper.java:471
             json.thumbnail = {
               _content: '',
               _content_type: ''
-- 
GitLab