mirror of
https://github.com/Elvanos/fantasia-archive.git
synced 2024-06-02 02:14:47 +12:00
0.1.5-rc-3
This commit is contained in:
parent
72ed88f33c
commit
89b7a620e4
12
src/App.vue
12
src/App.vue
|
@ -270,5 +270,17 @@ export default class App extends BaseClass {
|
|||
}
|
||||
|
||||
advSearchWindowVisible = false
|
||||
|
||||
/****************************************************************/
|
||||
// Local keybinds
|
||||
/****************************************************************/
|
||||
|
||||
@Watch("SGET_getCurrentKeyBindData", { deep: true })
|
||||
processKeyPush () {
|
||||
// Toggle the Advanced search cheatsheet
|
||||
if (this.determineKeyBind("toggleAdvSearchCheatsheet")) {
|
||||
this.advSearchWindowVisible = !this.advSearchWindowVisible
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -163,11 +163,28 @@
|
|||
</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
icon="mdi-content-save-edit"
|
||||
:color="(!hasEdits) ? 'teal-14' : 'primary'"
|
||||
outline
|
||||
@click="saveCurrentDocument(true)"
|
||||
v-if="!currentyEditable && SGET_allOpenedDocuments.docs.length > 0"
|
||||
>
|
||||
<q-tooltip
|
||||
:delay="500"
|
||||
anchor="bottom left"
|
||||
self="top middle"
|
||||
>
|
||||
Save document without exiting edit mode
|
||||
</q-tooltip>
|
||||
|
||||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
icon="mdi-content-save"
|
||||
:color="(!hasEdits) ? 'teal-14' : 'primary'"
|
||||
outline
|
||||
@click="saveCurrentDocument"
|
||||
@click="saveCurrentDocument(false)"
|
||||
v-if="!currentyEditable && SGET_allOpenedDocuments.docs.length > 0"
|
||||
>
|
||||
<q-tooltip
|
||||
|
@ -322,7 +339,12 @@ export default class DocumentControl extends BaseClass {
|
|||
|
||||
// Save document - CTRL + S
|
||||
if (this.determineKeyBind("saveDocument") && !this.currentyEditable && this.SGET_allOpenedDocuments.docs.length > 0 && !this.SGET_getDialogsState) {
|
||||
this.saveCurrentDocument().catch(e => console.log(e))
|
||||
this.saveCurrentDocument(false).catch(e => console.log(e))
|
||||
}
|
||||
|
||||
// Save document without exiting edit mode - CTRL + ALT + S
|
||||
if (this.determineKeyBind("saveDocumentNoExit") && !this.currentyEditable && this.SGET_allOpenedDocuments.docs.length > 0 && !this.SGET_getDialogsState) {
|
||||
this.saveCurrentDocument(true).catch(e => console.log(e))
|
||||
}
|
||||
|
||||
// Add new under parent - CTRL + SHIFT + N
|
||||
|
@ -486,8 +508,8 @@ export default class DocumentControl extends BaseClass {
|
|||
|
||||
documentsCopy = null as unknown as I_OpenedDocument[]
|
||||
|
||||
async saveCurrentDocument () {
|
||||
if (document.activeElement) {
|
||||
async saveCurrentDocument (editMode: boolean) {
|
||||
if (document.activeElement && editMode === false) {
|
||||
(document.activeElement as HTMLElement).blur()
|
||||
}
|
||||
|
||||
|
@ -502,7 +524,7 @@ export default class DocumentControl extends BaseClass {
|
|||
const savedDocument: {
|
||||
documentCopy: I_OpenedDocument,
|
||||
allOpenedDocuments: I_OpenedDocument[]
|
||||
} = await saveDocument(currentDoc, this.documentsCopy)
|
||||
} = await saveDocument(currentDoc, this.documentsCopy, editMode)
|
||||
|
||||
// Update the opened document
|
||||
const dataPass = { doc: savedDocument.documentCopy, treeAction: true }
|
||||
|
@ -514,6 +536,12 @@ export default class DocumentControl extends BaseClass {
|
|||
const dataPass = { doc: doc, treeAction: true }
|
||||
this.SSET_updateOpenedDocument(dataPass)
|
||||
}
|
||||
|
||||
this.$q.notify({
|
||||
group: false,
|
||||
type: "positive",
|
||||
message: "Document successfully saved"
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -186,7 +186,7 @@
|
|||
</template>
|
||||
|
||||
<template v-if="prop.node.isRoot">
|
||||
<q-separator />
|
||||
<q-separator dark />
|
||||
<q-item clickable v-close-popup @click="addNewObjectRoute(prop.node)">
|
||||
<q-item-section>Add new document of type: {{prop.node.label}}</q-item-section>
|
||||
<q-item-section avatar>
|
||||
|
@ -196,7 +196,7 @@
|
|||
</template>
|
||||
|
||||
<template v-if="!prop.node.isRoot">
|
||||
<q-separator />
|
||||
<q-separator dark />
|
||||
<q-item clickable v-close-popup @click="copyName(prop.node)">
|
||||
<q-item-section>Copy name</q-item-section>
|
||||
<q-item-section avatar>
|
||||
|
@ -215,7 +215,7 @@
|
|||
<q-icon name="mdi-format-color-fill" />
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-separator />
|
||||
<q-separator dark />
|
||||
<q-item clickable v-close-popup @click="openExistingDocumentRoute(prop.node)">
|
||||
<q-item-section>Open document</q-item-section>
|
||||
<q-item-section avatar>
|
||||
|
@ -240,7 +240,7 @@
|
|||
<q-icon name="mdi-content-copy" />
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-separator />
|
||||
<q-separator dark />
|
||||
<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 avatar class="text-secondary">
|
||||
|
|
|
@ -91,8 +91,38 @@
|
|||
touch-position
|
||||
context-menu
|
||||
>
|
||||
|
||||
<q-list class="bg-gunmetal-light text-accent">
|
||||
<q-item clickable>
|
||||
<q-item-section>All opened tabs</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
|
||||
:to="`/project/display-content/${menuDoc.type}/${menuDoc._id}`"
|
||||
v-for="menuDoc in localDocuments"
|
||||
:key="menuDoc._id"
|
||||
clickable
|
||||
:style="`
|
||||
color: ${retrieveFieldValue(menuDoc,'documentColor')};
|
||||
background-color: ${retrieveFieldValue(menuDoc,'documentBackgroundColor')};
|
||||
filter: ${(retrieveFieldValue(menuDoc,'minorSwitch') ? 'grayscale(100) brightness(0.7)' : '')}`"
|
||||
>
|
||||
<q-item-section class="isDeadIndicator grow-0" v-if="retrieveFieldValue(menuDoc,'deadSwitch')">
|
||||
†
|
||||
</q-item-section>
|
||||
<q-item-section
|
||||
:class="{'isDead': (retrieveFieldValue(menuDoc,'deadSwitch') && !hideDeadCrossThrough)}"
|
||||
>{{retrieveFieldValue(menuDoc,'name')}}</q-item-section>
|
||||
<q-item-section avatar>
|
||||
<q-icon :name="(retrieveFieldValue(menuDoc,'categorySwitch') ? 'fas fa-folder-open' : menuDoc.icon)" />
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-item>
|
||||
<q-separator dark />
|
||||
<q-item clickable v-close-popup @click="copyName(document)">
|
||||
<q-item-section>Copy name</q-item-section>
|
||||
<q-item-section avatar>
|
||||
|
@ -111,7 +141,7 @@
|
|||
<q-icon name="mdi-format-color-fill" />
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-separator />
|
||||
<q-separator dark />
|
||||
<q-item v-if="!document.isNew" clickable v-close-popup @click="addNewUnderParent(document)">
|
||||
<q-item-section>Create new document with this document as parent</q-item-section>
|
||||
<q-item-section avatar>
|
||||
|
@ -143,20 +173,20 @@
|
|||
<q-icon name="mdi-close-box-multiple-outline" />
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-separator />
|
||||
<q-separator dark />
|
||||
<q-item clickable v-close-popup @click="SSET_forceCloseAllButCurrentDocuments(document)">
|
||||
<q-item-section class="text-secondary">Force close all tabs except for this</q-item-section>
|
||||
<q-item-section class="text-secondary"><b>Force close all tabs except for this</b></q-item-section>
|
||||
<q-item-section avatar class="text-secondary">
|
||||
<q-icon name="mdi-close-box" />
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup @click="SSET_forceCloseAllDocuments">
|
||||
<q-item-section class="text-secondary">Force close all tabs</q-item-section>
|
||||
<q-item-section class="text-secondary"><b>Force close all tabs</b></q-item-section>
|
||||
<q-item-section avatar class="text-secondary">
|
||||
<q-icon name="mdi-close-box-multiple" />
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-separator />
|
||||
<q-separator dark />
|
||||
<q-item clickable v-close-popup @click="deleteTabDocument(document)">
|
||||
<q-item-section class="text-secondary"><b>Delete this document</b></q-item-section>
|
||||
<q-item-section avatar class="text-secondary">
|
||||
|
|
|
@ -165,7 +165,7 @@
|
|||
<q-icon name="mdi-format-color-fill" />
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-separator />
|
||||
<q-separator dark />
|
||||
<q-item clickable @click="openExistingInput(opt)">
|
||||
<q-item-section>Open document</q-item-section>
|
||||
<q-item-section avatar>
|
||||
|
|
|
@ -101,7 +101,7 @@
|
|||
<q-icon name="mdi-format-color-fill" />
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-separator />
|
||||
<q-separator dark />
|
||||
<q-item clickable @click="openExistingInput(fixGetCorrectDocument(single))">
|
||||
<q-item-section>Open document</q-item-section>
|
||||
<q-item-section avatar>
|
||||
|
@ -217,7 +217,7 @@
|
|||
<q-icon name="mdi-format-color-fill" />
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-separator />
|
||||
<q-separator dark />
|
||||
<q-item clickable @click="openExistingInput(fixGetCorrectDocument(scope.opt))">
|
||||
<q-item-section>Open document</q-item-section>
|
||||
<q-item-section avatar>
|
||||
|
@ -316,7 +316,7 @@
|
|||
<q-icon name="mdi-format-color-fill" />
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-separator />
|
||||
<q-separator dark />
|
||||
<q-item clickable @click="openExistingInput(opt)">
|
||||
<q-item-section>Open document</q-item-section>
|
||||
<q-item-section avatar>
|
||||
|
|
|
@ -98,7 +98,7 @@
|
|||
<q-icon name="mdi-format-color-fill" />
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-separator />
|
||||
<q-separator dark />
|
||||
<q-item clickable @click="openExistingInput(fixGetCorrectDocument(localInput))">
|
||||
<q-item-section>Open document</q-item-section>
|
||||
<q-item-section avatar>
|
||||
|
@ -214,7 +214,7 @@
|
|||
<q-icon name="mdi-format-color-fill" />
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-separator />
|
||||
<q-separator dark />
|
||||
<q-item clickable @click="openExistingInput(fixGetCorrectDocument(scope.opt))">
|
||||
<q-item-section>Open document</q-item-section>
|
||||
<q-item-section avatar>
|
||||
|
@ -315,7 +315,7 @@
|
|||
<q-icon name="mdi-format-color-fill" />
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-separator />
|
||||
<q-separator dark />
|
||||
<q-item clickable @click="openExistingInput(opt)">
|
||||
<q-item-section>Open document</q-item-section>
|
||||
<q-item-section avatar>
|
||||
|
|
|
@ -262,6 +262,10 @@ a {
|
|||
backface-visibility: hidden;
|
||||
}
|
||||
|
||||
.grow-0 {
|
||||
flex-grow: 0;
|
||||
}
|
||||
|
||||
.q-notification__message {
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
|
@ -361,6 +365,11 @@ a {
|
|||
z-index: 999999;
|
||||
}
|
||||
|
||||
.q-menu {
|
||||
z-index: 99999999 !important;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.text-underline {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
|
|
@ -26,11 +26,15 @@
|
|||
- Optimized multiple parts of the code to run smoother
|
||||
- Fixed wrong icons in some fields in some document types
|
||||
- Fixed a bug that was allowing for an attempted deletion of a document while the document data was still being retrieved. This resulted in an error that both made a mess of a UI and didn't delete the desider document
|
||||
- Fixed a bug in the scroll of the hierarchical tree that was causing it to not display last 1-2 items when scrolling down
|
||||
- Fixed a bug that was causing the hierarchical tree-resizing drag-bar to not scroll down with the rest of the page when viewing documents
|
||||
|
||||
### New features
|
||||
|
||||
- Added context menu support and multiple actions (right click) for top tabs, hierarchical tree and relationships across whole app
|
||||
- New actions for **Top Tabs**
|
||||
- All Opened Tabs
|
||||
- A list of all opened tabs for quick navigation
|
||||
- Copy name
|
||||
- Copy text color
|
||||
- Copy background color
|
||||
|
@ -64,6 +68,7 @@
|
|||
- Create new document with this document as parent
|
||||
- Copy this document
|
||||
- Added a special description field for categories that become visible only when the document is switches to the category mode
|
||||
- Added an option and correnspoding buttons/keybinds to save without exiting edit mode
|
||||
- Added a new 2-way relationship field `Connected to Lore notes/Other notes` to every single document type across the whole document
|
||||
- Added a whole new category "Organizations/Other groups" and connected it to other document types
|
||||
- Added a floating popup windows for quick cheatsheet for Advanced Search guide that can be summoned from each relationship search anywhere in the app
|
||||
|
@ -99,9 +104,12 @@
|
|||
- Added keybind: Force close all tabs except for this
|
||||
- Added keybind: Force close all tabs
|
||||
- Added keybind: Copy active document
|
||||
- Added keybind: Toggle the Advanced search cheatsheet
|
||||
- Added keybind: Save document without exiting edit mode
|
||||
|
||||
### QoL adjustments
|
||||
|
||||
- Added small popup notification upon succesfull save of a document
|
||||
- Unified and modified a lot of the root category names/descriptions
|
||||
- Changed focusing of the hierarchy tree search input from CTRL + SHIFT + W to CTRL + SHIFT +T
|
||||
- Updated fullscreen editor looks to work more like a proper document editor
|
||||
|
|
|
@ -142,7 +142,7 @@ export default class DocumentLayout extends BaseClass {
|
|||
|
||||
<style lang="scss">
|
||||
|
||||
.sideWrapper{
|
||||
.sideWrapper {
|
||||
height: calc(100% - 40px) !important;
|
||||
}
|
||||
|
||||
|
@ -168,6 +168,7 @@ export default class DocumentLayout extends BaseClass {
|
|||
height: calc(100vh - 95px);
|
||||
bottom: 0;
|
||||
top: 95px;
|
||||
position: sticky;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -22,10 +22,28 @@
|
|||
v-if="disableDocumentControlBar"
|
||||
>
|
||||
|
||||
<q-btn
|
||||
icon="mdi-content-save-edit"
|
||||
:color="(hasEdits) ? 'teal-14' : 'primary'"
|
||||
:outline="isDarkMode"
|
||||
class="q-mr-md"
|
||||
@click="saveCurrentDocument(true)"
|
||||
v-if="editMode"
|
||||
>
|
||||
<q-tooltip
|
||||
:delay="500"
|
||||
anchor="bottom left"
|
||||
self="top middle"
|
||||
>
|
||||
Save document without exiting edit mode
|
||||
</q-tooltip>
|
||||
|
||||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
:color="(hasEdits) ? 'teal-14' : 'primary'"
|
||||
icon="mdi-content-save"
|
||||
@click="saveCurrentDocument"
|
||||
@click="saveCurrentDocument(false)"
|
||||
:outline="isDarkMode"
|
||||
class="q-mr-md"
|
||||
v-if="editMode"
|
||||
|
@ -646,41 +664,6 @@ export default class PageDocumentDisplay extends BaseClass {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Triggers the save action of the document; canceling local edit mode and comitting the document data to the store
|
||||
*/
|
||||
async triggerSaveDocument () {
|
||||
const currentDoc = this.currentData
|
||||
|
||||
const allDocuments = this.SGET_allOpenedDocuments
|
||||
|
||||
const docCopy: I_OpenedDocument[] = extend(true, [], allDocuments.docs)
|
||||
|
||||
if (currentDoc) {
|
||||
// @ts-ignore
|
||||
const savedDocument: {
|
||||
documentCopy: I_OpenedDocument,
|
||||
allOpenedDocuments: I_OpenedDocument[]
|
||||
} = await saveDocument(currentDoc, docCopy)
|
||||
|
||||
// Update the opened document
|
||||
const dataPass = { doc: savedDocument.documentCopy, treeAction: true }
|
||||
this.SSET_updateOpenedDocument(dataPass)
|
||||
|
||||
// Update all others
|
||||
for (const doc of savedDocument.allOpenedDocuments) {
|
||||
// Update the opened document
|
||||
const dataPass = { doc: doc, treeAction: true }
|
||||
this.SSET_updateOpenedDocument(dataPass)
|
||||
}
|
||||
|
||||
this.editMode = false
|
||||
this.currentData.isNew = false
|
||||
this.currentData.hasEdits = false
|
||||
this.currentData.editMode = false
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the current document type blueprint
|
||||
*/
|
||||
|
@ -927,8 +910,8 @@ export default class PageDocumentDisplay extends BaseClass {
|
|||
/**
|
||||
* Saves the current document
|
||||
*/
|
||||
async saveCurrentDocument () {
|
||||
if (document.activeElement) {
|
||||
async saveCurrentDocument (keepEditMode: boolean) {
|
||||
if (document.activeElement && keepEditMode === false) {
|
||||
(document.activeElement as HTMLElement).blur()
|
||||
}
|
||||
|
||||
|
@ -943,7 +926,7 @@ export default class PageDocumentDisplay extends BaseClass {
|
|||
const savedDocument: {
|
||||
documentCopy: I_OpenedDocument,
|
||||
allOpenedDocuments: I_OpenedDocument[]
|
||||
} = await saveDocument(currentDoc, docCopy)
|
||||
} = await saveDocument(currentDoc, docCopy, keepEditMode)
|
||||
|
||||
// Update the opened document
|
||||
const dataPass = { doc: savedDocument.documentCopy, treeAction: true }
|
||||
|
@ -955,6 +938,12 @@ export default class PageDocumentDisplay extends BaseClass {
|
|||
const dataPass = { doc: doc, treeAction: true }
|
||||
this.SSET_updateOpenedDocument(dataPass)
|
||||
}
|
||||
|
||||
this.$q.notify({
|
||||
group: false,
|
||||
type: "positive",
|
||||
message: "Document successfully saved"
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -154,6 +154,17 @@ export const defaultKeybinds = [
|
|||
tooltip: "Save active document"
|
||||
},
|
||||
|
||||
// Save document without exiting edit mode - CTRL + ALT + S
|
||||
{
|
||||
altKey: true,
|
||||
ctrlKey: true,
|
||||
shiftKey: false,
|
||||
which: 83,
|
||||
editable: true,
|
||||
id: "saveDocumentNoExit",
|
||||
tooltip: "Save document without exiting edit mode"
|
||||
},
|
||||
|
||||
// Edit document - CTRL + E
|
||||
{
|
||||
altKey: false,
|
||||
|
@ -198,6 +209,17 @@ export const defaultKeybinds = [
|
|||
tooltip: "Delete active document"
|
||||
},
|
||||
|
||||
// Toggle the Advanced search cheatsheet - NONE
|
||||
{
|
||||
altKey: false,
|
||||
ctrlKey: false,
|
||||
shiftKey: false,
|
||||
which: false,
|
||||
editable: true,
|
||||
id: "toggleAdvSearchCheatsheet",
|
||||
tooltip: "Toggle the Advanced search cheatsheet"
|
||||
},
|
||||
|
||||
// Next focus - Tab
|
||||
{
|
||||
altKey: false,
|
||||
|
|
|
@ -7,7 +7,7 @@ import PouchDB from "pouchdb"
|
|||
/**
|
||||
* Saves the given project and handles all the needed procedures
|
||||
*/
|
||||
export const saveDocument = async (document: I_OpenedDocument, allOpenedDocuments: I_OpenedDocument[]) => {
|
||||
export const saveDocument = async (document: I_OpenedDocument, allOpenedDocuments: I_OpenedDocument[], editModeAfterSave: boolean) => {
|
||||
const BlueprintsDB = new PouchDB("blueprints")
|
||||
const currentBlueprint: {extraFields: I_ExtraFields[]} = await BlueprintsDB.get(document.type)
|
||||
|
||||
|
@ -110,6 +110,9 @@ export const saveDocument = async (document: I_OpenedDocument, allOpenedDocument
|
|||
await CurrentObjectDB.put(documentCopy)
|
||||
}
|
||||
|
||||
// Set edit mode for frontend
|
||||
documentCopy.editMode = editModeAfterSave
|
||||
|
||||
return { documentCopy, allOpenedDocuments }
|
||||
}
|
||||
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
|
||||
## THE GM BATCH END
|
||||
|
||||
- Add HTML webcolor cheatsheet in floating window (look for JSON of them somewhere?)
|
||||
|
||||
- Add dropdown of all opened document for tab context menu (submenu)
|
||||
|
||||
- Mass tag rename/deletion (done via document saving!)
|
||||
|
|
Loading…
Reference in a new issue