Skip to content

Commit 4132b98

Browse files
committed
create caption input for maps and charts
1 parent 6ab1b8b commit 4132b98

File tree

6 files changed

+45
-1
lines changed

6 files changed

+45
-1
lines changed

StorylinesSchema.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,10 @@
185185
"title": {
186186
"type": "string",
187187
"description": "A title that is displayed centered above this map."
188+
},
189+
"caption": {
190+
"type": "string",
191+
"description": "Supporting text content for the map."
188192
}
189193
},
190194
"required": ["config", "type"]

public/StorylinesSlideSchema.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,10 @@
192192
"type": "string",
193193
"description": "A title that is displayed centered above this map."
194194
},
195+
"caption": {
196+
"type": "string",
197+
"description": "Supporting text content for the map."
198+
},
195199
"timeSlider": {
196200
"type": "object",
197201
"description": "Configuration for a time slider on the map.",
@@ -256,6 +260,10 @@
256260
"customStyles": {
257261
"type": "string",
258262
"description": "Additional CSS styles to apply to the panel."
263+
},
264+
"caption": {
265+
"type": "string",
266+
"description": "Supporting text content for the chart."
259267
}
260268
},
261269
"additionalProperties": false,

src/components/chart-editor.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,10 @@
4747
:configFileStructure="configFileStructure"
4848
:sourceCounts="sourceCounts"
4949
:lang="lang"
50+
:index="index"
5051
@edit="editChart"
5152
@delete="$vfm.open(`${element.name}-${index}`)"
53+
@captionEdit="onChartsEdited"
5254
></ChartPreview>
5355
</template>
5456
</draggable>

src/components/helpers/chart-preview.vue

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,19 @@
6363
</div>
6464
</button>
6565
</div>
66+
<div class="flex items-center mt-2">
67+
<label :for="'chartPreviewCaption' + index" class="font-bold"
68+
>{{ $t('editor.image.label.caption') }}:
69+
</label>
70+
<input
71+
:id="'chartPreviewCaption' + index"
72+
class="editor-input w-2/5 ml-2"
73+
type="text"
74+
v-model="chart.caption"
75+
placeholder="Add a caption"
76+
@input="$emit('captionEdit')"
77+
/>
78+
</div>
6679
</li>
6780
</template>
6881

@@ -92,6 +105,7 @@ export default class ChartPreviewV extends Vue {
92105
@Prop() configFileStructure!: ConfigFileStructure;
93106
@Prop() sourceCounts!: SourceCounts;
94107
@Prop() lang!: string;
108+
@Prop() index!: number;
95109
96110
loading = true;
97111
chartIdx = 0;

src/components/map-editor.vue

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,19 @@
2424

2525
<div class="mb-4" v-if="usingTimeSlider"></div>
2626

27+
<div class="flex items-center w-full text-left mt-2">
28+
<label class="editor-label text-label" for="rampMapCaption">
29+
{{ $t('editor.image.label.caption') }}:</label
30+
>
31+
<input
32+
id="rampMapCaption"
33+
class="editor-input w-2/5"
34+
type="text"
35+
v-model="panel.caption"
36+
placeholder="Add a caption"
37+
/>
38+
</div>
39+
2740
<div class="ramp-editor mt-5" ref="editor" style="width: 70vw; height: 80vh"></div>
2841
</div>
2942
<vue-final-modal
@@ -44,7 +57,7 @@
4457
:disabled="timeSliderError"
4558
@click="saveTimeSlider"
4659
>
47-
Done
60+
{{ $t('editor.done') }}
4861
</button>
4962
</div>
5063
</vue-final-modal>

src/definitions.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ export interface MapPanel extends BasePanel {
183183
title: string;
184184
scrollguard: boolean;
185185
customStyles?: string;
186+
caption?: string;
186187
}
187188
export interface TimeSliderConfig {
188189
range: number[];
@@ -252,6 +253,7 @@ export interface ChartPanel extends BasePanel {
252253
name?: string;
253254
options?: DQVOptions;
254255
customStyles?: string;
256+
caption?: string;
255257
}
256258

257259
export interface ChartConfig {
@@ -260,6 +262,7 @@ export interface ChartConfig {
260262
config?: any;
261263
name?: string;
262264
options?: DQVOptions;
265+
caption?: string;
263266
}
264267

265268
export interface ImageFile {

0 commit comments

Comments
 (0)