From e19185139e15d173a6f65443ba204b81482861db Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Tue, 7 Oct 2014 16:37:22 -0300 Subject: [PATCH 1/3] Import backup from a plain text only for iOS --- css/src/main.css | 1 + js/controllers/import.js | 13 +++++++------ views/import.html | 20 +++++++++++++++++--- 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/css/src/main.css b/css/src/main.css index efae2e357..d0a1881d3 100644 --- a/css/src/main.css +++ b/css/src/main.css @@ -167,6 +167,7 @@ a:hover { .join input, .setup input, .import input, +.import textarea, .settings input { background: #2C3E50 !important; -moz-box-shadow: inset 0px 0px 3px 0px rgba(0,0,0,0.10) !important; diff --git a/js/controllers/import.js b/js/controllers/import.js index 58b3227f9..4c10279e4 100644 --- a/js/controllers/import.js +++ b/js/controllers/import.js @@ -1,12 +1,13 @@ 'use strict'; angular.module('copayApp.controllers').controller('ImportController', - function($scope, $rootScope, $location, walletFactory, controllerUtils, Passphrase, notification) { + function($scope, $rootScope, $location, walletFactory, controllerUtils, Passphrase, notification, isMobile) { controllerUtils.redirIfLogged(); $scope.title = 'Import a backup'; $scope.importStatus = 'Importing wallet - Reading backup...'; $scope.hideAdv = true; + $scope.is_iOS = isMobile.iOS(); var reader = new FileReader(); @@ -69,10 +70,6 @@ angular.module('copayApp.controllers').controller('ImportController', $scope.choosefile = !$scope.choosefile; }; - $scope.openPasteArea = function() { - $scope.pastetext = !$scope.pastetext; - }; - $scope.getFile = function() { // If we use onloadend, we need to check the readyState. reader.onloadend = function(evt) { @@ -93,9 +90,10 @@ angular.module('copayApp.controllers').controller('ImportController', } var backupFile = $scope.file; + var backupText = form.backupText.$modelValue; var password = form.password.$modelValue; - if (!backupFile) { + if (!backupFile && !backupText) { $scope.loading = false; notification.error('Error', 'Please, select your backup file'); $scope.loading = false; @@ -105,5 +103,8 @@ angular.module('copayApp.controllers').controller('ImportController', if (backupFile) { reader.readAsBinaryString(backupFile); } + else { + _importBackup(backupText); + } }; }); diff --git a/views/import.html b/views/import.html index d88c49353..60515968f 100644 --- a/views/import.html +++ b/views/import.html @@ -15,9 +15,23 @@

{{title|translate}}

- Choose backup file from your computer - +
+ + Choose backup file from your computer + + +
+ +
+ + +
From 923455ab31d189a15e94998699944d33b5f276a8 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Tue, 7 Oct 2014 18:35:22 -0300 Subject: [PATCH 2/3] Fix style for small devices --- css/src/mobile.css | 16 ++++++++++++++++ views/import.html | 9 +++------ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/css/src/mobile.css b/css/src/mobile.css index 158b9f5b4..b36b42fbe 100644 --- a/css/src/mobile.css +++ b/css/src/mobile.css @@ -171,5 +171,21 @@ margin-bottom: 0; } + .button, button { + padding: 1rem 1.2rem 1.0625rem; + } + + form { + margin: 0; + } + + .box-setup { + margin-bottom: 50px; + } + + .footer-setup { + margin-bottom: 50px; + } + } diff --git a/views/import.html b/views/import.html index 60515968f..839950501 100644 --- a/views/import.html +++ b/views/import.html @@ -14,7 +14,6 @@

{{title|translate}}

-
Choose backup file from your computer @@ -34,18 +33,17 @@
- + - + Show Hide advanced options -
Skipping fields: {{skipFields}}
-
+
« Back
Show QR @@ -40,12 +40,12 @@ change
-

+ -

-

+ + {{addr.balance || 0|noFractionNumber}} {{$root.wallet.settings.unitName}} -

+
diff --git a/views/create.html b/views/create.html index 6524c6d44..860789b8c 100644 --- a/views/create.html +++ b/views/create.html @@ -12,8 +12,10 @@
- Step 1 - Step 2 + Step 1 + Step 2

Create new wallet

- + Show Hide advanced options @@ -52,7 +54,6 @@ -

@@ -77,7 +78,7 @@

(*) The limits are imposed by the bitcoin network.

-
+
« Back « Back
-

{{tx.createdTs | amCalendar}}

+ {{tx.createdTs | amCalendar}}
@@ -88,11 +88,9 @@ -
-

+

{{c.cId === $root.wallet.getMyCopayerId() ? 'Me' : $root.wallet.publicKeyRing.nicknameForCopayer(c.cId)}} -

-
+
diff --git a/views/join.html b/views/join.html index 48885172f..6388fcf3d 100644 --- a/views/join.html +++ b/views/join.html @@ -13,7 +13,7 @@

Join a Wallet in Creation

-
-
+
« Back
-
- + {{vin.value| noFractionNumber}} {{$root.wallet.settings.unitName}} -

+

-

+
@@ -76,8 +76,8 @@
-
- + {{vout.value| noFractionNumber}} {{$root.wallet.settings.unitName}} -

+

-

+