mirror of
https://github.com/Elvanos/fantasia-archive.git
synced 2024-09-30 00:56:59 +13:00
0.1.8 - export fixes (linebreaks)
This commit is contained in:
parent
4b171773e2
commit
88dc7d869d
2 changed files with 19 additions and 37 deletions
|
@ -141,30 +141,6 @@
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
|
|
||||||
<q-item v-if="exportWholeProject">
|
|
||||||
<q-item-section side>
|
|
||||||
<q-icon name="mdi-help-circle" size="18px">
|
|
||||||
<q-tooltip :delay="500">
|
|
||||||
Some projects can have overlapping names for multiple documents.
|
|
||||||
<br>
|
|
||||||
Normally, this would results in the contents of the documents overwriting each other.
|
|
||||||
<br>
|
|
||||||
If this is turned on, documents will also receive their unique IDs
|
|
||||||
<br>
|
|
||||||
attached to their file names - preventing any overwriting.
|
|
||||||
</q-tooltip>
|
|
||||||
</q-icon>
|
|
||||||
</q-item-section>
|
|
||||||
<q-item-section>
|
|
||||||
<q-checkbox
|
|
||||||
:class="{'warning': !useSafetyMode}"
|
|
||||||
dark color="primary"
|
|
||||||
v-model="useSafetyMode"
|
|
||||||
label="Use safety export mode?"
|
|
||||||
/>
|
|
||||||
</q-item-section>
|
|
||||||
</q-item>
|
|
||||||
|
|
||||||
<q-item v-if="selectedExportFormat === 'Adobe Reader - PDF'">
|
<q-item v-if="selectedExportFormat === 'Adobe Reader - PDF'">
|
||||||
<q-item-section side>
|
<q-item-section side>
|
||||||
<q-icon name="mdi-help-circle" size="18px">
|
<q-icon name="mdi-help-circle" size="18px">
|
||||||
|
@ -314,10 +290,9 @@
|
||||||
<br>
|
<br>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<span class="text-bold text-secondary" v-if="!useSafetyMode && exportWholeProject">
|
<span class="text-bold text-secondary" v-if="!useCompatibilityMode && exportWholeProject">
|
||||||
<br>
|
|
||||||
Please condider turning the safety export mode ON before exporting to avoid data loss!
|
|
||||||
<br>
|
<br>
|
||||||
|
Please condider turning the unique-indentifier mode ON before exporting to avoid data loss!
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<span>
|
<span>
|
||||||
|
@ -541,6 +516,8 @@ export default class ExportProject extends DialogBase {
|
||||||
resetLocalData () {
|
resetLocalData () {
|
||||||
this.selectedExportFormat = "Adobe Reader - PDF"
|
this.selectedExportFormat = "Adobe Reader - PDF"
|
||||||
this.exportWholeProject = false
|
this.exportWholeProject = false
|
||||||
|
this.useCompatibilityMode = true
|
||||||
|
this.includeSpoilers = false
|
||||||
this.includeTags = false
|
this.includeTags = false
|
||||||
this.includeHierarchyPath = false
|
this.includeHierarchyPath = false
|
||||||
this.hideDeadInformation = false
|
this.hideDeadInformation = false
|
||||||
|
@ -550,7 +527,6 @@ export default class ExportProject extends DialogBase {
|
||||||
this.useFallbackFont = false
|
this.useFallbackFont = false
|
||||||
this.exportDocumentsModel = []
|
this.exportDocumentsModel = []
|
||||||
this.exportOngoing = false
|
this.exportOngoing = false
|
||||||
this.useSafetyMode = true
|
|
||||||
this.exportList = []
|
this.exportList = []
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -591,8 +567,6 @@ export default class ExportProject extends DialogBase {
|
||||||
|
|
||||||
useFallbackFont = false
|
useFallbackFont = false
|
||||||
|
|
||||||
useSafetyMode = true
|
|
||||||
|
|
||||||
noFolderMode = false
|
noFolderMode = false
|
||||||
|
|
||||||
setDocumentPreviewClose () {
|
setDocumentPreviewClose () {
|
||||||
|
@ -890,7 +864,10 @@ export default class ExportProject extends DialogBase {
|
||||||
// Build string out of lists
|
// Build string out of lists
|
||||||
if (field.type === "list" && Array.isArray(returnValue)) {
|
if (field.type === "list" && Array.isArray(returnValue)) {
|
||||||
if (!field.predefinedListExtras) {
|
if (!field.predefinedListExtras) {
|
||||||
returnValue = returnValue.map((e: {value: string}) => `${e.value}`)
|
returnValue = returnValue.map((e: {value: string}) => {
|
||||||
|
const returnString = e.value.replace(/(\r\n|\n|\r)/gm, "")
|
||||||
|
return returnString
|
||||||
|
})
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (field.predefinedListExtras?.reverse) {
|
if (field.predefinedListExtras?.reverse) {
|
||||||
|
@ -899,6 +876,7 @@ export default class ExportProject extends DialogBase {
|
||||||
if (e.value) {
|
if (e.value) {
|
||||||
returnString = `${returnString}: ${e.value}`
|
returnString = `${returnString}: ${e.value}`
|
||||||
}
|
}
|
||||||
|
returnString = returnString.replace(/(\r\n|\n|\r)/gm, "")
|
||||||
return returnString
|
return returnString
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -908,6 +886,7 @@ export default class ExportProject extends DialogBase {
|
||||||
if (e.affix) {
|
if (e.affix) {
|
||||||
returnString = `${e.value} (${e.affix})`
|
returnString = `${e.value} (${e.affix})`
|
||||||
}
|
}
|
||||||
|
returnString = returnString.replace(/(\r\n|\n|\r)/gm, "")
|
||||||
return returnString
|
return returnString
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -936,8 +915,7 @@ export default class ExportProject extends DialogBase {
|
||||||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
||||||
localReturnValue = `${localReturnValue} (${matchedNote.value})`
|
localReturnValue = `${localReturnValue} (${matchedNote.value})`
|
||||||
}
|
}
|
||||||
|
returnValue = localReturnValue.replace(/(\r\n|\n|\r)/gm, "")
|
||||||
returnValue = localReturnValue
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
returnValue = ""
|
returnValue = ""
|
||||||
|
@ -970,7 +948,7 @@ export default class ExportProject extends DialogBase {
|
||||||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
||||||
localReturnValue = `${localReturnValue} (${matchedNote.value})`
|
localReturnValue = `${localReturnValue} (${matchedNote.value})`
|
||||||
}
|
}
|
||||||
|
localReturnValue = localReturnValue.replace(/(\r\n|\n|\r)/gm, "")
|
||||||
return localReturnValue
|
return localReturnValue
|
||||||
}
|
}
|
||||||
return " "
|
return " "
|
||||||
|
@ -1067,9 +1045,7 @@ export default class ExportProject extends DialogBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fix invalid characters in document file name
|
// Fix invalid characters in document file name
|
||||||
let exportFileName = (this.useSafetyMode && this.exportWholeProject)
|
let exportFileName = input.name
|
||||||
? `${input.name} (${input.id})`
|
|
||||||
: input.name
|
|
||||||
reservedCharacterList.forEach(char => {
|
reservedCharacterList.forEach(char => {
|
||||||
exportFileName = exportFileName.replace(char, "-")
|
exportFileName = exportFileName.replace(char, "-")
|
||||||
exportFileName = exportFileName.replace(char, "-")
|
exportFileName = exportFileName.replace(char, "-")
|
||||||
|
@ -1340,6 +1316,11 @@ export default class ExportProject extends DialogBase {
|
||||||
else if (!this.writerMode) {
|
else if (!this.writerMode) {
|
||||||
doc.font("Roboto-Bold").fillColor("#000000").fontSize(textFont)
|
doc.font("Roboto-Bold").fillColor("#000000").fontSize(textFont)
|
||||||
.text(field.label, textPadding, undefined, paragraphOptions)
|
.text(field.label, textPadding, undefined, paragraphOptions)
|
||||||
|
|
||||||
|
if (input.id === "60d23d8b-367f-4d5c-870c-74a0d46d6019") {
|
||||||
|
console.log(field.label)
|
||||||
|
console.log(field.value)
|
||||||
|
}
|
||||||
doc.font("Roboto-Regular").fillColor("#000000").fontSize(textFont)
|
doc.font("Roboto-Regular").fillColor("#000000").fontSize(textFont)
|
||||||
.list((Array.isArray(field.value) ? field.value : [field.value]), listPadding, undefined, paragraphOptions)
|
.list((Array.isArray(field.value) ? field.value : [field.value]), listPadding, undefined, paragraphOptions)
|
||||||
.moveDown()
|
.moveDown()
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
- Fixed a typo in "Save all opened documents with active changes" keybind
|
- Fixed a typo in "Save all opened documents with active changes" keybind
|
||||||
- Fixed a bug that was causing the predefined select list sometimes completely disappear along with whole select in the single-select field when filtering (eg: Sex field)
|
- Fixed a bug that was causing the predefined select list sometimes completely disappear along with whole select in the single-select field when filtering (eg: Sex field)
|
||||||
- Slightly improved performance when loading the project for the first time
|
- Slightly improved performance when loading the project for the first time
|
||||||
|
- Fixed a bug in PDF export that was causing export crashes in case of line breaks present in the list/relationship field notes
|
||||||
|
|
||||||
### New features
|
### New features
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue