mirror of https://github.com/keeweb/keeweb.git
fix #1293: copying full urls
This commit is contained in:
parent
a5c6180154
commit
0b13c06a09
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -22,6 +22,10 @@ class FieldViewUrl extends FieldViewText {
|
|||
displayUrl(url) {
|
||||
return url.replace(this.displayUrlRegex, '');
|
||||
}
|
||||
|
||||
getTextValue() {
|
||||
return this.fixUrl(this.value);
|
||||
}
|
||||
}
|
||||
|
||||
export { FieldViewUrl };
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue