diff --git a/package.json b/package.json index d1dfb12883f16bca44176ea75c7e11f2c0a740a1..15b36e4cd1681576b760871bd6dd847a7c1fe387 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,6 @@ "vue-i18n-bridge": "^9.2.0-beta.10", "vue-material-design-icons": "^4.11.0", "vue-meta": "^2.4.0", - "vue-plausible": "^1.1.4", "vue-router": "^3.5.1", "vuetify": "^2.5.8", "vuex": "^3.6.2" diff --git a/public/index.html b/public/index.html index 2b1570d9bf9f8ff45294bf9e3b77b46a647dc981..4684e5d4c8365d9c0f1aa60144a14a6f5a812719 100644 --- a/public/index.html +++ b/public/index.html @@ -12,11 +12,20 @@ <meta property="og:url" content="ordbokene.no" /> <meta property="og:description" content="Bokmålsordboka og Nynorskordboka viser skrivemåte og bøying i tråd med norsk rettskriving. Språkrådet og Universitetet i Bergen står bak ordbøkene." /> <meta property="twitter:description" content="Bokmålsordboka og Nynorskordboka viser skrivemåte og bøying i tråd med norsk rettskriving. Språkrådet og Universitetet i Bergen står bak ordbøkene." /> - <meta property="og:image" content="https://dev.ordbok.uib.no/logo.png" /> + <meta property="og:image" content="<%= BASE_URL %>logo.png" /> <meta property="og:image:width" content="256px" /> <meta property="og:image:height" content="256px" /> - <meta property="twitter:image" content="https://dev.ordbok.uib.no/logo.png" /> + <meta property="twitter:image" content="<%= BASE_URL %>logo.png" /> <meta property="description" content="Bokmålsordboka og Nynorskordboka viser skrivemåte og bøying i tråd med norsk rettskriving. Språkrådet og Universitetet i Bergen står bak ordbøkene." /> + <link rel="preload" as="font" href="<%= BASE_URL %>fonts/fC1lPYxPY3rXxEndZJAzN3Srdy0.0ad9c62f.woff2" type="font/woff2" crossorigin="anonymous"/> + <link rel="preload" as="font" href="<%= BASE_URL %>fonts/fC14PYxPY3rXxEndZJAzN3wQUjjCjl0.2712a85c.woff2" type="font/woff2" crossorigin="anonymous"/> + <link rel="preload" as="font" href="<%= BASE_URL %>fonts/NotoSansParen.967bb7ff.woff" type="font/woff" crossorigin="anonymous"/> + <link rel="preload" as="font" href="<%= BASE_URL %>fonts/o-0IIpQlx3QUlC5A4PNr5TRA.df7d440a.woff2" type="font/woff2" crossorigin="anonymous"/> + <link rel="preload" as="font" href="<%= BASE_URL %>fonts/o-0NIpQlx3QUlC5A4PNjXhFVZNyBx2pqPA.887e23ab.woff2" type="font/woff2" crossorigin="anonymous"/> + <link rel="preload" as="font" href="<%= BASE_URL %>fonts/o-0OIpQlx3QUlC5A4PNr4ARCQ_k.6816e3a8.woff2" type="font/woff2" crossorigin="anonymous"/> + <link rel="preload" as="font" href="<%= BASE_URL %>fonts/MaterialIcons-Regular.51cf1d64.ttf" type="font/ttf" crossorigin="anonymous"/> + <link rel="preload" as="font" href="<%= BASE_URL %>fonts/MaterialIcons-Regular.84a37de8.woff" type="font/woff" crossorigin="anonymous"/> + <link rel="preload" as="font" href="<%= BASE_URL %>fonts/MaterialIcons-Regular.703cf8f2.woff2" type="font/woff2" crossorigin="anonymous"/> <title>Ordbøkene.no - Bokmålsordboka og Nynorskordboka</title> </head> diff --git a/src/components/About.vue b/src/components/About.vue index bf9f3b6e67febe308d7aef54800fed45b2040022..77709581a94471e79eb7af8b73848e38ab15b032 100644 --- a/src/components/About.vue +++ b/src/components/About.vue @@ -508,9 +508,6 @@ The Norwegian Language Collections at the University of Bergen Library have a nu <p>Når skulane stengjer ein del nettsider på prøver og eksamen, må eit utval andre sider vere opne for at ordbøkene.no skal fungere. Her er domena som ordboksida brukar: <ul class="bullet"> <li><a href="https://ordbokene.no/">https://ordbokene.no/</a></li> - <li><a href="https://fonts.googleapis.com/">https://fonts.googleapis.com/</a></li> - <li><a href="https://fonts.gstatic.com/">https://fonts.gstatic.com/</a></li> - <li><a href="https://plausible.io/">https://plausible.io/</a></li> <li><a href="https://oda.uib.no/">https://oda.uib.no/</a></li> </ul></p> </details> @@ -641,9 +638,6 @@ The Norwegian Language Collections at the University of Bergen Library have a nu <p>Når skolene stenger en del nettsider på prøver og eksamen, må et utvalg andre sider være åpne for at ordbøkene.no skal fungere. Her er domenene som ordboksida bruker: <ul class="bullet"> <li><a href="https://ordbokene.no/">https://ordbokene.no/</a></li> - <li><a href="https://fonts.googleapis.com/">https://fonts.googleapis.com/</a></li> - <li><a href="https://fonts.gstatic.com/">https://fonts.gstatic.com/</a></li> - <li><a href="https://plausible.io/">https://plausible.io/</a></li> <li><a href="https://oda.uib.no/">https://oda.uib.no/</a></li> </ul></p> </details> diff --git a/src/components/Article.vue b/src/components/Article.vue index 9f7990fb524815dd1f55cbd3b24c1672f95b31d0..2a7957c13825bdc9ff0200161172aa5afe909763 100644 --- a/src/components/Article.vue +++ b/src/components/Article.vue @@ -277,7 +277,6 @@ export default { }, toggle_collapse: function() { - this.$plausible.trackEvent('toggle collapse', {props: {from: this.collapsed, to: !this.collapsed}}) this.collapsed = !this.collapsed }, diff --git a/src/components/Autocomplete.vue b/src/components/Autocomplete.vue index 66e69d183b7d7b1dd61a4561ca402f3de0e323f5..13b535f300e614f4960e3963c10ed4554ac6655a 100644 --- a/src/components/Autocomplete.vue +++ b/src/components/Autocomplete.vue @@ -92,7 +92,7 @@ loading: false, items: [], search: null, - select: this.$route.query? this.$route.query.q : null, + select: this.$parent.queryString || null, suggesting: null, menuDialog: false, dictMenuOpened: false @@ -126,7 +126,7 @@ update_lang_form(lang) { this.$emit('update-lang-form', lang) // Submit if switching on front page - if (this.search && this.search!=this.$route.query.q && !this.items[0]) { + if (this.search && this.search!=this.$parent.queryString && !this.items[0]) { this.submit({q: this.search, match: this.search, time: Date.now()}) } else { diff --git a/src/components/DictionaryView.vue b/src/components/DictionaryView.vue index b2e1a2043b4fb3218e70cb8e147c819a1eabfb63..917e0d06aaa37651dae027768eab483f91fd46af 100644 --- a/src/components/DictionaryView.vue +++ b/src/components/DictionaryView.vue @@ -16,7 +16,7 @@ <div class="search_notification" v-if="inflection_suggestions && inflection_suggestions.length"> <v-icon left - color="primary">info</v-icon><em>{{$route.query.q}}</em> {{$t('notifications.inflected')}}<!-- + color="primary">info</v-icon><em>{{queryString}}</em> {{$t('notifications.inflected')}}<!-- --><span v-for="(item,index) in inflection_suggestions" :key="index"><!-- --><router-link :to="generate_path({q: item[0]})" @@ -29,8 +29,8 @@ color="primary">info</v-icon>{{$t('notifications.similar_nn')}}<!-- --><span v-for="(item,index) in similar" :key="index"><!-- - --><router-link :to="generate_path({q: $route.query.q+'|'+item[0]})" - @click.native="similar_link($route.query.q+'|'+item[0])">{{item[0]}}</router-link><!-- + --><router-link :to="generate_path({q: queryString+'|'+item[0]})" + @click.native="similar_link(queryString+'|'+item[0])">{{item[0]}}</router-link><!-- -->{{index == similar.length-1? '.' : ', '}} </span> </div> @@ -40,8 +40,8 @@ color="primary">info</v-icon>{{$t('notifications.similar_bm')}}<!-- --><span v-for="(item,index) in similar" :key="index"><!-- - --><router-link :to="generate_path({q: $route.query.q+'|'+item[0]})" - @click.native="similar_link($route.query.q+'|'+item[0])">{{item[0]}}</router-link><!-- + --><router-link :to="generate_path({q: queryString+'|'+item[0]})" + @click.native="similar_link(queryString+'|'+item[0])">{{item[0]}}</router-link><!-- -->{{index == similar.length-1? '.' : ', '}} </span> </div> @@ -67,7 +67,7 @@ v-if="pos_selected">{{$t('notifications.no_pos_results', {pos: $t('pos_tags_plural.'+pos_selected)})}}</span></strong> </p> <p class="below-notification" v-if="!article && inflection_suggestions && inflection_suggestions.length"> - <em>{{$route.query.q}}</em>{{$t('notifications.inflected')}} + <em>{{this.queryString}}</em>{{$t('notifications.inflected')}} <span v-for="(item,index) in inflection_suggestions" :key="index"><!-- --><router-link :to="generate_path({q: item[0]})" @@ -193,9 +193,7 @@ function navigate_to_article(self, origin) { .then(function(response){ self.waiting_for_articles = false self.replace_history() - if (origin) { - self.$plausible.trackEvent('internal link incoming', {props: {origin}}) - } + //if (origin) self.$plausible.trackEvent('internal link incoming', {props: {origin}}) }) } @@ -387,6 +385,9 @@ export default { } }, computed: { + queryString: function() { + return this.$route.query.q || this.$route.params.q + }, waiting: function() { return (this.waiting_for_articles || this.waiting_for_metadata) && this.$route.name != 'root' } @@ -396,8 +397,8 @@ export default { return {meta: [{name: "robots", content: 'none'}]} } let q = "" - if (this.$route.query.q) { - q = this.$route.query.q + " - " + if (this.queryString) { + q = this.queryString + (this.lang == 'bm,nn' ? ' - ' : ' | ') } let desc = " viser skrivemåte og bøying i tråd med norsk rettskriving. Språkrådet og Universitetet i Bergen står bak ordbøkene." switch (this.lang) { @@ -434,6 +435,11 @@ export default { if (self.$route.name == 'search') { navigate_to_query(self, self.$route.query.q, true) } + else if(self.$route.name == 'word') { + self.scope = 'e' + self.pos = null + navigate_to_query(self, self.$route.params.q, true) + } else if(self.$route.name == 'lookup'){ navigate_to_article(self, self.$route.path) } @@ -553,26 +559,24 @@ export default { }, inflection_link: function (word) { - this.$plausible.trackEvent('inflection link', {props: {lang: this.previous.params.lang, from: this.previous.query.q, to: word}}) + //this.$plausible.trackEvent('inflection link', {props: {lang: this.previous.params.lang, from: this.previous.query.q, to: word}}) this.event = null navigate_to_query(this, word) }, similar_link: function (word) { - this.$plausible.trackEvent('similar link', {props: {lang: this.previous.params.lang, from: this.previous.query.q, to: word}}) + //this.$plausible.trackEvent('similar link', {props: {lang: this.previous.params.lang, from: this.previous.query.q, to: word}}) this.event = null navigate_to_query(this, word) }, fulltext_link: function () { - this.$plausible.trackEvent('fulltext link', {props: {query: this.$route.query.q}}) this.event = null this.scope = this.scope + "f" - navigate_to_query(this, this.$route.query.q) + navigate_to_query(this, this.queryString) }, language_link: function (lang) { - this.$plausible.trackEvent('language link', {props: {query: this.$route.query.q, from: this.previous.params.lang, to: lang, }}) this.lang = lang this.event = null - navigate_to_query(this, this.$route.query.q) + navigate_to_query(this, this.queryString) }, select_result: function (event) { @@ -588,9 +592,7 @@ export default { // Tracking let track_props = {query: event.q} if (event.match) track_props.match = event.match - this.$plausible.trackEvent('dropdown selection', { - props: track_props - }) + //this.$plausible.trackEvent('dropdown selection', { props: track_props }) }, pos_param: function() { @@ -599,7 +601,7 @@ export default { }, update_page: function() { this.waiting_for_articles = true - let q = (this.$route.query || this.$route.params).q + let q = this.queryString let path = `/${this.lang}/search` let pos = this.pos_param() let query = {q: q, page: this.page} @@ -634,7 +636,13 @@ export default { }, generate_path: function(params) { - return this.$router.resolve({query: {...this.$route.query, ...params}}).href + if (this.$route.name == "word") { + return this.$router.resolve({name: "search", query: {q: this.$route.params.q, ...params}}).href + } + else { + return this.$router.resolve({query: {...this.$route.query, ...params}}).href + } + }, generate_lang_path: function(dict) { @@ -643,7 +651,7 @@ export default { }, reload_params: function() { - let q = (this.$route.query || this.$route.params).q + let q = this.queryString if (q) { let path = `/${this.lang}/search` let pos = this.pos_param() diff --git a/src/components/InflectionButton.vue b/src/components/InflectionButton.vue index 2047a6cfcedb7638f0169718c15841d885371467..d42a6c68cb768ad04f35889ce7f2badd15716200 100644 --- a/src/components/InflectionButton.vue +++ b/src/components/InflectionButton.vue @@ -46,7 +46,8 @@ export default { toggle: function() { this.inflection_expanded = !this.inflection_expanded if (! this.inflect_reported) { - this.$plausible.trackEvent('open inflection', {props: {article: `/${this.dictionary}/${this.article_id}/${this.lemmas[0].lemma}`}}) + console.log("open inflection") + //this.$plausible.trackEvent('open inflection', {props: {article: `/${this.dictionary}/${this.article_id}/${this.lemmas[0].lemma}`}}) } this.inflect_reported = true diff --git a/src/locales/nno.json b/src/locales/nno.json index 8646908bff74620bcdd2245ba45e98e12837aca5..fb4afab2dc417af6057fa83362336b5b09aa1ae4 100644 --- a/src/locales/nno.json +++ b/src/locales/nno.json @@ -155,8 +155,8 @@ "title": "Feil", "description": "Det har oppstått ein uventa feil i kommunikasjonen med serveren (statuskode: {code})"}, "network": { - "title":"Tilkoblingsfeil", - "description": "Eit nettverksproblem hindra lasting av sida. Prøv å laste sida på nytt, eller sjekk om du er kobla til internett."}, + "title":"Tilkoplingsfeil", + "description": "Eit nettverksproblem hindra lasting av sida. Prøv å laste sida på nytt, eller sjekk om du er kopla til internett."}, "no_article": "Serveren finn ingen artikkel med ID {id}. Artikkelen kan ha blitt sletta eller flytta, eller du kan ha brukt ei ugyldig lenkje.", "generic": { "title": "Feil", diff --git a/src/main.js b/src/main.js index 9916159623bf521be00d01794a12d2543d063197..f6af7b03bd8d0988e540f6557780606354aaebfc 100644 --- a/src/main.js +++ b/src/main.js @@ -4,13 +4,10 @@ import App from './App.vue' import About from './components/About.vue' import DictionaryView from './components/DictionaryView.vue' import VueRouter from 'vue-router' -import { VuePlausible } from 'vue-plausible' import vuetify from './plugins/vuetify' import Vuex from 'vuex' import i18n from './i18n' import VueMeta from 'vue-meta' - - Vue.config.productionTip = false @@ -22,11 +19,6 @@ Vue.use(VueMeta, { refreshOnceOnNavigation: true }) -Vue.use(VuePlausible, { - domain: 'beta.ordbok.uib.no' -}) - -Vue.$plausible.enableAutoPageviews() const router = new VueRouter({ mode: 'history', @@ -57,11 +49,8 @@ const router = new VueRouter({ path: ':id(\\d+)/:lemma?' }, { - name: "short", - path: ':query', - redirect: to => { - return {path: 'search', query: {q: to.params.query, scope: 'e'}} - } + name: "word", + path: ':q' } ] }, @@ -138,7 +127,6 @@ const store = new Vuex.Store({ }, setLocale(state, payload) { - Vue.$plausible.trackEvent("set locale", {props: {from: state.currentLocale, to: payload.locale}}) state.currentLocale = payload.value i18n.locale = payload.value state.localeChosen = true @@ -146,7 +134,6 @@ const store = new Vuex.Store({ }, setCollapse(state, value) { - Vue.$plausible.trackEvent("set collapse", {props: {from: state.collapseArticles, to: value}}) if (!state.unavailable) localStorage.setItem("collapseArticles", value) state.collapseArticles = value }, @@ -158,7 +145,6 @@ const store = new Vuex.Store({ state.perPage = value }, toggleInflectionNo(state) { - Vue.$plausible.trackEvent("toggle inflection number", {props: {from: state.showInflectionNo, to: !state.showInflectionNo}}) state.showInflectionNo = !state.showInflectionNo if (!state.unavailable) localStorage.setItem('showInflectionNo', state.showInflectionNo); }, @@ -166,12 +152,10 @@ const store = new Vuex.Store({ state.menuOpen = !state.menuOpen }, setDefaultDict(state, value) { - Vue.$plausible.trackEvent("set default dict", {props: {from: state.defaultDict, to: value}}) if (!state.unavailable) localStorage.setItem("defaultDict", value) state.defaultDict = value }, resetStore() { - Vue.$plausible.trackEvent("reset store") localStorage.removeItem("showSearchToolbar") localStorage.removeItem("showInflectionNo") localStorage.removeItem("currentLocale")