From 884b453bec30dea99d8ccbb5a8b052081b7b28f6 Mon Sep 17 00:00:00 2001 From: Ryan Coulson Date: Wed, 8 Jan 2025 11:56:41 -0500 Subject: [PATCH] add intro background customization to metadata editor --- StorylinesSchema.json | 25 +- src/components/helpers/metadata-content.vue | 70 ++++- src/components/metadata-editor.vue | 314 +++++++++++++------- src/definitions.ts | 3 + src/lang/lang.csv | 8 +- 5 files changed, 299 insertions(+), 121 deletions(-) diff --git a/StorylinesSchema.json b/StorylinesSchema.json index a3895734..3e8380bc 100644 --- a/StorylinesSchema.json +++ b/StorylinesSchema.json @@ -103,7 +103,7 @@ "type": { "type": "string", "enum": ["dynamic"] - }, + }, "modified": { "type": "boolean", "description": "An optional tag that specifies whether the panel has been modified from its default configuration" @@ -189,7 +189,7 @@ "title": { "type": "string", "description": "A title that is displayed centered above this map." - }, + }, "caption": { "type": "string", "description": "Supporting text content for the map." @@ -289,7 +289,7 @@ "type": { "type": "string", "enum": ["video"] - }, + }, "modified": { "type": "boolean", "description": "An optional tag that specifies whether the panel has been modified from its default configuration" @@ -361,7 +361,20 @@ "type": { "type": "string", "description": "The type of chart.", - "enum": ["line", "spline", "area", "areaspline", "column", "bar", "pie", "scatter", "gauge", "arearange", "areasplinerange", "columnrange"] + "enum": [ + "line", + "spline", + "area", + "areaspline", + "column", + "bar", + "pie", + "scatter", + "gauge", + "arearange", + "areasplinerange", + "columnrange" + ] }, "width": { "type": "number", @@ -436,6 +449,10 @@ "blurb": { "type": "string", "description": "Any additional information to display on the introductory slide." + }, + "backgroundImage": { + "type": "string", + "description": "A background image for the introduction slide." } }, "required": ["logo", "title"] diff --git a/src/components/helpers/metadata-content.vue b/src/components/helpers/metadata-content.vue index 7381ca9c..a7d771b6 100644 --- a/src/components/helpers/metadata-content.vue +++ b/src/components/helpers/metadata-content.vue @@ -115,13 +115,13 @@ + + + + +

{{ metadata.introBgName || $t('editor.metadataForm.na') }}

+ + +
+ + +

+ {{ $t('editor.image.loadingError') }} +

+
+ + + +
@@ -245,8 +300,8 @@ export default class MetadataEditorV extends Vue { @Prop() metadata!: MetadataContent; @Prop({ default: true }) editing!: boolean; - openFileSelector(): void { - document.getElementById('logoUpload')?.click(); + openFileSelector(where: string = 'logoUpload'): void { + document.getElementById(where)?.click(); } metadataChanged(event: Event): void { @@ -261,6 +316,11 @@ export default class MetadataEditorV extends Vue { this.metadata.logoName = ''; this.metadata.logoPreview = ''; } + + removeIntroBackground(): void { + this.metadata.introBgName = ''; + this.metadata.introBgPreview = ''; + } } diff --git a/src/components/metadata-editor.vue b/src/components/metadata-editor.vue index 9a1226a6..545ebc61 100644 --- a/src/components/metadata-editor.vue +++ b/src/components/metadata-editor.vue @@ -437,8 +437,8 @@ :metadata="metadata" :editing="editingMetadata" @metadata-changed="updateMetadata" - @logo-changed="onFileChange" - @logo-source-changed="onLogoSourceInput" + @image-changed="onFileChange" + @image-source-changed="onImageSourceInput" >
@@ -540,8 +540,8 @@