1
0
mirror of https://github.com/bitwarden/desktop.git synced 2024-09-06 00:28:04 +02:00

setup and stub out password generator page

This commit is contained in:
Kyle Spearrin 2016-09-17 18:27:36 -04:00
parent 36b580d60a
commit d0ca428d90
9 changed files with 138 additions and 35 deletions

View File

@ -28,75 +28,83 @@
$httpProvider.interceptors.push('jwtInterceptor'); $httpProvider.interceptors.push('jwtInterceptor');
$urlRouterProvider.otherwise(function ($injector, $location) { $urlRouterProvider.otherwise(function ($injector, $location) {
var $state = $injector.get("$state"); var $state = $injector.get('$state');
$state.go("login"); $state.go('login');
}); });
$stateProvider $stateProvider
.state('login', { .state('login', {
url: "/login", url: '/login',
controller: 'accountsLoginController', controller: 'accountsLoginController',
templateUrl: "app/accounts/views/accountsLogin.html", templateUrl: 'app/accounts/views/accountsLogin.html',
data: { authorize: false }, data: { authorize: false },
params: { animation: null } params: { animation: null }
}) })
.state('twoFactor', { .state('twoFactor', {
url: "/two-factor", url: '/two-factor',
controller: 'accountsLoginController', controller: 'accountsLoginController',
templateUrl: "app/accounts/views/accountsLoginTwoFactor.html", templateUrl: 'app/accounts/views/accountsLoginTwoFactor.html',
data: { authorize: false }, data: { authorize: false },
params: { animation: null } params: { animation: null }
}) })
.state('tabs', { .state('tabs', {
url: "/tab", url: '/tab',
abstract: true, abstract: true,
templateUrl: "app/global/tabs.html", templateUrl: 'app/global/tabs.html',
data: { authorize: true }, data: { authorize: true },
params: { animation: null } params: { animation: null }
}) })
.state('tabs.current', { .state('tabs.current', {
url: "/current", url: '/current',
templateUrl: "app/current/views/current.html", templateUrl: 'app/current/views/current.html',
controller: 'currentController' controller: 'currentController'
}) })
.state('tabs.vault', { .state('tabs.vault', {
url: "/vault", url: '/vault',
templateUrl: "app/vault/views/vault.html", templateUrl: 'app/vault/views/vault.html',
controller: 'vaultController', controller: 'vaultController',
params: { scrollY: 0, searchText: null } params: { scrollY: 0, searchText: null }
}) })
.state('tabs.settings', { .state('tabs.settings', {
url: "/settings", url: '/settings',
templateUrl: "app/settings/views/settings.html", templateUrl: 'app/settings/views/settings.html',
controller: 'settingsController' controller: 'settingsController'
}) })
.state('tabs.tools', { .state('tabs.tools', {
url: "/tools", url: '/tools',
templateUrl: "app/tools/views/tools.html", templateUrl: 'app/tools/views/tools.html',
controller: 'toolsController' controller: 'toolsController'
}) })
.state('viewSite', { .state('viewSite', {
url: "/view-site?siteId", url: '/view-site?siteId',
templateUrl: "app/vault/views/vaultViewSite.html", templateUrl: 'app/vault/views/vaultViewSite.html',
controller: 'vaultViewSiteController', controller: 'vaultViewSiteController',
data: { authorize: true }, data: { authorize: true },
params: { animation: null, returnScrollY: 0, returnSearchText: null } params: { animation: null, returnScrollY: 0, returnSearchText: null }
}) })
.state('addSite', { .state('addSite', {
url: "/add-site", url: '/add-site',
templateUrl: "app/vault/views/vaultAddSite.html", templateUrl: 'app/vault/views/vaultAddSite.html',
controller: 'vaultAddSiteController', controller: 'vaultAddSiteController',
data: { authorize: true }, data: { authorize: true },
params: { animation: null, returnScrollY: 0, returnSearchText: null, name: null, uri: null } params: { animation: null, returnScrollY: 0, returnSearchText: null, name: null, uri: null }
}) })
.state('editSite', { .state('editSite', {
url: "/edit-site?siteId", url: '/edit-site?siteId',
templateUrl: "app/vault/views/vaultEditSite.html", templateUrl: 'app/vault/views/vaultEditSite.html',
controller: 'vaultEditSiteController', controller: 'vaultEditSiteController',
data: { authorize: true }, data: { authorize: true },
params: { animation: null, fromView: true, returnScrollY: 0, returnSearchText: null } params: { animation: null, fromView: true, returnScrollY: 0, returnSearchText: null }
})
.state('passwordGenerator', {
url: '/password-generator',
templateUrl: 'app/tools/views/toolsPasswordGenerator.html',
controller: 'toolsPasswordGeneratorController',
data: { authorize: true },
params: { animation: null, fromAdd: false, fromEdit: null }
}); });
}) })
.run(function ($rootScope, userService, loginService, tokenService, $state) { .run(function ($rootScope, userService, loginService, tokenService, $state) {

View File

@ -16,12 +16,14 @@ angular
tabId = tabs[0].id; tabId = tabs[0].id;
} }
else { else {
$scope.loaded = true;
return; return;
} }
domain = tldjs.getDomain(url); domain = tldjs.getDomain(url);
$scope.sites = []; $scope.sites = [];
if (!domain) { if (!domain) {
$scope.loaded = true;
return; return;
} }

View File

@ -0,0 +1,6 @@
angular
.module('bit.tools')
.controller('toolsPasswordGeneratorController', function ($scope, $state, $stateParams) {
popupUtils.initListSectionItemListeners();
});

View File

@ -5,7 +5,7 @@
<div class="list"> <div class="list">
<div class="list-section"> <div class="list-section">
<div class="list-section-items"> <div class="list-section-items">
<a class="list-section-item wrap" href="#"> <a class="list-section-item wrap" href="" ui-sref="passwordGenerator({animation: 'in-slide-up'})">
<span class="leading-icon"><i class="fa fa-refresh fa-fw"></i></span> <span class="leading-icon"><i class="fa fa-refresh fa-fw"></i></span>
<span class="text">Password Generator</span> <span class="text">Password Generator</span>
<span class="detail">Automatically generate strong, unique passwords for your logins.</span> <span class="detail">Automatically generate strong, unique passwords for your logins.</span>

View File

@ -0,0 +1,72 @@
<div class="header">
<div class="left">
<a ng-click="close()" href="">Close</a>
</div>
<div class="right">
<a ng-click="select()" href="">Select</a>
</div>
<div class="title">Generate Password</div>
</div>
<div class="content">
<div style="margin: 20px; font-size: 20px; text-align: center;">
<span id="generated-password">*&Houhdasdy87</span>
</div>
<div class="list" style="margin-top: 0;">
<div class="list-section" style="padding-top: 0;">
<div class="list-section-items">
<a class="list-section-item" href="#">
Regenerate Password
</a>
<a class="list-section-item" href="#">
Copy Password
</a>
</div>
</div>
<div class="list-section">
<div class="list-section-header">
Options
</div>
<div class="list-section-items">
<div class="list-section-item list-section-item-slider">
<label for="length">Length</label>
</div>
<div class="list-section-item list-section-item-checkbox">
<label for="uppercase">A-Z</label>
<input id="uppercase" type="checkbox">
</div>
<div class="list-section-item list-section-item-checkbox">
<label for="lowercase">a-z</label>
<input id="lowercase" type="checkbox">
</div>
<div class="list-section-item list-section-item-checkbox">
<label for="numbers">0-9</label>
<input id="numbers" type="checkbox">
</div>
<div class="list-section-item list-section-item-checkbox">
<label for="special">!@#$%^&*</label>
<input id="special" type="checkbox">
</div>
</div>
</div>
<div class="list-section">
<div class="list-section-items">
<div class="list-section-item list-section-item-input">
<label for="min-numbers">Minimum Numbers</label>
<input id="min-numbers" type="number" min="0" max="5">
</div>
<div class="list-section-item list-section-item-input">
<label for="min-special">Minimum Special</label>
<input id="min-special" type="number" min="0" max="5">
</div>
</div>
</div>
<div class="list-section">
<div class="list-section-items">
<div class="list-section-item list-section-item-checkbox">
<label for="ambiguous">Avoid Ambiguous Characters</label>
<input id="ambiguous" type="checkbox">
</div>
</div>
</div>
</div>
</div>

View File

@ -17,19 +17,19 @@
</div> </div>
<div class="list-section-items"> <div class="list-section-items">
<div class="list-section-item"> <div class="list-section-item">
<label for="name">Name</label> <label for="name" class="item-label">Name</label>
<input id="name" type="text" name="Name" ng-model="site.name" bit-field> <input id="name" type="text" name="Name" ng-model="site.name" bit-field>
</div> </div>
<div class="list-section-item"> <div class="list-section-item">
<label for="uri">URI</label> <label for="uri" class="item-label">URI</label>
<input id="uri" type="text" name="Uri" ng-model="site.uri" bit-field> <input id="uri" type="text" name="Uri" ng-model="site.uri" bit-field>
</div> </div>
<div class="list-section-item"> <div class="list-section-item">
<label for="username">Username</label> <label for="username" class="item-label">Username</label>
<input id="username" type="text" name="Username" ng-model="site.username" bit-field> <input id="username" type="text" name="Username" ng-model="site.username" bit-field>
</div> </div>
<div class="list-section-item"> <div class="list-section-item">
<label for="password">Password</label> <label for="password" class="item-label">Password</label>
<input id="password" type="password" name="Password" ng-model="site.password" bit-field> <input id="password" type="password" name="Password" ng-model="site.password" bit-field>
</div> </div>
<a class="list-section-item" href="#"> <a class="list-section-item" href="#">
@ -41,7 +41,7 @@
<div class="list-section"> <div class="list-section">
<div class="list-section-items"> <div class="list-section-items">
<div class="list-section-item"> <div class="list-section-item">
<label for="folder">Folder</label> <label for="folder" class="item-label">Folder</label>
<select id="folder" name="FolderId" ng-model="site.folderId" bit-field> <select id="folder" name="FolderId" ng-model="site.folderId" bit-field>
<option ng-repeat="folder in folders | orderBy: ['name']" value="{{folder.id}}">{{folder.name}}</option> <option ng-repeat="folder in folders | orderBy: ['name']" value="{{folder.id}}">{{folder.name}}</option>
</select> </select>

View File

@ -17,19 +17,19 @@
</div> </div>
<div class="list-section-items"> <div class="list-section-items">
<div class="list-section-item"> <div class="list-section-item">
<label for="name">Name</label> <label for="name" class="item-label">Name</label>
<input id="name" type="text" name="Name" ng-model="site.name" bit-field> <input id="name" type="text" name="Name" ng-model="site.name" bit-field>
</div> </div>
<div class="list-section-item"> <div class="list-section-item">
<label for="uri">URI</label> <label for="uri" class="item-label">URI</label>
<input id="uri" type="text" name="Uri" ng-model="site.uri" bit-field> <input id="uri" type="text" name="Uri" ng-model="site.uri" bit-field>
</div> </div>
<div class="list-section-item"> <div class="list-section-item">
<label for="username">Username</label> <label for="username" class="item-label">Username</label>
<input id="username" type="text" name="Username" ng-model="site.username" bit-field> <input id="username" type="text" name="Username" ng-model="site.username" bit-field>
</div> </div>
<div class="list-section-item"> <div class="list-section-item">
<label for="password">Password</label> <label for="password" class="item-label">Password</label>
<input id="password" type="password" name="Password" ng-model="site.password" bit-field> <input id="password" type="password" name="Password" ng-model="site.password" bit-field>
</div> </div>
<a class="list-section-item" href="#"> <a class="list-section-item" href="#">
@ -41,7 +41,7 @@
<div class="list-section"> <div class="list-section">
<div class="list-section-items"> <div class="list-section-items">
<div class="list-section-item"> <div class="list-section-item">
<label for="folder">Folder</label> <label for="folder" class="item-label">Folder</label>
<select id="folder" name="FolderId" ng-model="site.folderId" bit-field> <select id="folder" name="FolderId" ng-model="site.folderId" bit-field>
<option ng-repeat="folder in folders | orderBy: ['name']" value="{{folder.id}}">{{folder.name}}</option> <option ng-repeat="folder in folders | orderBy: ['name']" value="{{folder.id}}">{{folder.name}}</option>
</select> </select>

View File

@ -62,6 +62,7 @@
<script src="app/tools/toolsModule.js"></script> <script src="app/tools/toolsModule.js"></script>
<script src="app/tools/toolsController.js"></script> <script src="app/tools/toolsController.js"></script>
<script src="app/tools/toolsPasswordGeneratorController.js"></script>
</head> </head>
<body ng-controller="mainController as main" class="{{main.animation}}"> <body ng-controller="mainController as main" class="{{main.animation}}">
<div ui-view class="main-view"></div> <div ui-view class="main-view"></div>

View File

@ -251,7 +251,7 @@
display: block; display: block;
} }
label, .item-label { .item-label {
font-size: @font-size-small; font-size: @font-size-small;
color: @gray-light; color: @gray-light;
display: block; display: block;
@ -298,7 +298,7 @@
} }
} }
&.list-section-item-checkbox { &.list-section-item-checkbox, &.list-section-item-input, &.list-section-item-slider {
label { label {
font-size: @font-size-base; font-size: @font-size-base;
color: @text-color; color: @text-color;
@ -306,13 +306,27 @@
width: initial; width: initial;
font-weight: normal; font-weight: normal;
float: left; float: left;
margin: 0;
} }
}
&.list-section-item-checkbox {
input[type="checkbox"] { input[type="checkbox"] {
float: right; float: right;
display: inline-block; display: inline-block;
} }
} }
&.list-section-item-input {
input {
float: right;
display: inline-block;
border: none;
background: none;
width: 100px;
text-align: right;
}
}
} }
&.list-no-selection { &.list-no-selection {