diff --git a/Tekst-Web/src/App.vue b/Tekst-Web/src/App.vue
index 3f0e3296..c9f17f72 100644
--- a/Tekst-Web/src/App.vue
+++ b/Tekst-Web/src/App.vue
@@ -4,7 +4,7 @@ import InitLoader from '@/components/InitLoader.vue';
import GlobalMessenger from '@/components/messages/GlobalMessenger.vue';
import { computed } from 'vue';
import { getLocaleProfile } from '@/i18n';
-import { useStateStore } from '@/stores';
+import { useStateStore, useThemeStore } from '@/stores';
import {
NLoadingBarProvider,
NConfigProvider,
@@ -13,7 +13,6 @@ import {
NBackTop,
useThemeVars,
} from 'naive-ui';
-import { useThemeStore } from '@/stores/theme';
import PageHeader from './layout/PageHeader.vue';
import PageFooter from './layout/PageFooter.vue';
import { useInitializeApp } from '@/composables/init';
diff --git a/Tekst-Web/src/components/browse/ResourceToggleDrawer.vue b/Tekst-Web/src/components/browse/ResourceToggleDrawer.vue
index 81cef817..c9225f05 100644
--- a/Tekst-Web/src/components/browse/ResourceToggleDrawer.vue
+++ b/Tekst-Web/src/components/browse/ResourceToggleDrawer.vue
@@ -1,13 +1,12 @@
-
+
diff --git a/Tekst-Web/src/forms/search/QuickSearchSettingsForm.vue b/Tekst-Web/src/forms/search/QuickSearchSettingsForm.vue
index 57b90433..da7dd0d4 100644
--- a/Tekst-Web/src/forms/search/QuickSearchSettingsForm.vue
+++ b/Tekst-Web/src/forms/search/QuickSearchSettingsForm.vue
@@ -1,11 +1,11 @@
-
+
{
+ const router = useRouter();
+ const { message } = useMessages();
+
+ const lastReq = ref();
+
+ const settingsGeneral = ref({
+ strict: false,
+ });
+ const settingsQuick = ref({
+ op: 'OR',
+ });
+ const settingsAdvanced = ref({});
+
+ function encodeQueryParam(requestBody?: SearchRequestBody): string | undefined {
+ if (!requestBody) return undefined;
+ try {
+ return Base64.encode(JSON.stringify(requestBody), true);
+ } catch {
+ message.error($t('errors.unexpected'));
+ return undefined;
+ }
+ }
+
+ function decodeQueryParam(): SearchRequestBody | undefined {
+ const queryParam = router.currentRoute.value.query.q?.toString();
+ try {
+ const decoded: SearchRequestBody = queryParam
+ ? JSON.parse(Base64.decode(queryParam))
+ : undefined;
+ if (!decoded || !['quick', 'advanced'].includes(decoded.type)) {
+ throw new Error();
+ }
+ return decoded;
+ } catch {
+ message.error($t('search.results.msgInvalidRequest'));
+ return undefined;
+ }
+ }
+
+ return {
+ settingsGeneral,
+ settingsQuick,
+ settingsAdvanced,
+ encodeQueryParam,
+ decodeQueryParam,
+ lastReq,
+ };
+});
diff --git a/Tekst-Web/src/stores/state.ts b/Tekst-Web/src/stores/state.ts
index e03ffd78..d0e16334 100644
--- a/Tekst-Web/src/stores/state.ts
+++ b/Tekst-Web/src/stores/state.ts
@@ -5,12 +5,12 @@ import type { RouteLocationNormalized } from 'vue-router';
import { i18n, setI18nLocale, getAvaliableBrowserLocaleKey, localeProfiles } from '@/i18n';
import type { LocaleProfile } from '@/i18n';
import { useRoute } from 'vue-router';
-import type { GeneralSearchSettings, TextRead, TranslationLocaleKey } from '@/api';
+import type { TextRead, TranslationLocaleKey } from '@/api';
import { $t, $te } from '@/i18n';
import { usePlatformData } from '@/composables/platformData';
import { useAuthStore } from './auth';
import { useMessages } from '@/composables/messages';
-import type { QuickSearchSettings, AdvancedSearchSettings, LocaleKey } from '@/api';
+import type { LocaleKey } from '@/api';
import { pickTranslation } from '@/utils';
export const useStateStore = defineStore('state', () => {
@@ -123,16 +123,6 @@ export const useStateStore = defineStore('state', () => {
() => text.value?.levels.map((l) => pickTranslation(l, locale.value)) || []
);
- // search settings
-
- const searchSettingsGeneral = ref({
- strict: false,
- });
- const searchSettingsQuick = ref({
- op: 'OR',
- });
- const searchSettingsAdvanced = ref({});
-
// init loading state
const initLoading = ref(false);
@@ -195,8 +185,5 @@ export const useStateStore = defineStore('state', () => {
fallbackText,
textLevelLabels,
getTextLevelLabel,
- searchSettingsGeneral,
- searchSettingsQuick,
- searchSettingsAdvanced,
};
});
diff --git a/Tekst-Web/src/views/ResourceSettingsView.vue b/Tekst-Web/src/views/ResourceSettingsView.vue
index 4f8e9d23..ffc38420 100644
--- a/Tekst-Web/src/views/ResourceSettingsView.vue
+++ b/Tekst-Web/src/views/ResourceSettingsView.vue
@@ -1,7 +1,7 @@