Merge pull request #2404 from cmgustavo/feature/copy-secret-masterpk

ACK
This commit is contained in:
Matias Pando 2015-02-09 12:35:44 -03:00
commit 7ed269ac2f
11 changed files with 69 additions and 26 deletions

View file

@ -1,12 +1,13 @@
'use strict';
angular.module('copayApp.controllers').controller('CopayersController',
function($scope, $rootScope, $timeout, go, identityService, notification) {
function($scope, $rootScope, $timeout, go, identityService, notification, isCordova) {
var w = $rootScope.wallet;
$scope.init = function() {
$rootScope.title = 'Share this secret with your copayers';
$scope.loading = false;
$scope.secret = $rootScope.wallet.getSecret();
$scope.isCordova = isCordova;
w.on('publicKeyRingUpdated', $scope.updateList);
w.on('ready', $scope.updateList);
@ -48,4 +49,20 @@ angular.module('copayApp.controllers').controller('CopayersController',
});
};
$scope.copySecret = function(secret) {
if (isCordova) {
window.cordova.plugins.clipboard.copy(secret);
window.plugins.toast.showShortCenter('Copied to clipboard');
}
};
$scope.shareSecret = function(secret) {
if (isCordova) {
if (isMobile.Android() || isMobile.Windows()) {
window.ignoreMobilePause = true;
}
window.plugins.socialsharing.share(secret, null, null, null);
}
};
});

View file

@ -137,6 +137,13 @@ angular.module('copayApp.controllers').controller('MoreController',
});
};
$scope.copyText = function(text) {
if (isCordova) {
window.cordova.plugins.clipboard.copy(text);
window.plugins.toast.showShortCenter('Copied to clipboard');
}
};
$scope.downloadWalletBackup = function() {
backupService.walletDownload(w);
};