Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
beta.ordbok.uib.no
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
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
Språksamlingane
beta.ordbok.uib.no
Commits
a735f379
Commit
a735f379
authored
3 years ago
by
Henrik Askjer
Browse files
Options
Downloads
Patches
Plain Diff
Test article lookup
parent
b095398d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/DictionaryView.vue
+7
-5
7 additions, 5 deletions
src/components/DictionaryView.vue
with
7 additions
and
5 deletions
src/components/DictionaryView.vue
+
7
−
5
View file @
a735f379
...
...
@@ -88,6 +88,8 @@ const oda_api = setup({
var
api_endpoint
=
process
.
env
.
VUE_APP_API_PREFIX
+
'
/api/dict
'
var
oda_dev
=
'
https://oda.uib.no/opal/dev
'
function
compare_by_hgno
(
lemma_text
)
{
return
function
(
art1
,
art2
)
{
let
lemma1
=
art1
.
lemmas
.
filter
(
lemma
=>
lemma
.
lemma
==
lemma_text
)[
0
]
...
...
@@ -109,7 +111,7 @@ function navigate_to_article(self, source) {
if
((
self
.
$route
.
query
.
nocache
||
''
).
toLowerCase
()
==
'
true
'
)
{
config
.
headers
.
cachebuster
=
Date
.
now
()
}
axios
.
get
(
api_endpoint
+
'
/
'
+
self
.
$route
.
params
.
lang
+
'
/article/
'
+
self
.
$route
.
params
.
id
,
config
)
axios
.
get
(
oda_dev
+
'
/
'
+
self
.
$route
.
params
.
lang
+
'
/article/
'
+
self
.
$route
.
params
.
id
,
config
)
.
then
(
function
(
response
){
self
.
article
=
Object
.
assign
(
response
.
data
,
{
'
dictionary
'
:
self
.
$route
.
params
.
lang
,
source
:
source
,
results
:
self
.
search_results
})
self
.
search_results
=
[]
...
...
@@ -200,7 +202,7 @@ export default {
return
(
this
.
waiting_for_articles
||
this
.
waiting_for_metadata
)
&&
this
.
$route
.
name
!=
'
root
'
},
api_pref
:
function
()
{
return
api_endpoint
+
'
/
'
+
this
.
lang
+
'
/article/
'
return
oda_dev
+
'
/
'
+
this
.
lang
+
'
/article/
'
},
get_oda_api
:
function
()
{
return
oda_api
...
...
@@ -230,7 +232,7 @@ export default {
let
self
=
this
Promise
.
all
(
unwrapped
.
map
((
article
)
=>
{
return
axios
.
get
(
`
${
api_endpoint
}
/
${
article
.
dictionary
}
/article/
${
article
.
id
}
`
)
return
axios
.
get
(
`
${
oda_dev
}
/
${
article
.
dictionary
}
/article/
${
article
.
id
}
.json
`
)
}))
.
then
((
response
)
=>
{
...
...
@@ -339,11 +341,11 @@ export default {
}
// words of the month
axios
.
get
(
api_endpoint
+
'
/bob/article/5607
'
).
then
(
function
(
response
){
axios
.
get
(
oda_dev
+
'
/bob/article/5607
.json
'
).
then
(
function
(
response
){
self
.
monthly_bm
=
Object
.
assign
(
response
.
data
,
{
dictionary
:
'
bob
'
})
})
axios
.
get
(
api_endpoint
+
'
/nob/article/78569
'
).
then
(
function
(
response
){
axios
.
get
(
oda_dev
+
'
/nob/article/78569
.json
'
).
then
(
function
(
response
){
self
.
monthly_nn
=
Object
.
assign
(
response
.
data
,
{
dictionary
:
'
nob
'
})
})
}).
catch
(
function
(
_
){
...
...
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