mirror of
https://github.com/moparisthebest/mail
synced 2025-02-19 20:31:48 -05:00
login initial foxed
This commit is contained in:
parent
ccbbd5b182
commit
691e434c49
@ -8,12 +8,15 @@ define(function(require) {
|
|||||||
var emailDao = appController._emailDao,
|
var emailDao = appController._emailDao,
|
||||||
states;
|
states;
|
||||||
|
|
||||||
$scope.states = states = {
|
// global state... inherited to all child scopes
|
||||||
|
$scope.$root.state = {};
|
||||||
|
|
||||||
|
states = {
|
||||||
IDLE: 1,
|
IDLE: 1,
|
||||||
PROCESSING: 2,
|
PROCESSING: 2,
|
||||||
DONE: 4
|
DONE: 4
|
||||||
};
|
};
|
||||||
$scope.state = states.IDLE; // initial state
|
$scope.state.ui = states.IDLE; // initial state
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -21,8 +24,8 @@ define(function(require) {
|
|||||||
//
|
//
|
||||||
|
|
||||||
$scope.confirmPassphrase = function() {
|
$scope.confirmPassphrase = function() {
|
||||||
var passphrase = $scope.passphrase,
|
var passphrase = $scope.state.passphrase,
|
||||||
confirmation = $scope.confirmation;
|
confirmation = $scope.state.confirmation;
|
||||||
|
|
||||||
if (!passphrase || passphrase !== confirmation) {
|
if (!passphrase || passphrase !== confirmation) {
|
||||||
return;
|
return;
|
||||||
@ -73,7 +76,7 @@ define(function(require) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function setState(state, async) {
|
function setState(state, async) {
|
||||||
$scope.state = state;
|
$scope.state.ui = state;
|
||||||
|
|
||||||
if (async) {
|
if (async) {
|
||||||
$scope.$apply();
|
$scope.$apply();
|
||||||
|
@ -1,21 +1,21 @@
|
|||||||
<div class="view-login" ng-class="{'waiting-cursor': state === states.PROCESSING}">
|
<div class="view-login" ng-class="{'waiting-cursor': state.ui === 2}">
|
||||||
|
|
||||||
<div class="logo-wrapper">
|
<div class="logo-wrapper">
|
||||||
<div class="logo"></div>
|
<div class="logo"></div>
|
||||||
</div><!--/logo-->
|
</div><!--/logo-->
|
||||||
|
|
||||||
<div class="content" ng-switch on="state">
|
<div class="content" ng-switch on="state.ui">
|
||||||
|
|
||||||
<div ng-switch-when="1">
|
<div ng-switch-when="1">
|
||||||
<h1>Set passphrase</h1>
|
<h1>Set passphrase</h1>
|
||||||
<p>This is used to protect your keypair. If you forget your passphrase, there is no way to restore your data.</p>
|
<p>This is used to protect your keypair. If you forget your passphrase, there is no way to restore your data.</p>
|
||||||
<form>
|
<form>
|
||||||
<div>
|
<div>
|
||||||
<input type="password" ng-model="passphrase" placeholder="Enter passphrase" tabindex="1" focus-me="true">
|
<input type="password" ng-model="state.passphrase" placeholder="Enter passphrase" tabindex="1" focus-me="true">
|
||||||
<input type="password" ng-model="confirmation" ng-class="{error: confirmation !== passphrase}" placeholder="Confirm passphrase" tabindex="2">
|
<input type="password" ng-model="state.confirmation" ng-class="{error: state.confirmation !== state.passphrase}" placeholder="Confirm passphrase" tabindex="2">
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<button type="submit" ng-click="confirmPassphrase()" class="btn" ng-disabled="!passphrase || passphrase!==confirmation" tabindex="3">Generate keypair</button>
|
<button type="submit" ng-click="confirmPassphrase()" class="btn" ng-disabled="!state.passphrase || state.passphrase !== state.confirmation" tabindex="3">Generate keypair</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user