1
0
mirror of https://github.com/bitwarden/desktop.git synced 2024-11-14 10:16:02 +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'
},
{
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'
},
{
@ -102,7 +103,8 @@ gulp.task('lib', ['clean:lib'], function () {
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'
}
];

View File

@ -100,7 +100,10 @@
templateUrl: 'app/vault/views/vaultAddSite.html',
controller: 'vaultAddSiteController',
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', {
url: '/edit-site?siteId',

View File

@ -10,12 +10,14 @@
<div class="list-grouped">
<div ng-click="fillSite(site)" class="list-grouped-item condensed" style="cursor: pointer;"
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)"
ngclipboard-success="clipboardSuccess(e, 'Password')" data-clipboard-text="{{site.password}}" ng-class="{'disabled': !site.password}">
<a class="btn-list" href="" ng-click="$event.stopPropagation()" title="Copy 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>
</a>
<a class="btn-list" href="" ng-click="$event.stopPropagation()" title="Copy Username" ngclipboard ngclipboard-error="clipboardError(e)"
ngclipboard-success="clipboardSuccess(e, 'Username')" data-clipboard-text="{{site.username}}" ng-class="{'disabled': !site.username}">
<a class="btn-list" href="" ng-click="$event.stopPropagation()" title="Copy 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>
</a>
<span class="text">{{site.name}}</span>

View File

@ -1,9 +1,17 @@
<div ui-view></div>
<div class="tabs" ng-controller="tabsController">
<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.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>
<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.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>
</div>

View File

@ -1,7 +1,8 @@
angular
.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 = {};
_service.logIn = function (email, masterPassword) {

View File

@ -21,7 +21,8 @@
$scope.changePassword = function () {
SweetAlert.swal({
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,
confirmButtonText: 'Yes',
cancelButtonText: 'Cancel'
@ -31,7 +32,8 @@
$scope.changeEmail = function () {
SweetAlert.swal({
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,
confirmButtonText: 'Yes',
cancelButtonText: 'Cancel'
@ -41,7 +43,9 @@
$scope.twoStep = function () {
SweetAlert.swal({
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,
confirmButtonText: 'Yes',
cancelButtonText: 'Cancel'
@ -71,6 +75,6 @@
default:
return;
}
};
});

View File

@ -21,7 +21,8 @@
<div class="centered-message" ng-if="loaded && !folders.length">
<p>
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>
</div>
<div class="page-loading" ng-if="!loaded">

View File

@ -1,7 +1,8 @@
angular
.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,
editState = $stateParams.editState;

View File

@ -56,11 +56,13 @@
<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" 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 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" 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>

View File

@ -43,7 +43,9 @@
<div class="list-section-item">
<label for="folder" class="item-label">Folder</label>
<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>
</div>
<div class="list-section-item list-section-item-checkbox">

View File

@ -43,7 +43,9 @@
<div class="list-section-item">
<label for="folder" class="item-label">Folder</label>
<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>
</div>
<div class="list-section-item list-section-item-checkbox">

View File

@ -19,7 +19,8 @@
{{site.name}}
</div>
<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>
</a>
<span class="item-label">Website</span>

View File

@ -29,7 +29,7 @@
}
}
else if (select.length > 0) {
select.openSelect();
select.focus();
}
});
@ -42,22 +42,3 @@
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 };
}
}
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
// input field just before it as the username.

View File

@ -99,6 +99,8 @@ function initTokenService() {
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)));
};
};