mirror of
https://github.com/Elvanos/fantasia-archive.git
synced 2024-09-29 16:51:21 +13:00
0.1.7-RC-1: fixed PDF exports
This commit is contained in:
parent
ac21593f08
commit
318ef09d19
10 changed files with 799 additions and 235 deletions
|
@ -585,7 +585,7 @@ export default class DocumentControl extends BaseClass {
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************/
|
/****************************************************************/
|
||||||
// Export project
|
// Save project
|
||||||
/****************************************************************/
|
/****************************************************************/
|
||||||
retrieveCurrentProjectName = retrieveCurrentProjectName
|
retrieveCurrentProjectName = retrieveCurrentProjectName
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,13 @@
|
||||||
@trigger-dialog-close="deleteObjectDialogClose"
|
@trigger-dialog-close="deleteObjectDialogClose"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<!-- Export project dialog -->
|
||||||
|
<exportProjectDialog
|
||||||
|
:dialog-trigger="exportProjectDialogTrigger"
|
||||||
|
:prepicked-ids="[prepickedID]"
|
||||||
|
@trigger-dialog-close="exportProjectDialogClose"
|
||||||
|
/>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class="treeSearchWrapper"
|
class="treeSearchWrapper"
|
||||||
:class="{'fullWidth': disableDocumentControlBar}"
|
:class="{'fullWidth': disableDocumentControlBar}"
|
||||||
|
@ -252,6 +259,13 @@
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
<q-separator dark />
|
<q-separator dark />
|
||||||
|
<q-item clickable v-close-popup @click="commenceExport(prop.node)">
|
||||||
|
<q-item-section>Export document</q-item-section>
|
||||||
|
<q-item-section avatar>
|
||||||
|
<q-icon name="mdi-database-export-outline" />
|
||||||
|
</q-item-section>
|
||||||
|
</q-item>
|
||||||
|
<q-separator dark />
|
||||||
<q-item clickable v-close-popup @click="deleteTabDocument(prop.node)">
|
<q-item clickable v-close-popup @click="deleteTabDocument(prop.node)">
|
||||||
<q-item-section class="text-secondary"><b>Delete this document</b></q-item-section>
|
<q-item-section class="text-secondary"><b>Delete this document</b></q-item-section>
|
||||||
<q-item-section avatar class="text-secondary">
|
<q-item-section avatar class="text-secondary">
|
||||||
|
@ -309,10 +323,12 @@ import { retrieveCurrentProjectName } from "src/scripts/projectManagement/projec
|
||||||
import { createNewWithParent } from "src/scripts/documentActions/createNewWithParent"
|
import { createNewWithParent } from "src/scripts/documentActions/createNewWithParent"
|
||||||
import { copyDocumentName, copyDocumentTextColor, copyDocumentBackgroundColor } from "src/scripts/documentActions/uniqueFieldCopy"
|
import { copyDocumentName, copyDocumentTextColor, copyDocumentBackgroundColor } from "src/scripts/documentActions/uniqueFieldCopy"
|
||||||
import { copyDocument } from "src/scripts/documentActions/copyDocument"
|
import { copyDocument } from "src/scripts/documentActions/copyDocument"
|
||||||
|
import exportProjectDialog from "src/components/dialogs/ExportProject.vue"
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
components: {
|
components: {
|
||||||
deleteDocumentCheckDialog,
|
deleteDocumentCheckDialog,
|
||||||
|
exportProjectDialog,
|
||||||
documentPreview: () => import("src/components/DocumentPreview.vue")
|
documentPreview: () => import("src/components/DocumentPreview.vue")
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -1136,6 +1152,27 @@ export default class ObjectTree extends BaseClass {
|
||||||
createNewWithParent(currentDoc, this)
|
createNewWithParent(currentDoc, this)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/****************************************************************/
|
||||||
|
// Export project dialog
|
||||||
|
/****************************************************************/
|
||||||
|
|
||||||
|
exportProjectDialogTrigger: string | false = false
|
||||||
|
exportProjectDialogClose () {
|
||||||
|
this.exportProjectDialogTrigger = false
|
||||||
|
}
|
||||||
|
|
||||||
|
exportProjectAssignUID () {
|
||||||
|
this.exportProjectDialogTrigger = this.generateUID()
|
||||||
|
}
|
||||||
|
|
||||||
|
prepickedID = ""
|
||||||
|
|
||||||
|
commenceExport (node: {_id: string}) {
|
||||||
|
this.prepickedID = node._id
|
||||||
|
|
||||||
|
this.exportProjectAssignUID()
|
||||||
|
}
|
||||||
|
|
||||||
/****************************************************************/
|
/****************************************************************/
|
||||||
// Delete dialog
|
// Delete dialog
|
||||||
/****************************************************************/
|
/****************************************************************/
|
||||||
|
|
|
@ -129,6 +129,168 @@
|
||||||
>
|
>
|
||||||
Project
|
Project
|
||||||
|
|
||||||
|
<q-menu
|
||||||
|
@show="checkProjectStatus"
|
||||||
|
anchor="bottom left"
|
||||||
|
class="bg-gunmetal-light"
|
||||||
|
dark
|
||||||
|
square
|
||||||
|
>
|
||||||
|
<q-list class="bg-gunmetal-light" dark>
|
||||||
|
|
||||||
|
<q-item
|
||||||
|
v-close-popup
|
||||||
|
clickable
|
||||||
|
active
|
||||||
|
active-class="bg-gunmetal-light text-cultured"
|
||||||
|
class="noHigh"
|
||||||
|
@click="newProjectAssignUID"
|
||||||
|
>
|
||||||
|
<q-item-section>New project</q-item-section>
|
||||||
|
<q-item-section avatar>
|
||||||
|
<q-icon name="mdi-plus" />
|
||||||
|
</q-item-section>
|
||||||
|
</q-item>
|
||||||
|
|
||||||
|
<q-separator dark />
|
||||||
|
|
||||||
|
<q-item
|
||||||
|
v-close-popup
|
||||||
|
clickable
|
||||||
|
active
|
||||||
|
active-class="bg-gunmetal-light text-cultured"
|
||||||
|
class="noHigh"
|
||||||
|
@click="commenceSave"
|
||||||
|
:disable="!projectExists || isFrontpage"
|
||||||
|
>
|
||||||
|
<q-item-section>Save current project</q-item-section>
|
||||||
|
<q-item-section avatar>
|
||||||
|
<q-icon name="mdi-package-variant-closed" />
|
||||||
|
</q-item-section>
|
||||||
|
</q-item>
|
||||||
|
|
||||||
|
<q-item
|
||||||
|
v-close-popup
|
||||||
|
clickable
|
||||||
|
active
|
||||||
|
active-class="bg-gunmetal-light text-cultured"
|
||||||
|
class="noHigh"
|
||||||
|
@click="loadProjectAssignUID"
|
||||||
|
>
|
||||||
|
<q-item-section>Load existing project</q-item-section>
|
||||||
|
<q-item-section avatar>
|
||||||
|
<q-icon name="mdi-package-variant" />
|
||||||
|
</q-item-section>
|
||||||
|
</q-item>
|
||||||
|
|
||||||
|
<q-separator dark />
|
||||||
|
|
||||||
|
<q-item
|
||||||
|
v-close-popup
|
||||||
|
clickable
|
||||||
|
active
|
||||||
|
active-class="bg-gunmetal-light text-cultured"
|
||||||
|
class="noHigh"
|
||||||
|
@click="exportProjectAssignUID"
|
||||||
|
:disable="!projectExists || isFrontpage"
|
||||||
|
>
|
||||||
|
<q-item-section>Export project/documents</q-item-section>
|
||||||
|
<q-item-section avatar>
|
||||||
|
<q-icon name="mdi-database-export-outline" />
|
||||||
|
</q-item-section>
|
||||||
|
</q-item>
|
||||||
|
|
||||||
|
<q-separator dark />
|
||||||
|
|
||||||
|
<q-item
|
||||||
|
v-close-popup
|
||||||
|
clickable
|
||||||
|
active
|
||||||
|
active-class="bg-gunmetal-light text-cultured"
|
||||||
|
class="noHigh"
|
||||||
|
@click="navigateToProjectPage"
|
||||||
|
:disable="!projectExists || isProjectPage"
|
||||||
|
>
|
||||||
|
<q-item-section>Show project overview</q-item-section>
|
||||||
|
<q-item-section avatar>
|
||||||
|
<q-icon name="mdi-chart-bar" />
|
||||||
|
</q-item-section>
|
||||||
|
</q-item>
|
||||||
|
|
||||||
|
<q-item
|
||||||
|
v-close-popup
|
||||||
|
clickable
|
||||||
|
active
|
||||||
|
active-class="bg-gunmetal-light text-cultured"
|
||||||
|
class="noHigh"
|
||||||
|
@click="projectCloseCheckDialogAssignUID"
|
||||||
|
:disable="!projectExists || isFrontpage"
|
||||||
|
>
|
||||||
|
<q-item-section>Close project</q-item-section>
|
||||||
|
<q-item-section avatar>
|
||||||
|
<q-icon name="mdi-exit-to-app" />
|
||||||
|
</q-item-section>
|
||||||
|
</q-item>
|
||||||
|
|
||||||
|
<q-separator dark />
|
||||||
|
|
||||||
|
<q-item clickable>
|
||||||
|
<q-item-section>Advanced project tools</q-item-section>
|
||||||
|
<q-item-section avatar>
|
||||||
|
<q-icon name="keyboard_arrow_right" />
|
||||||
|
</q-item-section>
|
||||||
|
<q-menu anchor="top end" self="top start">
|
||||||
|
<q-list class="bg-gunmetal text-accent">
|
||||||
|
|
||||||
|
<q-item
|
||||||
|
v-close-popup
|
||||||
|
clickable
|
||||||
|
active
|
||||||
|
active-class="bg-gunmetal-light text-cultured"
|
||||||
|
class="noHigh"
|
||||||
|
@click="mergeProjectAssignUID"
|
||||||
|
:disable="!projectExists || isFrontpage"
|
||||||
|
>
|
||||||
|
<q-item-section>Merge another project into the current one</q-item-section>
|
||||||
|
<q-item-section avatar>
|
||||||
|
<q-icon name="mdi-folder-plus-outline" />
|
||||||
|
</q-item-section>
|
||||||
|
</q-item>
|
||||||
|
|
||||||
|
<q-separator dark />
|
||||||
|
|
||||||
|
<q-item
|
||||||
|
v-close-popup
|
||||||
|
clickable
|
||||||
|
active
|
||||||
|
active-class="bg-gunmetal-light text-cultured"
|
||||||
|
class="noHigh"
|
||||||
|
@click="repairProjectAssignUID"
|
||||||
|
:disable="!projectExists || isFrontpage"
|
||||||
|
>
|
||||||
|
<q-item-section>Repair legacy project</q-item-section>
|
||||||
|
<q-item-section avatar>
|
||||||
|
<q-icon name="mdi-wrench" />
|
||||||
|
</q-item-section>
|
||||||
|
</q-item>
|
||||||
|
|
||||||
|
</q-list>
|
||||||
|
</q-menu>
|
||||||
|
</q-item>
|
||||||
|
</q-list>
|
||||||
|
</q-menu>
|
||||||
|
</q-btn>
|
||||||
|
|
||||||
|
<!-- Tools button-->
|
||||||
|
<q-btn
|
||||||
|
flat
|
||||||
|
:ripple="false"
|
||||||
|
dark
|
||||||
|
size='md'
|
||||||
|
no-caps
|
||||||
|
>
|
||||||
|
Tools
|
||||||
|
|
||||||
<q-menu
|
<q-menu
|
||||||
@show="checkProjectStatus"
|
@show="checkProjectStatus"
|
||||||
anchor="bottom left"
|
anchor="bottom left"
|
||||||
|
@ -202,163 +364,6 @@
|
||||||
|
|
||||||
<q-separator dark />
|
<q-separator dark />
|
||||||
|
|
||||||
<q-item
|
|
||||||
v-close-popup
|
|
||||||
clickable
|
|
||||||
active
|
|
||||||
active-class="bg-gunmetal-light text-cultured"
|
|
||||||
class="noHigh"
|
|
||||||
@click="newProjectAssignUID"
|
|
||||||
>
|
|
||||||
<q-item-section>New project</q-item-section>
|
|
||||||
<q-item-section avatar>
|
|
||||||
<q-icon name="mdi-plus" />
|
|
||||||
</q-item-section>
|
|
||||||
</q-item>
|
|
||||||
|
|
||||||
<q-separator dark />
|
|
||||||
|
|
||||||
<q-item
|
|
||||||
v-close-popup
|
|
||||||
clickable
|
|
||||||
active
|
|
||||||
active-class="bg-gunmetal-light text-cultured"
|
|
||||||
class="noHigh"
|
|
||||||
@click="commenceSave"
|
|
||||||
:disable="!projectExists || isFrontpage"
|
|
||||||
>
|
|
||||||
<q-item-section>Save current project</q-item-section>
|
|
||||||
<q-item-section avatar>
|
|
||||||
<q-icon name="mdi-package-variant-closed" />
|
|
||||||
</q-item-section>
|
|
||||||
</q-item>
|
|
||||||
|
|
||||||
<q-item
|
|
||||||
v-close-popup
|
|
||||||
clickable
|
|
||||||
active
|
|
||||||
active-class="bg-gunmetal-light text-cultured"
|
|
||||||
class="noHigh"
|
|
||||||
@click="loadProjectAssignUID"
|
|
||||||
>
|
|
||||||
<q-item-section>Load existing project</q-item-section>
|
|
||||||
<q-item-section avatar>
|
|
||||||
<q-icon name="mdi-package-variant" />
|
|
||||||
</q-item-section>
|
|
||||||
</q-item>
|
|
||||||
|
|
||||||
<q-separator dark />
|
|
||||||
|
|
||||||
<q-item clickable>
|
|
||||||
<q-item-section>Advanced project tools</q-item-section>
|
|
||||||
<q-item-section avatar>
|
|
||||||
<q-icon name="keyboard_arrow_right" />
|
|
||||||
</q-item-section>
|
|
||||||
<q-menu anchor="top end" self="top start">
|
|
||||||
<q-list class="bg-gunmetal text-accent">
|
|
||||||
|
|
||||||
<q-item
|
|
||||||
v-close-popup
|
|
||||||
clickable
|
|
||||||
active
|
|
||||||
active-class="bg-gunmetal-light text-cultured"
|
|
||||||
class="noHigh"
|
|
||||||
@click="mergeProjectAssignUID"
|
|
||||||
:disable="!projectExists || isFrontpage"
|
|
||||||
>
|
|
||||||
<q-item-section>Merge another project into the current one</q-item-section>
|
|
||||||
<q-item-section avatar>
|
|
||||||
<q-icon name="mdi-folder-plus-outline" />
|
|
||||||
</q-item-section>
|
|
||||||
</q-item>
|
|
||||||
|
|
||||||
<q-item
|
|
||||||
v-close-popup
|
|
||||||
clickable
|
|
||||||
active
|
|
||||||
active-class="bg-gunmetal-light text-cultured"
|
|
||||||
class="noHigh"
|
|
||||||
@click="exportProjectAssignUID"
|
|
||||||
:disable="!projectExists || isFrontpage"
|
|
||||||
>
|
|
||||||
<q-item-section>Export project/documents</q-item-section>
|
|
||||||
<q-item-section avatar>
|
|
||||||
<q-icon name="mdi-database-export-outline" />
|
|
||||||
</q-item-section>
|
|
||||||
</q-item>
|
|
||||||
|
|
||||||
<q-separator dark />
|
|
||||||
|
|
||||||
<q-item
|
|
||||||
v-close-popup
|
|
||||||
clickable
|
|
||||||
active
|
|
||||||
active-class="bg-gunmetal-light text-cultured"
|
|
||||||
class="noHigh"
|
|
||||||
@click="repairProjectAssignUID"
|
|
||||||
:disable="!projectExists || isFrontpage"
|
|
||||||
>
|
|
||||||
<q-item-section>Repair legacy project</q-item-section>
|
|
||||||
<q-item-section avatar>
|
|
||||||
<q-icon name="mdi-wrench" />
|
|
||||||
</q-item-section>
|
|
||||||
</q-item>
|
|
||||||
|
|
||||||
</q-list>
|
|
||||||
</q-menu>
|
|
||||||
</q-item>
|
|
||||||
|
|
||||||
<q-separator dark />
|
|
||||||
|
|
||||||
<q-item
|
|
||||||
v-close-popup
|
|
||||||
clickable
|
|
||||||
active
|
|
||||||
active-class="bg-gunmetal-light text-cultured"
|
|
||||||
class="noHigh"
|
|
||||||
@click="navigateToProjectPage"
|
|
||||||
:disable="!projectExists || isProjectPage"
|
|
||||||
>
|
|
||||||
<q-item-section>Show project overview</q-item-section>
|
|
||||||
<q-item-section avatar>
|
|
||||||
<q-icon name="mdi-chart-bar" />
|
|
||||||
</q-item-section>
|
|
||||||
</q-item>
|
|
||||||
|
|
||||||
<q-item
|
|
||||||
v-close-popup
|
|
||||||
clickable
|
|
||||||
active
|
|
||||||
active-class="bg-gunmetal-light text-cultured"
|
|
||||||
class="noHigh"
|
|
||||||
@click="projectCloseCheckDialogAssignUID"
|
|
||||||
:disable="!projectExists || isFrontpage"
|
|
||||||
>
|
|
||||||
<q-item-section>Close project</q-item-section>
|
|
||||||
<q-item-section avatar>
|
|
||||||
<q-icon name="mdi-exit-to-app" />
|
|
||||||
</q-item-section>
|
|
||||||
</q-item>
|
|
||||||
</q-list>
|
|
||||||
</q-menu>
|
|
||||||
</q-btn>
|
|
||||||
|
|
||||||
<!-- Help button-->
|
|
||||||
<q-btn
|
|
||||||
flat
|
|
||||||
:ripple="false"
|
|
||||||
dark
|
|
||||||
size='md'
|
|
||||||
no-caps
|
|
||||||
>
|
|
||||||
Help, Settings & Info
|
|
||||||
<q-menu
|
|
||||||
anchor="bottom left"
|
|
||||||
class="bg-gunmetal-light"
|
|
||||||
dark
|
|
||||||
square
|
|
||||||
>
|
|
||||||
<q-list class="bg-gunmetal-light" dark>
|
|
||||||
<q-item
|
<q-item
|
||||||
@click="programSettingsDialogAssignUID"
|
@click="programSettingsDialogAssignUID"
|
||||||
v-close-popup
|
v-close-popup
|
||||||
|
@ -373,7 +378,26 @@
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
|
|
||||||
<q-separator dark />
|
</q-list>
|
||||||
|
</q-menu>
|
||||||
|
</q-btn>
|
||||||
|
|
||||||
|
<!-- Help button-->
|
||||||
|
<q-btn
|
||||||
|
flat
|
||||||
|
:ripple="false"
|
||||||
|
dark
|
||||||
|
size='md'
|
||||||
|
no-caps
|
||||||
|
>
|
||||||
|
Help & Info
|
||||||
|
<q-menu
|
||||||
|
anchor="bottom left"
|
||||||
|
class="bg-gunmetal-light"
|
||||||
|
dark
|
||||||
|
square
|
||||||
|
>
|
||||||
|
<q-list class="bg-gunmetal-light" dark>
|
||||||
|
|
||||||
<q-item
|
<q-item
|
||||||
@click="keybindsDialogAssignUID"
|
@click="keybindsDialogAssignUID"
|
||||||
|
|
|
@ -1,5 +1,12 @@
|
||||||
<template>
|
<template>
|
||||||
<q-dialog
|
<div>
|
||||||
|
<!-- Export project dialog -->
|
||||||
|
<exportProjectDialog
|
||||||
|
:dialog-trigger="exportProjectDialogTrigger"
|
||||||
|
:prepicked-ids="[prepickedID]"
|
||||||
|
@trigger-dialog-close="exportProjectDialogClose"
|
||||||
|
/>
|
||||||
|
<q-dialog
|
||||||
no-route-dismiss
|
no-route-dismiss
|
||||||
v-model="dialogModel"
|
v-model="dialogModel"
|
||||||
@before-hide="triggerDialogClose"
|
@before-hide="triggerDialogClose"
|
||||||
|
@ -10,7 +17,7 @@
|
||||||
>
|
>
|
||||||
|
|
||||||
<q-card-section class="row items-center">
|
<q-card-section class="row items-center">
|
||||||
<h6 class="text-center q-my-sm">Open existing document</h6>
|
<h6 class="text-center q-my-sm">Search through existing documents</h6>
|
||||||
</q-card-section>
|
</q-card-section>
|
||||||
|
|
||||||
<q-card-section class="column items-center">
|
<q-card-section class="column items-center">
|
||||||
|
@ -202,6 +209,13 @@
|
||||||
<q-icon color="primary" name="mdi-content-copy" />
|
<q-icon color="primary" name="mdi-content-copy" />
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
|
<q-separator dark />
|
||||||
|
<q-item clickable v-close-popup @click="commenceExport(opt)">
|
||||||
|
<q-item-section>Export document</q-item-section>
|
||||||
|
<q-item-section avatar>
|
||||||
|
<q-icon name="mdi-database-export-outline" />
|
||||||
|
</q-item-section>
|
||||||
|
</q-item>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</q-list>
|
</q-list>
|
||||||
|
@ -220,6 +234,8 @@
|
||||||
|
|
||||||
</q-card>
|
</q-card>
|
||||||
</q-dialog>
|
</q-dialog>
|
||||||
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
@ -232,6 +248,7 @@ import { extend, uid } from "quasar"
|
||||||
import { createNewWithParent } from "src/scripts/documentActions/createNewWithParent"
|
import { createNewWithParent } from "src/scripts/documentActions/createNewWithParent"
|
||||||
import { copyDocumentName, copyDocumentTextColor, copyDocumentBackgroundColor } from "src/scripts/documentActions/uniqueFieldCopy"
|
import { copyDocumentName, copyDocumentTextColor, copyDocumentBackgroundColor } from "src/scripts/documentActions/uniqueFieldCopy"
|
||||||
import { copyDocument } from "src/scripts/documentActions/copyDocument"
|
import { copyDocument } from "src/scripts/documentActions/copyDocument"
|
||||||
|
import exportProjectDialog from "src/components/dialogs/ExportProject.vue"
|
||||||
|
|
||||||
import DialogBase from "src/components/dialogs/_DialogBase"
|
import DialogBase from "src/components/dialogs/_DialogBase"
|
||||||
import { I_Blueprint } from "src/interfaces/I_Blueprint"
|
import { I_Blueprint } from "src/interfaces/I_Blueprint"
|
||||||
|
@ -239,7 +256,8 @@ import documentPreview from "src/components/DocumentPreview.vue"
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
components: {
|
components: {
|
||||||
documentPreview
|
documentPreview,
|
||||||
|
exportProjectDialog
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
export default class ExistingDocumentDialog extends DialogBase {
|
export default class ExistingDocumentDialog extends DialogBase {
|
||||||
|
@ -593,6 +611,30 @@ export default class ExistingDocumentDialog extends DialogBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
documentPreviewClose = ""
|
documentPreviewClose = ""
|
||||||
|
|
||||||
|
prepickedID = ""
|
||||||
|
|
||||||
|
/****************************************************************/
|
||||||
|
// Export project dialog
|
||||||
|
/****************************************************************/
|
||||||
|
|
||||||
|
exportProjectDialogTrigger: string | false = false
|
||||||
|
exportProjectDialogClose () {
|
||||||
|
this.exportProjectDialogTrigger = false
|
||||||
|
}
|
||||||
|
|
||||||
|
exportProjectAssignUID () {
|
||||||
|
this.exportProjectDialogTrigger = this.generateUID()
|
||||||
|
}
|
||||||
|
|
||||||
|
commenceExport (node: {_id: string}) {
|
||||||
|
this.dialogModel = false
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
|
this.prepickedID = node._id
|
||||||
|
|
||||||
|
this.exportProjectAssignUID()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -19,16 +19,41 @@
|
||||||
<div class="row justify-center">
|
<div class="row justify-center">
|
||||||
<div class="col-4">
|
<div class="col-4">
|
||||||
<div class="q-mx-lg">
|
<div class="q-mx-lg">
|
||||||
<q-select
|
|
||||||
class="exportTypeSelect"
|
<div class="row">
|
||||||
dark
|
<div class="col">
|
||||||
popup-content-class="menuResizer"
|
<q-select
|
||||||
:options="exportFormats"
|
class="exportTypeSelect"
|
||||||
label="Export file format"
|
dark
|
||||||
filled
|
popup-content-class="menuResizer"
|
||||||
input-debounce="0"
|
:options="exportFormats"
|
||||||
v-model="selectedExportFormat"
|
label="Export file format"
|
||||||
/>
|
filled
|
||||||
|
input-debounce="0"
|
||||||
|
v-model="selectedExportFormat"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="col-auto self-center q-ml-sm" v-if="selectedExportFormat === 'Adobe Reader - PDF'">
|
||||||
|
<q-icon name="mdi-alert-circle" size="20px">
|
||||||
|
<q-tooltip :delay="500">
|
||||||
|
Please note that the PDF export doesn't play nice
|
||||||
|
<br>
|
||||||
|
with underlined text if different parts of the same paragraph
|
||||||
|
<br>
|
||||||
|
have increased/decreased font sizes
|
||||||
|
<br>
|
||||||
|
OR
|
||||||
|
<br>
|
||||||
|
if you have underlines in headings.
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
If your document contains such text,
|
||||||
|
<br>
|
||||||
|
then the result might not very appealing aesthetically.
|
||||||
|
</q-tooltip>
|
||||||
|
</q-icon>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<q-checkbox
|
<q-checkbox
|
||||||
class="q-mt-lg"
|
class="q-mt-lg"
|
||||||
|
@ -40,12 +65,29 @@
|
||||||
<q-checkbox
|
<q-checkbox
|
||||||
class="q-mt-lg"
|
class="q-mt-lg"
|
||||||
dark color="primary"
|
dark color="primary"
|
||||||
|
v-model="writerMode"
|
||||||
|
label="Export only text editors and document name?"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<q-checkbox
|
||||||
|
class="q-mt-lg"
|
||||||
|
dark color="primary"
|
||||||
|
v-if='writerMode'
|
||||||
|
v-model="writerModeTitles"
|
||||||
|
label="Include text editor field titles?"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<q-checkbox
|
||||||
|
class="q-mt-lg"
|
||||||
|
v-if='!writerMode'
|
||||||
|
dark color="primary"
|
||||||
v-model="includeTags"
|
v-model="includeTags"
|
||||||
label="Include tags in the export?"
|
label="Include tags in the export?"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<q-checkbox
|
<q-checkbox
|
||||||
class="q-mt-lg"
|
class="q-mt-lg"
|
||||||
|
v-if='!writerMode'
|
||||||
dark color="primary"
|
dark color="primary"
|
||||||
v-model="includeHierarchyPath"
|
v-model="includeHierarchyPath"
|
||||||
label="Include hierarchical path in the export?"
|
label="Include hierarchical path in the export?"
|
||||||
|
@ -53,13 +95,14 @@
|
||||||
|
|
||||||
<q-checkbox
|
<q-checkbox
|
||||||
class="q-mt-lg"
|
class="q-mt-lg"
|
||||||
|
v-if='!writerMode'
|
||||||
dark color="primary"
|
dark color="primary"
|
||||||
v-model="includeIsDead"
|
v-model="includeIsDead"
|
||||||
label="Include dead/gone/destroyed documents in the export?"
|
label="Include dead/gone/destroyed documents in the export?"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<q-checkbox
|
<q-checkbox
|
||||||
v-if="includeIsDead"
|
v-if='!writerMode && includeIsDead'
|
||||||
class="q-mt-lg"
|
class="q-mt-lg"
|
||||||
dark color="primary"
|
dark color="primary"
|
||||||
v-model="hideDeadInformation"
|
v-model="hideDeadInformation"
|
||||||
|
@ -294,6 +337,8 @@ export default class ExportProject extends DialogBase {
|
||||||
this.includeHierarchyPath = false
|
this.includeHierarchyPath = false
|
||||||
this.hideDeadInformation = false
|
this.hideDeadInformation = false
|
||||||
this.includeIsDead = true
|
this.includeIsDead = true
|
||||||
|
this.writerMode = false
|
||||||
|
this.writerModeTitles = false
|
||||||
this.exportDocumentsModel = []
|
this.exportDocumentsModel = []
|
||||||
this.exportOngoing = false
|
this.exportOngoing = false
|
||||||
this.exportList = []
|
this.exportList = []
|
||||||
|
@ -316,6 +361,10 @@ export default class ExportProject extends DialogBase {
|
||||||
|
|
||||||
exportWholeProject = false
|
exportWholeProject = false
|
||||||
|
|
||||||
|
writerMode = false
|
||||||
|
|
||||||
|
writerModeTitles = false
|
||||||
|
|
||||||
includeTags = false
|
includeTags = false
|
||||||
|
|
||||||
includeHierarchyPath = false
|
includeHierarchyPath = false
|
||||||
|
@ -776,39 +825,68 @@ export default class ExportProject extends DialogBase {
|
||||||
JSONExport[0] = `${JSONExport[0]} - Category`
|
JSONExport[0] = `${JSONExport[0]} - Category`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Document type
|
if (!this.writerMode) {
|
||||||
JSONExport.push({ h2: "Document type" })
|
// Document type
|
||||||
JSONExport.push({ ul: [input.documentType] })
|
JSONExport.push({ h2: "Document type" })
|
||||||
|
JSONExport.push({ ul: [input.documentType] })
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!this.writerMode) {
|
||||||
// Status
|
// Status
|
||||||
if (!this.hideDeadInformation) {
|
if (!this.hideDeadInformation) {
|
||||||
JSONExport.push({ h2: "Status" })
|
JSONExport.push({ h2: "Status" })
|
||||||
JSONExport.push({ ul: [(input.isDead) ? "Dead/Gone/Destroyed" : "Active/Alive"] })
|
JSONExport.push({ ul: [(input.isDead) ? "Dead/Gone/Destroyed" : "Active/Alive"] })
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!this.writerMode) {
|
||||||
// Hierarchy path
|
// Hierarchy path
|
||||||
if (this.includeHierarchyPath) {
|
if (this.includeHierarchyPath) {
|
||||||
JSONExport.push({ h2: "Hierarchical path" })
|
JSONExport.push({ h2: "Hierarchical path" })
|
||||||
JSONExport.push({ ul: [input.hierarchicalPath] })
|
JSONExport.push({ ul: [input.hierarchicalPath] })
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!this.writerMode) {
|
||||||
// Tags
|
// Tags
|
||||||
if (this.includeTags) {
|
if (this.includeTags) {
|
||||||
JSONExport.push({ h2: "Tags" })
|
JSONExport.push({ h2: "Tags" })
|
||||||
JSONExport.push({ ul: (Array.isArray(input.tags) ? input.tags : []) })
|
JSONExport.push({ ul: (Array.isArray(input.tags) ? input.tags : []) })
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Other fields
|
// Other fields
|
||||||
input.fieldValues.forEach(field => {
|
input.fieldValues.forEach(field => {
|
||||||
if (field.type === "break") {
|
if (field.type === "break" && !this.writerMode) {
|
||||||
JSONExport.push({ hr: "" })
|
JSONExport.push({ hr: "" })
|
||||||
JSONExport.push({ h1: field.label })
|
JSONExport.push({ h1: field.label })
|
||||||
}
|
}
|
||||||
else if (field.type === "wysiwyg") {
|
else if (field.type === "wysiwyg") {
|
||||||
JSONExport.push({ h2: field.label })
|
if (!this.writerMode || this.writerModeTitles) {
|
||||||
JSONExport.push({ p: field.value })
|
JSONExport.push({ h2: field.label })
|
||||||
|
}
|
||||||
|
|
||||||
|
let localValue = field.value as unknown as string
|
||||||
|
|
||||||
|
var replacements = [
|
||||||
|
[/\*/g, "\\*", "asterisks"],
|
||||||
|
[/#/g, "\\#", "number signs"],
|
||||||
|
[/\(/g, "\\(", "parentheses"],
|
||||||
|
[/\)/g, "\\)", "parentheses"],
|
||||||
|
[/\[/g, "\\[", "square brackets"],
|
||||||
|
[/\]/g, "\\]", "square brackets"],
|
||||||
|
[/_/g, "\\_", "underscores"]
|
||||||
|
]
|
||||||
|
|
||||||
|
// Escape special Characters
|
||||||
|
replacements.forEach(rep => {
|
||||||
|
// @ts-ignore
|
||||||
|
localValue = localValue.replace(rep[0], rep[1])
|
||||||
|
})
|
||||||
|
|
||||||
|
JSONExport.push({ p: localValue })
|
||||||
}
|
}
|
||||||
else {
|
else if (!this.writerMode) {
|
||||||
JSONExport.push({ h2: field.label })
|
JSONExport.push({ h2: field.label })
|
||||||
if (Array.isArray(field.value)) {
|
if (Array.isArray(field.value)) {
|
||||||
JSONExport.push({ ul: field.value })
|
JSONExport.push({ ul: field.value })
|
||||||
|
@ -865,62 +943,75 @@ export default class ExportProject extends DialogBase {
|
||||||
// Next line
|
// Next line
|
||||||
doc.fontSize(textFont).moveDown().moveDown()
|
doc.fontSize(textFont).moveDown().moveDown()
|
||||||
|
|
||||||
// Document type
|
if (!this.writerMode) {
|
||||||
doc.font("Times-Bold").fillColor("#000000").fontSize(textFont)
|
// Document type
|
||||||
.text("Document type", textPadding, undefined, paragraphOptions)
|
doc.font("Times-Bold").fillColor("#000000").fontSize(textFont)
|
||||||
doc.font("Times-Roman").fillColor("#000000").fontSize(textFont)
|
.text("Document type", textPadding, undefined, paragraphOptions)
|
||||||
.list([input.documentType], listPadding, undefined, paragraphOptions)
|
doc.font("Times-Roman").fillColor("#000000").fontSize(textFont)
|
||||||
.moveDown()
|
.list([input.documentType], listPadding, undefined, paragraphOptions)
|
||||||
|
.moveDown()
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!this.writerMode) {
|
||||||
// Status
|
// Status
|
||||||
if (!this.hideDeadInformation) {
|
if (!this.hideDeadInformation) {
|
||||||
doc.font("Times-Bold").fillColor("#000000").fontSize(textFont)
|
doc.font("Times-Bold").fillColor("#000000").fontSize(textFont)
|
||||||
.text("Status", textPadding, undefined, paragraphOptions)
|
.text("Status", textPadding, undefined, paragraphOptions)
|
||||||
doc.font("Times-Roman").fillColor("#000000").fontSize(textFont)
|
doc.font("Times-Roman").fillColor("#000000").fontSize(textFont)
|
||||||
.list([((input.isDead) ? "Dead/Gone/Destroyed" : "Active/Alive")], listPadding, undefined, paragraphOptions)
|
.list([((input.isDead) ? "Dead/Gone/Destroyed" : "Active/Alive")], listPadding, undefined, paragraphOptions)
|
||||||
.moveDown()
|
.moveDown()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hierarchy path
|
if (!this.writerMode) {
|
||||||
if (this.includeHierarchyPath) {
|
// Hierarchy path
|
||||||
doc.font("Times-Bold").fillColor("#000000").fontSize(textFont)
|
if (this.includeHierarchyPath) {
|
||||||
.text("Hierarchical path", textPadding, undefined, paragraphOptions)
|
doc.font("Times-Bold").fillColor("#000000").fontSize(textFont)
|
||||||
doc.font("Times-Roman").fillColor("#000000").fontSize(textFont)
|
.text("Hierarchical path", textPadding, undefined, paragraphOptions)
|
||||||
.list([input.hierarchicalPath], listPadding)
|
doc.font("Times-Roman").fillColor("#000000").fontSize(textFont)
|
||||||
.moveDown()
|
.list([input.hierarchicalPath], listPadding)
|
||||||
|
.moveDown()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!this.writerMode) {
|
||||||
// Tags
|
// Tags
|
||||||
if (this.includeTags) {
|
if (this.includeTags) {
|
||||||
doc.font("Times-Bold").fillColor("#000000").fontSize(textFont)
|
doc.font("Times-Bold").fillColor("#000000").fontSize(textFont)
|
||||||
.text("Tags", textPadding, undefined, paragraphOptions)
|
.text("Tags", textPadding, undefined, paragraphOptions)
|
||||||
doc.font("Times-Roman").fillColor("#000000").fontSize(textFont)
|
doc.font("Times-Roman").fillColor("#000000").fontSize(textFont)
|
||||||
.list((Array.isArray(input.tags) ? input.tags : []), listPadding, undefined, paragraphOptions)
|
.list((Array.isArray(input.tags) ? input.tags : []), listPadding, undefined, paragraphOptions)
|
||||||
.moveDown()
|
.moveDown()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Other fields
|
// Other fields
|
||||||
input.fieldValues.forEach(field => {
|
input.fieldValues.forEach(field => {
|
||||||
if (field.type === "break") {
|
if (field.type === "break" && !this.writerMode) {
|
||||||
doc.moveDown()
|
doc.moveDown()
|
||||||
.font("Times-Bold").fillColor("#000000").fontSize(subTitleFont)
|
.font("Times-Bold").fillColor("#000000").fontSize(subTitleFont)
|
||||||
.text(field.label, textPadding, undefined, paragraphOptions)
|
.text(field.label, textPadding, undefined, paragraphOptions)
|
||||||
.moveDown()
|
.moveDown()
|
||||||
}
|
}
|
||||||
else if (field.type === "wysiwyg") {
|
else if (field.type === "wysiwyg") {
|
||||||
doc.font("Times-Bold").fillColor("#000000").fontSize(textFont)
|
if (!this.writerMode || this.writerModeTitles) {
|
||||||
.text(field.label, textPadding, undefined, paragraphOptions)
|
doc.font("Times-Bold").fillColor("#000000").fontSize(textFont)
|
||||||
.moveDown()
|
.text(field.label, textPadding, undefined, paragraphOptions)
|
||||||
|
.moveDown()
|
||||||
|
}
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
const returnList = this.buildPDFWysiwygContent(field.value)
|
const returnList = this.buildPDFWysiwygContent(field.value)
|
||||||
|
|
||||||
doc.font("Times-Roman").fillColor("#000000").fontSize(textFont)
|
doc.font("Times-Roman").fillColor("#000000").fontSize(textFont)
|
||||||
|
|
||||||
const wysiwygOptions: {[key:string]: any} = extend(true, {}, paragraphOptions)
|
|
||||||
|
|
||||||
returnList.forEach(node => {
|
returnList.forEach(node => {
|
||||||
if (node.type === "text") {
|
if (node.type === "text") {
|
||||||
|
const wysiwygOptions: {[key:string]: any} = extend(true, {}, paragraphOptions)
|
||||||
|
wysiwygOptions.baseline = "alphabetic"
|
||||||
|
|
||||||
|
doc.fontSize(textFont)
|
||||||
|
|
||||||
// Italic
|
// Italic
|
||||||
wysiwygOptions.oblique = node.attrs.italic
|
wysiwygOptions.oblique = node.attrs.italic
|
||||||
|
|
||||||
|
@ -930,6 +1021,23 @@ export default class ExportProject extends DialogBase {
|
||||||
// Bold
|
// Bold
|
||||||
doc.font((node?.attrs?.bold) ? "Times-Bold" : "Times-Roman")
|
doc.font((node?.attrs?.bold) ? "Times-Bold" : "Times-Roman")
|
||||||
|
|
||||||
|
// Heading font sizing
|
||||||
|
if (node?.attrs?.hasHeadingFontSize) {
|
||||||
|
// @ts-ignore
|
||||||
|
doc.fontSize(node.attrs.nodeHeadingSize)
|
||||||
|
// @ts-ignore
|
||||||
|
wysiwygOptions.lineGap = node.attrs.nodeHeadingSize / 3
|
||||||
|
doc.font("Times-Bold")
|
||||||
|
}
|
||||||
|
|
||||||
|
// Custom font sizing
|
||||||
|
if (node?.attrs?.hasSpecialFontSize) {
|
||||||
|
// @ts-ignore
|
||||||
|
doc.fontSize(node.attrs.specialFontSize)
|
||||||
|
// @ts-ignore
|
||||||
|
wysiwygOptions.lineGap = node.attrs.specialFontSize / 3
|
||||||
|
}
|
||||||
|
|
||||||
// Continued
|
// Continued
|
||||||
wysiwygOptions.continued = node.attrs.continued
|
wysiwygOptions.continued = node.attrs.continued
|
||||||
|
|
||||||
|
@ -948,7 +1056,7 @@ export default class ExportProject extends DialogBase {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
doc.moveDown()
|
doc.moveDown()
|
||||||
}
|
}
|
||||||
else {
|
else if (!this.writerMode) {
|
||||||
doc.font("Times-Bold").fillColor("#000000").fontSize(textFont)
|
doc.font("Times-Bold").fillColor("#000000").fontSize(textFont)
|
||||||
.text(field.label, textPadding, undefined, paragraphOptions)
|
.text(field.label, textPadding, undefined, paragraphOptions)
|
||||||
doc.font("Times-Roman").fillColor("#000000").fontSize(textFont)
|
doc.font("Times-Roman").fillColor("#000000").fontSize(textFont)
|
||||||
|
@ -961,6 +1069,27 @@ export default class ExportProject extends DialogBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
buildPDFWysiwygContent (input: string) {
|
buildPDFWysiwygContent (input: string) {
|
||||||
|
const blockTagList = [
|
||||||
|
"div",
|
||||||
|
"h1",
|
||||||
|
"h2",
|
||||||
|
"h3",
|
||||||
|
"h4",
|
||||||
|
"h5",
|
||||||
|
"h6",
|
||||||
|
"li",
|
||||||
|
"blockquote"
|
||||||
|
]
|
||||||
|
|
||||||
|
const headingsList = [
|
||||||
|
"h1",
|
||||||
|
"h2",
|
||||||
|
"h3",
|
||||||
|
"h4",
|
||||||
|
"h5",
|
||||||
|
"h6"
|
||||||
|
]
|
||||||
|
|
||||||
const returnNodeList: I_HtmlParserNode[] = []
|
const returnNodeList: I_HtmlParserNode[] = []
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
||||||
|
@ -977,6 +1106,60 @@ export default class ExportProject extends DialogBase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const processHeadingFontSize = (heading: string) => {
|
||||||
|
switch (heading) {
|
||||||
|
case "h1":
|
||||||
|
return 24
|
||||||
|
|
||||||
|
case "h2":
|
||||||
|
return 20
|
||||||
|
|
||||||
|
case "h3":
|
||||||
|
return 18
|
||||||
|
|
||||||
|
case "h4":
|
||||||
|
return 16
|
||||||
|
|
||||||
|
case "h5":
|
||||||
|
return 14
|
||||||
|
|
||||||
|
case "h6":
|
||||||
|
return 12
|
||||||
|
|
||||||
|
default:
|
||||||
|
return 11
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const processNodeFontSize = (fontString: string) => {
|
||||||
|
const fontNumber = parseInt(fontString)
|
||||||
|
switch (fontNumber) {
|
||||||
|
case 1:
|
||||||
|
return 7
|
||||||
|
|
||||||
|
case 2:
|
||||||
|
return 9
|
||||||
|
|
||||||
|
case 3:
|
||||||
|
return 11
|
||||||
|
|
||||||
|
case 4:
|
||||||
|
return 13
|
||||||
|
|
||||||
|
case 5:
|
||||||
|
return 16
|
||||||
|
|
||||||
|
case 6:
|
||||||
|
return 19
|
||||||
|
|
||||||
|
case 7:
|
||||||
|
return 23
|
||||||
|
|
||||||
|
default:
|
||||||
|
return 11
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const processNode = (node: I_HtmlParserNode) => {
|
const processNode = (node: I_HtmlParserNode) => {
|
||||||
// ------------- NODE EXTRA ATTRIBUTES ------------------
|
// ------------- NODE EXTRA ATTRIBUTES ------------------
|
||||||
let nodeStyles: false|string = false
|
let nodeStyles: false|string = false
|
||||||
|
@ -985,6 +1168,12 @@ export default class ExportProject extends DialogBase {
|
||||||
nodeStyles = (processNodeStyles(snapshot.style)) ? snapshot.style : false
|
nodeStyles = (processNodeStyles(snapshot.style)) ? snapshot.style : false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let nodeFontSize: false|string = false
|
||||||
|
if (node?.attrs?.size) {
|
||||||
|
const snapshot: {size:string} = extend(true, {}, node.attrs)
|
||||||
|
nodeFontSize = (snapshot.size) || false
|
||||||
|
}
|
||||||
|
|
||||||
let parentIsBlockquote = false
|
let parentIsBlockquote = false
|
||||||
if (node.parentNode?.attrs?.blockquotePadding) {
|
if (node.parentNode?.attrs?.blockquotePadding) {
|
||||||
parentIsBlockquote = true
|
parentIsBlockquote = true
|
||||||
|
@ -997,11 +1186,39 @@ export default class ExportProject extends DialogBase {
|
||||||
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands
|
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands
|
||||||
const nextNode = node.selfNodeList[node.selfIndex + 1]
|
const nextNode = node.selfNodeList[node.selfIndex + 1]
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
|
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands
|
||||||
|
const nextParentNode = node?.parentNode?.selfNodeList[node?.parentNode?.selfIndex + 1]
|
||||||
|
|
||||||
|
// If it is the last one, obviously dont continue anything
|
||||||
|
if (!nextNode) {
|
||||||
|
node.isLast = true
|
||||||
|
}
|
||||||
|
|
||||||
|
// Text modifier - Headings
|
||||||
|
if ((node.type === "tag" && headingsList.includes(node.name)) || node?.parentNode?.attrs.hasHeadingFontSize === true) {
|
||||||
|
node.attrs.hasHeadingFontSize = true
|
||||||
|
|
||||||
|
if (headingsList.includes(node.name)) {
|
||||||
|
node.attrs.nodeHeadingSize = processHeadingFontSize(node.name)
|
||||||
|
}
|
||||||
|
else if (node?.parentNode?.attrs?.nodeHeadingSize) {
|
||||||
|
node.attrs.nodeHeadingSize = node?.parentNode?.attrs?.nodeHeadingSize
|
||||||
|
}
|
||||||
|
|
||||||
|
node.attrs.continued = false
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
node.attrs.hasHeadingFontSize = false
|
||||||
|
}
|
||||||
|
|
||||||
// If next if bold, italic or underline
|
// If next if bold, italic or underline
|
||||||
if (nextNode) {
|
if (nextNode) {
|
||||||
if ((nextNode.type === "tag" && nextNode.name === "i") ||
|
if ((nextNode.type === "tag" && nextNode.name === "i") ||
|
||||||
(nextNode.type === "tag" && nextNode.name === "b") ||
|
(nextNode.type === "tag" && nextNode.name === "b") ||
|
||||||
(nextNode.type === "tag" && nextNode.name === "u")
|
(nextNode.type === "tag" && nextNode.name === "u") ||
|
||||||
|
(nextNode.type === "tag" && nextNode.name === "font") ||
|
||||||
|
(nextNode.type === "tag" && nextNode.name === "span")
|
||||||
) {
|
) {
|
||||||
node.attrs.continued = true
|
node.attrs.continued = true
|
||||||
}
|
}
|
||||||
|
@ -1018,6 +1235,15 @@ export default class ExportProject extends DialogBase {
|
||||||
node.attrs.align = node.parentNode.attrs.align
|
node.attrs.align = node.parentNode.attrs.align
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Temporary fix for spans
|
||||||
|
if ((node.type === "tag" && node.name === "span") || node?.parentNode?.attrs.isSpan === true) {
|
||||||
|
node.attrs.isSpan = true
|
||||||
|
node.attrs.continued = true
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
node.attrs.isSpan = false
|
||||||
|
}
|
||||||
|
|
||||||
// Text modifier - Italic
|
// Text modifier - Italic
|
||||||
if ((node.type === "tag" && node.name === "i") || node?.parentNode?.attrs.italic === true) {
|
if ((node.type === "tag" && node.name === "i") || node?.parentNode?.attrs.italic === true) {
|
||||||
node.attrs.italic = true
|
node.attrs.italic = true
|
||||||
|
@ -1045,13 +1271,33 @@ export default class ExportProject extends DialogBase {
|
||||||
node.attrs.underline = false
|
node.attrs.underline = false
|
||||||
}
|
}
|
||||||
|
|
||||||
// If it is the last one, obviously dont continue anything
|
// Text modifier - Font size
|
||||||
if (!nextNode && node.type !== "text") {
|
if ((node.type === "tag" && node.name === "font") || node?.parentNode?.attrs.hasSpecialFontSize === true) {
|
||||||
node.isLast = true
|
node.attrs.hasSpecialFontSize = true
|
||||||
|
// @ts-ignore
|
||||||
|
node.attrs.specialFontSize = (nodeFontSize)
|
||||||
|
// @ts-ignore
|
||||||
|
? processNodeFontSize(nodeFontSize)
|
||||||
|
: node?.parentNode?.attrs?.specialFontSize
|
||||||
|
node.attrs.continued = true
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
node.attrs.hasSpecialFontSize = false
|
||||||
}
|
}
|
||||||
|
|
||||||
// Don't continue is this lack a continuing node
|
// Don't continue is this lack a continuing node OR if next node is 'div'
|
||||||
if (node.parentNode?.isLast && !nextNode) {
|
if ((node.parentNode?.isLast && !nextNode) ||
|
||||||
|
(nextNode && nextNode.type === "tag" && blockTagList.includes(nextNode.name)) ||
|
||||||
|
(node.isLast && nextParentNode?.type === "tag" && blockTagList.includes(nextParentNode?.name)) ||
|
||||||
|
(node.isLast && node.parentNode?.isLast)
|
||||||
|
) {
|
||||||
|
if (node.content === "great and brilliant Lord Demarcus Katari'") {
|
||||||
|
console.log((node.parentNode?.isLast && !nextNode))
|
||||||
|
console.log((nextNode && nextNode.type === "tag" && blockTagList.includes(nextNode.name)))
|
||||||
|
console.log((node.isLast && nextParentNode?.type === "tag" && blockTagList.includes(nextParentNode?.name)))
|
||||||
|
console.log((node.isLast && node.parentNode?.isLast))
|
||||||
|
}
|
||||||
|
|
||||||
node.attrs.continued = false
|
node.attrs.continued = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1063,29 +1309,36 @@ export default class ExportProject extends DialogBase {
|
||||||
// ------------- NODE PROCESSING ----------------------
|
// ------------- NODE PROCESSING ----------------------
|
||||||
|
|
||||||
// Return text node value OR a break
|
// Return text node value OR a break
|
||||||
if ((node.type === "text" && node.content) || node.type === "br") {
|
if ((node.type === "text" && node.content)) {
|
||||||
const returnNode = node
|
const returnNode = node
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
returnNode.content = returnNode.content.replace(/ /g, "").replace(/(\r\n|\n|\r)/gm, "")
|
returnNode.content = returnNode.content.replace(/ /g, "").replace(/(\r\n|\n|\r)/gm, "")
|
||||||
|
if (node.attrs.isSpan) {
|
||||||
|
returnNode.content = returnNode.content + " "
|
||||||
|
}
|
||||||
returnNodeList.push(returnNode)
|
returnNodeList.push(returnNode)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Process subnodes
|
// Process subnodes
|
||||||
else if (node?.children?.length > 0) {
|
else if (node?.children?.length > 0) {
|
||||||
node.children.forEach((childNode, i) => {
|
node.children.forEach((childNode, i) => {
|
||||||
childNode.selfIndex = i
|
childNode.selfIndex = i
|
||||||
childNode.selfNodeList = node.children
|
childNode.selfNodeList = node.children.filter(subNode => subNode.name !== "br")
|
||||||
childNode.parentNode = node
|
childNode.parentNode = node
|
||||||
|
|
||||||
|
if (node.name === "span") {
|
||||||
|
console.log((childNode))
|
||||||
|
}
|
||||||
|
|
||||||
processNode(childNode)
|
processNode(childNode)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Generate return value
|
// Generate return value
|
||||||
parsedHTML[0].selfNodeList = [parsedHTML[0]]
|
parsedHTML[0].selfNodeList = [parsedHTML[0]].filter(subNode => subNode.name !== "br")
|
||||||
parsedHTML[0].selfIndex = 0
|
parsedHTML[0].selfIndex = 0
|
||||||
parsedHTML[0].attrs = {}
|
parsedHTML[0].attrs = {}
|
||||||
|
|
||||||
processNode(parsedHTML[0])
|
processNode(parsedHTML[0])
|
||||||
|
|
||||||
return returnNodeList
|
return returnNodeList
|
||||||
|
|
134
src/css/app.scss
134
src/css/app.scss
|
@ -190,6 +190,70 @@ a {
|
||||||
> div {
|
> div {
|
||||||
margin: 12.5px 0;
|
margin: 12.5px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
font[size="1"] {
|
||||||
|
font-size: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
font[size="2"] {
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
font[size="3"] {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
font[size="4"] {
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
font[size="5"] {
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
font[size="6"] {
|
||||||
|
font-size: 28px;
|
||||||
|
}
|
||||||
|
|
||||||
|
font[size="7"] {
|
||||||
|
font-size: 34px;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
font-size: 50px;
|
||||||
|
font-weight: 400;
|
||||||
|
line-height: 1.4;
|
||||||
|
}
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
font-size: 40px;
|
||||||
|
font-weight: 400;
|
||||||
|
line-height: 1.6;
|
||||||
|
}
|
||||||
|
|
||||||
|
h3 {
|
||||||
|
font-size: 35px;
|
||||||
|
font-weight: 400;
|
||||||
|
line-height: 1.6;
|
||||||
|
}
|
||||||
|
|
||||||
|
h4 {
|
||||||
|
font-size: 30px;
|
||||||
|
font-weight: 400;
|
||||||
|
line-height: 1.8;
|
||||||
|
}
|
||||||
|
|
||||||
|
h5 {
|
||||||
|
font-size: 25px;
|
||||||
|
font-weight: 400;
|
||||||
|
line-height: 1.8;
|
||||||
|
}
|
||||||
|
|
||||||
|
h6 {
|
||||||
|
font-size: 20px;
|
||||||
|
font-weight: 400;
|
||||||
|
line-height: 1.8;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.q-editor__toolbars-container {
|
.q-editor__toolbars-container {
|
||||||
|
@ -693,3 +757,73 @@ body .q-tooltip {
|
||||||
right: 0;
|
right: 0;
|
||||||
top: 0;
|
top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
font[size="1"] {
|
||||||
|
font-size: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
font[size="2"] {
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
font[size="3"] {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
font[size="4"] {
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
font[size="5"] {
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
font[size="6"] {
|
||||||
|
font-size: 28px;
|
||||||
|
}
|
||||||
|
|
||||||
|
font[size="7"] {
|
||||||
|
font-size: 34px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.q-menu.q-position-engine .q-list {
|
||||||
|
h1 {
|
||||||
|
font-size: 50px;
|
||||||
|
font-weight: 400;
|
||||||
|
line-height: 1.4;
|
||||||
|
}
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
font-size: 40px;
|
||||||
|
font-weight: 400;
|
||||||
|
line-height: 1.6;
|
||||||
|
}
|
||||||
|
|
||||||
|
h3 {
|
||||||
|
font-size: 35px;
|
||||||
|
font-weight: 400;
|
||||||
|
line-height: 1.6;
|
||||||
|
}
|
||||||
|
|
||||||
|
h4 {
|
||||||
|
font-size: 30px;
|
||||||
|
font-weight: 400;
|
||||||
|
line-height: 1.8;
|
||||||
|
}
|
||||||
|
|
||||||
|
h5 {
|
||||||
|
font-size: 25px;
|
||||||
|
font-weight: 400;
|
||||||
|
line-height: 1.8;
|
||||||
|
}
|
||||||
|
|
||||||
|
h6 {
|
||||||
|
font-size: 20px;
|
||||||
|
font-weight: 400;
|
||||||
|
line-height: 1.8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-no-wrap {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
### New features
|
### New features
|
||||||
|
|
||||||
- **Added export support for Markdown**
|
- **Added export support for Markdown**
|
||||||
|
- **Added export support for PDF**
|
||||||
- **Added on-the-fly relationship documents generation**
|
- **Added on-the-fly relationship documents generation**
|
||||||
- **Added stat/attribute support for multiple RPG systems**
|
- **Added stat/attribute support for multiple RPG systems**
|
||||||
- **Added option to search through the `Other names` field via `@` modifier**
|
- **Added option to search through the `Other names` field via `@` modifier**
|
||||||
|
@ -60,6 +61,8 @@
|
||||||
- Added a tiny bit of color to help discern which relationship is one-way and which is two-way
|
- Added a tiny bit of color to help discern which relationship is one-way and which is two-way
|
||||||
- Adjusted the single and multi relationship fields not showing suggestion popups when a value is removed the list
|
- Adjusted the single and multi relationship fields not showing suggestion popups when a value is removed the list
|
||||||
- Adjusted the single relationship fields to hide the suggest list when a value is selected from the list
|
- Adjusted the single relationship fields to hide the suggest list when a value is selected from the list
|
||||||
|
- Adjust font sizes for titles and "sizes" in text editor field to be actually useable without looks ridiculous
|
||||||
|
- Rearanged the menu and added a new `Tools` category to make finding stuff a bit easier
|
||||||
|
|
||||||
## 0.1.6a
|
## 0.1.6a
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ export interface I_HtmlParserNode {
|
||||||
voidElement: boolean;
|
voidElement: boolean;
|
||||||
name: string;
|
name: string;
|
||||||
attrs: {
|
attrs: {
|
||||||
[key: string]: string|boolean
|
[key: string]: string|boolean|number
|
||||||
};
|
};
|
||||||
children: I_HtmlParserNode[];
|
children: I_HtmlParserNode[];
|
||||||
selfIndex?: number;
|
selfIndex?: number;
|
||||||
|
|
|
@ -524,6 +524,74 @@ export const RPGSystemsStats = [
|
||||||
"Reflexes (ref) - Speed (spd)"
|
"Reflexes (ref) - Speed (spd)"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: "Fallout",
|
||||||
|
values: [
|
||||||
|
"Strength",
|
||||||
|
"Perception",
|
||||||
|
"Endurance",
|
||||||
|
"Charisma",
|
||||||
|
"Intelligence",
|
||||||
|
"Agility",
|
||||||
|
"Luck"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Star Trek Adventures - Personnel (Modiphius 2d20 System)",
|
||||||
|
values: [
|
||||||
|
"Control - Attribute",
|
||||||
|
"Daring - Attribute",
|
||||||
|
"Fitness - Attribute",
|
||||||
|
"Insight - Attribute",
|
||||||
|
"Presence - Attribute",
|
||||||
|
"Reason - Attribute",
|
||||||
|
"Command - Discipline",
|
||||||
|
"Conn - Discipline",
|
||||||
|
"Security - Discipline",
|
||||||
|
"Engineering - Discipline",
|
||||||
|
"Science - Discipline",
|
||||||
|
"Medicine - Discipline"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Star Trek Adventures - Ships (Modiphius 2d20 System)",
|
||||||
|
values: [
|
||||||
|
"Engines - Systems",
|
||||||
|
"Structure - Systems",
|
||||||
|
"Computers - Systems",
|
||||||
|
"Sensors - Systems",
|
||||||
|
"Weapons - Systems",
|
||||||
|
"Communications - Systems",
|
||||||
|
"Command - Department",
|
||||||
|
"Conn - Department",
|
||||||
|
"Security - Department",
|
||||||
|
"Engineering - Department",
|
||||||
|
"Science - Department",
|
||||||
|
"Medicine - Department"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Warhammer 40k (Dark Heresy 2)",
|
||||||
|
values: [
|
||||||
|
"Weapon Skill",
|
||||||
|
"Ballistic Skill",
|
||||||
|
"Strength",
|
||||||
|
"Toughness",
|
||||||
|
"Agility",
|
||||||
|
"Intelligence",
|
||||||
|
"Perception",
|
||||||
|
"Willpower",
|
||||||
|
"Fellowship",
|
||||||
|
"Psy Rating",
|
||||||
|
"Wounds",
|
||||||
|
"Fatigue",
|
||||||
|
"Insanity",
|
||||||
|
"Corruption",
|
||||||
|
"Influence",
|
||||||
|
"Profit Factor",
|
||||||
|
"Infamy"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
"Absorption",
|
"Absorption",
|
||||||
"Alertness",
|
"Alertness",
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
## THE GM BATCH START - 0.1.7
|
## THE GM BATCH START - 0.1.7
|
||||||
|
|
||||||
- "Save all" keybind and "Save all and exit" option on the exiting
|
- Add `Font` and `hX` elements to PDF support... maybe something else
|
||||||
|
Suggestion: In Species/Races/Flora/Fauna docs, move Related Species/Races/Flora/Fauna and Characters of Species/Races/Flora/Fauna down and move the text fields (Description & History and Traditions & Customs) up. I have a lot of characters and have to scroll quite a bit to get down to the text fields to read them.
|
||||||
- Export for MD/PDF/ODT/DOCX
|
|
||||||
|
|
||||||
## THE GM BATCH END - 0.1.7
|
## THE GM BATCH END - 0.1.7
|
||||||
|
|
||||||
## PROJECT SETTINGS BATCH 1 START - 0.1.8
|
## PROJECT SETTINGS BATCH 1 START - 0.1.8
|
||||||
|
|
||||||
- Add `SHIFT + ENTER` add mode to relationship searches to add documents without deleting the entered text
|
- Add `SHIFT + ENTER` add mode to relationship searches to add documents without deleting the entered text
|
||||||
|
- Rewrite document display algortithmn and add option to show description (text editor fields) on top of the section (under break)
|
||||||
|
- Breaks/titles in lists
|
||||||
- Pin document preview floating window
|
- Pin document preview floating window
|
||||||
- Project setting dialog/options
|
- Project setting dialog/options
|
||||||
- Project rename
|
- Project rename
|
||||||
|
@ -71,6 +72,7 @@
|
||||||
|
|
||||||
### High priority
|
### High priority
|
||||||
|
|
||||||
|
- Export for ODT/DOCX
|
||||||
- Dynamic table field
|
- Dynamic table field
|
||||||
- Add subtabs (character stats, general info, etc)
|
- Add subtabs (character stats, general info, etc)
|
||||||
- Global text find/replace
|
- Global text find/replace
|
||||||
|
@ -82,6 +84,7 @@
|
||||||
|
|
||||||
### Low priority
|
### Low priority
|
||||||
|
|
||||||
|
- Double decimals (dates) in order field
|
||||||
- Horizontal fields (title AND value next to each other. Might need a designer)
|
- Horizontal fields (title AND value next to each other. Might need a designer)
|
||||||
- Simple data imports (maybe?)
|
- Simple data imports (maybe?)
|
||||||
- Vanity project-wide word count
|
- Vanity project-wide word count
|
||||||
|
|
Loading…
Reference in a new issue