Commit 48c502a8 authored by Henrik Askjer's avatar Henrik Askjer
Browse files

Merge branch 'dev' into 'prod'

Merge dev into prod

See merge request spraksamlingane/beta.ordbok.uib.no!190
parents 713955de 37d2d0d0
......@@ -11,12 +11,13 @@
"axios": "^0.21.1",
"core-js": "~3.6.5",
"debounce": "^1.2.1",
"inflection-table": "https://git.app.uib.no/api/v4/projects/16442/jobs/artifacts/1.0.8/raw/module.tar.gz?job=publish",
"inflection-table": "https://git.app.uib.no/api/v4/projects/16442/jobs/artifacts/1.0.12/raw/module.tar.gz?job=publish",
"vue": "^2.6.12",
"vue-i18n": "^8.26.7",
"vue-i18n-bridge": "^9.2.0-beta.10",
"vue-material-design-icons": "^4.11.0",
"vue-meta": "^2.4.0",
"vue-plausible": "^1.3.1",
"vue-router": "^3.5.1",
"vuetify": "^2.5.8",
"vuex": "^3.6.2"
......@@ -8134,9 +8135,9 @@
"dev": true
},
"node_modules/inflection-table": {
"version": "1.0.8",
"resolved": "https://git.app.uib.no/api/v4/projects/16442/jobs/artifacts/1.0.8/raw/module.tar.gz?job=publish",
"integrity": "sha512-1OUvvhOV+iaIrv8SbZY6JMJXq0Ru+7YAmnad0LntJEbmkH0ZZSe+w6CxapN72gOfnfqWOrSQ6C0/CzE15p4lQg==",
"version": "1.0.12",
"resolved": "https://git.app.uib.no/api/v4/projects/16442/jobs/artifacts/1.0.12/raw/module.tar.gz?job=publish",
"integrity": "sha512-tpOQyANSxsCPYIH0eWUF+48mjEZemZjng/DQMf2ks+kPR9lm0MepwcwebYPZ3k69PT8WlMG15uKEaPlU26/+dg==",
"dependencies": {
"core-js": "~3.6.5",
"jquery": "^3.5.1",
......@@ -10339,6 +10340,14 @@
"node": ">=8"
}
},
"node_modules/plausible-tracker": {
"version": "0.3.5",
"resolved": "https://registry.npmjs.org/plausible-tracker/-/plausible-tracker-0.3.5.tgz",
"integrity": "sha512-6c6VPdPtI9KmIsfr8zLBViIDMt369eeaNA1J8JrAmAtrpSkeJWvjwcJ+cLn7gVJn5AtQWC8NgSEee2d/5RNytA==",
"engines": {
"node": ">=10"
}
},
"node_modules/pluralize": {
"version": "7.0.0",
"integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==",
......@@ -14223,6 +14232,14 @@
"node": ">=0.10.0"
}
},
"node_modules/vue-plausible": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/vue-plausible/-/vue-plausible-1.3.1.tgz",
"integrity": "sha512-OqZiScz/7glitE4XSJTwGUHO31VEbba2efmLki0+rIGDx3NysSOBJMyFz6yBFPWKms4jb1lDmx1wCsbAl7mrtA==",
"dependencies": {
"plausible-tracker": "^0.3.4"
}
},
"node_modules/vue-router": {
"version": "3.5.2",
"integrity": "sha512-807gn82hTnjCYGrnF3eNmIw/dk7/GE4B5h69BlyCK9KHASwSloD1Sjcn06zg9fVG4fYH2DrsNBZkpLtb25WtaQ=="
......@@ -21444,8 +21461,8 @@
"dev": true
},
"inflection-table": {
"version": "https://git.app.uib.no/api/v4/projects/16442/jobs/artifacts/1.0.8/raw/module.tar.gz?job=publish",
"integrity": "sha512-1OUvvhOV+iaIrv8SbZY6JMJXq0Ru+7YAmnad0LntJEbmkH0ZZSe+w6CxapN72gOfnfqWOrSQ6C0/CzE15p4lQg==",
"version": "https://git.app.uib.no/api/v4/projects/16442/jobs/artifacts/1.0.12/raw/module.tar.gz?job=publish",
"integrity": "sha512-tpOQyANSxsCPYIH0eWUF+48mjEZemZjng/DQMf2ks+kPR9lm0MepwcwebYPZ3k69PT8WlMG15uKEaPlU26/+dg==",
"requires": {
"core-js": "~3.6.5",
"jquery": "^3.5.1",
......@@ -23154,6 +23171,11 @@
"find-up": "^4.0.0"
}
},
"plausible-tracker": {
"version": "0.3.5",
"resolved": "https://registry.npmjs.org/plausible-tracker/-/plausible-tracker-0.3.5.tgz",
"integrity": "sha512-6c6VPdPtI9KmIsfr8zLBViIDMt369eeaNA1J8JrAmAtrpSkeJWvjwcJ+cLn7gVJn5AtQWC8NgSEee2d/5RNytA=="
},
"pluralize": {
"version": "7.0.0",
"integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==",
......@@ -26246,6 +26268,14 @@
}
}
},
"vue-plausible": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/vue-plausible/-/vue-plausible-1.3.1.tgz",
"integrity": "sha512-OqZiScz/7glitE4XSJTwGUHO31VEbba2efmLki0+rIGDx3NysSOBJMyFz6yBFPWKms4jb1lDmx1wCsbAl7mrtA==",
"requires": {
"plausible-tracker": "^0.3.4"
}
},
"vue-router": {
"version": "3.5.2",
"integrity": "sha512-807gn82hTnjCYGrnF3eNmIw/dk7/GE4B5h69BlyCK9KHASwSloD1Sjcn06zg9fVG4fYH2DrsNBZkpLtb25WtaQ=="
......
......@@ -134,6 +134,12 @@ The Norwegian Language Collections at the University of Bergen Library have a nu
</ul></p>
</details>
<details>
<summary><h2>Privacy</h2></summary>
<p>Ordbøkene.no does not use cookies, but saves user preferences using local storage in the browser, without sending this information to our server at UiB. Searches are logged on the server, but we do not use this information for other purposes than search statistics.
We use a Nginx-webserver that continuously overwrites the logs, so that we never store IP-addresses permanently. We also log the usage of certain features on the website using plausible.io, a service that does not store IP-addresses or other information that can connect the usage statistics to individual users.</p>
</details>
</Article>
......@@ -958,7 +964,16 @@ The Norwegian Language Collections at the University of Bergen Library have a nu
<li><a href="https://ordbokene.no/">https://ordbokene.no/</a></li>
<li><a href="https://oda.uib.no/">https://oda.uib.no/</a></li>
<li><a href="https://odd.uib.no/">https://odd.uib.no/</a></li>
<li><a href="https://plausible.io/">https://plausible.io/</a></li>
</ul></p>
<p>Nynorsksenteret har skrive to saker om bruk av ordbøkene.no i skulen:
<ul class="bullet"><li><a href="https://nynorsksenteret.no/vidaregaande/grammatikk/gode-tips-til-bruk-av-nettordboka">Gode tips til bruk av nettordboka</a></li>
<li><a href="https://nynorsksenteret.no/blogg/ta-i-bruk-dei-nye-ordbokene">Ta i bruk dei nye ordbøkene</a></li></ul></p><p>
Nynorsksenteret har dessutan eit opplegg for ungdomsskulen om <a href="https://nynorsksenteret.no/ungdomsskule/skriving/kreativ-skriving/hiphop-ordboka-som-kreativt-verktoy">hiphop og bruk av ordbøkene som kreative verktøy</a></p>
</details>
<details>
<summary><h2>Personvern</h2></summary>
<p>Ordbøkene brukar ikkje informasjonskapslar (cookiar), men lagrar brukarinnstillingane lokalt i nettlesaren (local storage), utan at informasjonen blir sendt vidare til serveren vår på UiB. Søkjeord blir logga på serveren, men vi brukar dette berre til å lage søkjestatistikk. Vi brukar ein Nginx-webserver der loggane blir overskrivne etter ei stund, slik at IP-adressene ikkje blir lagra permanent nokon stad. Vi loggar òg bruken av enkelte funksjonar på nettsida med plausible.io, som ikkje lagrar IP-adresser eller annan informasjon som kan knyte bruksstatistikken til enkeltbrukarar.</p>
</details>
</Article>
......@@ -1532,11 +1547,16 @@ The Norwegian Language Collections at the University of Bergen Library have a nu
<li><a href="https://ordbokene.no/">https://ordbokene.no/</a></li>
<li><a href="https://oda.uib.no/">https://oda.uib.no/</a></li>
<li><a href="https://odd.uib.no/">https://odd.uib.no/</a></li>
<li><a href="https://plausible.io/">https://plausible.io/</a></li>
</ul></p>
<p>Nynorsksenteret har skrevet to saker om bruk av ordbøkene.no i skolen:
<ul class="bullet"><li><a href="https://nynorsksenteret.no/vidaregaande/grammatikk/gode-tips-til-bruk-av-nettordboka">Gode tips til bruk av nettordboka</a></li>
<li><a href="https://nynorsksenteret.no/blogg/ta-i-bruk-dei-nye-ordbokene">Ta i bruk dei nye ordbøkene</a></li></ul></p><p>
Nynorsksenteret har dessuten et opplegg for ungdomsskolen om <a href="https://nynorsksenteret.no/ungdomsskule/skriving/kreativ-skriving/hiphop-ordboka-som-kreativt-verktoy">hiphop og bruk av ordbøkene som kreative verktøy</a></p>
</details>
<details>
<summary><h2>Personvern</h2></summary>
<p>Ordbøkene bruker ikke informasjonskapsler (cookies), men lagrer brukerinnstillinger lokalt i nettleseren (local storage) uten å sende denne informasjonen til vår server. Søkeord logges på serveren, men dette bruker vi kun til å lage søkestatistikk. Vi henter ikke ut IP-adresser eller annen informasjon som kan knytte søkeordene til bestemte brukere. Vi benytter en Nginx-webserver der loggene overskrives etter en stund, slik at IP-adressene ikke lagres permanent noe sted.</p>
<p>Ordbøkene bruker ikke informasjonskapsler (cookier), men lagrer brukerinnstillinger lokalt i nettleseren (local storage), uten å sende denne informasjonen til vår server på UiB. Søkeord logges på serveren, men dette bruker vi kun til å lage søkestatistikk. Vi benytter en Nginx-webserver der loggene overskrives etter en stund, slik at IP-adressene ikke lagres permanent noe sted. Vi logger også bruken av enkelte funksjoner på nettsiden med plausible.io, som ikke lagrer IP-adresser eller annen informasjon som kan knytte bruksstatistikken til bestemte brukere.</p>
</details>
</Article>
......
......@@ -67,19 +67,6 @@ function find_sub_articles(definition) {
}
}
function find_content(definition) {
let content_list = []
let sub_definitions = definition.elements.filter(el => el.type_ == 'definition')
sub_definitions.forEach((subdef, i) => {
content_list = content_list.concat(find_content(subdef))
})
let content_nodes = definition.elements.filter(el => ['explanation', 'example', 'compound_list'].includes(el.type_))
content_list = content_list.concat(content_nodes)
return content_list
}
export default {
name: 'Article',
......@@ -202,15 +189,20 @@ export default {
else {
return
}
},
sub_articles: function() {
return this.article.body.definitions.reduce((acc, val) => acc.concat(find_sub_articles(val)), []).sort((s1, s2) => s1.lemmas[0].localeCompare(s2.lemmas[0]))
},
has_content: function() {
return this.article.body.definitions.reduce((acc, val) => acc.concat(find_content(val)), []).length > 0
},
for (const definition of this.article.body.definitions) {
for (const element of definition.elements) {
if (['explanation', 'example', 'compound_list', 'definition'].includes(element.type_)) {
return true
}
}
}
return false
}
},
components: {
DefElement,
......
......@@ -31,7 +31,7 @@
--><span v-for="(item,index) in similar"
:key="index"><!--
--><router-link :to="generate_path({q: queryString+'|'+item[0]})"
@click.native="similar_link()">{{item[0]}}</router-link><!--
@click.native="similar_link(item[0])">{{item[0]}}</router-link><!--
-->{{index == similar.length-1? '.' : ', '}}
</span>
</div>
......@@ -42,7 +42,7 @@
--><span v-for="(item,index) in similar"
:key="index"><!--
--><router-link :to="generate_path({q: queryString+'|'+item[0]})"
@click.native="similar_link()">{{item[0]}}</router-link><!--
@click.native="similar_link(item[0])">{{item[0]}}</router-link><!--
-->{{index == similar.length-1? '.' : ', '}}
</span>
</div>
......@@ -108,7 +108,7 @@
<template v-for="(item, index) in similar">
<v-list-item :key="index">
<router-link :to="generate_path({q: item[0]})"
@click.native="similar_link()">{{item[0]}}</router-link>
@click.native="similar_link(item[0])">{{item[0]}}</router-link>
<span class="dict-parentheses"
v-if="lang=='bm,nn'">&nbsp;({{["bokmål","nynorsk","bokmål, nynorsk"][item[1]-1]}})</span>
</v-list-item>
......@@ -211,7 +211,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(' incoming', {props: {origin}})
})
}
......@@ -615,12 +615,13 @@ 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 () {
//this.$plausible.trackEvent('similar link', {props: {lang: this.previous.params.lang, from: this.previous.query.q, to: word}})
similar_link: function (word) {
console.log(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, this.queryString)
},
......@@ -648,7 +649,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() {
......
......@@ -49,7 +49,7 @@ 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}`}})
this.$plausible.trackEvent('open inflection', {props: {article: `/${this.dictionary}/${this.article_id}/${this.lemmas[0].lemma}`}})
}
this.inflect_reported = true
......
......@@ -4,6 +4,7 @@ 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'
......@@ -19,6 +20,13 @@ Vue.use(VueMeta, {
refreshOnceOnNavigation: true
})
Vue.use(VuePlausible, {
domain: 'ordbokene.no'
})
Vue.$plausible.enableAutoPageviews()
const router = new VueRouter({
mode: 'history',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment