Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
johanneswilm committed Sep 19, 2024
1 parent b70d791 commit 647c71d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export class DOCXBookExporter {

getBaseMetadata() {
const authors = this.book.metadata.author.length ? [{institution: this.book.metadata.author}] : []
const keywords = this.book.metadata.keywords.length ? this.book.metadata.keywords.split(',').map(keyword => keyword.trim()) : []
const keywords = this.book.metadata.keywords.length ? this.book.metadata.keywords.split(",").map(keyword => keyword.trim()) : []
return {
authors,
keywords,
Expand Down
20 changes: 10 additions & 10 deletions fiduswriter/book/static/js/modules/books/exporter/docx/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,24 +46,24 @@ export class DOCXBookExporterRender extends DOCXExporterRender {

render(docContent, pmBib, settings, richtext, citations, chapterNumber) {
this.text = this.bodyTemplate.cloneNode(true)
const bodyBookmark = this.text.query('w:bookmarkStart', {'w:name':"body"})
const bodyBookmark = this.text.query("w:bookmarkStart", {"w:name": "body"})
if (bodyBookmark) {
bodyBookmark.setAttribute('w:name', `chapter ${chapterNumber}`)
bodyBookmark.setAttribute("w:name", `chapter ${chapterNumber}`)
}
super.render(docContent, pmBib, settings, richtext, citations)
this.bodyParts.push(this.text)
}

renderAmbles({title, subtitle, version, publisher, copyright, author, keywords, language}) {
const tags = [
{title: 'book.title', content: title},
{title: 'book.subtitle', content: subtitle},
{title: 'book.version', content: version},
{title: 'book.publisher', content: publisher},
{title: 'book.copyright', content: copyright},
{title: 'book.author', content: author},
{title: 'book.keywords', content: keywords},
{title: 'book.language', content: language}
{title: "book.title", content: title},
{title: "book.subtitle", content: subtitle},
{title: "book.version", content: version},
{title: "book.publisher", content: publisher},
{title: "book.copyright", content: copyright},
{title: "book.author", content: author},
{title: "book.keywords", content: keywords},
{title: "book.language", content: language}
]
const usedTags = [], ambles = [this.preamble, this.postamble]
ambles.forEach(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ export class ODTBookExporter {


getBaseMetadata() {
const authors = this.book.metadata.author.length ? [{institution: this.book.metadata.author}] : []
const keywords = this.book.metadata.keywords.length ? this.book.metadata.keywords.split(',').map(keyword => keyword.trim()) : []
const authors = this.book.metadata.author.length ? [{institution: this.book.metadata.author}] : []
const keywords = this.book.metadata.keywords.length ? this.book.metadata.keywords.split(",").map(keyword => keyword.trim()) : []
return {
authors,
keywords,
Expand Down
4 changes: 2 additions & 2 deletions fiduswriter/book/static/js/modules/books/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ export const exportMenuModel = () => ({
action: ({saveBook, book, overview}) => {
saveBook().then(() => exportDOCX(book, overview))
},
disabled: ({saveBook, book, overview}) => !book.docx_template
disabled: ({book}) => !book.docx_template
},

{
Expand All @@ -455,7 +455,7 @@ export const exportMenuModel = () => ({
action: ({saveBook, book, overview}) => {
saveBook().then(() => exportODT(book, overview))
},
disabled: ({saveBook, book, overview}) => !book.odt_template
disabled: ({book}) => !book.odt_template
},
{
type: "action",
Expand Down

0 comments on commit 647c71d

Please sign in to comment.