fix #1293: copying full urls

This commit is contained in:
antelle 2020-03-14 21:12:13 +01:00
parent a5c6180154
commit 0b13c06a09
4 changed files with 17 additions and 14 deletions

View File

@ -597,9 +597,7 @@ class DetailsView extends View {
return false;
}
if (!window.getSelection().toString()) {
const fieldValue = editView.otpValue || editView.value;
const fieldText =
fieldValue && fieldValue.isProtected ? fieldValue.getText() : fieldValue;
const fieldText = editView.getTextValue();
if (!fieldText) {
return;
}

View File

@ -22,6 +22,10 @@ class FieldViewUrl extends FieldViewText {
displayUrl(url) {
return url.replace(this.displayUrlRegex, '');
}
getTextValue() {
return this.fixUrl(this.value);
}
}
export { FieldViewUrl };

View File

@ -82,19 +82,16 @@ class FieldView extends View {
const field = this.model.name;
let copyRes;
if (field) {
const value = this.value || '';
if (value && value.isProtected) {
const text = value.getText();
if (!text) {
return;
}
if (!CopyPaste.simpleCopy) {
CopyPaste.createHiddenInput(text);
}
copyRes = CopyPaste.copy(text);
this.emit('copy', { source: this, copyRes });
const text = this.getTextValue();
if (!text) {
return;
}
if (!CopyPaste.simpleCopy) {
CopyPaste.createHiddenInput(text);
}
copyRes = CopyPaste.copy(text);
this.emit('copy', { source: this, copyRes });
return;
}
if (!this.value) {
return;
@ -347,6 +344,9 @@ class FieldView extends View {
}
getTextValue() {
if (!this.value) {
return '';
}
return this.value.isProtected ? this.value.getText() : this.value;
}
}

View File

@ -13,6 +13,7 @@ Release notes
`-` fix #1385: fixed a file watcher error on network locations
`-` fix #1391: passwords imported from CSV were not hidden
`-` fix #1387: fixed drag-drop for otp fields
`-` fix #1293: copying full urls
##### v1.12.3 (2019-11-06)
`-` fix #1335: removed the menubar on Windows and Linux