This commit is contained in:
Matias Alejo Garcia 2014-09-04 16:23:37 -03:00
commit 9ad326cd30
8 changed files with 20 additions and 22 deletions

View file

@ -53,12 +53,14 @@ var defaultConfig = {
verbose: 1, verbose: 1,
plugins: { plugins: {
// LocalStorage: true, LocalStorage: true,
GoogleDrive: true, // GoogleDrive: true,
}, },
GoogleDrive: { GoogleDrive: {
clientId: '232630733383-29u1khqf5i8qubhf0homhpb2m14b5lja.apps.googleusercontent.com', // for localhost:
clientId: '232630733383-a35gcnovnkgka94394i88gq60vtjb4af.apps.googleusercontent.com',
// clientId: '232630733383-29u1khqf5i8qubhf0homhpb2m14b5lja.apps.googleusercontent.com',
home: 'copay' home: 'copay'
}, },
}; };

View file

@ -4,10 +4,10 @@ angular.module('copayApp.controllers').controller('HomeController', function($sc
controllerUtils.redirIfLogged(); controllerUtils.redirIfLogged();
$scope.loading = true; $scope.retreiving = true;
walletFactory.getWallets(function(ret) { walletFactory.getWallets(function(ret) {
$scope.loading = false; $scope.retreiving = false;
$scope.hasWallets = (ret && ret.length > 0) ? true : false; $scope.hasWallets = (ret && ret.length > 0) ? true : false;
}); });
}); });

View file

@ -14,6 +14,7 @@ angular.module('copayApp.controllers').controller('OpenController', function($sc
}; };
$rootScope.fromSetup = false; $rootScope.fromSetup = false;
$scope.loading = false; $scope.loading = false;
$scope.retreiving = true;
walletFactory.getWallets(function(wallets) { walletFactory.getWallets(function(wallets) {
$scope.wallets = wallets.sort(cmp); $scope.wallets = wallets.sort(cmp);
@ -23,6 +24,7 @@ angular.module('copayApp.controllers').controller('OpenController', function($sc
walletFactory.storage.getLastOpened(function(ret) { walletFactory.storage.getLastOpened(function(ret) {
$scope.selectedWalletId = ret || ($scope.wallets[0] && $scope.wallets[0].id); $scope.selectedWalletId = ret || ($scope.wallets[0] && $scope.wallets[0].id);
$scope.retreiving = false;
}); });
}); });

View file

@ -83,7 +83,6 @@ Storage.prototype.getGlobal = function(k, cb) {
preconditions.checkArgument(cb); preconditions.checkArgument(cb);
this.storage.getItem(k, function(item) { this.storage.getItem(k, function(item) {
console.log('[Storage.js.96:item:]',item); //TODO
cb(item == 'undefined' ? undefined : item); cb(item == 'undefined' ? undefined : item);
}); });
}; };
@ -121,9 +120,7 @@ Storage.prototype.get = function(walletId, k, cb) {
Storage.prototype._readHelper = function(walletId, k, cb) { Storage.prototype._readHelper = function(walletId, k, cb) {
console.log('[Storage.js.134:walletId:]',walletId,k); //TODO
var wk = this._key(walletId, k); var wk = this._key(walletId, k);
this._read(wk, function(v){ this._read(wk, function(v){
return cb(v,k); return cb(v,k);
}); });
@ -141,10 +138,7 @@ console.log('[Storage.js.142:keys:]',keys); //TODO
for (var ii in keys) { for (var ii in keys) {
this._readHelper(walletId, keys[ii], function(v, k) { this._readHelper(walletId, keys[ii], function(v, k) {
ret[k] = v; ret[k] = v;
console.log('[Storage.js.144:ret:]',k,i,l,v); //TODO
if (++i == l) { if (++i == l) {
console.log('[Storage.js.157] LKIST', ret); //TODO
return cb(ret); return cb(ret);
} }
}); });
@ -174,11 +168,9 @@ Storage.prototype.getWalletIds = function(cb) {
var uniq = {}; var uniq = {};
this.storage.allKeys(function(keys) { this.storage.allKeys(function(keys) {
console.log('[Storage.js.170:keys:]',keys); //TODO
for (var ii in keys) { for (var ii in keys) {
var key = keys[ii]; var key = keys[ii];
console.log('[Storage.js.174:key:]',key); //TODO
var split = key.split('::'); var split = key.split('::');
if (split.length == 2) { if (split.length == 2) {
var walletId = split[0]; var walletId = split[0];
@ -201,20 +193,17 @@ Storage.prototype.getWallets = function(cb) {
var self = this; var self = this;
this.getWalletIds(function(ids) { this.getWalletIds(function(ids) {
console.log('[Storage.js.197:ids:]',ids); //TODO
var l = ids.length, i=0; var l = ids.length, i=0;
if (!l) if (!l)
return cb([]); return cb([]);
for (var ii in ids) { for (var ii in ids) {
var id = ids[ii]; var id = ids[ii];
console.log('[Storage.js.206:id:]',id); //TODO
self.getName(id, function(name) { self.getName(id, function(name) {
wallets.push({ wallets.push({
id: id, id: id,
name: name, name: name,
}); });
console.log('[Storage.js.208:wallets:]',wallets); //TODO
if (++i == l) { if (++i == l) {
return cb(wallets); return cb(wallets);
} }

View file

@ -1,7 +1,5 @@
'use strict'; 'use strict';
angular.module('copayApp.services').factory('walletFactory', function(pluginManager){ angular.module('copayApp.services').factory('walletFactory', function(pluginManager){
console.log('[walletFactory.js.3]'); //TODO
return new copay.WalletFactory(config, copay.version, pluginManager); return new copay.WalletFactory(config, copay.version, pluginManager);
}); });

View file

@ -5,7 +5,6 @@ function LocalStorage() {
}; };
LocalStorage.prototype.init = function() { LocalStorage.prototype.init = function() {
console.log(' init LocalStorage'); //TODO
}; };

View file

@ -1,5 +1,9 @@
<div class="home" ng-controller="HomeController"> <div class="home" ng-controller="HomeController">
<div class="row"> <div data-alert class="loading-screen" ng-show="retreiving">
<i class="size-60 fi-bitcoin-circle icon-rotate spinner"></i>
Retreiving information from storage...
</div>
<div class="row" ng-show="!loading">
<div class="large-4 columns logo-setup"> <div class="large-4 columns logo-setup">
<img src="img/logo-negative-beta.svg" alt="Copay" width="146" height="59"> <img src="img/logo-negative-beta.svg" alt="Copay" width="146" height="59">
<div ng-include="'views/includes/version.html'"></div> <div ng-include="'views/includes/version.html'"></div>

View file

@ -1,9 +1,13 @@
<div class="open" ng-controller="OpenController"> <div class="open" ng-controller="OpenController">
<div data-alert class="loading-screen" ng-show="loading && !failure"> <div data-alert class="loading-screen" ng-show="retreiving">
<i class="size-60 fi-bitcoin-circle icon-rotate spinner"></i>
Retreiving information from storage...
</div>
<div data-alert class="loading-screen" ng-show="loading && !failure && !retreiving">
<i class="size-60 fi-bitcoin-circle icon-rotate spinner"></i> <i class="size-60 fi-bitcoin-circle icon-rotate spinner"></i>
<span translate>Connecting...</span> <span translate>Connecting...</span>
</div> </div>
<div class="row" ng-show="!loading"> <div class="row" ng-show="!loading && !retreiving">
<div class="large-4 columns logo-setup"> <div class="large-4 columns logo-setup">
<img src="img/logo-negative-beta.svg" alt="Copay" width="146" height="59"> <img src="img/logo-negative-beta.svg" alt="Copay" width="146" height="59">
<div ng-include="'views/includes/version.html'"></div> <div ng-include="'views/includes/version.html'"></div>