Небольшая поправка формирования заголовка

This commit is contained in:
Book Pauk
2021-11-18 17:56:54 +07:00
parent c534edfeb5
commit 9be4011d54

View File

@@ -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();
} }