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')
|
.addClass('btn').addClass('btn-primary')
|
||||||
.css('margin-right', '15px')
|
.css('margin-right', '15px')
|
||||||
.click(function(e) {
|
.click(function(e) {
|
||||||
if (!cip.settings['defined-credential-fields']) {
|
if (!cip.settings['defined-custom-fields']) {
|
||||||
cip.settings['defined-credential-fields'] = {};
|
cip.settings['defined-custom-fields'] = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cipDefine.selection.username) {
|
if (cipDefine.selection.username) {
|
||||||
|
|
@ -639,7 +639,7 @@ cipDefine.initDescription = function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
const location = cip.getDocumentLocation();
|
const location = cip.getDocumentLocation();
|
||||||
cip.settings['defined-credential-fields'][location] = {
|
cip.settings['defined-custom-fields'][location] = {
|
||||||
username: cipDefine.selection.username,
|
username: cipDefine.selection.username,
|
||||||
password: cipDefine.selection.password,
|
password: cipDefine.selection.password,
|
||||||
fields: fieldIds
|
fields: fieldIds
|
||||||
|
|
@ -660,7 +660,7 @@ cipDefine.initDescription = function() {
|
||||||
$description.append($btnDismiss);
|
$description.append($btnDismiss);
|
||||||
|
|
||||||
const location = cip.getDocumentLocation();
|
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 $p = jQuery('<p>').html('For this page credential fields are already selected and will be overwritten.<br />');
|
||||||
const $btnDiscard = jQuery('<button>')
|
const $btnDiscard = jQuery('<button>')
|
||||||
.attr('id', 'btn-warning')
|
.attr('id', 'btn-warning')
|
||||||
|
|
@ -670,7 +670,7 @@ cipDefine.initDescription = function() {
|
||||||
.addClass('btn-sm')
|
.addClass('btn-sm')
|
||||||
.addClass('btn-danger')
|
.addClass('btn-danger')
|
||||||
.click(function(e) {
|
.click(function(e) {
|
||||||
delete cip.settings['defined-credential-fields'][location];
|
delete cip.settings['defined-custom-fields'][location];
|
||||||
|
|
||||||
browser.runtime.sendMessage({
|
browser.runtime.sendMessage({
|
||||||
action: 'save_settings',
|
action: 'save_settings',
|
||||||
|
|
@ -969,7 +969,7 @@ cipFields.getCombination = function(givenType, fieldId) {
|
||||||
}
|
}
|
||||||
// use defined credential fields (already loaded into combinations)
|
// use defined credential fields (already loaded into combinations)
|
||||||
const location = cip.getDocumentLocation();
|
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];
|
return cipFields.combinations[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1170,8 +1170,8 @@ cipFields.prepareCombinations = function(combinations) {
|
||||||
|
|
||||||
cipFields.useDefinedCredentialFields = function() {
|
cipFields.useDefinedCredentialFields = function() {
|
||||||
const location = cip.getDocumentLocation();
|
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 creds = cip.settings['defined-credential-fields'][location];
|
const creds = cip.settings['defined-custom-fields'][location];
|
||||||
|
|
||||||
let $found = _f(creds.username) || _f(creds.password);
|
let $found = _f(creds.username) || _f(creds.password);
|
||||||
for (const i of creds.fields) {
|
for (const i of creds.fields) {
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
<ul class="nav navbar-nav">
|
<ul class="nav navbar-nav">
|
||||||
<li class="active"><a href="#general-settings">General</a></li>
|
<li class="active"><a href="#general-settings">General</a></li>
|
||||||
<li><a href="#connected-databases">Connected Databases</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="#ignored-sites">Ignored sites</a></li>
|
||||||
<li><a href="#about">About</a></li>
|
<li><a href="#about">About</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
@ -241,16 +241,16 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Specified credential fields -->
|
<!-- Custom credential fields -->
|
||||||
<div class="tab" id="tab-specified-fields">
|
<div class="tab" id="tab-custom-fields">
|
||||||
<h2>Specified credential fields</h2>
|
<h2>Custom credential fields</h2>
|
||||||
<hr />
|
<hr />
|
||||||
<p>
|
<p>
|
||||||
If KeePassXC-Browser detects the wrong credential fields, you are able to specify the correct fields by yourself.
|
If KeePassXC-Browser detects the wrong credential fields, you are able to specify the correct fields by yourself.
|
||||||
<br />
|
<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 />
|
<br />
|
||||||
On this page you can manage theses specified credential fields.
|
On this page you can manage saved custom credential fields.
|
||||||
</p>
|
</p>
|
||||||
<table class="table table-striped table-bordered table-hover">
|
<table class="table table-striped table-bordered table-hover">
|
||||||
<thead>
|
<thead>
|
||||||
|
|
@ -261,7 +261,7 @@
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr class="empty">
|
<tr class="empty">
|
||||||
<td colspan="2">No specified credential fields found.</td>
|
<td colspan="2">No saved custom credential fields found.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="clone">
|
<tr class="clone">
|
||||||
<td></td>
|
<td></td>
|
||||||
|
|
@ -269,16 +269,16 @@
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</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-dialog">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
<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>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<p>Do you really want to remove the specified credential fields on the page <strong></strong>?</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 the next time you visit this page.</p>
|
<p class="help-block">KeePassXC-Browser will automatically detect the credential fields next time you visit this page.</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button class="btn" data-dismiss="modal" aria-hidden="true">Cancel</button>
|
<button class="btn" data-dismiss="modal" aria-hidden="true">Cancel</button>
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ $(function() {
|
||||||
options.initMenu();
|
options.initMenu();
|
||||||
options.initGeneralSettings();
|
options.initGeneralSettings();
|
||||||
options.initConnectedDatabases();
|
options.initConnectedDatabases();
|
||||||
options.initSpecifiedCredentialFields();
|
options.initCustomCredentialFields();
|
||||||
options.initIgnoredSites();
|
options.initIgnoredSites();
|
||||||
options.initAbout();
|
options.initAbout();
|
||||||
});
|
});
|
||||||
|
|
@ -214,50 +214,50 @@ options.initConnectedDatabases = function() {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
options.initSpecifiedCredentialFields = function() {
|
options.initCustomCredentialFields = function() {
|
||||||
$('#dialogDeleteSpecifiedCredentialFields').modal({keyboard: true, show: false, backdrop: true});
|
$('#dialogDeleteCustomCredentialFields').modal({keyboard: true, show: false, backdrop: true});
|
||||||
$('#tab-specified-fields tr.clone:first button.delete:first').click(function(e) {
|
$('#tab-custom-fields tr.clone:first button.delete:first').click(function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
$('#dialogDeleteSpecifiedCredentialFields').data('url', $(this).closest('tr').data('url'));
|
$('#dialogDeleteCustomCredentialFields').data('url', $(this).closest('tr').data('url'));
|
||||||
$('#dialogDeleteSpecifiedCredentialFields').data('tr-id', $(this).closest('tr').attr('id'));
|
$('#dialogDeleteCustomCredentialFields').data('tr-id', $(this).closest('tr').attr('id'));
|
||||||
$('#dialogDeleteSpecifiedCredentialFields .modal-body:first strong:first').text($(this).closest('tr').children('td:first').text());
|
$('#dialogDeleteCustomCredentialFields .modal-body:first strong:first').text($(this).closest('tr').children('td:first').text());
|
||||||
$('#dialogDeleteSpecifiedCredentialFields').modal('show');
|
$('#dialogDeleteCustomCredentialFields').modal('show');
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#dialogDeleteSpecifiedCredentialFields .modal-footer:first button.yes:first').click(function(e) {
|
$('#dialogDeleteCustomCredentialFields .modal-footer:first button.yes:first').click(function(e) {
|
||||||
$('#dialogDeleteSpecifiedCredentialFields').modal('hide');
|
$('#dialogDeleteCustomCredentialFields').modal('hide');
|
||||||
|
|
||||||
const url = $('#dialogDeleteSpecifiedCredentialFields').data('url');
|
const url = $('#dialogDeleteCustomCredentialFields').data('url');
|
||||||
const trId = $('#dialogDeleteSpecifiedCredentialFields').data('tr-id');
|
const trId = $('#dialogDeleteCustomCredentialFields').data('tr-id');
|
||||||
$('#tab-specified-fields #' + trId).remove();
|
$('#tab-custom-fields #' + trId).remove();
|
||||||
|
|
||||||
delete options.settings['defined-credential-fields'][url];
|
delete options.settings['defined-custom-fields'][url];
|
||||||
options.saveSettings();
|
options.saveSettings();
|
||||||
|
|
||||||
if ($('#tab-specified-fields table tbody:first tr').length > 2) {
|
if ($('#tab-custom-fields table tbody:first tr').length > 2) {
|
||||||
$('#tab-specified-fields table tbody:first tr.empty:first').hide();
|
$('#tab-custom-fields table tbody:first tr.empty:first').hide();
|
||||||
} else {
|
} 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');
|
trClone.removeClass('clone');
|
||||||
let counter = 1;
|
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);
|
const tr = trClone.clone(true);
|
||||||
tr.data('url', url);
|
tr.data('url', url);
|
||||||
tr.attr('id', 'tr-scf' + counter);
|
tr.attr('id', 'tr-scf' + counter);
|
||||||
++counter;
|
++counter;
|
||||||
|
|
||||||
tr.children('td:first').text(url);
|
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) {
|
if ($('#tab-custom-fields table tbody:first tr').length > 2) {
|
||||||
$('#tab-specified-fields table tbody:first tr.empty:first').hide();
|
$('#tab-custom-fields table tbody:first tr.empty:first').hide();
|
||||||
} else {
|
} 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 class="container">
|
||||||
<div id="settings" class="settings">
|
<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-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>
|
<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">
|
<div id="update-available" class="alert alert-danger">
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div id="settings" class="settings">
|
<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-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>
|
<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">
|
<div id="update-available" class="alert alert-danger">
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div id="settings" class="settings">
|
<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-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>
|
<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">
|
<div id="update-available" class="alert alert-danger">
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div id="settings" class="settings">
|
<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-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>
|
<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">
|
<div id="update-available" class="alert alert-danger">
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue