Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
beta.ordbok.uib.no
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Margunn.Rauset
beta.ordbok.uib.no
Commits
8f098e16
Commit
8f098e16
authored
3 years ago
by
Henrik Askjer
Browse files
Options
Downloads
Patches
Plain Diff
Add article source if needed
parent
4c5bf2b7
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/DictionaryView.vue
+10
-9
10 additions, 9 deletions
src/components/DictionaryView.vue
with
10 additions
and
9 deletions
src/components/DictionaryView.vue
+
10
−
9
View file @
8f098e16
...
@@ -97,7 +97,7 @@ function navigate_to_article(self, source) {
...
@@ -97,7 +97,7 @@ function navigate_to_article(self, source) {
}
}
axios
.
get
(
oda_dev
+
'
/
'
+
self
.
$route
.
params
.
lang
+
'
/article/
'
+
self
.
$route
.
params
.
id
+
"
.json
"
,
config
)
axios
.
get
(
oda_dev
+
'
/
'
+
self
.
$route
.
params
.
lang
+
'
/article/
'
+
self
.
$route
.
params
.
id
+
"
.json
"
,
config
)
.
then
(
function
(
response
){
.
then
(
function
(
response
){
self
.
article
=
Object
.
assign
(
response
.
data
,
{
'
dictionary
'
:
self
.
$route
.
params
.
lang
,
source
:
source
,
results
:
self
.
search_results
})
self
.
article
=
Object
.
assign
(
response
.
data
,
{
'
dictionary
'
:
self
.
$route
.
params
.
lang
,
results
:
self
.
search_results
})
self
.
search_results
=
[]
self
.
search_results
=
[]
self
.
error
=
null
self
.
error
=
null
})
})
...
@@ -145,8 +145,7 @@ function navigate_to_search(self, query) {
...
@@ -145,8 +145,7 @@ function navigate_to_search(self, query) {
function
navigate_to_word
(
self
,
word
)
{
function
navigate_to_word
(
self
,
word
)
{
let
event
=
self
.
event
?
self
.
event
:
{
q
:
word
,
let
event
=
self
.
event
?
self
.
event
:
{
q
:
word
,
match
:
word
,
match
:
word
}
source
:
self
.
$route
.
path
}
// Get article IDs
// Get article IDs
...
@@ -168,7 +167,6 @@ function navigate_to_word(self, word) {
...
@@ -168,7 +167,6 @@ function navigate_to_word(self, word) {
.
then
((
response
)
=>
{
.
then
((
response
)
=>
{
self
.
search_results
=
response
.
map
((
element
,
index
)
=>
{
self
.
search_results
=
response
.
map
((
element
,
index
)
=>
{
return
Object
.
assign
(
element
.
data
,
{
return
Object
.
assign
(
element
.
data
,
{
source
:
event
.
source
,
match
:
event
.
match
,
match
:
event
.
match
,
dictionary
:
unwrapped
[
index
].
dictionary
dictionary
:
unwrapped
[
index
].
dictionary
})
})
...
@@ -240,15 +238,17 @@ export default {
...
@@ -240,15 +238,17 @@ export default {
select_result
:
function
(
event
)
{
select_result
:
function
(
event
)
{
this
.
event
=
event
this
.
event
=
event
if
(
event
.
match
)
{
if
(
event
.
match
)
{
event
.
source
=
'
/
'
+
this
.
lang
+
'
/w/
'
+
event
.
match
let
route
=
`/
${
this
.
lang
}
/search/
${
event
.
match
}
`
this
.
$router
.
push
(
event
.
sourc
e
)
this
.
$router
.
push
(
rout
e
)
navigate_to_word
(
this
)
navigate_to_word
(
this
)
}
else
{
}
else
{
this
.
waiting_for_articles
=
true
this
.
waiting_for_articles
=
true
this
.
article
=
null
this
.
article
=
null
this
.
$router
.
push
(
`/
${
this
.
lang
}
/search/
${
event
.
q
}
`
)
navigate_to_search
(
this
,
event
.
q
)
event
.
match
=
'
<fritekstsøk>
'
event
.
match
=
'
<fritekstsøk>
'
let
route
=
`/
${
this
.
lang
}
/search/
${
event
.
q
}
`
this
.
$router
.
push
(
route
)
navigate_to_search
(
this
,
event
.
q
)
}
}
// Tracking
// Tracking
this
.
$plausible
.
trackEvent
(
event
.
update_lang
?
"
language
"
:
'
dropdown selection
'
,
{
this
.
$plausible
.
trackEvent
(
event
.
update_lang
?
"
language
"
:
'
dropdown selection
'
,
{
...
@@ -278,6 +278,7 @@ export default {
...
@@ -278,6 +278,7 @@ export default {
}
}
},
},
details_click
:
function
(
item
)
{
details_click
:
function
(
item
)
{
item
.
article
.
source
=
this
.
$route
.
path
this
.
article
=
item
.
article
this
.
article
=
item
.
article
history
.
replaceState
({
article
:
this
.
article
,
search_results
:
[],
lang
:
this
.
lang
,
error
:
null
},
''
)
history
.
replaceState
({
article
:
this
.
article
,
search_results
:
[],
lang
:
this
.
lang
,
error
:
null
},
''
)
},
},
...
@@ -305,7 +306,7 @@ export default {
...
@@ -305,7 +306,7 @@ export default {
navigate_to_word
(
self
,
self
.
$route
.
params
.
word
)
navigate_to_word
(
self
,
self
.
$route
.
params
.
word
)
}
}
else
if
(
self
.
$route
.
name
==
'
lookup
'
){
else
if
(
self
.
$route
.
name
==
'
lookup
'
){
navigate_to_article
(
self
,
self
.
$route
.
pa
rams
.
id
)
navigate_to_article
(
self
,
self
.
$route
.
pa
th
)
}
}
else
if
(
self
.
$route
.
name
==
'
search
'
)
{
else
if
(
self
.
$route
.
name
==
'
search
'
)
{
self
.
lang
=
self
.
$route
.
params
.
lang
self
.
lang
=
self
.
$route
.
params
.
lang
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment