WIP functionality on words
This commit is contained in:
parent
f0e14c896a
commit
273901d2d6
3 changed files with 65 additions and 14 deletions
|
|
@ -61,7 +61,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div ng-show="wordsC.mnemonicWords || (wordsC.credentialsEncrypted && !wordsC.deleted)">
|
<div ng-show="wordsC.mnemonicWords || (wordsC.credentialsEncrypted && !wordsC.deleted)">
|
||||||
<div class="row">
|
<!-- <div class="row">
|
||||||
<div class="m10t columns">
|
<div class="m10t columns">
|
||||||
<a class="button outline light-gray expand tiny" ng-click="wordsC.toggle()">
|
<a class="button outline light-gray expand tiny" ng-click="wordsC.toggle()">
|
||||||
<i class="fi-widget m3r"></i>
|
<i class="fi-widget m3r"></i>
|
||||||
|
|
@ -71,16 +71,18 @@
|
||||||
<i ng-if="wordsC.show" class="icon-arrow-up4"></i>
|
<i ng-if="wordsC.show" class="icon-arrow-up4"></i>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> -->
|
||||||
|
|
||||||
|
|
||||||
<div class="row m10t m10b" ng-show="wordsC.show">
|
<!-- <div class="row m10t m10b" ng-show="wordsC.show"> -->
|
||||||
|
<div class="row m10t m10b">
|
||||||
<div class="small-centered text-gray columns size-14 text-center" translate>
|
<div class="small-centered text-gray columns size-14 text-center" translate>
|
||||||
Your Wallet Seed
|
Your Wallet Seed
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row" ng-show="wordsC.show">
|
<!-- <div class="row" ng-show="wordsC.show"> -->
|
||||||
|
<div class="row">
|
||||||
<div class="columns">
|
<div class="columns">
|
||||||
<div class="p10" style="background:white" ng-class="{'enable_text_select': index.network == 'testnet'}">
|
<div class="p10" style="background:white" ng-class="{'enable_text_select': index.network == 'testnet'}">
|
||||||
<span ng-repeat="word in wordsC.mnemonicWords track by $index"><span style="white-space:nowrap">{{word}}</span><span ng-show="wordsC.useIdeograms"> </span> </span>
|
<span ng-repeat="word in wordsC.mnemonicWords track by $index"><span style="white-space:nowrap">{{word}}</span><span ng-show="wordsC.useIdeograms"> </span> </span>
|
||||||
|
|
@ -88,18 +90,20 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row m10t m20b" ng-show="wordsC.show">
|
<!-- <div class="row m10t m20b" ng-show="wordsC.show"> -->
|
||||||
<div class="columns" ng-show="wordsC.mnemonicHasPassphrase">
|
<div class="row m10t m20b">
|
||||||
<span class="size-12">
|
<div class="columns" ng-show="wordsC.mnemonicHasPassphrase">
|
||||||
<i class="fi-alert"></i>
|
<span class="size-12">
|
||||||
<span translate>
|
<i class="fi-alert"></i>
|
||||||
WARNING: This seed was created with a passphrase. To recover this wallet both the mnemonic and passphrase are needed.
|
<span translate>
|
||||||
</span>
|
WARNING: This seed was created with a passphrase. To recover this wallet both the mnemonic and passphrase are needed.
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row" ng-show="wordsC.show">
|
<!-- <div class="row" ng-show="wordsC.show"> -->
|
||||||
|
<!-- <div class="row">
|
||||||
<div class="m10t text-center columns">
|
<div class="m10t text-center columns">
|
||||||
<div class="size-12 text-gray">
|
<div class="size-12 text-gray">
|
||||||
<span translate>
|
<span translate>
|
||||||
|
|
@ -113,6 +117,12 @@
|
||||||
</span>
|
</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
</div> -->
|
||||||
|
|
||||||
|
<div class="columns text-center">
|
||||||
|
<button class="black round small expand" ng-style="{'background-color':index.backgroundColor}" ng-click="$root.go('backupWords');" translate>
|
||||||
|
Continue
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- hide this in multisig just to show less text -->
|
<!-- hide this in multisig just to show less text -->
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,15 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('wordsController',
|
angular.module('copayApp.controllers').controller('wordsController',
|
||||||
function($rootScope, $scope, $timeout, profileService, go, gettext, confirmDialog, notification, bwsError, $log) {
|
function($rootScope, $scope, $timeout, $log, $compile, lodash, profileService, go, gettext, confirmDialog, notification, bwsError) {
|
||||||
|
|
||||||
var msg = gettext('Are you sure you want to delete the backup words?');
|
var msg = gettext('Are you sure you want to delete the backup words?');
|
||||||
var successMsg = gettext('Backup words deleted');
|
var successMsg = gettext('Backup words deleted');
|
||||||
var self = this;
|
var self = this;
|
||||||
self.show = false;
|
self.show = false;
|
||||||
|
self.sorted = false;
|
||||||
|
$scope.seed = '';
|
||||||
|
var customSortWords = [];
|
||||||
var fc = profileService.focusedClient;
|
var fc = profileService.focusedClient;
|
||||||
|
|
||||||
if (fc.isPrivKeyEncrypted()) self.credentialsEncrypted = true;
|
if (fc.isPrivKeyEncrypted()) self.credentialsEncrypted = true;
|
||||||
|
|
@ -84,4 +87,31 @@ angular.module('copayApp.controllers').controller('wordsController',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self.disableButton = function(word) {
|
||||||
|
document.getElementById(word).disabled = true;
|
||||||
|
$scope.seed += word + ' ';
|
||||||
|
customSortWords.push(word);
|
||||||
|
|
||||||
|
if (customSortWords.length == 12)
|
||||||
|
self.shouldContinue(customSortWords);
|
||||||
|
|
||||||
|
self.addButton(word);
|
||||||
|
}
|
||||||
|
|
||||||
|
self.addButton = function(word) {
|
||||||
|
var btnhtml = '<button class="button radius tiny" style="white-space:nowrap" ' +
|
||||||
|
'ng - click = "wordsC.removeButton(' + word + ')" id = "{{' + word + '_}}" > ' + word + ' </button>';
|
||||||
|
var temp = $compile(btnhtml)($scope);
|
||||||
|
angular.element(document.getElementById('addWord')).append(temp);
|
||||||
|
}
|
||||||
|
|
||||||
|
self.removeButton = function(word) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
self.shouldContinue = function(customSortWords) {
|
||||||
|
if (lodash.isEqual(self.mnemonicWords, customSortWords))
|
||||||
|
self.sorted = true;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -434,6 +434,17 @@ angular
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
.state('backupWords', {
|
||||||
|
url: '/backupWords',
|
||||||
|
templateUrl: 'views/backupWords.html',
|
||||||
|
walletShouldBeComplete: true,
|
||||||
|
needProfile: true,
|
||||||
|
views: {
|
||||||
|
'main': {
|
||||||
|
templateUrl: 'views/backupWords.html'
|
||||||
|
},
|
||||||
|
}
|
||||||
|
})
|
||||||
.state('preferencesGlobal', {
|
.state('preferencesGlobal', {
|
||||||
url: '/preferencesGlobal',
|
url: '/preferencesGlobal',
|
||||||
needProfile: true,
|
needProfile: true,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue