diff --git a/frontend/src/lib/editor.svelte b/frontend/src/lib/editor.svelte index 53d4cc4..eda9e46 100644 --- a/frontend/src/lib/editor.svelte +++ b/frontend/src/lib/editor.svelte @@ -11,6 +11,8 @@ import SettingsCard from '$lib/editor/settings-card.svelte'; import QuizCard from '$lib/editor/card.svelte'; import Spinner from './Spinner.svelte'; + import { elementSelection } from '$lib/stores.js'; + import ElementSelection from '$lib/editor/slides/element_selection.svelte'; let schemaInvalid = false; let yupErrorMessage = ''; @@ -187,3 +189,7 @@ {/await} + +{#if $elementSelection.data === null} + +{/if} diff --git a/frontend/src/lib/editor/card.svelte b/frontend/src/lib/editor/card.svelte index 03b99ea..a79b74f 100644 --- a/frontend/src/lib/editor/card.svelte +++ b/frontend/src/lib/editor/card.svelte @@ -12,6 +12,7 @@ import Spinner from '../Spinner.svelte'; import { createTippy } from 'svelte-tippy'; import { getLocalization } from '$lib/i18n'; + import Slide from './slide.svelte'; const { t } = getLocalization(); @@ -51,9 +52,9 @@ */ -
+
-
+
-
-
- {#await import('$lib/inline-editor.svelte')} - - {:then c} -
- +
+ {#await import('$lib/inline-editor.svelte')} + + {:then c} +
+ +
+ {/await} +
+ {#if data.questions[selected_question].image != undefined && data.questions[selected_question].image !== ''} +
+ not available { + data.questions[selected_question].image = ''; + }} />
- {/await} -
- {#if data.questions[selected_question].image != undefined && data.questions[selected_question].image !== ''} -
- not available { - data.questions[selected_question].image = ''; - }} - /> -
- {:else if pow_data === undefined} - - - - {:else} - {#await import('$lib/editor/uploader.svelte')} - - {:then c} - - {/await} - {/if} -
-
- - + + {:else} + {#await import('$lib/editor/uploader.svelte')} + + {:then c} + - - -
-
-
- -
-
- {#if data.questions[selected_question].type === QuizQuestionType.ABCD} - {#await import('$lib/editor/ABCDEditorPart.svelte')} - - {:then c} - - {/await} - {:else if data.questions[selected_question].type === QuizQuestionType.RANGE} - - {:else if data.questions[selected_question].type === QuizQuestionType.VOTING} - {#await import('$lib/editor/VotingEditorPart.svelte')} - - {:then c} - {/await} {/if} +
+
+ + + + +
+
+
+ +
+
+ {#if data.questions[selected_question].type === QuizQuestionType.ABCD} + {#await import('$lib/editor/ABCDEditorPart.svelte')} + + {:then c} + + {/await} + {:else if data.questions[selected_question].type === QuizQuestionType.RANGE} + + {:else if data.questions[selected_question].type === QuizQuestionType.VOTING} + {#await import('$lib/editor/VotingEditorPart.svelte')} + + {:then c} + + {/await} + {/if} +
+

+ {$t('editor_page.right_click_to_delete')} +

-

{$t('editor_page.right_click_to_delete')}

-
+ {:else} + + {/if}
diff --git a/frontend/src/lib/editor/sidebar.svelte b/frontend/src/lib/editor/sidebar.svelte index c575606..0b0aa6f 100644 --- a/frontend/src/lib/editor/sidebar.svelte +++ b/frontend/src/lib/editor/sidebar.svelte @@ -242,7 +242,7 @@
{/each}
+
diff --git a/frontend/src/lib/editor/slide.svelte b/frontend/src/lib/editor/slide.svelte new file mode 100644 index 0000000..97063f1 --- /dev/null +++ b/frontend/src/lib/editor/slide.svelte @@ -0,0 +1,205 @@ + + + +
+
+ {#each elements as el, i} +
+ + + + + {#if el.type === ElementTypes.Text} +

Text

+ + {:else if el.type === ElementTypes.Headline} +

Headline

+ + {/if} +
+ {/each} +
+
+ {#each ghost_elements as el, i} +
+ +
+ {/each} +
+
diff --git a/frontend/src/lib/editor/slides/element_selection.svelte b/frontend/src/lib/editor/slides/element_selection.svelte new file mode 100644 index 0000000..2639ac5 --- /dev/null +++ b/frontend/src/lib/editor/slides/element_selection.svelte @@ -0,0 +1,77 @@ + + + +
+
+
+

Select the element you want to add

+
+
    + {#each element_list as el} +
  • { + elementSelection.set({ data: el.type }); + }} + > +
    +

    {el.name}

    +

    {el.description}

    +
    + {el.shortcut} +
  • + {/each} +
+
+
diff --git a/frontend/src/lib/editor/slides/types/headline.svelte b/frontend/src/lib/editor/slides/types/headline.svelte new file mode 100644 index 0000000..2272baf --- /dev/null +++ b/frontend/src/lib/editor/slides/types/headline.svelte @@ -0,0 +1,10 @@ + + + + diff --git a/frontend/src/lib/editor/slides/types/text.svelte b/frontend/src/lib/editor/slides/types/text.svelte new file mode 100644 index 0000000..6990f86 --- /dev/null +++ b/frontend/src/lib/editor/slides/types/text.svelte @@ -0,0 +1,16 @@ + + + + + +