add controllers files to displaimer and splash
This commit is contained in:
parent
1ab9d8507f
commit
39e6a81b62
7 changed files with 74 additions and 62 deletions
|
|
@ -2,12 +2,14 @@
|
||||||
ng-if="agreed && index.hasProfile"
|
ng-if="agreed && index.hasProfile"
|
||||||
class="topbar-container"
|
class="topbar-container"
|
||||||
ng-include="'views/includes/topbar.html'"
|
ng-include="'views/includes/topbar.html'"
|
||||||
ng-init="titleSection='Terms of Use'; goBackToState = 'about'; noColor = true">
|
ng-init="titleSection='Terms of Use'; goBackToState = 'about'; noColor = true"
|
||||||
|
>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="content p20b" ng-class="{'disclaimer':!index.hasProfile}">
|
<div class="content p20b" ng-class="{'disclaimer':!index.hasProfile}" ng-controller="disclaimerController">
|
||||||
<h4 class="title m0" ng-show="!index.hasProfile">
|
<h4 class="title m0" ng-show="!index.hasProfile">
|
||||||
<span translate>Terms of Use</span>
|
<span translate>Terms of Use</span>
|
||||||
<logo class="right" width="40"></logo>
|
<logo class="right" width="40"></logo>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
<div class="splash content text-center" ng-if="!index.hasProfile">
|
<div class="splash content text-center" ng-if="!index.hasProfile" ng-controller="splashController">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="medium-centered small-centered large-centered columns">
|
<div class="medium-centered small-centered large-centered columns">
|
||||||
<div class="m20t">
|
<div class="m20t">
|
||||||
|
|
|
||||||
28
src/js/controllers/disclaimer.js
Normal file
28
src/js/controllers/disclaimer.js
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
angular.module('copayApp.controllers').controller('disclaimerController',
|
||||||
|
function($scope, $timeout, storageService, applicationService, go, gettextCatalog, isCordova) {
|
||||||
|
storageService.getCopayDisclaimerFlag(function(err, val) {
|
||||||
|
$scope.agreed = val;
|
||||||
|
$timeout(function() {
|
||||||
|
$scope.$digest();
|
||||||
|
}, 1);
|
||||||
|
});
|
||||||
|
|
||||||
|
$scope.agree = function() {
|
||||||
|
if (isCordova) {
|
||||||
|
window.plugins.spinnerDialog.show(null, gettextCatalog.getString('Loading...'), true);
|
||||||
|
}
|
||||||
|
$scope.loading = true;
|
||||||
|
$timeout(function() {
|
||||||
|
storageService.setCopayDisclaimerFlag(function(err) {
|
||||||
|
$timeout(function() {
|
||||||
|
if (isCordova) {
|
||||||
|
window.plugins.spinnerDialog.hide();
|
||||||
|
}
|
||||||
|
applicationService.restart();
|
||||||
|
}, 1000);
|
||||||
|
});
|
||||||
|
}, 100);
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
@ -273,7 +273,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
||||||
return cb(null, opts.walletStatus);
|
return cb(null, opts.walletStatus);
|
||||||
else {
|
else {
|
||||||
self.updateError = false;
|
self.updateError = false;
|
||||||
return fc.getStatus(function(err, ret) {
|
return fc.getStatus({}, function(err, ret) {
|
||||||
if (err) {
|
if (err) {
|
||||||
self.updateError = bwsError.msg(err, gettext('Could not update Wallet'));
|
self.updateError = bwsError.msg(err, gettext('Could not update Wallet'));
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
32
src/js/controllers/splash.js
Normal file
32
src/js/controllers/splash.js
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
angular.module('copayApp.controllers').controller('splashController',
|
||||||
|
function($scope, $timeout, $log, profileService, storageService, go) {
|
||||||
|
storageService.getCopayDisclaimerFlag(function(err, val) {
|
||||||
|
if (!val) go.path('disclaimer');
|
||||||
|
|
||||||
|
if (profileService.profile) {
|
||||||
|
go.walletHome();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$scope.create = function(noWallet) {
|
||||||
|
$scope.creatingProfile = true;
|
||||||
|
|
||||||
|
$timeout(function() {
|
||||||
|
profileService.create({
|
||||||
|
noWallet: noWallet
|
||||||
|
}, function(err) {
|
||||||
|
if (err) {
|
||||||
|
$scope.creatingProfile = false;
|
||||||
|
$log.warn(err);
|
||||||
|
$scope.error = err;
|
||||||
|
$scope.$apply();
|
||||||
|
$timeout(function() {
|
||||||
|
$scope.create(noWallet);
|
||||||
|
}, 3000);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, 100);
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
@ -81,35 +81,6 @@ angular
|
||||||
views: {
|
views: {
|
||||||
'main': {
|
'main': {
|
||||||
templateUrl: 'views/splash.html',
|
templateUrl: 'views/splash.html',
|
||||||
controller: function($scope, $timeout, $log, profileService, storageService, go) {
|
|
||||||
storageService.getCopayDisclaimerFlag(function(err, val) {
|
|
||||||
if (!val) go.path('disclaimer');
|
|
||||||
|
|
||||||
if (profileService.profile) {
|
|
||||||
go.walletHome();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$scope.create = function(noWallet) {
|
|
||||||
$scope.creatingProfile = true;
|
|
||||||
|
|
||||||
$timeout(function() {
|
|
||||||
profileService.create({
|
|
||||||
noWallet: noWallet
|
|
||||||
}, function(err) {
|
|
||||||
if (err) {
|
|
||||||
$scope.creatingProfile = false;
|
|
||||||
$log.warn(err);
|
|
||||||
$scope.error = err;
|
|
||||||
$scope.$apply();
|
|
||||||
$timeout(function() {
|
|
||||||
$scope.create(noWallet);
|
|
||||||
}, 3000);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}, 100);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -131,31 +102,6 @@ angular
|
||||||
views: {
|
views: {
|
||||||
'main': {
|
'main': {
|
||||||
templateUrl: 'views/disclaimer.html',
|
templateUrl: 'views/disclaimer.html',
|
||||||
controller: function($scope, $timeout, storageService, applicationService, go, gettextCatalog, isCordova) {
|
|
||||||
storageService.getCopayDisclaimerFlag(function(err, val) {
|
|
||||||
$scope.agreed = val;
|
|
||||||
$timeout(function() {
|
|
||||||
$scope.$digest();
|
|
||||||
}, 1);
|
|
||||||
});
|
|
||||||
|
|
||||||
$scope.agree = function() {
|
|
||||||
if (isCordova) {
|
|
||||||
window.plugins.spinnerDialog.show(null, gettextCatalog.getString('Loading...'), true);
|
|
||||||
}
|
|
||||||
$scope.loading = true;
|
|
||||||
$timeout(function() {
|
|
||||||
storageService.setCopayDisclaimerFlag(function(err) {
|
|
||||||
$timeout(function() {
|
|
||||||
if (isCordova) {
|
|
||||||
window.plugins.spinnerDialog.hide();
|
|
||||||
}
|
|
||||||
applicationService.restart();
|
|
||||||
}, 1000);
|
|
||||||
});
|
|
||||||
}, 100);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -165,6 +165,13 @@ angular.module('copayApp.services')
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
root._seedWallet = function(walletClient) {
|
||||||
|
var config = configService.getSync().wallet.settings;
|
||||||
|
console.log('[profileService.js.169:config:]',config); //TODO
|
||||||
|
asdd;
|
||||||
|
walletClient.seedFromRandomWithMnemonic('livenet',null, mnemonicLang);
|
||||||
|
};
|
||||||
|
|
||||||
root._createNewProfile = function(opts, cb) {
|
root._createNewProfile = function(opts, cb) {
|
||||||
|
|
||||||
if (opts.noWallet) {
|
if (opts.noWallet) {
|
||||||
|
|
@ -172,10 +179,7 @@ angular.module('copayApp.services')
|
||||||
}
|
}
|
||||||
|
|
||||||
var walletClient = bwcService.getClient();
|
var walletClient = bwcService.getClient();
|
||||||
// TODO LANG...
|
this._seedWallet(walletClient);
|
||||||
// TODO...
|
|
||||||
$log.warn("TODO LANG!")
|
|
||||||
walletClient.seedFromRandomWithMnemonic('livenet');
|
|
||||||
|
|
||||||
walletClient.createWallet('Personal Wallet', 'me', 1, 1, {
|
walletClient.createWallet('Personal Wallet', 'me', 1, 1, {
|
||||||
network: 'livenet'
|
network: 'livenet'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue