custom fields on all add/edit login pages
This commit is contained in:
parent
8fa6ff48cf
commit
05c8a39e6d
|
@ -30,6 +30,25 @@
|
|||
}
|
||||
};
|
||||
|
||||
$scope.addField = function () {
|
||||
if (!$scope.login.fields) {
|
||||
$scope.login.fields = [];
|
||||
}
|
||||
|
||||
$scope.login.fields.push({
|
||||
type: '0',
|
||||
name: null,
|
||||
value: null
|
||||
});
|
||||
}
|
||||
|
||||
$scope.removeField = function (field) {
|
||||
var index = $scope.login.fields.indexOf(field);
|
||||
if (index > -1) {
|
||||
$scope.login.fields.splice(index, 1);
|
||||
}
|
||||
}
|
||||
|
||||
$scope.clipboardSuccess = function (e) {
|
||||
e.clearSelection();
|
||||
selectPassword(e);
|
||||
|
|
|
@ -31,6 +31,25 @@
|
|||
}
|
||||
};
|
||||
|
||||
$scope.addField = function () {
|
||||
if (!$scope.login.fields) {
|
||||
$scope.login.fields = [];
|
||||
}
|
||||
|
||||
$scope.login.fields.push({
|
||||
type: '0',
|
||||
name: null,
|
||||
value: null
|
||||
});
|
||||
}
|
||||
|
||||
$scope.removeField = function (field) {
|
||||
var index = $scope.login.fields.indexOf(field);
|
||||
if (index > -1) {
|
||||
$scope.login.fields.splice(index, 1);
|
||||
}
|
||||
}
|
||||
|
||||
$scope.clipboardSuccess = function (e) {
|
||||
e.clearSelection();
|
||||
selectPassword(e);
|
||||
|
|
|
@ -31,6 +31,29 @@
|
|||
}
|
||||
};
|
||||
|
||||
$scope.addField = function () {
|
||||
if (!$scope.login.fields) {
|
||||
$scope.login.fields = [];
|
||||
}
|
||||
|
||||
$scope.login.fields.push({
|
||||
type: '0',
|
||||
name: null,
|
||||
value: null
|
||||
});
|
||||
}
|
||||
|
||||
$scope.removeField = function (field) {
|
||||
var index = $scope.login.fields.indexOf(field);
|
||||
if (index > -1) {
|
||||
$scope.login.fields.splice(index, 1);
|
||||
}
|
||||
}
|
||||
|
||||
$scope.toggleFavorite = function () {
|
||||
$scope.login.favorite = !$scope.login.favorite;
|
||||
}
|
||||
|
||||
$scope.clipboardSuccess = function (e) {
|
||||
e.clearSelection();
|
||||
selectPassword(e);
|
||||
|
|
|
@ -55,8 +55,12 @@
|
|||
};
|
||||
|
||||
$scope.addField = function () {
|
||||
if (!$scope.login.fields) {
|
||||
$scope.login.fields = [];
|
||||
}
|
||||
|
||||
$scope.login.fields.push({
|
||||
type: 0,
|
||||
type: '0',
|
||||
name: null,
|
||||
value: null
|
||||
});
|
||||
|
|
|
@ -99,17 +99,73 @@
|
|||
<label for="notes">Notes</label>
|
||||
<textarea id="notes" name="Notes" class="form-control" ng-model="login.notes" api-field></textarea>
|
||||
</div>
|
||||
<div class="checkbox" ng-if="!hideFavorite">
|
||||
<label>
|
||||
<input type="checkbox" ng-model="login.favorite" name="Favorite" />
|
||||
Favorite
|
||||
</label>
|
||||
<hr />
|
||||
<h4><i class="fa fa-list-ul"></i> Custom Fields</h4>
|
||||
<div ng-repeat="field in login.fields">
|
||||
<div class="row">
|
||||
<div class="col-sm-3">
|
||||
<div class="form-group">
|
||||
<label for="field_name{{$index}}">Name</label>
|
||||
<input type="text" id="field_name{{$index}}" name="Field.Name{{$index}}" class="form-control" ng-model="field.name" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<div class="form-group">
|
||||
<label for="field_type{{$index}}">Type</label>
|
||||
<select id="field_type{{$index}}" name="Field.Type{{$index}}" class="form-control" ng-model="field.type">
|
||||
<option value="0">Text</option>
|
||||
<option value="1">Hidden</option>
|
||||
<option value="2">Boolean</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<div class="form-group">
|
||||
<div class="pull-right password-options" ng-if="field.type === '1'">
|
||||
<i class="fa fa-lg fa-eye" uib-tooltip="Toggle Visibility" tooltip-placement="left"
|
||||
password-viewer="#field_value{{$index}}"></i>
|
||||
</div>
|
||||
<label for="field_value{{$index}}">Value</label>
|
||||
<div class="input-group" ng-if="field.type !== '2'">
|
||||
<input ng-attr-type="{{field.type === '0' ? 'text' : 'password'}}" id="field_value{{$index}}"
|
||||
name="Field.Value{{$index}}" class="form-control" ng-model="field.value" />
|
||||
<span class="input-group-btn" uib-tooltip="Copy Value" tooltip-placement="left">
|
||||
<button class="btn btn-default btn-flat" type="button" ngclipboard
|
||||
ngclipboard-success="clipboardSuccess(e)" ngclipboard-error="clipboardError(e, true)"
|
||||
data-clipboard-text="{{field.value}}">
|
||||
<i class="fa fa-clipboard"></i>
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
<div ng-if="field.type === '2'">
|
||||
<input type="checkbox" id="field_value{{$index}}" name="Field.Value{{$index}}" ng-model="field.value"
|
||||
data-ng-true-value="'true'" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-1">
|
||||
<br class="hidden-xs" />
|
||||
<a href="#" ng-click="removeField(field)" stop-click>
|
||||
<i class="fa fa-remove"></i>
|
||||
<span class="visible-xs-inline">Remove Custom Field</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<hr class="visible-xs-block" />
|
||||
</div>
|
||||
<a href="#" ng-click="addField()" stop-click>
|
||||
<i class="fa fa-plus-circle"></i> New Custom Field
|
||||
</a>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="submit" class="btn btn-primary btn-flat" ng-disabled="addLoginForm.$loading">
|
||||
<i class="fa fa-refresh fa-spin loading-icon" ng-show="addLoginForm.$loading"></i>Submit
|
||||
</button>
|
||||
<button type="button" class="btn btn-default btn-flat" ng-click="close()">Close</button>
|
||||
<button type="button" ng-if="!hideFavorite" class="btn btn-link pull-right" ng-click="toggleFavorite()"
|
||||
uib-tooltip="Toggle Favorite" tooltip-placement="left">
|
||||
<i class="fa fa-lg" ng-class="login.favorite ? 'fa-star' : 'fa-star-o'"></i>
|
||||
<span class="sr-only">Toggle Favorite</span>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
|
|
|
@ -158,7 +158,7 @@
|
|||
</div>
|
||||
<div class="col-md-1">
|
||||
<br class="hidden-xs" />
|
||||
<a href="#" ng-click="removeField(field)">
|
||||
<a href="#" ng-click="removeField(field)" stop-click>
|
||||
<i class="fa fa-remove"></i>
|
||||
<span class="visible-xs-inline">Remove Custom Field</span>
|
||||
</a>
|
||||
|
@ -166,7 +166,7 @@
|
|||
</div>
|
||||
<hr class="visible-xs-block" />
|
||||
</div>
|
||||
<a href="#" ng-click="addField()">
|
||||
<a href="#" ng-click="addField()" stop-click>
|
||||
<i class="fa fa-plus-circle"></i> New Custom Field
|
||||
</a>
|
||||
</div>
|
||||
|
@ -175,12 +175,13 @@
|
|||
<i class="fa fa-refresh fa-spin loading-icon" ng-show="editLoginForm.$loading"></i>Save
|
||||
</button>
|
||||
<button type="button" class="btn btn-default btn-flat" ng-click="close()">Close</button>
|
||||
<button type="button" class="btn btn-link pull-right" ng-click="delete()" uib-tooltip="Delete" ng-disabled="readOnly">
|
||||
<button type="button" class="btn btn-link pull-right" ng-click="delete()" uib-tooltip="Delete"
|
||||
tooltip-placement="left" ng-disabled="readOnly">
|
||||
<i class="fa fa-trash fa-lg"></i>
|
||||
<span class="sr-only">Delete</span>
|
||||
</button>
|
||||
<button type="button" ng-if="!hideFavorite" class="btn btn-link pull-right" ng-click="toggleFavorite()"
|
||||
uib-tooltip="Toggle Favorite">
|
||||
uib-tooltip="Toggle Favorite" tooltip-placement="left">
|
||||
<i class="fa fa-lg" ng-class="login.favorite ? 'fa-star' : 'fa-star-o'"></i>
|
||||
<span class="sr-only">Toggle Favorite</span>
|
||||
</button>
|
||||
|
|
Loading…
Reference in New Issue