Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
subugoe
emo
TIDO
Commits
5c946fce
Commit
5c946fce
authored
Feb 24, 2021
by
schneider210
Browse files
feat: adjust content type/s according to the recently introduced content key from the API
parent
7a553968
Pipeline
#175927
passed with stages
in 2 minutes and 26 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/App.vue
View file @
5c946fce
...
...
@@ -16,7 +16,6 @@
<router-view
:collection=
"collection"
:config=
"config"
:contenturl=
"contenturl"
:fontsize=
"fontsize"
:imageurl=
"imageurl"
:item=
"item"
...
...
@@ -25,6 +24,8 @@
:manifests=
"manifests"
:panels=
"panels"
:request=
"request"
:transcription=
"transcription"
:transliteration=
"transliteration"
:tree=
"tree"
/>
</q-page-container>
...
...
@@ -54,7 +55,6 @@ export default {
return
{
collection
:
{},
collectiontitle
:
''
,
contenturl
:
''
,
config
:
{},
fontsize
:
14
,
imageurl
:
''
,
...
...
@@ -64,6 +64,8 @@ export default {
itemurls
:
[],
language
:
''
,
manifests
:
[],
transcription
:
''
,
transliteration
:
''
,
tree
:
[],
};
},
...
...
@@ -166,6 +168,18 @@ export default {
getConfig
()
{
this
.
config
=
JSON
.
parse
(
document
.
getElementById
(
'
tido-config
'
).
text
);
},
/**
* caller: *getItemData()*
*
* @param string array
*
* @return array
*/
getContent
(
content
)
{
return
[
content
[
0
].
url
,
content
[
1
].
url
,
];
},
/**
* fetch all data provided on 'item level'
* caller: *mounted-hook*, *getManifest()*
...
...
@@ -177,7 +191,8 @@ export default {
.
then
((
data
)
=>
{
this
.
item
=
data
;
this
.
contenturl
=
data
.
content
||
''
;
[
this
.
transcription
,
this
.
transliteration
]
=
this
.
getContent
(
data
.
content
);
this
.
imageurl
=
data
.
image
.
id
||
''
;
});
},
...
...
src/components/content.vue
View file @
5c946fce
...
...
@@ -34,17 +34,11 @@
</q-btn>
</div>
</div>
<!-- FIXME: => 'v-html' directive can lead to XSS attack vue/no-v-html
Vue v1 supported triple braces to show html (
{{
{
...
}}
}
).
These
have
been
considered
deprecated
and
aren
'
t available anymore as is Vue
'
s
directive
"
v-text
"
.
The
latter
represents
text
*
as
is
*
anyways
,
e
.
g
.
it
would
show
html
tags
in
the
text
.
Atm
there
doesn
'
t seem to be an alternative to "v-html" in regards to presenting xml/html.
-->
<div
class=
"row"
>
<!-- eslint-disable -- https://eslint.vuejs.org/rules/no-v-html.html -->
<div
:class="[
'
scroll
-
panel
'
, config.rtl ?
'
rtl
-
support
'
:
''
]"
:class=
"['scroll-panel', config.rtl ? 'rtl' : '']"
:id=
"nodeid"
ref=
"contentsize"
v-html=
"content"
...
...
@@ -63,10 +57,6 @@ export default {
type
:
Object
,
default
:
()
=>
{},
},
contenturl: {
type: String,
default: () =>
''
,
}
,
fontsize
:
{
type
:
Number
,
default
:
()
=>
14
,
...
...
@@ -79,6 +69,10 @@ export default {
type
:
Function
,
default
:
null
,
},
transcription
:
{
type
:
String
,
default
:
()
=>
''
,
},
},
data
()
{
return
{
...
...
@@ -96,7 +90,7 @@ export default {
this
.
fasSearchPlus
=
fasSearchPlus
;
this
.
fasSearchMinus
=
fasSearchMinus
;
this.content = await this.request(this.
contenturl
,
'
text
'
).then((data) => data);
this
.
content
=
await
this
.
request
(
this
.
transcription
,
'
text
'
).
then
((
data
)
=>
data
);
},
mounted
()
{
this
.
$refs
.
contentsize
.
style
.
fontSize
=
`
${
this
.
fontsize
}
px`
;
...
...
@@ -140,7 +134,7 @@ export default {
</
script
>
<
style
lang=
"scss"
scoped
>
.rtl
-support
{
.rtl
{
direction
:
rtl
;
}
</
style
>
src/index.template.html
View file @
5c946fce
...
...
@@ -31,7 +31,7 @@
-->
<script
id=
"tido-config"
type=
"application/json"
>
{
"
entrypoint
"
:
""
,
"
entrypoint
"
:
"
https://ahikar-test.sub.uni-goettingen.de/api/textapi/ahikar/arabic-karshuni/collection.json
"
,
"
colors
"
:
{
"
primary
"
:
""
,
"
secondary
"
:
""
,
...
...
src/views/mainview.vue
View file @
5c946fce
...
...
@@ -94,10 +94,6 @@ export default {
type
:
Object
,
default
:
()
=>
{},
},
contenturl
:
{
type
:
String
,
default
:
()
=>
''
,
},
fontsize
:
{
type
:
Number
,
default
:
()
=>
14
,
...
...
@@ -130,6 +126,14 @@ export default {
type
:
Function
,
default
:
()
=>
null
,
},
transcription
:
{
type
:
String
,
default
:
()
=>
''
,
},
transliteration
:
{
type
:
String
,
default
:
()
=>
''
,
},
tree
:
{
type
:
Array
,
default
:
()
=>
[],
...
...
@@ -140,7 +144,7 @@ export default {
return
this
.
manifests
.
length
&&
this
.
tree
.
length
;
},
keys
()
{
return
{
3
:
this
.
imageurl
,
4
:
this
.
contenturl
};
return
{
3
:
this
.
imageurl
,
4
:
this
.
transcription
};
},
},
};
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment