Небольшая поправка формирования заголовка
This commit is contained in:
@@ -60,15 +60,19 @@ class PasteTextPage {
|
|||||||
|
|
||||||
calcTitle(event) {
|
calcTitle(event) {
|
||||||
if (this.bookTitle == '') {
|
if (this.bookTitle == '') {
|
||||||
let text = event.clipboardData.getData('text');
|
this.bookTitle = `Из буфера обмена ${utils.formatDate(new Date(), 'noDate')}`;
|
||||||
this.bookTitle = `Из буфера обмена ${utils.formatDate(new Date(), 'noDate')}: ` + _.compact([
|
if (event) {
|
||||||
this.getNonEmptyLine3words(text, 1),
|
let text = event.clipboardData.getData('text');
|
||||||
this.getNonEmptyLine3words(text, 2)
|
this.bookTitle += ': ' + _.compact([
|
||||||
]).join(' - ');
|
this.getNonEmptyLine3words(text, 1),
|
||||||
|
this.getNonEmptyLine3words(text, 2)
|
||||||
|
]).join(' - ');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
loadBuffer() {
|
loadBuffer() {
|
||||||
|
this.calcTitle();
|
||||||
this.$emit('load-buffer', {buffer: `<buffer><fb2-title>${utils.escapeXml(this.bookTitle)}</fb2-title>${utils.escapeXml(this.$refs.textArea.value)}</buffer>`});
|
this.$emit('load-buffer', {buffer: `<buffer><fb2-title>${utils.escapeXml(this.bookTitle)}</fb2-title>${utils.escapeXml(this.$refs.textArea.value)}</buffer>`});
|
||||||
this.close();
|
this.close();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user