mirror of https://github.com/BTCPrivate/copay.git
Removes unnecessary files
This commit is contained in:
parent
585f83825f
commit
cc8521d51e
|
@ -1,2 +0,0 @@
|
|||
<div class="settings" ng-controller="DevLoginController">
|
||||
</div>
|
|
@ -1,62 +0,0 @@
|
|||
{{'Receive'|translate}}
|
||||
{{'History'|translate}}
|
||||
{{'Wrong password'|translate}}
|
||||
{{'Copied to clipboard'|translate}}
|
||||
{{'Please enter the required fields'|translate}}
|
||||
{{'Import a backup'|translate}}
|
||||
{{'Importing wallet - Reading backup...'|translate}}
|
||||
{{'Importing wallet - Setting things up...'|translate}}
|
||||
{{'Importing wallet - We are almost there...'|translate}}
|
||||
{{'Error updating indexes:'|translate}}
|
||||
{{'Please, select your backup file'|translate}}
|
||||
{{'Please enter the required fields'|translate}}
|
||||
{{'Fatal error connecting to Insight server'|translate}}
|
||||
{{'The wallet is full'|translate}}
|
||||
{{'Wallet network configuration missmatch'|translate}}
|
||||
{{'The secret string you entered is invalid'|translate}}
|
||||
{{'Transactions Proposals Purged'|translate}}
|
||||
{{'transaction proposal purged'|translate}}
|
||||
{{'Updating balance'|translate}}
|
||||
{{'Scaning for transactions'|translate}}
|
||||
{{'Using derived addresses from your wallet'|translate}}
|
||||
{{'Finished'|translate}}
|
||||
{{'The balance is updated using the derived addresses'|translate}}
|
||||
{{'Login Required'|translate}}
|
||||
{{'Please open wallet to complete payment'|translate}}
|
||||
{{'Send'|translate}}
|
||||
{{'Unable to send transaction proposal'|translate}}
|
||||
{{'The transaction proposal has been created'|translate}}
|
||||
{{'Form Error'|translate}}
|
||||
{{'Please complete required fields'|translate}}
|
||||
{{'Success'|translate}}
|
||||
{{'New entry has been created'|translate}}
|
||||
{{'There was an error sending the transaction'|translate}}
|
||||
{{'Transaction rejected'|translate}}
|
||||
{{'You rejected the transaction successfully'|translate}}
|
||||
{{'There was an error signing the transaction'|translate}}
|
||||
{{'Session will be closed'|translate}}
|
||||
{{'Your session is about to expire due to inactivity in'|translate}}
|
||||
{{'seconds'|translate}}
|
||||
{{'Session closed'|translate}}
|
||||
{{'Session closed because a long time of inactivity'|translate}}
|
||||
{{'available.'|translate}}
|
||||
{{'It\'s important that you update your wallet at https://copay.io'|translate}}
|
||||
{{'Please update your wallet at https://copay.io'|translate}}
|
||||
{{'Backup created'|translate}}
|
||||
{{'Encrypted backup file saved'|translate}}
|
||||
{{'Networking Error'|translate}}
|
||||
{{'Could not connect to the Insight server. Check your settings and network configuration'|translate}}
|
||||
{{'Received corrupt message from '|translate}}
|
||||
{{'Transaction Update'|translate}}
|
||||
{{'A transaction was signed by'|translate}}
|
||||
{{'A transaction was rejected by'|translate}}
|
||||
{{'Transaction Error'|translate}}
|
||||
{{'Received corrupt transaction from'|translate}}
|
||||
{{'New Transaction'|translate}}
|
||||
{{'You have a pending transaction proposal'|translate}}
|
||||
{{'You have'|translate}}
|
||||
{{'pending transaction proposals'|translate}}
|
||||
{{'Funds received!'|translate}}
|
||||
{{'Transaction broadcasted'|translate}}
|
||||
{{'Accessing your profile'|translate}}
|
||||
{{'Signing out'|translate}}
|
|
@ -1,67 +0,0 @@
|
|||
|
||||
<div class="import-profile" ng-controller="importProfileController as importProfile">
|
||||
<div ng-show="$root.starting">
|
||||
<div ng-include="'views/includes/loading.html'" ng-init="title = importStatus"></div>
|
||||
</div>
|
||||
|
||||
<div class="row" ng-show="!$root.starting">
|
||||
<div class="large-5 large-centered medium-7 medium-centered columns">
|
||||
<div class="logo-setup show-for-large-up">
|
||||
<img src="img/logo-negative-beta.svg" alt="Copay" width="100">
|
||||
<div ng-include="'views/includes/version.html'"></div>
|
||||
</div>
|
||||
<div>
|
||||
<h2 translate>Import a profile</h2>
|
||||
<form name="importProfileForm" ng-submit="importProfile.import(importProfileForm)" novalidate>
|
||||
<div class="box-notification" ng-show="error">
|
||||
<div class="box-icon error">
|
||||
<i class="fi-x size-24"></i>
|
||||
</div>
|
||||
<span class="text-warning size-14">
|
||||
{{error|translate}}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div ng-show="!isSafari && !isCordova">
|
||||
<div class="input">
|
||||
<input type="file" class="db form-control"
|
||||
placeholder="{{'Select a backup file'|translate}}" name="backupFile" ng-model="importProfile.backupFile" ng-file-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div ng-show="importProfile.isSafari || importProfile.isCordova">
|
||||
<div class="input">
|
||||
<textarea
|
||||
placeholder="{{'Paste backup plain text code'|translate}}"
|
||||
class="form-control"
|
||||
name="backupText"
|
||||
ng-model="importProfile.backupText"
|
||||
rows="5"></textarea>
|
||||
<i class="icon-compose"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input">
|
||||
<input type="password" class="form-control" placeholder="{{'Your profile password'|translate}}"
|
||||
name="password" ng-model="importProfile.password" required>
|
||||
<i class="icon-locked"></i>
|
||||
</div>
|
||||
|
||||
<button translate type="submit"
|
||||
class="button primary radius expand m0"
|
||||
ng-disabled="importProfileForm.$invalid">
|
||||
Import backup
|
||||
</button>
|
||||
</form>
|
||||
<div class="box-setup-footer">
|
||||
<div class="left">
|
||||
<a class="button outline dark-gray tiny" ng-click="$root.go('signin')">
|
||||
<i class="icon-arrow-left4 size-10"></i>
|
||||
<span translate>Back</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,124 +0,0 @@
|
|||
<div class="backup" ng-controller="ProfileController" ng-init="init()">
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<div class="panel">
|
||||
<div class="row collapse">
|
||||
<div class="large-2 medium-2 columns text-center">
|
||||
<a class="photo-container profile"
|
||||
ng-click="$root.openExternalLink('https://gravatar.com/')"
|
||||
ng-init="isHover=0"
|
||||
ng-mouseenter="isHover=1"
|
||||
ng-mouseleave="isHover=0">
|
||||
<img ng-show="!isHover" gravatar-src="'{{username}}'" gravatar-size="80">
|
||||
<img ng-show="isHover" src="img/change-avatar.png" with="80">
|
||||
</a>
|
||||
</div>
|
||||
<div class="large-10 medium-10 columns">
|
||||
<h2>
|
||||
<span translate>Profile</span>
|
||||
<span class="size-12 text-warning" ng-if="$root.iden.backupNeeded">
|
||||
[ <span translate>Needs Backup</span> ]
|
||||
</span>
|
||||
</h2>
|
||||
<span translate class="text-gray">It's important to backup your profile so that you can recover it in case of disaster. The backup will include all your profile's wallets</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" ng-show="!backupProfilePlainText">
|
||||
<div class="large-12 columns">
|
||||
<button class="primary expand" ng-click="downloadProfileBackup()" ng-disabled="loading"
|
||||
ng-show="!isSafari && !isCordova"><i class="fi-download"></i>
|
||||
<span translate>Download backup</span></button>
|
||||
<button class="primary expand" ng-click="viewProfileBackup()" ng-disabled="loading"
|
||||
ng-show="isSafari && !isCordova"><i class="fi-eye"></i>
|
||||
<span translate>View backup</span></button>
|
||||
<div ng-show="isCordova">
|
||||
<h4 translate>Backup options</h4>
|
||||
<button class="primary expand"
|
||||
ng-click="copyProfileBackup()"><i class="fi-clipboard-pencil"></i>
|
||||
<span translate>Copy to clipboard</span></button>
|
||||
<button class="primary expand"
|
||||
ng-click="sendProfileBackup()"><i class="fi-mail"></i>
|
||||
<span translate>Send by email</span></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row m20b" ng-show="backupProfilePlainText">
|
||||
<div class="large-12 columns">
|
||||
<h3 translate>Copy backup in a safe place</h3>
|
||||
<div class="input">
|
||||
<textarea class="show-for-large-up" readonly rows="5">{{backupProfilePlainText}}</textarea>
|
||||
<textarea class="hide-for-large-up" rows="5">{{backupProfilePlainText}}</textarea>
|
||||
</div>
|
||||
<div class="size-12 text-gray text-right">
|
||||
<i class="icon-compose"></i>
|
||||
<span translate>Copy this text as it is in a safe place (notepad or email)</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div ng-show="$root.quotaPerItem">
|
||||
<div class="line-dashed-h m20b"></div>
|
||||
|
||||
<div class="row size-12 m20b">
|
||||
<div class="large-12 columns">
|
||||
<div ng-if="perItem" translate>
|
||||
Your current server usage quotas are: <b>{{perItem}}kB</b> per wallet and up to <b>{{nrWallets}}</b> wallets.
|
||||
</div>
|
||||
<div ng-if="$root.needsEmailConfirmation" class="m10t">
|
||||
<i class="fi-alert"></i>
|
||||
<span translate>Confirm your email address to increase storage usage limits.</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="line-dashed-h m20b"></div>
|
||||
|
||||
<div class="row oh m20b">
|
||||
<div class="large-12 columns">
|
||||
<a class="button outline light-gray tiny" ng-click="hideAdv=!hideAdv">
|
||||
<i class="fi-widget m3r"></i>
|
||||
<span translate ng-hide="!hideAdv">Show</span>
|
||||
<span translate ng-hide="hideAdv">Hide</span>
|
||||
<span translate>advanced options</span>
|
||||
<i ng-if="hideAdv" class="icon-arrow-down4"></i>
|
||||
<i ng-if="!hideAdv" class="icon-arrow-up4"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div ng-hide="hideAdv" class="row">
|
||||
<div class="large-12 columns">
|
||||
<div class="panel">
|
||||
<h2><i class="fi-minus-circle m10r"></i>
|
||||
<span translate>Delete Profile</span>
|
||||
</h2>
|
||||
<p translate class="text-gray">Permanently delete this profile and all its wallets. WARNING: this action cannot be reversed.</p>
|
||||
<div ng-show="!confirmDelete">
|
||||
<a translate class="button warning m0" ng-click="confirmDelete=!confirmDelete">Delete Profile
|
||||
</a>
|
||||
</div>
|
||||
<div class="text-center" ng-show="confirmDelete">
|
||||
<h2 translate>Are you sure you want to delete this profile?</h2>
|
||||
<div class="row">
|
||||
<div class="large-6 medium-6 small-6 columns">
|
||||
<button class="gray" ng-disabled="loading"
|
||||
ng-click="confirmDelete=!confirmDelete" translate>Cancel</button>
|
||||
</div>
|
||||
<div class="large-6 medium-6 small-6 columns">
|
||||
<button class="warning" ng-disabled="loading" ng-click="deleteProfile()">
|
||||
<i class="fi-trash"></i> <span translate>Delete</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="extra-margin-bottom"></div>
|
|
@ -1,60 +0,0 @@
|
|||
<div class="settings row" ng-controller="settingsController as settings" ng-init="settings.init()">
|
||||
<h1 class="hide-for-small-only">{{$root.title|translate}}</h1>
|
||||
<div class="large-5 large-centered medium-7 medium-centered columns">
|
||||
<div class="logo-setup show-for-large-up" id="top">
|
||||
<img src="img/logo-negative-beta.svg" alt="Copay" width="100">
|
||||
<div ng-include="'views/includes/version.html'"></div>
|
||||
</div>
|
||||
<h2>Settings</h2>
|
||||
<form name="settingsForm">
|
||||
<div class="box-notification" ng-show="message">
|
||||
<div class="box-icon">
|
||||
<i class="fi-check size-24"></i>
|
||||
</div>
|
||||
<span class="text-primary size-14">
|
||||
{{message|translate}}
|
||||
</span>
|
||||
</div>
|
||||
<fieldset>
|
||||
<legend translate>Bitcore wallet service</legend>
|
||||
<div class="row collapse">
|
||||
<label class="left" for="bws">URL</label>
|
||||
<div class="has-error right size-12" ng-show="settingsForm.bws.$invalid">
|
||||
<span class="icon-input"><i class="fi-x"></i></span>
|
||||
<span translate>Not valid</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input">
|
||||
<input type="text" class="form-control" name="bws" ng-model="settings.bws" valid-url required>
|
||||
</div>
|
||||
|
||||
<small class="text-gray">
|
||||
<span translate>Bitcore wallet service is open-source software. You can run your own instances, check</span>
|
||||
<a href
|
||||
ng-click="$root.openExternalLink('https://github.com/bitpay/bitcore-wallet-service')">Github repository</a>
|
||||
</small>
|
||||
</fieldset>
|
||||
<button translate
|
||||
type="submit"
|
||||
class="button primary radius expand m0"
|
||||
ng-disabled="settingsForm.$invalid || loading" ng-click="settings.save()">
|
||||
Save
|
||||
</button>
|
||||
</form>
|
||||
<div class="box-setup-footer">
|
||||
<div class="left">
|
||||
<a class="button outline dark-gray tiny" ng-click="$root.go('signin')">
|
||||
<i class="icon-arrow-left4 size-10"></i>
|
||||
<span translate>Back</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="right">
|
||||
<a class="button outline dark-gray tiny" href="" ng-click="settings.reset()">
|
||||
<i class="fi-page-delete"></i>
|
||||
<span translate>Reset settings</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -1,132 +0,0 @@
|
|||
<div class="signin" ng-controller="signinController as signin" ng-init="signin.init()">
|
||||
|
||||
|
||||
<div ng-if="askForPin || ($root.hasPin && !$root.iden)">
|
||||
<div ng-include="'views/includes/pin-number.html'"></div>
|
||||
</div>
|
||||
|
||||
<div ng-show="$root.starting">
|
||||
<div ng-include="'views/includes/loading.html'" ng-init="title = 'Accessing your profile'"></div>
|
||||
</div>
|
||||
|
||||
<div class="row" ng-show="signin.showDisclaimer">
|
||||
<div class="large-8 medium-10 small-12 large-centered medium-centered columns">
|
||||
<h1 class="text-white text-center" translate>Disclaimer</h1>
|
||||
<p class="text-white" translate>
|
||||
The software you are about to use is free, open source, and unsupported beta software. It is important to understand
|
||||
that beta software refers to software that is undergoing testing and has not officially been released, could have
|
||||
bugs, and may not act in a reliable fashion. Because the software is currently in beta, it is possible but not certain
|
||||
that you may lose bitcoin or the value of your bitcoin. It is recommended that you store only nominal amounts of
|
||||
bitcoins. You acknowledge that your use of this software is at your own discretion and in compliance with all
|
||||
applicable laws. You are responsible for safekeeping your login IDs, passwords, private key pairs, PINs and any other
|
||||
codes you use to access the software. IF YOU HAVE NOT SEPARATELY STORED A BACKUP OF ANY WALLET ADDRESSES AND PRIVATE
|
||||
KEY PAIRS MAINTAINED IN YOUR ACCOUNT, YOU ACKNOWLEDGE AND AGREE THAT ANY BITCOINS YOU HAVE ASSOCIATED WITH SUCH WALLET
|
||||
ADDRESSES WILL BECOME INACCESSIBLE IF YOU DO NOT HAVE YOUR ACCOUNT PASSWORD AND/OR PIN. All transaction requests are
|
||||
irreversible. The authors of the software, employees and affiliates of Bitpay, copyright holders, and BitPay, Inc.
|
||||
cannot retrieve your private keys or passwords if you lose or forget them and cannot guarantee transaction
|
||||
confirmation as they do not have control over the Bitcoin network. You agree to provide accurate and complete
|
||||
information in connection with your use of the account. You assume any and all risk associated with the use of the
|
||||
software. To the fullest extent permitted by law, this software is provided “as is” and no representations or
|
||||
warranties can be made of any kind, express or implied, including but not limited to the warranties of
|
||||
merchantability, fitness or a particular purpose and noninfringement. In no event shall the authors of the software,
|
||||
employees and affiliates of Bitpay, copyright holders, or BitPay, Inc. be held liable for any claim, damages or other
|
||||
liability, whether in an action of contract, tort, or otherwise, arising from, out of or in connection with the
|
||||
software or the use or other dealings in the software. We reserve the right to modify this disclaimer from time to
|
||||
time.
|
||||
</p>
|
||||
<button class="success expand" ng-click="signin.agreeDisclaimer()">
|
||||
{{'I read and agree with these terms'|translate}}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="large-5 large-centered medium-7 medium-centered columns" ng-show="!$root.starting && !signin.showDisclaimer">
|
||||
|
||||
<div class="logo-setup" ng-show="!$root.iden && !signin.hideForWP && !$root.hasPin">
|
||||
<img src="img/logo-negative-beta.svg" alt="Copay" width="100">
|
||||
<div ng-include="'views/includes/version.html'"></div>
|
||||
</div>
|
||||
|
||||
<div ng-if='askForPin || ($root.hasPin && !$root.iden)'>
|
||||
<h2 ng-show="$root.hasPin && !$root.iden" translate>Enter PIN</h2>
|
||||
<h2 ng-show="signin.askForPin && signin.askForPin !=2" translate>Set up a PIN</h2>
|
||||
<h2 ng-show="signin.askForPin == 2" translate>Repeat PIN</h2>
|
||||
<div class="box-notification" ng-show="signin.error">
|
||||
<div class="box-icon error">
|
||||
<i class="fi-x size-24"></i>
|
||||
</div>
|
||||
<span class="text-warning size-14">
|
||||
{{signin.error|translate}}
|
||||
</span>
|
||||
</div>
|
||||
<div ng-include="'views/includes/pin.html'"></div>
|
||||
</div>
|
||||
|
||||
<div ng-if='!$root.hasPin && !signin.askForPin && !$root.iden'>
|
||||
<h2 translate>Signin</h2>
|
||||
<div class="p10 bg-success m20b text-white" ng-show="signin.pendingPayment">
|
||||
<div class="left">
|
||||
<i class="size-36 m10r"></i>
|
||||
</div>
|
||||
<div class="size-14" translate>
|
||||
Please sign in to make the payment
|
||||
</div>
|
||||
</div>
|
||||
<form name="loginForm" ng-submit="signin.openWithCredentials(loginForm)" novalidate>
|
||||
<div class="box-notification" ng-show="error">
|
||||
<div class="box-icon error">
|
||||
<i class="fi-x size-24"></i>
|
||||
</div>
|
||||
<span class="text-warning size-14">
|
||||
{{error|translate}}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="input">
|
||||
<input type="text" ng-model="email" class="form-control" name="email" placeholder="{{'Username'|translate}}"
|
||||
required show-focus="!isMobile" ng-focus="formFocus()">
|
||||
<i class="icon-person"></i>
|
||||
</div>
|
||||
<div class="input">
|
||||
<input type="password" ng-model="password" class="form-control" name="password"
|
||||
placeholder="{{'Password'|translate}}" required ng-focus="formFocus()">
|
||||
<i class="icon-locked"></i>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<button type="submit" class="button primary radius expand m0"
|
||||
ng-disabled="loginForm.$invalid">
|
||||
{{'Sign in'|translate}}
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<div class="box-setup-footer">
|
||||
|
||||
<div class="right">
|
||||
<a class="button outline dark-gray tiny" ng-click="$root.go('settings')">
|
||||
<i class="icon-wrench show-for-large-up size-14"></i>
|
||||
<span translate>Settings</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="left m10r">
|
||||
<a class="button outline dark-gray tiny" ng-click="$root.go('createProfile')">
|
||||
<i class="icon-person show-for-large-up size-14"></i>
|
||||
<span translate>Create profile</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="left">
|
||||
<a class="button outline dark-gray tiny" ng-click="$root.go('importProfile')">
|
||||
<i class="icon-upload show-for-large-up size-14"></i>
|
||||
<span translate>Import</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
<div class="wide-page" ng-controller="WarningController"
|
||||
ng-init="checkLock()">
|
||||
<div class="text-center">
|
||||
<img src="img/logo-negative-beta.svg" alt="Copay" width="146" height="59">
|
||||
<div class="text-white" ng-include="'views/includes/version.html'"></div>
|
||||
</div>
|
||||
<h1 translate class="text-center text-warning">Warning!</h1>
|
||||
<h3 class="text-center text-white">
|
||||
<span translate>This wallet appears to be currently open.</span>
|
||||
<br>
|
||||
<span translate>Opening the wallet in multiple browser tabs could lead to unexpected results</span>
|
||||
</h3>
|
||||
<div class="text-center m30v large-12 columns">
|
||||
<div class="row">
|
||||
<div class="large-12 columns medium-12 small-12 text-center">
|
||||
<a href class="button sucess" ng-click="signout()">« <span translate>Back</span></a>
|
||||
<br>
|
||||
<br>
|
||||
<a translate href ng-click="ignoreLock()">Continue anyways</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-center text-gray small cb">
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('EmailConfirmationController', function($scope, $rootScope, $location) {
|
||||
$rootScope.fromEmailConfirmation = true;
|
||||
$location.path('/');
|
||||
});
|
|
@ -1,81 +0,0 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('importProfileController',
|
||||
function($scope, $rootScope, $timeout, notification, isMobile, isCordova, identityService) {
|
||||
this.importStatus = 'Importing profile - Reading backup...';
|
||||
this.hideAdv = true;
|
||||
this.isSafari = isMobile.Safari();
|
||||
this.isCordova = isCordova;
|
||||
|
||||
window.ignoreMobilePause = true;
|
||||
$scope.$on('$destroy', function() {
|
||||
$timeout(function(){
|
||||
window.ignoreMobilePause = false;
|
||||
}, 100);
|
||||
});
|
||||
|
||||
var reader = new FileReader();
|
||||
|
||||
var updateStatus = function(status) {
|
||||
this.importStatus = status;
|
||||
}
|
||||
|
||||
var _importBackup = function(str) {
|
||||
var password = this.password;
|
||||
updateStatus('Importing profile - Setting things up...');
|
||||
|
||||
identityService.importProfile(str,password, function(err, iden) {
|
||||
if (err) {
|
||||
$rootScope.starting = false;
|
||||
copay.logger.warn(err);
|
||||
if ((err.toString() || '').match('BADSTR')) {
|
||||
this.error = 'Bad password or corrupt profile file';
|
||||
} else if ((err.toString() || '').match('EEXISTS')) {
|
||||
this.error = 'Profile already exists';
|
||||
} else {
|
||||
this.error = 'Unknown error';
|
||||
}
|
||||
$timeout(function() {
|
||||
$rootScope.$digest();
|
||||
}, 1);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
this.getFile = function() {
|
||||
// If we use onloadend, we need to check the readyState.
|
||||
reader.onloadend = function(evt) {
|
||||
if (evt.target.readyState == FileReader.DONE) { // DONE == 2
|
||||
var encryptedObj = evt.target.result;
|
||||
_importBackup(encryptedObj);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
this.import = function(form) {
|
||||
|
||||
if (form.$invalid) {
|
||||
this.error = 'Please enter the required fields';
|
||||
return;
|
||||
}
|
||||
var backupFile = this.file;
|
||||
var backupText = form.backupText.$modelValue;
|
||||
var password = form.password.$modelValue;
|
||||
|
||||
if (!backupFile && !backupText) {
|
||||
this.error = 'Please, select your backup file';
|
||||
return;
|
||||
}
|
||||
|
||||
$rootScope.starting = true;
|
||||
|
||||
$timeout(function() {
|
||||
|
||||
if (backupFile) {
|
||||
reader.readAsBinaryString(backupFile);
|
||||
} else {
|
||||
_importBackup(backupText);
|
||||
}
|
||||
}, 100);
|
||||
};
|
||||
});
|
|
@ -1,68 +0,0 @@
|
|||
'use strict';
|
||||
angular.module('copayApp.controllers').controller('ProfileController', function($scope, $rootScope, $location, $modal, $filter, $timeout, backupService, identityService, isMobile, isCordova, notification) {
|
||||
$scope.username = $rootScope.iden.getName();
|
||||
$scope.isSafari = isMobile.Safari();
|
||||
$scope.isCordova = isCordova;
|
||||
|
||||
$rootScope.title = 'Profile';
|
||||
$scope.hideAdv = true;
|
||||
|
||||
$scope.downloadProfileBackup = function() {
|
||||
backupService.profileDownload($rootScope.iden);
|
||||
};
|
||||
|
||||
$scope.viewProfileBackup = function() {
|
||||
$scope.loading = true;
|
||||
$timeout(function() {
|
||||
$scope.backupProfilePlainText = backupService.profileEncrypted($rootScope.iden);
|
||||
}, 100);
|
||||
};
|
||||
|
||||
$scope.copyProfileBackup = function() {
|
||||
var ep = backupService.profileEncrypted($rootScope.iden);
|
||||
window.cordova.plugins.clipboard.copy(ep);
|
||||
window.plugins.toast.showShortCenter('Copied to clipboard');
|
||||
};
|
||||
|
||||
$scope.sendProfileBackup = function() {
|
||||
if (isMobile.Android() || isMobile.Windows()) {
|
||||
window.ignoreMobilePause = true;
|
||||
}
|
||||
window.plugins.toast.showShortCenter('Preparing backup...');
|
||||
var name = $rootScope.iden.fullName;
|
||||
var ep = backupService.profileEncrypted($rootScope.iden);
|
||||
var properties = {
|
||||
subject: 'Copay Profile Backup: ' + name,
|
||||
body: 'Here is the encrypted backup of the profile ' + name + ': \n\n' + ep + '\n\n To import this backup, copy all text between {...}, including the symbols {}',
|
||||
isHtml: false
|
||||
};
|
||||
window.plugin.email.open(properties);
|
||||
};
|
||||
|
||||
$scope.init = function() {
|
||||
if ($rootScope.quotaPerItem) {
|
||||
$scope.perItem = $filter('noFractionNumber')($rootScope.quotaPerItem / 1000, 1);
|
||||
$scope.nrWallets = parseInt($rootScope.quotaItems) - 1;
|
||||
}
|
||||
// no need to add event handlers here. Wallet deletion is handle by callback.
|
||||
};
|
||||
|
||||
$scope.deleteProfile = function() {
|
||||
$scope.loading = true;
|
||||
identityService.deleteProfile(function(err, res) {
|
||||
$scope.loading = false;
|
||||
if (err) {
|
||||
log.warn(err);
|
||||
notification.error('Error', 'Could not delete profile');
|
||||
$timeout(function() {
|
||||
$scope.$digest();
|
||||
});
|
||||
} else {
|
||||
$location.path('/');
|
||||
$timeout(function() {
|
||||
notification.success('Success', 'Profile successfully deleted');
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
});
|
|
@ -1,26 +0,0 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('settingsController', function(configService, applicationService) {
|
||||
var config;
|
||||
|
||||
this.init = function() {
|
||||
config = configService.get();
|
||||
this.bws = config.bws.url;
|
||||
};
|
||||
|
||||
this.save = function() {
|
||||
if (!this.bws) return;
|
||||
config.bws.url = this.bws;
|
||||
var res = configService.set(config);
|
||||
if (res) {
|
||||
applicationService.restart();
|
||||
}
|
||||
};
|
||||
|
||||
this.reset = function() {
|
||||
if (configService.reset()) {
|
||||
applicationService.restart();
|
||||
}
|
||||
};
|
||||
|
||||
});
|
|
@ -1,5 +0,0 @@
|
|||
angular.module('copayApp.controllers').controller('signOutController', function(identityService) {
|
||||
|
||||
identityService.signout();
|
||||
|
||||
});
|
|
@ -1,174 +0,0 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('signinController',
|
||||
function($rootScope, $timeout, $window, go, notification, profileService, pinService, applicationService, isMobile, isCordova, localStorageService) {
|
||||
|
||||
var KEY = 'CopayDisclaimer';
|
||||
var _credentials;
|
||||
|
||||
this.init = function() {
|
||||
this.isMobile = isMobile.any();
|
||||
this.isWindowsPhoneApp = isMobile.Windows() && isCordova;
|
||||
this.hideForWP = 0;
|
||||
this.attempt = 0;
|
||||
this.digits = [];
|
||||
this.defined = [];
|
||||
this.askForPin = 0;
|
||||
|
||||
// This is only for backwards compat, insight api should link to #!/confirmed directly
|
||||
if (getParam('confirmed')) {
|
||||
var hashIndex = window.location.href.indexOf('/?');
|
||||
window.location = window.location.href.substr(0, hashIndex) + '#!/confirmed';
|
||||
return;
|
||||
}
|
||||
|
||||
if ($rootScope.fromEmailConfirmation) {
|
||||
this.confirmedEmail = true;
|
||||
$rootScope.fromEmailConfirmation = false;
|
||||
}
|
||||
|
||||
if ($rootScope.wallet) {
|
||||
go.walletHome();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
this.clear = function() {
|
||||
pinService.clearPin(this);
|
||||
};
|
||||
|
||||
this.press = function(digit) {
|
||||
pinService.pressPin(this, digit);
|
||||
};
|
||||
|
||||
this.skip = function() {
|
||||
pinService.skipPin(this);
|
||||
};
|
||||
|
||||
this.agreeDisclaimer = function() {
|
||||
if (localStorageService.set(KEY, true)) {
|
||||
this.showDisclaimer = null;
|
||||
}
|
||||
};
|
||||
|
||||
this.formFocus = function() {
|
||||
if (this.isWindowsPhoneApp) {
|
||||
this.hideForWP = true;
|
||||
$timeout(function() {
|
||||
this.$digest();
|
||||
}, 1);
|
||||
}
|
||||
};
|
||||
|
||||
this.openWithPin = function(pin) {
|
||||
|
||||
if (!pin) {
|
||||
this.error = 'Please enter the required fields';
|
||||
return;
|
||||
}
|
||||
$rootScope.starting = true;
|
||||
|
||||
$timeout(function() {
|
||||
var credentials = pinService.get(pin, function(err, credentials) {
|
||||
if (err || !credentials) {
|
||||
$rootScope.starting = null;
|
||||
this.error = 'Wrong PIN';
|
||||
this.clear();
|
||||
$timeout(function() {
|
||||
this.error = null;
|
||||
}, 2000);
|
||||
return;
|
||||
}
|
||||
this.open(credentials.email, credentials.password);
|
||||
});
|
||||
}, 100);
|
||||
};
|
||||
|
||||
this.openWallets = function() {
|
||||
var iden = $rootScope.iden;
|
||||
$rootScope.hideNavigation = false;
|
||||
$rootScope.starting = true;
|
||||
iden.openWallets();
|
||||
};
|
||||
|
||||
this.createPin = function(pin) {
|
||||
preconditions.checkArgument(pin);
|
||||
preconditions.checkState($rootScope.iden);
|
||||
preconditions.checkState(_credentials && _credentials.email);
|
||||
$rootScope.starting = true;
|
||||
|
||||
$timeout(function() {
|
||||
pinService.save(pin, _credentials.email, _credentials.password, function(err) {
|
||||
_credentials.password = '';
|
||||
_credentials = null;
|
||||
this.askForPin = 0;
|
||||
$rootScope.hasPin = true;
|
||||
$rootScope.starting = null;
|
||||
this.openWallets();
|
||||
});
|
||||
}, 100);
|
||||
};
|
||||
|
||||
this.openWithCredentials = function(form) {
|
||||
if (form && form.$invalid) {
|
||||
this.error = 'Please enter the required fields';
|
||||
return;
|
||||
}
|
||||
|
||||
this.open(form.email.$modelValue, form.password.$modelValue);
|
||||
};
|
||||
|
||||
|
||||
this.pinLogout = function() {
|
||||
pinService.clear(function() {
|
||||
copay.logger.debug('PIN erased');
|
||||
delete $rootScope['hasPin'];
|
||||
applicationService.restart();
|
||||
});
|
||||
};
|
||||
|
||||
this.open = function(username, password) {
|
||||
$rootScope.starting = true;
|
||||
profileService.open(username, password, function(err) {
|
||||
if (err) {
|
||||
$rootScope.starting = false;
|
||||
$rootScope.hasPin = false;
|
||||
pinService.clear(function() {});
|
||||
this.error = 'Unknown error';
|
||||
return;
|
||||
}
|
||||
|
||||
// mobile
|
||||
if (this.isMobile && !$rootScope.hasPin) {
|
||||
_credentials = {
|
||||
email: email,
|
||||
password: password,
|
||||
};
|
||||
this.askForPin = 1;
|
||||
$rootScope.starting = false;
|
||||
$rootScope.hideNavigation = true;
|
||||
$timeout(function() {
|
||||
$rootScope.$digest();
|
||||
}, 1);
|
||||
}
|
||||
// no mobile
|
||||
else {
|
||||
// this.openWallets();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
function getParam(sname) {
|
||||
var params = location.search.substr(location.search.indexOf("?") + 1);
|
||||
var sval = "";
|
||||
params = params.split("&");
|
||||
// split param and value into individual pieces
|
||||
for (var i = 0; i < params.length; i++) {
|
||||
var temp = params[i].split("=");
|
||||
if ([temp[0]] == sname) {
|
||||
sval = temp[1];
|
||||
}
|
||||
}
|
||||
return sval;
|
||||
}
|
||||
});
|
|
@ -1,7 +0,0 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('unsupportedController', function($state) {
|
||||
if (localStorage && localStorage.length > 0) {
|
||||
$state.go('signin');
|
||||
}
|
||||
});
|
|
@ -1,47 +0,0 @@
|
|||
'use strict';
|
||||
angular.module('copayApp.controllers').controller('walletForPaymentController', function($rootScope, $scope, $modal, identityService, go) {
|
||||
|
||||
// INIT: (not it a function, since there is no associated html)
|
||||
|
||||
var ModalInstanceCtrl = function($scope, $modalInstance, identityService) {
|
||||
$scope.loading = true;
|
||||
preconditions.checkState($rootScope.iden);
|
||||
|
||||
var iden = $rootScope.iden;
|
||||
iden.on('newWallet', function() {
|
||||
$scope.setWallets();
|
||||
});
|
||||
|
||||
$scope.setWallets = function() {
|
||||
$scope.wallets = $rootScope.iden.getWallets();
|
||||
};
|
||||
|
||||
$scope.ok = function(w) {
|
||||
$modalInstance.close(w);
|
||||
};
|
||||
|
||||
$scope.cancel = function() {
|
||||
$rootScope.pendingPayment = null;
|
||||
$modalInstance.close();
|
||||
};
|
||||
};
|
||||
|
||||
var modalInstance = $modal.open({
|
||||
templateUrl: 'views/modals/walletSelection.html',
|
||||
windowClass: 'full',
|
||||
controller: ModalInstanceCtrl,
|
||||
});
|
||||
|
||||
modalInstance.result.then(function(w) {
|
||||
if (w) {
|
||||
identityService.setFocusedWallet(w);
|
||||
$rootScope.walletForPaymentSet = true;
|
||||
} else {
|
||||
$rootScope.pendingPayment = null;
|
||||
}
|
||||
go.walletHome();
|
||||
}, function() {
|
||||
$rootScope.pendingPayment = null;
|
||||
go.walletHome();
|
||||
});
|
||||
});
|
|
@ -1,27 +0,0 @@
|
|||
'use strict';
|
||||
angular.module('copayApp.controllers').controller('WarningController', function($scope, $rootScope, $location, identityService) {
|
||||
|
||||
$scope.checkLock = function() {
|
||||
if (!$rootScope.tmp || !$rootScope.tmp.getLock()) {
|
||||
console.log('[warning.js.7] TODO LOCK'); //TODO
|
||||
}
|
||||
};
|
||||
|
||||
$scope.signout = function() {
|
||||
identityService.signout();
|
||||
};
|
||||
|
||||
$scope.ignoreLock = function() {
|
||||
var w = $rootScope.tmp;
|
||||
delete $rootScope['tmp'];
|
||||
|
||||
if (!w) {
|
||||
$location.path('/');
|
||||
} else {
|
||||
w.ignoreLock = 1;
|
||||
$scope.loading = true;
|
||||
//controllerUtils.startNetwork(w, $scope);
|
||||
// TODO
|
||||
}
|
||||
};
|
||||
});
|
Loading…
Reference in New Issue