Merge pull request #3276 from cmgustavo/glidera/disclosure-disable-sandbox
Adds btc values. Adds disclosure. Fix modals. Removes sandbox
This commit is contained in:
commit
e9e20e1503
10 changed files with 105 additions and 31 deletions
|
|
@ -58,11 +58,21 @@
|
||||||
<div class="text-center m20v">
|
<div class="text-center m20v">
|
||||||
<img src="img/glidera-logo.png" ng-click="index.updateGlidera(index.glideraToken, index.glideraPermissions)" width="200">
|
<img src="img/glidera-logo.png" ng-click="index.updateGlidera(index.glideraToken, index.glideraPermissions)" width="200">
|
||||||
</div>
|
</div>
|
||||||
<div class="text-center small-10 small-centered columns" ng-show="!showOauthForm">
|
<div class="text-center small-10 small-centered columns" ng-show="!showOauthForm">
|
||||||
<p class="m10b">You can buy and sell Bitcoin with a US bank account directly in Copay.</p>
|
<p class="m10b">You can buy and sell Bitcoin with a US bank account directly in Copay.</p>
|
||||||
<p class="text-gray size-12">Connect your Glidera account to get started</p>
|
|
||||||
|
|
||||||
<a class="button m20t light-gray outline round small"
|
<p class="m20t text-gray size-12 text-left">
|
||||||
|
DISCLOSURE.<br>
|
||||||
|
Glidera Inc. (Glidera) is providing the service of buying or selling bitcoins to Copay users. To enable this
|
||||||
|
service, Glidera has registered with US Treasury Department’s FinCEN as a Money Service Business
|
||||||
|
(#31000042625755). Users of Copay must agree to the service agreement presented by Glidera prior to obtaining
|
||||||
|
Glidera’s service of buying or selling bitcoins. Service available in U.S. only; (buy & sell) CA, GA, IL, KS,
|
||||||
|
MA, MD, MO, MT, MN, SC, TX; (buy only) AZ, CO, DE, ME, NJ, PA, TN, UT.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p class="m20t text-gray size-12">Connect your Glidera account to get started</p>
|
||||||
|
|
||||||
|
<a class="button light-gray outline round small"
|
||||||
ng-click="$root.openExternalLink(glidera.getAuthenticateUrl(), '_system'); showOauthForm = true">
|
ng-click="$root.openExternalLink(glidera.getAuthenticateUrl(), '_system'); showOauthForm = true">
|
||||||
Connect to Glidera
|
Connect to Glidera
|
||||||
</a>
|
</a>
|
||||||
|
|
@ -175,6 +185,11 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="large-4 medium-4 small-4 columns">
|
<div class="large-4 medium-4 small-4 columns">
|
||||||
|
<div class="size-14">
|
||||||
|
<span ng-show="tx.type == 'BUY'">Bought</span>
|
||||||
|
<span ng-show="tx.type == 'SELL'">Sold</span>
|
||||||
|
<b>{{tx.qty}}</b> BTC
|
||||||
|
</div>
|
||||||
<span class="size-14 text-bold">
|
<span class="size-14 text-bold">
|
||||||
{{tx.subtotal|currency:'':2}} {{tx.currency}}
|
{{tx.subtotal|currency:'':2}} {{tx.currency}}
|
||||||
</span>
|
</span>
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,6 @@
|
||||||
<div translate>Create, join or import</div>
|
<div translate>Create, join or import</div>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<!-- // DISABLED
|
|
||||||
<li ng-show="index.glideraEnabled">
|
<li ng-show="index.glideraEnabled">
|
||||||
<a ng-click="$root.go('glidera')" class="oh">
|
<a ng-click="$root.go('glidera')" class="oh">
|
||||||
<i class="icon-arrow-right3 size-18 right m10t"></i>
|
<i class="icon-arrow-right3 size-18 right m10t"></i>
|
||||||
|
|
@ -37,6 +36,5 @@
|
||||||
<div>Glidera</div>
|
<div>Glidera</div>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
-->
|
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@
|
||||||
</div>
|
</div>
|
||||||
<span ng-show="tx.type == 'BUY'">Bought</span>
|
<span ng-show="tx.type == 'BUY'">Bought</span>
|
||||||
<span ng-show="tx.type == 'SELL'">Sold</span>
|
<span ng-show="tx.type == 'SELL'">Sold</span>
|
||||||
|
<b>{{tx.qty}}</b> BTC
|
||||||
<div class="size-36 m20b">
|
<div class="size-36 m20b">
|
||||||
{{tx.subtotal|currency:'':2}} {{tx.currency}}
|
{{tx.subtotal|currency:'':2}} {{tx.currency}}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
40
public/views/modals/glidera-wallets.html
Normal file
40
public/views/modals/glidera-wallets.html
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
<nav class="tab-bar">
|
||||||
|
<section class="left-small">
|
||||||
|
<a ng-click="cancel()" class="p10">
|
||||||
|
<span class="text-close" translate>Close</span>
|
||||||
|
</a>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="middle tab-bar-section">
|
||||||
|
<h1 class="title ellipsis">
|
||||||
|
<span ng-show="type == 'BUY'">Choose your destination wallet</span>
|
||||||
|
<span ng-show="type == 'SELL'">Choose your source wallet</span>
|
||||||
|
</h1>
|
||||||
|
</section>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
<div class="modal-content">
|
||||||
|
<div ng-show="type == 'SELL'">
|
||||||
|
<h4 class="title m0 oh">
|
||||||
|
<div class="left">
|
||||||
|
<i class="fi-info size-18 m10r"></i>
|
||||||
|
</div>
|
||||||
|
<div class="size-10 m5t">
|
||||||
|
Notice: only 1-1 (single signature) wallets can be used for sell bitcoin
|
||||||
|
</div>
|
||||||
|
</h4>
|
||||||
|
</div>
|
||||||
|
<ul class="no-bullet">
|
||||||
|
<li class="line-b" ng-repeat="w in wallets">
|
||||||
|
<a ng-click="selectWallet(w.id, w.name)" class="db oh">
|
||||||
|
<div class="avatar-wallet"
|
||||||
|
ng-style="{'background-color':w.color}">{{(w.name || w.id) | limitTo: 1}}</div>
|
||||||
|
<div class="ellipsis name-wallet text-bold">{{w.name || w.id}}</div>
|
||||||
|
<div class="size-12">{{w.m}} of {{w.n}}
|
||||||
|
<span ng-show="w.network=='testnet'">[Testnet]</span>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<div class="extra-margin-bottom"></div>
|
||||||
|
</div>
|
||||||
|
|
@ -105,11 +105,11 @@
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<!-- // DISABLED
|
|
||||||
<li class="line-b p20" ng-show="!index.noFocusedWallet">
|
<li class="line-b p20" ng-show="!index.noFocusedWallet">
|
||||||
<span>Enable Glidera Service</span>
|
<span>Enable Glidera Service</span>
|
||||||
<switch id="glidera-enabled" name="glideraEnabled" ng-model="glideraEnabled" class="green right"></switch>
|
<switch id="glidera-enabled" name="glideraEnabled" ng-model="glideraEnabled" class="green right"></switch>
|
||||||
</li>
|
</li>
|
||||||
|
<!-- Disabled for testnet
|
||||||
<li class="line-b p20" ng-show="!index.noFocusedWallet && glideraEnabled">
|
<li class="line-b p20" ng-show="!index.noFocusedWallet && glideraEnabled">
|
||||||
<span>Glidera Sandbox</span>
|
<span>Glidera Sandbox</span>
|
||||||
<switch id="glidera-testnet" name="glideraTestnet" ng-model="glideraTestnet" class="green right"></switch>
|
<switch id="glidera-testnet" name="glideraTestnet" ng-model="glideraTestnet" class="green right"></switch>
|
||||||
|
|
|
||||||
|
|
@ -51,12 +51,12 @@
|
||||||
ng-submit="sell.get2faCode(index.glideraToken)" novalidate>
|
ng-submit="sell.get2faCode(index.glideraToken)" novalidate>
|
||||||
|
|
||||||
<div ng-if="index.glideraToken"
|
<div ng-if="index.glideraToken"
|
||||||
ng-init="otherWallets = sell.otherWallets(index.glideraTestnet)"
|
ng-init="sell.init(index.glideraTestnet)"
|
||||||
ng-click="openWalletsModal(otherWallets)">
|
ng-click="openWalletsModal(sell.otherWallets)">
|
||||||
<label>Wallet</label>
|
<label>Wallet</label>
|
||||||
<div class="input">
|
<div class="input">
|
||||||
<input type="text" id="address" name="address" ng-disabled="sell.selectedWalletId"
|
<input type="text" id="address" name="address" ng-disabled="sell.selectedWalletId"
|
||||||
ng-attr-placeholder="{{'Choose your destination wallet'}}"
|
ng-attr-placeholder="{{'Choose your source wallet'}}"
|
||||||
ng-model="sell.selectedWalletName" required>
|
ng-model="sell.selectedWalletName" required>
|
||||||
<a class="postfix size-12 m0 text-gray">
|
<a class="postfix size-12 m0 text-gray">
|
||||||
<i class="icon-wallet size-18"></i>
|
<i class="icon-wallet size-18"></i>
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ angular.module('copayApp.controllers').controller('buyGlideraController',
|
||||||
self.selectedWalletName = null;
|
self.selectedWalletName = null;
|
||||||
self.selectedWalletAddr = null;
|
self.selectedWalletAddr = null;
|
||||||
var ModalInstanceCtrl = function($scope, $modalInstance) {
|
var ModalInstanceCtrl = function($scope, $modalInstance) {
|
||||||
|
$scope.type = 'BUY';
|
||||||
$scope.wallets = wallets;
|
$scope.wallets = wallets;
|
||||||
$scope.cancel = function() {
|
$scope.cancel = function() {
|
||||||
$modalInstance.dismiss('cancel');
|
$modalInstance.dismiss('cancel');
|
||||||
|
|
@ -49,7 +50,7 @@ angular.module('copayApp.controllers').controller('buyGlideraController',
|
||||||
};
|
};
|
||||||
|
|
||||||
var modalInstance = $modal.open({
|
var modalInstance = $modal.open({
|
||||||
templateUrl: 'views/modals/wallets.html',
|
templateUrl: 'views/modals/glidera-wallets.html',
|
||||||
windowClass: animationService.modalAnimated.slideUp,
|
windowClass: animationService.modalAnimated.slideUp,
|
||||||
controller: ModalInstanceCtrl,
|
controller: ModalInstanceCtrl,
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('glideraController',
|
angular.module('copayApp.controllers').controller('glideraController',
|
||||||
function($scope, $timeout, $modal, profileService, configService, storageService, glideraService, isChromeApp) {
|
function($scope, $timeout, $modal, profileService, configService, storageService, glideraService, isChromeApp, animationService) {
|
||||||
|
|
||||||
var config = configService.getSync().wallet.settings;
|
|
||||||
|
|
||||||
this.getAuthenticateUrl = function() {
|
this.getAuthenticateUrl = function() {
|
||||||
return glideraService.getOauthCodeUrl();
|
return glideraService.getOauthCodeUrl();
|
||||||
|
|
@ -35,16 +33,9 @@ angular.module('copayApp.controllers').controller('glideraController',
|
||||||
}, 100);
|
}, 100);
|
||||||
};
|
};
|
||||||
|
|
||||||
// DISABLE ANIMATION ON CHROMEAPP
|
|
||||||
if (isChromeApp) {
|
|
||||||
var animatedSlideRight = 'full';
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
var animatedSlideRight = 'full animated slideInRight';
|
|
||||||
}
|
|
||||||
|
|
||||||
this.openTxModal = function(token, tx) {
|
this.openTxModal = function(token, tx) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
var config = configService.getSync().wallet.settings;
|
||||||
var fc = profileService.focusedClient;
|
var fc = profileService.focusedClient;
|
||||||
var ModalInstanceCtrl = function($scope, $modalInstance) {
|
var ModalInstanceCtrl = function($scope, $modalInstance) {
|
||||||
$scope.tx = tx;
|
$scope.tx = tx;
|
||||||
|
|
@ -63,13 +54,13 @@ angular.module('copayApp.controllers').controller('glideraController',
|
||||||
|
|
||||||
var modalInstance = $modal.open({
|
var modalInstance = $modal.open({
|
||||||
templateUrl: 'views/modals/glidera-tx-details.html',
|
templateUrl: 'views/modals/glidera-tx-details.html',
|
||||||
windowClass: animatedSlideRight,
|
windowClass: animationService.modalAnimated.slideRight,
|
||||||
controller: ModalInstanceCtrl,
|
controller: ModalInstanceCtrl,
|
||||||
});
|
});
|
||||||
|
|
||||||
modalInstance.result.finally(function() {
|
modalInstance.result.finally(function() {
|
||||||
var m = angular.element(document.getElementsByClassName('reveal-modal'));
|
var m = angular.element(document.getElementsByClassName('reveal-modal'));
|
||||||
m.addClass('slideOutRight');
|
m.addClass(animationService.modalAnimated.slideOutRight);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -110,8 +110,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
||||||
self.updateColor();
|
self.updateColor();
|
||||||
self.updateAlias();
|
self.updateAlias();
|
||||||
|
|
||||||
// DISABLED
|
self.initGlidera();
|
||||||
//self.initGlidera();
|
|
||||||
|
|
||||||
if (fc.isPrivKeyExternal()) {
|
if (fc.isPrivKeyExternal()) {
|
||||||
self.needsBackup = false;
|
self.needsBackup = false;
|
||||||
|
|
@ -840,8 +839,11 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
||||||
|
|
||||||
self.initGlidera = function(accessToken) {
|
self.initGlidera = function(accessToken) {
|
||||||
self.glideraEnabled = configService.getSync().glidera.enabled;
|
self.glideraEnabled = configService.getSync().glidera.enabled;
|
||||||
self.glideraTestnet = configService.getSync().glidera.testnet;
|
// self.glideraTestnet = configService.getSync().glidera.testnet;
|
||||||
var network = self.glideraTestnet ? 'testnet' : 'livenet';
|
// var network = self.glideraTestnet ? 'testnet' : 'livenet';
|
||||||
|
// Disabled for testnet
|
||||||
|
self.glideraTestnet = false;
|
||||||
|
var network = 'livenet';
|
||||||
|
|
||||||
self.glideraToken = null;
|
self.glideraToken = null;
|
||||||
self.glideraError = null;
|
self.glideraError = null;
|
||||||
|
|
@ -851,7 +853,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
||||||
self.glideraTxs = null;
|
self.glideraTxs = null;
|
||||||
self.glideraStatus = null;
|
self.glideraStatus = null;
|
||||||
|
|
||||||
if (!self.glideraEnabled || self.isShared) return;
|
if (!self.glideraEnabled) return;
|
||||||
|
|
||||||
glideraService.setCredentials(network);
|
glideraService.setCredentials(network);
|
||||||
|
|
||||||
|
|
@ -1062,6 +1064,11 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
||||||
|
|
||||||
|
|
||||||
$rootScope.$on('NewBlock', function() {
|
$rootScope.$on('NewBlock', function() {
|
||||||
|
if (self.glideraEnabled) {
|
||||||
|
$timeout(function() {
|
||||||
|
self.updateGlidera();
|
||||||
|
});
|
||||||
|
}
|
||||||
if (self.pendingAmount) {
|
if (self.pendingAmount) {
|
||||||
self.updateAll({
|
self.updateAll({
|
||||||
walletStatus: null,
|
walletStatus: null,
|
||||||
|
|
@ -1164,4 +1171,4 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
||||||
self.setFocusedWallet();
|
self.setFocusedWallet();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -14,18 +14,39 @@ angular.module('copayApp.controllers').controller('sellGlideraController',
|
||||||
this.currentFeeLevel = config.wallet.settings.feeLevel || 'normal';
|
this.currentFeeLevel = config.wallet.settings.feeLevel || 'normal';
|
||||||
var fc;
|
var fc;
|
||||||
|
|
||||||
this.otherWallets = function(testnet) {
|
var otherWallets = function(testnet) {
|
||||||
var network = testnet ? 'testnet' : 'livenet';
|
var network = testnet ? 'testnet' : 'livenet';
|
||||||
return lodash.filter(profileService.getWallets(network), function(w) {
|
return lodash.filter(profileService.getWallets(network), function(w) {
|
||||||
return w.network == network && w.m == 1;
|
return w.network == network && w.m == 1;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.init = function(testnet) {
|
||||||
|
self.otherWallets = otherWallets(testnet);
|
||||||
|
// Choose focused wallet
|
||||||
|
try {
|
||||||
|
var currentWalletId = profileService.focusedClient.credentials.walletId;
|
||||||
|
lodash.find(self.otherWallets, function(w) {
|
||||||
|
if (w.id == currentWalletId) {
|
||||||
|
$timeout(function() {
|
||||||
|
self.selectedWalletId = w.id;
|
||||||
|
self.selectedWalletName = w.name;
|
||||||
|
fc = profileService.getClient(w.id);
|
||||||
|
$scope.$apply();
|
||||||
|
}, 100);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch(e) {
|
||||||
|
$log.debug(e);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
$scope.openWalletsModal = function(wallets) {
|
$scope.openWalletsModal = function(wallets) {
|
||||||
self.error = null;
|
self.error = null;
|
||||||
self.selectedWalletId = null;
|
self.selectedWalletId = null;
|
||||||
self.selectedWalletName = null;
|
self.selectedWalletName = null;
|
||||||
var ModalInstanceCtrl = function($scope, $modalInstance) {
|
var ModalInstanceCtrl = function($scope, $modalInstance) {
|
||||||
|
$scope.type = 'SELL';
|
||||||
$scope.wallets = wallets;
|
$scope.wallets = wallets;
|
||||||
$scope.cancel = function() {
|
$scope.cancel = function() {
|
||||||
$modalInstance.dismiss('cancel');
|
$modalInstance.dismiss('cancel');
|
||||||
|
|
@ -45,7 +66,7 @@ angular.module('copayApp.controllers').controller('sellGlideraController',
|
||||||
};
|
};
|
||||||
|
|
||||||
var modalInstance = $modal.open({
|
var modalInstance = $modal.open({
|
||||||
templateUrl: 'views/modals/wallets.html',
|
templateUrl: 'views/modals/glidera-wallets.html',
|
||||||
windowClass: animationService.modalAnimated.slideUp,
|
windowClass: animationService.modalAnimated.slideUp,
|
||||||
controller: ModalInstanceCtrl,
|
controller: ModalInstanceCtrl,
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue