From e7d8421c4d23f9d2cb6ad5fd3fb59f60f0601ee5 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Sat, 22 Nov 2014 15:51:58 -0300 Subject: [PATCH 1/6] Remove shell dependences. Remove unnecessary plugins. Remove unnecessary directives --- Gruntfile.js | 1 - cordova/android/config.xml | 40 ---------------- cordova/ios/Copay-Info.plist | 83 --------------------------------- js/controllers/history.js | 4 -- js/controllers/import.js | 8 ---- js/controllers/importProfile.js | 7 --- js/controllers/receive.js | 6 --- js/directives.js | 10 ---- js/mobile.js | 9 ---- js/services/backupService.js | 19 -------- views/receive.html | 4 +- 11 files changed, 1 insertion(+), 190 deletions(-) delete mode 100644 cordova/android/config.xml delete mode 100644 cordova/ios/Copay-Info.plist diff --git a/Gruntfile.js b/Gruntfile.js index 21b799ac7..15deb7e92 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -115,7 +115,6 @@ module.exports = function(grunt) { vendors: { src: [ 'lib/mousetrap/mousetrap.min.js', - 'js/shell.js', // shell must be loaded before moment due to the way moment loads in a commonjs env 'lib/moment/min/moment.min.js', 'lib/qrcode-generator/js/qrcode.js', 'lib/lodash/dist/lodash.js', diff --git a/cordova/android/config.xml b/cordova/android/config.xml deleted file mode 100644 index c9941d97a..000000000 --- a/cordova/android/config.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - Copay - - A secure bitcoin wallet for friends and companies. - - - Bitpay Inc. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/cordova/ios/Copay-Info.plist b/cordova/ios/Copay-Info.plist deleted file mode 100644 index c619115c1..000000000 --- a/cordova/ios/Copay-Info.plist +++ /dev/null @@ -1,83 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleDisplayName - ${PRODUCT_NAME} - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIconFile - icon.png - CFBundleIcons - - CFBundlePrimaryIcon - - CFBundleIconFiles - - icon-40 - icon-small - icon-60 - icon.png - icon@2x - icon-72 - icon-72@2x - - UIPrerenderedIcon - - - - CFBundleIcons~ipad - - CFBundlePrimaryIcon - - CFBundleIconFiles - - icon-small - icon-40 - icon-50 - icon-76 - icon-60 - icon - icon@2x - icon-72 - icon-72@2x - - UIPrerenderedIcon - - - - CFBundleIdentifier - com.bitpay.copay - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - APPL - CFBundleShortVersionString - 0.6.4 - CFBundleSignature - ???? - CFBundleVersion - 0.6.4 - LSRequiresIPhoneOS - - NSMainNibFile - - NSMainNibFile~ipad - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeRight - - - diff --git a/js/controllers/history.js b/js/controllers/history.js index 911659760..770bae7c5 100644 --- a/js/controllers/history.js +++ b/js/controllers/history.js @@ -29,10 +29,6 @@ angular.module('copayApp.controllers').controller('HistoryController', $scope.downloadHistory = function() { - if (window.cordova) { - log.info('Not available on mobile'); - return; - } var w = $rootScope.wallet; if (!w) return; diff --git a/js/controllers/import.js b/js/controllers/import.js index 9c802fa0c..b7ecf09bc 100644 --- a/js/controllers/import.js +++ b/js/controllers/import.js @@ -18,14 +18,6 @@ angular.module('copayApp.controllers').controller('ImportController', $scope.$digest(); } - $scope.openFileDialog = function() { - if (window.cshell) { - return cshell.send('backup:import'); - } - $scope.choosefile = !$scope.choosefile; - }; - - $scope._doImport = function(encryptedObj, password) { updateStatus('Importing wallet - Procesing backup...'); diff --git a/js/controllers/importProfile.js b/js/controllers/importProfile.js index fe9a292a3..016308052 100644 --- a/js/controllers/importProfile.js +++ b/js/controllers/importProfile.js @@ -46,13 +46,6 @@ angular.module('copayApp.controllers').controller('ImportProfileController', }); }; - $scope.openFileDialog = function() { - if (window.cshell) { - return cshell.send('backup:import'); - } - $scope.choosefile = !$scope.choosefile; - }; - $scope.getFile = function() { // If we use onloadend, we need to check the readyState. reader.onloadend = function(evt) { diff --git a/js/controllers/receive.js b/js/controllers/receive.js index c7f860403..a701c0392 100644 --- a/js/controllers/receive.js +++ b/js/controllers/receive.js @@ -25,12 +25,6 @@ angular.module('copayApp.controllers').controller('ReceiveController', $scope.openAddressModal = function(address) { var ModalInstanceCtrl = function($scope, $modalInstance, address) { $scope.address = address; - $scope.isMobile = !!window.cordova; - - $scope.mobileCopy = function(address) { - window.cordova.plugins.clipboard.copy(address); - window.plugins.toast.showShortBottom('Copied to clipboard'); - }; $scope.cancel = function() { $modalInstance.dismiss('cancel'); diff --git a/js/directives.js b/js/directives.js index e24748362..262cb719e 100644 --- a/js/directives.js +++ b/js/directives.js @@ -264,16 +264,6 @@ angular.module('copayApp.directives') } }; }) - .directive('openExternal', function() { - return { - restrict: 'A', - link: function(scope, element, attrs) { - element.bind('click', function() { - window.open('bitcoin:' + attrs.address, '_blank'); - }); - } - } - }) // From https://gist.github.com/asafge/7430497 .directive('ngReallyClick', [ diff --git a/js/mobile.js b/js/mobile.js index b8d28931c..8da5a66e6 100644 --- a/js/mobile.js +++ b/js/mobile.js @@ -14,13 +14,4 @@ function onDeviceReady() { }, false); - - function handleBitcoinURI(url) { - if (!url) return; - window.location = '#!/uri-payment/' + url; - } - - window.plugins.webintent.getUri(handleBitcoinURI); - window.plugins.webintent.onNewIntent(handleBitcoinURI); - window.handleOpenURL = handleBitcoinURI; } diff --git a/js/services/backupService.js b/js/services/backupService.js index d903a0bf9..775b25be3 100644 --- a/js/services/backupService.js +++ b/js/services/backupService.js @@ -14,25 +14,6 @@ BackupService.prototype._download = function(ew, walletName, filename) { type: 'text/plain;charset=utf-8' }); - - // show a native save dialog if we are in the shell - // and pass the wallet to the shell to convert to node Buffer - if (window.cshell) { - return window.cshell.send('backup:download', { - name: walletName, - wallet: ew - }); - } - - // throw an email intent if we are in the mobile version - if (window.cordova) { - var name = wallet.name ? wallet.name + ' ' : ''; - return window.plugin.email.open({ - subject: 'Copay - ' + name + 'Wallet ' + 'Backup', - body: 'Here is the encrypted backup of the wallet ' + wallet.id, - attachments: ['base64:' + filename + '//' + btoa(ew)] - }); - } this.notifications.success('Backup created', 'Encrypted backup file saved'); // otherwise lean on the browser implementation diff --git a/views/receive.html b/views/receive.html index 6ec2c7fe3..50a11468e 100644 --- a/views/receive.html +++ b/views/receive.html @@ -11,9 +11,7 @@
- - - + change
From dc225710257613c59e40491206e2e8ff57daec00 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Sat, 22 Nov 2014 15:52:46 -0300 Subject: [PATCH 2/6] fix message error when click on open camera --- views/send.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/views/send.html b/views/send.html index 2b2d03b2c..b02f73230 100644 --- a/views/send.html +++ b/views/send.html @@ -50,10 +50,10 @@
- +
- +
From 14a86ecccc4b271487c487fa7e925d9887b15819 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Sat, 22 Nov 2014 15:53:18 -0300 Subject: [PATCH 3/6] Fix mobile/desktop notifications. Fix popup QR-Code --- css/src/main.css | 31 ++++++++++++++----------------- css/src/mobile.css | 36 ++++++++++++++++++++++++++++++++++++ views/modals/qr-address.html | 31 +++++++++++++++---------------- 3 files changed, 65 insertions(+), 33 deletions(-) diff --git a/css/src/main.css b/css/src/main.css index 238d2b2e6..2055ae555 100644 --- a/css/src/main.css +++ b/css/src/main.css @@ -140,7 +140,8 @@ header .alt-currency { right: 14px; width: 220px; list-style-type: none; - top: 47px;nt + top: 47px; + z-index: 10001; } .head .menu ul li.divider { @@ -666,7 +667,7 @@ input[type=number]::-webkit-outer-spin-button { } .dr-notification-container.top { - top: 20px; + top: 60px; } .dr-notification-container.center { @@ -675,15 +676,14 @@ input[type=number]::-webkit-outer-spin-button { } .dr-notification-wrapper { - width: 360px; + width: 400px; position: relative; - margin: 10px 0; + margin: 0 0 1px 0; } .dr-notification { - width: 360px; + width: 400px; clear: both; - height: 90px; overflow: hidden; } @@ -694,17 +694,15 @@ input[type=number]::-webkit-outer-spin-button { border-radius: 20px; display: inline-block; padding: 5px; - font-size: 12px; + font-size: 18px; position: absolute; - right: 350px; - top: -8px; + right: 5px; + top: 5px; cursor: pointer; z-index: 10; } .dr-notification-image { - width: 80px; - height: 90px; float: left; display: block; font-size: 40px; @@ -715,7 +713,7 @@ input[type=number]::-webkit-outer-spin-button { .dr-notification-image i { display: block; width: 100%; - padding-top: 20px; + padding: 20px; } .dr-notification-image img { margin: 15px; @@ -724,15 +722,16 @@ input[type=number]::-webkit-outer-spin-button { } .dr-notification-content { - padding-left: 90px; - padding-right: 10px; + padding-left: 80px; + padding-right: 30px; padding-top: 5px; + padding-bottom: 5px; } .dr-notification-title { color: white; padding: 0px; - font-size: 18px; + font-size: 16px; margin-top: 0; } @@ -740,8 +739,6 @@ input[type=number]::-webkit-outer-spin-button { background-color: #34495E; color: #eee; border: 1px solid #2C3E50; - opacity: 0.9; - } .dr-notification-close-btn { background-color: #34495E; diff --git a/css/src/mobile.css b/css/src/mobile.css index e8143b0b4..098bb79c8 100644 --- a/css/src/mobile.css +++ b/css/src/mobile.css @@ -183,5 +183,41 @@ margin-top: 10px; } + /* notifications */ + + .dr-notification { + width: 100%; + } + + .dr-notification-container { + width: 100%; + } + + .dr-notification-container.top { + top: 2.813rem; + } + + .dr-notification-wrapper { + width: 100%; + margin: 0; + } + + .dr-notification-close-btn { + font-size: 20px; + } + + .dr-notification-image { + font-size: 30px; + } + + .dr-notification-text { + font-size: 10px; + line-height: 100%; + } + + .dr-notification-image i { + padding: 15px; + } + } diff --git a/views/modals/qr-address.html b/views/modals/qr-address.html index 5f7d990c3..fb82d6b03 100644 --- a/views/modals/qr-address.html +++ b/views/modals/qr-address.html @@ -1,22 +1,21 @@
- + -
-

{{address.address}}

- - - -

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

+
+ {{address.address}} change +
+ + ({{label}}) + +

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

-
- - - Open in external application - -
× From 2a9ccd53f4d9a2ff0dc413f71e1aee7ec4feef46 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Sat, 22 Nov 2014 16:38:00 -0300 Subject: [PATCH 4/6] cleaning dist folder --- dist/README.md | 1 - 1 file changed, 1 deletion(-) delete mode 100644 dist/README.md diff --git a/dist/README.md b/dist/README.md deleted file mode 100644 index 1d883f95d..000000000 --- a/dist/README.md +++ /dev/null @@ -1 +0,0 @@ -This is the destination directory for the built atom-shell binaries and the files used to create them \ No newline at end of file From e1fd75b262561c148510b970981677fa65825f41 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Sat, 22 Nov 2014 17:34:28 -0300 Subject: [PATCH 5/6] New bottom bar menu for small devices --- css/src/mobile.css | 20 ++++++++++++++++++++ index.html | 5 +++++ views/includes/bottombar-mobile.html | 13 +++++++++++++ views/includes/sidebar-mobile.html | 25 ++++++++++--------------- 4 files changed, 48 insertions(+), 15 deletions(-) create mode 100644 views/includes/bottombar-mobile.html diff --git a/css/src/mobile.css b/css/src/mobile.css index 098bb79c8..e5a32430f 100644 --- a/css/src/mobile.css +++ b/css/src/mobile.css @@ -39,6 +39,15 @@ background: #3C4E60; } + .bottom-bar { + display: block; + position: fixed; + bottom: 0; + width: 100%; + z-index: 5; + background: #3C4E60; + } + .left-off-canvas-menu { background: #2C3E50; } @@ -89,6 +98,17 @@ opacity: 0.6; } + .bottombar-item a { + color: #fff; + padding: 4px 0; + display: block; + } + + .bottombar-item a.active { + color: #000; + background-color: #fff; + } + .box-founds { background-color: #213140; } diff --git a/index.html b/index.html index 41424f99e..307d2b898 100644 --- a/index.html +++ b/index.html @@ -85,6 +85,11 @@
+
+
+
+
diff --git a/views/includes/bottombar-mobile.html b/views/includes/bottombar-mobile.html new file mode 100644 index 000000000..08436ba85 --- /dev/null +++ b/views/includes/bottombar-mobile.html @@ -0,0 +1,13 @@ + + diff --git a/views/includes/sidebar-mobile.html b/views/includes/sidebar-mobile.html index 6e5d61498..bcd29abf4 100644 --- a/views/includes/sidebar-mobile.html +++ b/views/includes/sidebar-mobile.html @@ -22,10 +22,7 @@
-

You do not have another wallets. Creates one more from link below.

-
- -
+

You do not have another wallets.

    From cdca0fb01445e7523c3438004bcc354322d8a08c Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Sat, 22 Nov 2014 17:36:19 -0300 Subject: [PATCH 6/6] Enhancement of mobile files generation. Created a dist folder with all compressed files --- .gitignore | 1 + Gruntfile.js | 25 +++++++++++++++++++++++++ cordova/android/AndroidManifest.xml | 7 ------- cordova/build.sh | 26 +++++--------------------- cordova/config.xml | 11 +++++++++-- package.json | 7 ++++--- 6 files changed, 44 insertions(+), 33 deletions(-) diff --git a/.gitignore b/.gitignore index 3081abfaa..f075c785b 100644 --- a/.gitignore +++ b/.gitignore @@ -75,6 +75,7 @@ shell/scripts/build dist/darwin dist/linux dist/windows +dist/web dist/*.dmg dist/*.tar.gz dist/*.exe diff --git a/Gruntfile.js b/Gruntfile.js index 15deb7e92..16d9661f5 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -200,6 +200,30 @@ module.exports = function(grunt) { } }, }, + copy: { + dist: { + files: [ + { + src: [ + 'index.html', + 'init.js', + 'config.js', + 'css/vendors.min.css', + 'css/copay.min.css', + 'js/copayBundle.js', + 'js/copayMain.js', + 'lib/vendors.js', + 'lib/angularjs-all.js', + 'font/**', + 'img/**', + 'sound/**', + 'views/**' + ], + dest: 'dist/web/' + } + ], + }, + }, jsdoc: { dist: { src: ['js/models/*.js', 'js/plugins/*.js'], @@ -215,6 +239,7 @@ module.exports = function(grunt) { grunt.registerTask('default', ['shell:dev', 'nggettext_compile', 'concat', 'cssmin']); + grunt.registerTask('dist', ['shell:prod', 'nggettext_compile', 'concat', 'cssmin', 'uglify', 'copy:dist']); grunt.registerTask('prod', ['shell:prod', 'nggettext_compile', 'concat', 'cssmin', 'uglify']); grunt.registerTask('translate', ['nggettext_extract']); grunt.registerTask('docs', ['jsdoc']); diff --git a/cordova/android/AndroidManifest.xml b/cordova/android/AndroidManifest.xml index 1d6f7e67b..022e657be 100644 --- a/cordova/android/AndroidManifest.xml +++ b/cordova/android/AndroidManifest.xml @@ -8,12 +8,6 @@ - - - - - - @@ -33,7 +27,6 @@ - diff --git a/cordova/build.sh b/cordova/build.sh index d9cb38b15..53023e373 100755 --- a/cordova/build.sh +++ b/cordova/build.sh @@ -67,39 +67,26 @@ if [ ! -d $PROJECT ]; then fi echo "${OpenColor}${Green}* Installing plugins... ${CloseColor}" - cordova plugin add https://github.com/Initsogar/cordova-webintent.git - checkOK - + cordova plugin add https://github.com/wildabeast/BarcodeScanner.git checkOK - cordova plugin add https://github.com/VersoSolutions/CordovaClipboard - checkOK - - cordova plugin add de.appplant.cordova.plugin.email-composer && cordova prepare - checkOK - - cordova plugin add https://github.com/EddyVerbruggen/Toast-PhoneGap-Plugin.git && cordova prepare - checkOK - cordova plugin add org.apache.cordova.splashscreen checkOK cordova plugin add org.apache.cordova.statusbar checkOK - cordova plugin add https://github.com/EddyVerbruggen/LaunchMyApp-PhoneGap-Plugin.git --variable URL_SCHEME=bitcoin - checkOK fi echo "${OpenColor}${Green}* Generating copay bundle...${CloseColor}" cd $BUILDDIR/.. -grunt +grunt dist checkOK echo "${OpenColor}${Green}* Coping files...${CloseColor}" cd $BUILDDIR/.. -cp -af {css,font,img,js,lib,sound,views,config.js,version.js,init.js} $PROJECT/www +cp -af dist/web/** $PROJECT/www checkOK sed "s/<\!-- PLACEHOLDER: CORDOVA SRIPT -->/