Remove shell dependences. Remove unnecessary plugins. Remove unnecessary directives

This commit is contained in:
Gustavo Maximiliano Cortez 2014-11-22 15:51:58 -03:00
commit e7d8421c4d
11 changed files with 1 additions and 190 deletions

View file

@ -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;

View file

@ -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...');

View file

@ -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) {

View file

@ -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');

View file

@ -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', [

View file

@ -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;
}

View file

@ -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