Skip to content

Commit

Permalink
create shared assets folder
Browse files Browse the repository at this point in the history
  • Loading branch information
IshavSohal committed Jan 23, 2025
1 parent 53f7df3 commit c0b14da
Show file tree
Hide file tree
Showing 9 changed files with 831 additions and 103 deletions.
3 changes: 3 additions & 0 deletions src/components/dynamic-editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@
:centerSlide="centerSlide"
:dynamicSelected="dynamicSelected"
@slide-edit="$emit('slide-edit')"
@shared-asset="(oppositeAssetPath: string, sharedAssetPath: string, oppositeLang: string) => {
$emit('shared-asset', oppositeAssetPath, sharedAssetPath, oppositeLang);
}"
></component>
</div>
</div>
Expand Down
38 changes: 35 additions & 3 deletions src/components/editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,14 @@
:slideIndex="slideIndex"
@slide-change="selectSlide"
@slides-updated="updateSlides"
@shared-asset="(oppositeAssetPath: string, sharedAssetPath: string, oppositeLang: string) => {
$emit('shared-asset', oppositeAssetPath, sharedAssetPath, oppositeLang);
}"
@process-panel="
(panel, callback, ...args) => {
$emit('process-panel', panel, callback, ...args);
}
"
:configFileStructure="configFileStructure"
:lang="configLang"
:sourceCounts="sourceCounts"
Expand Down Expand Up @@ -323,6 +331,14 @@
:slideIndex="slideIndex"
@slide-change="selectSlide"
@slides-updated="updateSlides"
@shared-asset="(oppositeAssetPath: string, sharedAssetPath: string, oppositeLang: string) => {
$emit('shared-asset', oppositeAssetPath, sharedAssetPath, oppositeLang);
}"
@process-panel="
(panel, callback, ...args) => {
$emit('process-panel', panel, callback, ...args);
}
"
:configFileStructure="configFileStructure"
:lang="configLang"
:sourceCounts="sourceCounts"
Expand All @@ -342,6 +358,9 @@
:slideIndex="slideIndex"
:isLast="slideIndex === slides.length - 1"
:uid="uuid"
@shared-asset="(oppositeAssetPath: string, sharedAssetPath: string, oppositeLang: string) => {
$emit('shared-asset', oppositeAssetPath, sharedAssetPath, oppositeLang);
}"
@slide-change="selectSlide"
@slide-edit="onSlidesEdited"
@custom-slide-updated="updateCustomSlide"
Expand Down Expand Up @@ -376,14 +395,17 @@
<script lang="ts">
import { Options, Prop, Vue, Watch } from 'vue-property-decorator';
import {
BasePanel,
ConfigFileStructure,
HelpSection,
ImagePanel,
MetadataContent,
MultiLanguageSlide,
Slide,
SourceCounts,
StoryRampConfig,
TextPanel
TextPanel,
VideoPanel
} from '@/definitions';
import { VueSpinnerOval } from 'vue3-spinners';
import axios from 'axios';
Expand Down Expand Up @@ -501,6 +523,10 @@ export default class EditorV extends Vue {
* Change current slide to selected slide.
*/
selectSlide(index: number, lang?: string): void {
console.log(' ');
console.log('selectSlide()');
console.log('current lang');
console.log(this.configLang);
// save changes to current slide before changing slides
if (this.$refs.slide !== undefined) {
(this.$refs.slide as SlideEditorV).saveChanges();
Expand All @@ -512,15 +538,21 @@ export default class EditorV extends Vue {
panel: [{ type: 'loading-page' }, { type: 'loading-page' }]
};
const newLang = lang ? lang : this.configLang ? this.configLang : 'en';
console.log('newLang');
console.log(newLang);
if (this.configLang !== newLang) {
this.$emit('lang-change', newLang);
}
setTimeout(() => {
if (index === -1 || !this.loadSlides) {
this.currentSlide = '';
} else {
const selectedLang = (lang ?? this.configLang) as keyof MultiLanguageSlide;
const selectedLang = newLang as keyof MultiLanguageSlide;
const selectedSlide = this.loadSlides[index][selectedLang];
this.currentSlide = selectedSlide ?? '';
}
this.slideIndex = index;
(this.$refs.slide as SlideEditorV).panelIndex = 0;
(this.$refs.slide as SlideEditorV).advancedEditorView = false;
Expand Down
2 changes: 1 addition & 1 deletion src/components/helpers/image-preview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<div class="flex-grow image-container">
<img
class="image-file object-cover"
:title="imageFile.id"
:title="imageFile.id.split('/').at(-1)"
:src="imageFile.src"
:alt="imageFile.altText"
/>
Expand Down
Loading

0 comments on commit c0b14da

Please sign in to comment.