mirror of https://github.com/keeweb/keeweb
fix #1460: auto-type on double-clicking field labels
parent
448e173f7e
commit
a2194435e6
|
@ -36,6 +36,7 @@ const DefaultAppSettings = {
|
|||
useGroupIconForEntries: false, // automatically use group icon when creating new entries
|
||||
enableUsb: true, // enable interaction with USB devices
|
||||
nativeArgon2: true, // use native argon2 module
|
||||
fieldLabelDblClickAutoType: false, // trigger auto-type by doubleclicking field label
|
||||
|
||||
yubiKeyShowIcon: true, // show an icon to open OTP codes from YubiKey
|
||||
yubiKeyAutoOpen: false, // auto-load one-time codes when there are open files
|
||||
|
|
|
@ -13,7 +13,8 @@ const Timeouts = {
|
|||
LinkDownloadRevoke: 10 * 1000 * 60,
|
||||
DefaultHttpRequest: 60000,
|
||||
ExternalDeviceReconnect: 3000,
|
||||
ExternalDeviceAfterReconnect: 1000
|
||||
ExternalDeviceAfterReconnect: 1000,
|
||||
FieldLabelDoubleClick: 300
|
||||
};
|
||||
|
||||
export { Timeouts };
|
||||
|
|
|
@ -458,6 +458,7 @@
|
|||
"setGenTryBetaWarningBody": "Please save all files and click this button again",
|
||||
"setGenShowAppLogs": "Show app logs",
|
||||
"setGenReloadApp": "Reload the app",
|
||||
"setGenFieldLabelDblClickAutoType": "Auto-type on double-clicking field labels",
|
||||
|
||||
"setFilePath": "File path",
|
||||
"setFileStorage": "This file is loaded from {}.",
|
||||
|
|
|
@ -9,6 +9,8 @@ import { Locale } from 'util/locale';
|
|||
import { AutoType } from 'auto-type';
|
||||
import { PasswordPresenter } from 'util/formatting/password-presenter';
|
||||
import { DropdownView } from 'views/dropdown-view';
|
||||
import { AppSettingsModel } from 'models/app-settings-model';
|
||||
import { Timeouts } from 'const/timeouts';
|
||||
import template from 'templates/details/fields/field.hbs';
|
||||
|
||||
class FieldView extends View {
|
||||
|
@ -16,6 +18,7 @@ class FieldView extends View {
|
|||
|
||||
events = {
|
||||
'click .details__field-label': 'fieldLabelClick',
|
||||
'dblclick .details__field-label': 'fieldLabelDblClick',
|
||||
'click .details__field-value': 'fieldValueClick',
|
||||
'dragstart .details__field-label': 'fieldLabelDrag',
|
||||
'click .details__field-options': 'fieldOptionsClick'
|
||||
|
@ -75,7 +78,20 @@ class FieldView extends View {
|
|||
if (this.preventCopy) {
|
||||
return;
|
||||
}
|
||||
this.copyValue();
|
||||
if (AutoType.enabled && AppSettingsModel.fieldLabelDblClickAutoType) {
|
||||
if (this.fieldLabelClickTimer) {
|
||||
clearTimeout(this.fieldLabelClickTimer);
|
||||
this.fieldLabelClickTimer = null;
|
||||
this.emit('autotype', { source: this });
|
||||
return;
|
||||
}
|
||||
this.fieldLabelClickTimer = setTimeout(() => {
|
||||
this.copyValue();
|
||||
this.fieldLabelClickTimer = null;
|
||||
}, Timeouts.FieldLabelDoubleClick);
|
||||
} else {
|
||||
this.copyValue();
|
||||
}
|
||||
}
|
||||
|
||||
copyValue() {
|
||||
|
|
|
@ -43,6 +43,8 @@ class SettingsGeneralView extends View {
|
|||
'change .settings__general-use-markdown': 'changeUseMarkdown',
|
||||
'change .settings__general-use-group-icon-for-entries': 'changeUseGroupIconForEntries',
|
||||
'change .settings__general-direct-autotype': 'changeDirectAutotype',
|
||||
'change .settings__general-field-label-dblclick-autotype':
|
||||
'changeFieldLabelDblClickAutoType',
|
||||
'change .settings__general-titlebar-style': 'changeTitlebarStyle',
|
||||
'click .settings__general-update-btn': 'checkUpdate',
|
||||
'click .settings__general-restart-btn': 'restartApp',
|
||||
|
@ -110,6 +112,7 @@ class SettingsGeneralView extends View {
|
|||
useMarkdown: AppSettingsModel.useMarkdown,
|
||||
useGroupIconForEntries: AppSettingsModel.useGroupIconForEntries,
|
||||
directAutotype: AppSettingsModel.directAutotype,
|
||||
fieldLabelDblClickAutoType: AppSettingsModel.fieldLabelDblClickAutoType,
|
||||
supportsTitleBarStyles: Launcher && Features.supportsTitleBarStyles(),
|
||||
titlebarStyle: AppSettingsModel.titlebarStyle,
|
||||
storageProviders,
|
||||
|
@ -321,6 +324,12 @@ class SettingsGeneralView extends View {
|
|||
Events.emit('refresh');
|
||||
}
|
||||
|
||||
changeFieldLabelDblClickAutoType(e) {
|
||||
const fieldLabelDblClickAutoType = e.target.checked || false;
|
||||
AppSettingsModel.fieldLabelDblClickAutoType = fieldLabelDblClickAutoType;
|
||||
Events.emit('refresh');
|
||||
}
|
||||
|
||||
restartApp() {
|
||||
if (Launcher) {
|
||||
Launcher.requestRestart();
|
||||
|
|
|
@ -147,6 +147,11 @@
|
|||
id="settings__general-direct-autotype" {{#if directAutotype}}checked{{/if}} />
|
||||
<label for="settings__general-direct-autotype">{{res 'setGenDirectAutotype'}}</label>
|
||||
</div>
|
||||
<div>
|
||||
<input type="checkbox" class="settings__input input-base settings__general-field-label-dblclick-autotype"
|
||||
id="settings__general-field-label-dblclick-autotype" {{#if fieldLabelDblClickAutoType}}checked{{/if}} />
|
||||
<label for="settings__general-field-label-dblclick-autotype">{{res 'setGenFieldLabelDblClickAutoType'}}</label>
|
||||
</div>
|
||||
{{/if}}
|
||||
<div>
|
||||
<input type="checkbox" class="settings__input input-base settings__general-use-markdown" id="settings__general-use-markdown" {{#if useMarkdown}}checked{{/if}} />
|
||||
|
|
|
@ -3,6 +3,7 @@ Release notes
|
|||
##### v1.15.0 (WIP)
|
||||
`+` YubiKey integration in two modes: OATH and Challenge-Response
|
||||
`+` configs are now encrypted with a key stored in keychain
|
||||
`+` #1460: auto-type on double-clicking field labels
|
||||
`+` #557: Argon2 speed improvements in desktop apps
|
||||
`+` #1503: ARM64 Windows support
|
||||
`+` #1480: option to create a portable installation
|
||||
|
|
Loading…
Reference in New Issue