mirror of
https://github.com/keepassxreboot/keepassxc-browser.git
synced 2026-03-11 08:54:43 +00:00
Rename Specified credential fields to Custom credential fields
This commit is contained in:
parent
6ba29a70f2
commit
6bb319ce86
7 changed files with 46 additions and 46 deletions
|
|
@ -620,8 +620,8 @@ cipDefine.initDescription = function() {
|
|||
.addClass('btn').addClass('btn-primary')
|
||||
.css('margin-right', '15px')
|
||||
.click(function(e) {
|
||||
if (!cip.settings['defined-credential-fields']) {
|
||||
cip.settings['defined-credential-fields'] = {};
|
||||
if (!cip.settings['defined-custom-fields']) {
|
||||
cip.settings['defined-custom-fields'] = {};
|
||||
}
|
||||
|
||||
if (cipDefine.selection.username) {
|
||||
|
|
@ -639,7 +639,7 @@ cipDefine.initDescription = function() {
|
|||
}
|
||||
|
||||
const location = cip.getDocumentLocation();
|
||||
cip.settings['defined-credential-fields'][location] = {
|
||||
cip.settings['defined-custom-fields'][location] = {
|
||||
username: cipDefine.selection.username,
|
||||
password: cipDefine.selection.password,
|
||||
fields: fieldIds
|
||||
|
|
@ -660,7 +660,7 @@ cipDefine.initDescription = function() {
|
|||
$description.append($btnDismiss);
|
||||
|
||||
const location = cip.getDocumentLocation();
|
||||
if (cip.settings['defined-credential-fields'] && cip.settings['defined-credential-fields'][location]) {
|
||||
if (cip.settings['defined-custom-fields'] && cip.settings['defined-custom-fields'][location]) {
|
||||
const $p = jQuery('<p>').html('For this page credential fields are already selected and will be overwritten.<br />');
|
||||
const $btnDiscard = jQuery('<button>')
|
||||
.attr('id', 'btn-warning')
|
||||
|
|
@ -670,7 +670,7 @@ cipDefine.initDescription = function() {
|
|||
.addClass('btn-sm')
|
||||
.addClass('btn-danger')
|
||||
.click(function(e) {
|
||||
delete cip.settings['defined-credential-fields'][location];
|
||||
delete cip.settings['defined-custom-fields'][location];
|
||||
|
||||
browser.runtime.sendMessage({
|
||||
action: 'save_settings',
|
||||
|
|
@ -969,7 +969,7 @@ cipFields.getCombination = function(givenType, fieldId) {
|
|||
}
|
||||
// use defined credential fields (already loaded into combinations)
|
||||
const location = cip.getDocumentLocation();
|
||||
if (cip.settings['defined-credential-fields'] && cip.settings['defined-credential-fields'][location]) {
|
||||
if (cip.settings['defined-custom-fields'] && cip.settings['defined-custom-fields'][location]) {
|
||||
return cipFields.combinations[0];
|
||||
}
|
||||
|
||||
|
|
@ -1170,8 +1170,8 @@ cipFields.prepareCombinations = function(combinations) {
|
|||
|
||||
cipFields.useDefinedCredentialFields = function() {
|
||||
const location = cip.getDocumentLocation();
|
||||
if (cip.settings['defined-credential-fields'] && cip.settings['defined-credential-fields'][location]) {
|
||||
const creds = cip.settings['defined-credential-fields'][location];
|
||||
if (cip.settings['defined-custom-fields'] && cip.settings['defined-custom-fields'][location]) {
|
||||
const creds = cip.settings['defined-custom-fields'][location];
|
||||
|
||||
let $found = _f(creds.username) || _f(creds.password);
|
||||
for (const i of creds.fields) {
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
<ul class="nav navbar-nav">
|
||||
<li class="active"><a href="#general-settings">General</a></li>
|
||||
<li><a href="#connected-databases">Connected Databases</a></li>
|
||||
<li><a href="#specified-fields">Specified credential fields</a></li>
|
||||
<li><a href="#custom-fields">Custom credential fields</a></li>
|
||||
<li><a href="#ignored-sites">Ignored sites</a></li>
|
||||
<li><a href="#about">About</a></li>
|
||||
</ul>
|
||||
|
|
@ -241,16 +241,16 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Specified credential fields -->
|
||||
<div class="tab" id="tab-specified-fields">
|
||||
<h2>Specified credential fields</h2>
|
||||
<!-- Custom credential fields -->
|
||||
<div class="tab" id="tab-custom-fields">
|
||||
<h2>Custom credential fields</h2>
|
||||
<hr />
|
||||
<p>
|
||||
If KeePassXC-Browser detects the wrong credential fields, you are able to specify the correct fields by yourself.
|
||||
<br />
|
||||
Just go to the page and click on the KeePassXC-Browser-Icon, now select <em>Choose own credential fields for this page</em>.
|
||||
Go to the page and click on the KeePassXC-Browser-Icon, now select <em>Choose custom credential fields for this page</em>.
|
||||
<br />
|
||||
On this page you can manage theses specified credential fields.
|
||||
On this page you can manage saved custom credential fields.
|
||||
</p>
|
||||
<table class="table table-striped table-bordered table-hover">
|
||||
<thead>
|
||||
|
|
@ -261,7 +261,7 @@
|
|||
</thead>
|
||||
<tbody>
|
||||
<tr class="empty">
|
||||
<td colspan="2">No specified credential fields found.</td>
|
||||
<td colspan="2">No saved custom credential fields found.</td>
|
||||
</tr>
|
||||
<tr class="clone">
|
||||
<td></td>
|
||||
|
|
@ -269,16 +269,16 @@
|
|||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div id="dialogDeleteSpecifiedCredentialFields" class="modal fade" tabindex="-1" role="dialog">
|
||||
<div id="dialogDeleteCustomCredentialFields" class="modal fade" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h3 id="myModalLabel">Remove specified credential fields?</h3>
|
||||
<h3 id="myModalLabel">Remove saved custom credential fields?</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>Do you really want to remove the specified credential fields on the page <strong></strong>?</p>
|
||||
<p class="help-block">KeePassXC-Browser will automatically detect the credential fields the next time you visit this page.</p>
|
||||
<p>DDo you really want to remove the saved custom credential fields on the page: <strong></strong>?</p>
|
||||
<p class="help-block">KeePassXC-Browser will automatically detect the credential fields next time you visit this page.</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn" data-dismiss="modal" aria-hidden="true">Cancel</button>
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ $(function() {
|
|||
options.initMenu();
|
||||
options.initGeneralSettings();
|
||||
options.initConnectedDatabases();
|
||||
options.initSpecifiedCredentialFields();
|
||||
options.initCustomCredentialFields();
|
||||
options.initIgnoredSites();
|
||||
options.initAbout();
|
||||
});
|
||||
|
|
@ -214,50 +214,50 @@ options.initConnectedDatabases = function() {
|
|||
});
|
||||
};
|
||||
|
||||
options.initSpecifiedCredentialFields = function() {
|
||||
$('#dialogDeleteSpecifiedCredentialFields').modal({keyboard: true, show: false, backdrop: true});
|
||||
$('#tab-specified-fields tr.clone:first button.delete:first').click(function(e) {
|
||||
options.initCustomCredentialFields = function() {
|
||||
$('#dialogDeleteCustomCredentialFields').modal({keyboard: true, show: false, backdrop: true});
|
||||
$('#tab-custom-fields tr.clone:first button.delete:first').click(function(e) {
|
||||
e.preventDefault();
|
||||
$('#dialogDeleteSpecifiedCredentialFields').data('url', $(this).closest('tr').data('url'));
|
||||
$('#dialogDeleteSpecifiedCredentialFields').data('tr-id', $(this).closest('tr').attr('id'));
|
||||
$('#dialogDeleteSpecifiedCredentialFields .modal-body:first strong:first').text($(this).closest('tr').children('td:first').text());
|
||||
$('#dialogDeleteSpecifiedCredentialFields').modal('show');
|
||||
$('#dialogDeleteCustomCredentialFields').data('url', $(this).closest('tr').data('url'));
|
||||
$('#dialogDeleteCustomCredentialFields').data('tr-id', $(this).closest('tr').attr('id'));
|
||||
$('#dialogDeleteCustomCredentialFields .modal-body:first strong:first').text($(this).closest('tr').children('td:first').text());
|
||||
$('#dialogDeleteCustomCredentialFields').modal('show');
|
||||
});
|
||||
|
||||
$('#dialogDeleteSpecifiedCredentialFields .modal-footer:first button.yes:first').click(function(e) {
|
||||
$('#dialogDeleteSpecifiedCredentialFields').modal('hide');
|
||||
$('#dialogDeleteCustomCredentialFields .modal-footer:first button.yes:first').click(function(e) {
|
||||
$('#dialogDeleteCustomCredentialFields').modal('hide');
|
||||
|
||||
const url = $('#dialogDeleteSpecifiedCredentialFields').data('url');
|
||||
const trId = $('#dialogDeleteSpecifiedCredentialFields').data('tr-id');
|
||||
$('#tab-specified-fields #' + trId).remove();
|
||||
const url = $('#dialogDeleteCustomCredentialFields').data('url');
|
||||
const trId = $('#dialogDeleteCustomCredentialFields').data('tr-id');
|
||||
$('#tab-custom-fields #' + trId).remove();
|
||||
|
||||
delete options.settings['defined-credential-fields'][url];
|
||||
delete options.settings['defined-custom-fields'][url];
|
||||
options.saveSettings();
|
||||
|
||||
if ($('#tab-specified-fields table tbody:first tr').length > 2) {
|
||||
$('#tab-specified-fields table tbody:first tr.empty:first').hide();
|
||||
if ($('#tab-custom-fields table tbody:first tr').length > 2) {
|
||||
$('#tab-custom-fields table tbody:first tr.empty:first').hide();
|
||||
} else {
|
||||
$('#tab-specified-fields table tbody:first tr.empty:first').show();
|
||||
$('#tab-custom-fields table tbody:first tr.empty:first').show();
|
||||
}
|
||||
});
|
||||
|
||||
const trClone = $('#tab-specified-fields table tr.clone:first').clone(true);
|
||||
const trClone = $('#tab-custom-fields table tr.clone:first').clone(true);
|
||||
trClone.removeClass('clone');
|
||||
let counter = 1;
|
||||
for (let url in options.settings['defined-credential-fields']) {
|
||||
for (let url in options.settings['defined-custom-fields']) {
|
||||
const tr = trClone.clone(true);
|
||||
tr.data('url', url);
|
||||
tr.attr('id', 'tr-scf' + counter);
|
||||
++counter;
|
||||
|
||||
tr.children('td:first').text(url);
|
||||
$('#tab-specified-fields table tbody:first').append(tr);
|
||||
$('#tab-custom-fields table tbody:first').append(tr);
|
||||
}
|
||||
|
||||
if ($('#tab-specified-fields table tbody:first tr').length > 2) {
|
||||
$('#tab-specified-fields table tbody:first tr.empty:first').hide();
|
||||
if ($('#tab-custom-fields table tbody:first tr').length > 2) {
|
||||
$('#tab-custom-fields table tbody:first tr.empty:first').hide();
|
||||
} else {
|
||||
$('#tab-specified-fields table tbody:first tr.empty:first').show();
|
||||
$('#tab-custom-fields table tbody:first tr.empty:first').show();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
<div class="container">
|
||||
<div id="settings" class="settings">
|
||||
<button id="btn-options" class="btn btn-sm btn-success"><span class="glyphicon glyphicon-cog"></span> Settings</button>
|
||||
<button id="btn-choose-credential-fields" class="btn btn-sm btn-warning"><span class="glyphicon glyphicon-list-alt"></span> Choose own credential fields for this page</button>
|
||||
<button id="btn-choose-credential-fields" class="btn btn-sm btn-warning"><span class="glyphicon glyphicon-list-alt"></span> Choose custom credential fields for this page</button>
|
||||
<button id="lock-database-button" class="btn btn-danger" title="Lock database"><span class="glyphicon glyphicon-lock"></span></button>
|
||||
|
||||
<div id="update-available" class="alert alert-danger">
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
<div class="container">
|
||||
<div id="settings" class="settings">
|
||||
<button id="btn-options" class="btn btn-sm btn-success"><span class="glyphicon glyphicon-cog"></span> Settings</button>
|
||||
<button id="btn-choose-credential-fields" class="btn btn-sm btn-warning"><span class="glyphicon glyphicon-list-alt"></span> Choose own credential fields for this page</button>
|
||||
<button id="btn-choose-credential-fields" class="btn btn-sm btn-warning"><span class="glyphicon glyphicon-list-alt"></span> Choose custom credential fields for this page</button>
|
||||
<button id="lock-database-button" class="btn btn-danger" title="Lock database"><span class="glyphicon glyphicon-lock"></span></button>
|
||||
|
||||
<div id="update-available" class="alert alert-danger">
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
<div class="container">
|
||||
<div id="settings" class="settings">
|
||||
<button id="btn-options" class="btn btn-sm btn-success"><span class="glyphicon glyphicon-cog"></span> Settings</button>
|
||||
<button id="btn-choose-credential-fields" class="btn btn-sm btn-warning"><span class="glyphicon glyphicon-list-alt"></span> Choose own credential fields for this page</button>
|
||||
<button id="btn-choose-credential-fields" class="btn btn-sm btn-warning"><span class="glyphicon glyphicon-list-alt"></span> Choose custom credential fields for this page</button>
|
||||
<button id="lock-database-button" class="btn btn-danger" title="Lock database"><span class="glyphicon glyphicon-lock"></span></button>
|
||||
|
||||
<div id="update-available" class="alert alert-danger">
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
<div class="container">
|
||||
<div id="settings" class="settings">
|
||||
<button id="btn-options" class="btn btn-sm btn-success"><span class="glyphicon glyphicon-cog"></span> Settings</button>
|
||||
<button id="btn-choose-credential-fields" class="btn btn-sm btn-warning"><span class="glyphicon glyphicon-list-alt"></span> Choose own credential fields for this page</button>
|
||||
<button id="btn-choose-credential-fields" class="btn btn-sm btn-warning"><span class="glyphicon glyphicon-list-alt"></span> Choose custom credential fields for this page</button>
|
||||
<button id="lock-database-button" class="btn btn-danger" title="Lock database"><span class="glyphicon glyphicon-lock"></span></button>
|
||||
|
||||
<div id="update-available" class="alert alert-danger">
|
||||
|
|
|
|||
Loading…
Reference in a new issue