From 162fc4db2acd4fb359e0c77dfce5ba9dd8434b2f Mon Sep 17 00:00:00 2001
From: Henrik Askjer <henrik.askjer@uib.no>
Date: Wed, 24 Nov 2021 11:12:32 +0100
Subject: [PATCH] add dummy settings

---
 src/components/Menu.vue | 46 +++++++++++++++++++++++++++++++++++++++--
 src/main.js             | 14 +++++++++----
 2 files changed, 54 insertions(+), 6 deletions(-)

diff --git a/src/components/Menu.vue b/src/components/Menu.vue
index 757036f3..c7e497c1 100644
--- a/src/components/Menu.vue
+++ b/src/components/Menu.vue
@@ -19,11 +19,31 @@
               </v-btn>
             </v-toolbar-items>
             </v-toolbar>
-            <v-container><v-row><v-col>
+            <v-container fluid><v-row align="center" justify="space-between">
+                <v-col><v-subheader>Visningsspråk</v-subheader>
+                <v-select rounded 
+                          v-value="$store.state.currentLocale"
+                          @submit="changeLocale"
+                          prepend-inner-icon="language"
+                          outlined
+                          :items="locales"
+                          dense>
+                    </v-select></v-col>
+                </v-row><v-row align="center"><v-col>
 
               <v-checkbox
                 v-model="toggleSearchToolbar"
-                label="Vis valg av ordklasse"
+                label="Vis verktøylinje for søkealternativer"
+                hide-details
+              ></v-checkbox>
+                <v-checkbox
+                v-model="toggleHGNO"
+                label="Vis homografnumre"
+                hide-details
+              ></v-checkbox>
+                <v-checkbox
+                v-model="toggleInflectionNo"
+                label="Bis bøyningsnumre"
                 hide-details
               ></v-checkbox>
              </v-col> </v-row>
@@ -35,11 +55,33 @@
 
 export default {
     name: "Menu",
+    data () {
+        return {
+            locales: [{text: "bokmål", value: "nob"}, {text: "nynorsk", value: "nno"}, {text:"english", value: "eng"}]
+
+        }
+    },
     computed: {
         toggleSearchToolbar: {
             get () { return this.$store.state.showSearchToolbar}, 
             set () { this.$store.commit("toggleSearchToolbar")
             }
+        },
+        toggleHGNO: {
+            get () { return this.$store.state.showHGNO}, 
+            set () { this.$store.commit("toggleHGNO")
+            }
+        },
+        toggleInflectionNo: {
+            get () { return this.$store.state.showInflectionNo}, 
+            set () { this.$store.commit("toggleInflectionNo")
+            }
+        },
+    },
+    methods: {
+        changeLocale: function(event) {
+            console.log(event)
+
         }
     }
 }
diff --git a/src/main.js b/src/main.js
index cdeffcd9..10de0c96 100644
--- a/src/main.js
+++ b/src/main.js
@@ -21,15 +21,21 @@ Vue.$plausible.enableAutoPageviews()
 const store = new Vuex.Store({
   strict: true,
   state: {
-    showRadioButtons: null,
     showSearchToolbar: null,
-    locale: null
+    showHGNO: null,
+    showInflectionNo: null,
+    currentLocale: null
   },
   mutations: {
     initStore(state) {
       state.showSearchToolbar = localStorage.getItem('showSearchToolbar') || false
-      state.showRadioButtons = localStorage.getItem('showRadioButtons') || false
-
+      state.showHGNO = localStorage.getItem('showHGNO') || false
+      state.showInflectionNo = localStorage.getItem('showInflectionNo') || false
+      state.currentLocale = localStorage.getItem('currentLocale') || false
+    },
+    changeLocale(state, locale) {
+      state.currentLocale = locale
+      localStorage.setItem("showSearchToolbar", locale);
     },
     toggleSearchToolbar(state) {
       let value = !state.showSearchToolbar
-- 
GitLab