Introduced a tooltip to make the secure field feature more understandable

Fixes #805
This commit is contained in:
Dennis Ploeger 2019-01-03 09:11:06 +01:00
parent 72c912d57f
commit 498dfad299
2 changed files with 12 additions and 0 deletions

View File

@ -268,6 +268,8 @@
"detOtpQrErrorBody": "Sorry, we could not read the QR code, please try once again or contact the app authors with error details.",
"detOtpQrWrong": "Wrong QR code",
"detOtpQrWrongBody": "Your QR code was successfully scanned but it doesn't contain one-time password data.",
"detLockField": "Lock this field, so its content isn't searchable and visible. Displaying the content requires explicitly clicking it.",
"detUnlockField": "Unlock this field, making its content searchable and visible immediately",
"autoTypeEntryFields": "Entry fields",
"autoTypeModifiers": "Modifier keys",

View File

@ -3,6 +3,8 @@ const FieldViewText = require('./field-view-text');
const FieldView = require('./field-view');
const Keys = require('../../const/keys');
const kdbxweb = require('kdbxweb');
const Tip = require('../../util/tip');
const Locale = require('../../util/locale');
const FieldViewCustom = FieldViewText.extend({
events: {
@ -23,6 +25,14 @@ const FieldViewCustom = FieldViewText.extend({
$('<div/>').addClass('details__field-value-btn details__field-value-btn-protect')
.appendTo(this.valueEl)
.mousedown(this.protectBtnClick.bind(this));
let securityTipTitle = Locale.detLockField;
if (this.isProtected) {
securityTipTitle = Locale.detUnlockField;
}
const securityTip = new Tip($(this.valueEl).find('.details__field-value-btn'), {
title: securityTipTitle
});
securityTip.init();
},
endEdit: function(newVal, extra) {