Added new command palette

This commit is contained in:
Mawoka
2023-06-22 18:54:27 +02:00
parent e0db6427af
commit a71c168eb2
8 changed files with 585 additions and 3 deletions
+2
View File
@@ -11,6 +11,7 @@
import { BrowserTracing } from '@sentry/tracing';
import { initLocalizationContext } from '$lib/i18n';
import { browser } from '$app/environment';
import CommandPalette from '$lib/components/commandpalette.svelte';
// import Alert from '$lib/modals/alert.svelte';
/* afterNavigate(() => {
@@ -91,6 +92,7 @@
{:else}
<slot />
{/if}
<CommandPalette />
<!--{#if $alertModal.open ?? false}
<div
+4 -1
View File
@@ -9,6 +9,7 @@
import { getLocalization } from '$lib/i18n';
import { navbarVisible } from '$lib/stores';
import type { Question } from '$lib/quiz_types';
import { page } from '$app/stores';
navbarVisible.set(false);
@@ -30,10 +31,12 @@
onMount(() => {
const from_localstorage = localStorage.getItem('create_game');
if (from_localstorage === null) {
let title = $page.url.searchParams.get('title');
title ??= '';
data = {
description: '',
public: false,
title: '',
title,
questions: [
/* {
type: QuizQuestionType.ABCD,
+10
View File
@@ -6,6 +6,8 @@
<script lang="ts">
import { getLocalization } from '$lib/i18n';
import { navbarVisible } from '$lib/stores';
import { onMount } from 'svelte';
import { page } from '$app/stores';
navbarVisible.set(true);
@@ -74,6 +76,14 @@
};
$: console.log(file_input);
onMount(() => {
let url_from_path = $page.url.searchParams.get('url');
if (url_from_path === '') {
url_from_path = null;
}
url_input = url_from_path ?? '';
});
</script>
<svelte:head>
@@ -7,8 +7,12 @@
import type { Data } from '$lib/quiztivity/types';
import Editor from '$lib/quiztivity/editor.svelte';
import { goto } from '$app/navigation';
import { page } from '$app/stores';
let data: Data = { pages: [], id: undefined, title: '' };
let title = $page.url.searchParams.get('title');
title ??= '';
let data: Data = { pages: [], id: undefined, title };
let saving = false;
const save_quiztivity = async () => {