1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-22 11:45:59 +01:00

formatting

This commit is contained in:
Kyle Spearrin 2016-09-22 13:15:42 -04:00
parent a57897b0c7
commit f28b690a2a
15 changed files with 57 additions and 45 deletions

View File

@ -78,7 +78,8 @@ gulp.task('lib', ['clean:lib'], function () {
dest: paths.libDir + 'angular-ui-router' dest: paths.libDir + 'angular-ui-router'
}, },
{ {
src: [paths.npmDir + 'angular-toastr/dist/angular-toastr.tpls.js', paths.npmDir + 'angular-toastr/dist/angular-toastr.css'], src: [paths.npmDir + 'angular-toastr/dist/angular-toastr.tpls.js',
paths.npmDir + 'angular-toastr/dist/angular-toastr.css'],
dest: paths.libDir + 'angular-toastr' dest: paths.libDir + 'angular-toastr'
}, },
{ {
@ -102,7 +103,8 @@ gulp.task('lib', ['clean:lib'], function () {
dest: paths.libDir + 'q' dest: paths.libDir + 'q'
}, },
{ {
src: [paths.npmDir + 'sweetalert/dist/sweetalert.css', paths.npmDir + 'sweetalert/dist/sweetalert.min.js', paths.npmDir + 'angular-sweetalert/SweetAlert.js'], src: [paths.npmDir + 'sweetalert/dist/sweetalert.css', paths.npmDir + 'sweetalert/dist/sweetalert.min.js',
paths.npmDir + 'angular-sweetalert/SweetAlert.js'],
dest: paths.libDir + 'sweetalert' dest: paths.libDir + 'sweetalert'
} }
]; ];

View File

@ -100,7 +100,10 @@
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, site: null, fromCurrent: false } params: {
animation: null, returnScrollY: 0, returnSearchText: null, name: null,
uri: null, site: null, fromCurrent: false
}
}) })
.state('editSite', { .state('editSite', {
url: '/edit-site?siteId', url: '/edit-site?siteId',

View File

@ -10,12 +10,14 @@
<div class="list-grouped"> <div class="list-grouped">
<div ng-click="fillSite(site)" class="list-grouped-item condensed" style="cursor: pointer;" <div ng-click="fillSite(site)" class="list-grouped-item condensed" style="cursor: pointer;"
ng-repeat="site in theSites = (sites | orderBy: ['name', 'username'])"> ng-repeat="site in theSites = (sites | orderBy: ['name', 'username'])">
<a class="btn-list" href="" ng-click="$event.stopPropagation()" title="Copy Password" ngclipboard ngclipboard-error="clipboardError(e)" <a class="btn-list" href="" ng-click="$event.stopPropagation()" title="Copy Password"
ngclipboard-success="clipboardSuccess(e, 'Password')" data-clipboard-text="{{site.password}}" ng-class="{'disabled': !site.password}"> ngclipboard ngclipboard-error="clipboardError(e)" ngclipboard-success="clipboardSuccess(e, 'Password')"
data-clipboard-text="{{site.password}}" ng-class="{'disabled': !site.password}">
<i class="fa fa-lg fa-key"></i> <i class="fa fa-lg fa-key"></i>
</a> </a>
<a class="btn-list" href="" ng-click="$event.stopPropagation()" title="Copy Username" ngclipboard ngclipboard-error="clipboardError(e)" <a class="btn-list" href="" ng-click="$event.stopPropagation()" title="Copy Username"
ngclipboard-success="clipboardSuccess(e, 'Username')" data-clipboard-text="{{site.username}}" ng-class="{'disabled': !site.username}"> ngclipboard ngclipboard-error="clipboardError(e)" ngclipboard-success="clipboardSuccess(e, 'Username')"
data-clipboard-text="{{site.username}}" ng-class="{'disabled': !site.username}">
<i class="fa fa-lg fa-user"></i> <i class="fa fa-lg fa-user"></i>
</a> </a>
<span class="text">{{site.name}}</span> <span class="text">{{site.name}}</span>

View File

@ -1,9 +1,17 @@
<div ui-view></div> <div ui-view></div>
<div class="tabs" ng-controller="tabsController"> <div class="tabs" ng-controller="tabsController">
<ul> <ul>
<li ng-class="{active: $state.includes('tabs.current')}"><a ui-sref="tabs.current"><i class="fa fa-folder fa-2x"></i> Tab</a></li> <li ng-class="{active: $state.includes('tabs.current')}">
<li ng-class="{active: $state.includes('tabs.vault')}"><a ui-sref="tabs.vault"><i class="fa fa-lock fa-2x"></i> My Vault</a></li> <a ui-sref="tabs.current"><i class="fa fa-folder fa-2x"></i> Tab</a>
<li ng-class="{active: $state.includes('tabs.tools')}"><a ui-sref="tabs.tools"><i class="fa fa-wrench fa-2x"></i> Tools</a></li> </li>
<li ng-class="{active: $state.includes('tabs.settings')}"><a ui-sref="tabs.settings"><i class="fa fa-cogs fa-2x"></i> Settings</a></li> <li ng-class="{active: $state.includes('tabs.vault')}">
<a ui-sref="tabs.vault"><i class="fa fa-lock fa-2x"></i> My Vault</a>
</li>
<li ng-class="{active: $state.includes('tabs.tools')}">
<a ui-sref="tabs.tools"><i class="fa fa-wrench fa-2x"></i> Tools</a>
</li>
<li ng-class="{active: $state.includes('tabs.settings')}">
<a ui-sref="tabs.settings"><i class="fa fa-cogs fa-2x"></i> Settings</a>
</li>
</ul> </ul>
</div> </div>

View File

@ -1,7 +1,8 @@
angular angular
.module('bit.services') .module('bit.services')
.factory('loginService', function (cryptoService, apiService, userService, tokenService, $q, syncService, $rootScope, siteService, folderService) { .factory('loginService', function (cryptoService, apiService, userService, tokenService, $q, syncService,
$rootScope, siteService, folderService) {
var _service = {}; var _service = {};
_service.logIn = function (email, masterPassword) { _service.logIn = function (email, masterPassword) {

View File

@ -21,7 +21,8 @@
$scope.changePassword = function () { $scope.changePassword = function () {
SweetAlert.swal({ SweetAlert.swal({
title: 'Change Master Password', title: 'Change Master Password',
text: 'You can change your master password on the bitwarden.com web vault. Do you want to visit the website now?', text: 'You can change your master password on the bitwarden.com web vault. Do you want to visit the ' +
'website now?',
showCancelButton: true, showCancelButton: true,
confirmButtonText: 'Yes', confirmButtonText: 'Yes',
cancelButtonText: 'Cancel' cancelButtonText: 'Cancel'
@ -31,7 +32,8 @@
$scope.changeEmail = function () { $scope.changeEmail = function () {
SweetAlert.swal({ SweetAlert.swal({
title: 'Change Email', title: 'Change Email',
text: 'You can change your email address on the bitwarden.com web vault. Do you want to visit the website now?', text: 'You can change your email address on the bitwarden.com web vault. Do you want to visit the ' +
'website now?',
showCancelButton: true, showCancelButton: true,
confirmButtonText: 'Yes', confirmButtonText: 'Yes',
cancelButtonText: 'Cancel' cancelButtonText: 'Cancel'
@ -41,7 +43,9 @@
$scope.twoStep = function () { $scope.twoStep = function () {
SweetAlert.swal({ SweetAlert.swal({
title: 'Two-step Login', title: 'Two-step Login',
text: 'Two-step login makes your account more secure by requiring you to enter a security code from an authenticator app whenever you log in. Two-step login can be enabled on the bitwarden.com web vault. Do you want to visit the website now?', text: 'Two-step login makes your account more secure by requiring you to enter a security code from an ' +
'authenticator app whenever you log in. Two-step login can be enabled on the bitwarden.com web vault. ' +
'Do you want to visit the website now?',
showCancelButton: true, showCancelButton: true,
confirmButtonText: 'Yes', confirmButtonText: 'Yes',
cancelButtonText: 'Cancel' cancelButtonText: 'Cancel'
@ -71,6 +75,6 @@
default: default:
return; return;
} }
}; };
}); });

View File

@ -21,7 +21,8 @@
<div class="centered-message" ng-if="loaded && !folders.length"> <div class="centered-message" ng-if="loaded && !folders.length">
<p> <p>
There are no folders to list. There are no folders to list.
<a ui-sref="addFolder({animation: 'in-slide-up'})" style="margin-top: 20px;" class="btn btn-link btn-lg btn-block">Add a Folder</a> <a ui-sref="addFolder({animation: 'in-slide-up'})" style="margin-top: 20px;"
class="btn btn-link btn-lg btn-block">Add a Folder</a>
</p> </p>
</div> </div>
<div class="page-loading" ng-if="!loaded"> <div class="page-loading" ng-if="!loaded">

View File

@ -1,7 +1,8 @@
angular angular
.module('bit.tools') .module('bit.tools')
.controller('toolsPasswordGeneratorController', function ($scope, $state, $stateParams, passwordGenerationService, toastr, $q) { .controller('toolsPasswordGeneratorController', function ($scope, $state, $stateParams, passwordGenerationService,
toastr, $q) {
var addState = $stateParams.addState, var addState = $stateParams.addState,
editState = $stateParams.editState; editState = $stateParams.editState;

View File

@ -56,11 +56,13 @@
<div class="list-section-items"> <div class="list-section-items">
<div class="list-section-item list-section-item-input"> <div class="list-section-item list-section-item-input">
<label for="min-numbers">Minimum Numbers</label> <label for="min-numbers">Minimum Numbers</label>
<input id="min-numbers" type="number" min="0" max="5" ng-model="options.minNumber" ng-change="saveOptions(options)"> <input id="min-numbers" type="number" min="0" max="5" ng-model="options.minNumber"
ng-change="saveOptions(options)">
</div> </div>
<div class="list-section-item list-section-item-input"> <div class="list-section-item list-section-item-input">
<label for="min-special">Minimum Special</label> <label for="min-special">Minimum Special</label>
<input id="min-special" type="number" min="0" max="5" ng-model="options.minSpecial" ng-change="saveOptions(options)"> <input id="min-special" type="number" min="0" max="5" ng-model="options.minSpecial"
ng-change="saveOptions(options)">
</div> </div>
</div> </div>
</div> </div>

View File

@ -43,7 +43,9 @@
<div class="list-section-item"> <div class="list-section-item">
<label for="folder" class="item-label">Folder</label> <label for="folder" class="item-label">Folder</label>
<select id="folder" name="FolderId" ng-model="site.folderId"> <select id="folder" name="FolderId" ng-model="site.folderId">
<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>
</div> </div>
<div class="list-section-item list-section-item-checkbox"> <div class="list-section-item list-section-item-checkbox">

View File

@ -43,7 +43,9 @@
<div class="list-section-item"> <div class="list-section-item">
<label for="folder" class="item-label">Folder</label> <label for="folder" class="item-label">Folder</label>
<select id="folder" name="FolderId" ng-model="site.folderId"> <select id="folder" name="FolderId" ng-model="site.folderId">
<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>
</div> </div>
<div class="list-section-item list-section-item-checkbox"> <div class="list-section-item list-section-item-checkbox">

View File

@ -19,7 +19,8 @@
{{site.name}} {{site.name}}
</div> </div>
<div class="list-section-item" ng-show="site.uri"> <div class="list-section-item" ng-show="site.uri">
<a class="btn-list" href="" title="Launch Website" ng-click="launchWebsite(site)" ng-show="site.showLaunch"> <a class="btn-list" href="" title="Launch Website" ng-click="launchWebsite(site)"
ng-show="site.showLaunch">
<i class="fa fa-lg fa-share-square-o"></i> <i class="fa fa-lg fa-share-square-o"></i>
</a> </a>
<span class="item-label">Website</span> <span class="item-label">Website</span>

View File

@ -29,7 +29,7 @@
} }
} }
else if (select.length > 0) { else if (select.length > 0) {
select.openSelect(); select.focus();
} }
}); });
@ -42,22 +42,3 @@
return self; return self;
}(); }();
// ref: http://stackoverflow.com/questions/19432610/jquery-open-select-by-button
(function ($) {
"use strict";
$.fn.openSelect = function () {
return this.each(function (index, el) {
$(el).focus();
if (document.createEvent) {
var event = document.createEvent("MouseEvents");
event.initMouseEvent("mousedown", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
el.dispatchEvent(event);
}
else if (element.fireEvent) {
el.fireEvent("onmousedown");
}
});
}
}(jQuery));

View File

@ -103,7 +103,7 @@ function initAutofill() {
fillScript.autosubmit = { focusOpid: password.opid }; fillScript.autosubmit = { focusOpid: password.opid };
} }
} }
else if (passwordFields.length == 1) { else if (passwordFields.length === 1) {
// The page does not have any forms with password fields. Use the one password field on the page and the // The page does not have any forms with password fields. Use the one password field on the page and the
// input field just before it as the username. // input field just before it as the username.

View File

@ -99,6 +99,8 @@ function initTokenService() {
throw 'Illegal base64url string!'; throw 'Illegal base64url string!';
} }
} }
return window.decodeURIComponent(escape(window.atob(output))); //polyfill https://github.com/davidchambers/Base64.js
//polyfill https://github.com/davidchambers/Base64.js
return window.decodeURIComponent(escape(window.atob(output)));
}; };
}; };