Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Arkindex
Frontend
Commits
fcb1a971
Commit
fcb1a971
authored
3 years ago
by
ml bonhomme
Committed by
Erwan Rouchet
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
use transcription.orientation for display
parent
21a412dc
No related branches found
No related tags found
1 merge request
!1074
use transcription.orientation for display
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
js/config.js
+21
-0
21 additions, 0 deletions
js/config.js
test/Element/Transcription/Box.js
+2
-1
2 additions, 1 deletion
test/Element/Transcription/Box.js
vue/Element/Transcription/Box.vue
+12
-2
12 additions, 2 deletions
vue/Element/Transcription/Box.vue
with
35 additions
and
3 deletions
js/config.js
+
21
−
0
View file @
fcb1a971
...
...
@@ -240,6 +240,27 @@ export const MONTHS = [
export
const
MANUAL_WORKER_VERSION
=
'
__manual__
'
/*
* Text orientation values to display and create non-left-to-right language transcriptions.
* "writing" is the value of the corresponding "writing-mode" CSS style property.
* For horizontal right to left text, a secondary "direction" style property also has to be specified.
*/
export
const
TEXT_ORIENTATIONS
=
{
'
horizontal-lr
'
:
{
writing
:
'
horizontal-tb
'
},
'
horizontal-rl
'
:
{
writing
:
'
horizontal-tb
'
,
direction
:
'
rtl
'
},
'
vertical-lr
'
:
{
writing
:
'
vertical-lr
'
},
'
vertical-rl
'
:
{
writing
:
'
vertical-rl
'
}
}
export
const
ENTITY_TYPES
=
{
person
:
{
icon
:
'
icon-user
'
,
...
...
This diff is collapsed.
Click to expand it.
test/Element/Transcription/Box.js
+
2
−
1
View file @
fcb1a971
...
...
@@ -10,7 +10,8 @@ localVue.use(Vuex)
describe
(
'
Element/Transcription/Box.vue
'
,
()
=>
{
const
transcription
=
{
id
:
'
transcriptionid
'
,
text
:
'
Vulpix used EMBER!
'
text
:
'
Vulpix used EMBER!
'
,
orientation
:
'
vertical-lr
'
}
const
entity1
=
{
id
:
'
entity1
'
,
...
...
This diff is collapsed.
Click to expand it.
vue/Element/Transcription/Box.vue
+
12
−
2
View file @
fcb1a971
<
template
>
<div
class=
"content"
>
<div
class=
"content"
:style=
"transcriptionOrientation"
>
<blockquote>
<Token
v-for=
"(token, index) in tokens"
...
...
@@ -12,7 +15,7 @@
<
script
>
import
{
mapState
}
from
'
vuex
'
import
{
MANUAL_WORKER_VERSION
}
from
'
~/js/config
'
import
{
MANUAL_WORKER_VERSION
,
TEXT_ORIENTATIONS
}
from
'
~/js/config
'
import
{
parseEntities
}
from
'
~/js/helpers
'
import
Token
from
'
./Token
'
...
...
@@ -47,6 +50,13 @@ export default {
// No version filter = display no entities at all
else
entityTs
=
[]
return
parseEntities
(
this
.
transcription
.
text
,
entityTs
)
},
transcriptionOrientation
()
{
const
trOrientation
=
TEXT_ORIENTATIONS
[
this
.
transcription
.
orientation
]
let
orientationStyle
=
{
'
writing-mode
'
:
'
horizontal-tb
'
}
if
(
'
direction
'
in
trOrientation
)
orientationStyle
=
{
'
writing-mode
'
:
trOrientation
.
writing
,
direction
:
trOrientation
.
direction
}
else
orientationStyle
=
{
'
writing-mode
'
:
trOrientation
.
writing
}
return
orientationStyle
}
}
}
...
...
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