Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Mirador annotations
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Loïs Poujade
Mirador annotations
Commits
801a525b
Verified
Commit
801a525b
authored
2 years ago
by
Loïs Poujade
Browse files
Options
Downloads
Plain Diff
Merge branch '1-edit-annotations-on-videos' into 5-images-in-annotations
parents
7cb70ef8
ef26ae0c
Branches
5-rebase-images-in-annot
5-wip-images-in-annot
tmp
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/AnnotationCreation.js
+13
-8
13 additions, 8 deletions
src/AnnotationCreation.js
src/WebAnnotation.js
+3
-2
3 additions, 2 deletions
src/WebAnnotation.js
src/plugins/annotationCreationCompanionWindow.js
+1
-1
1 addition, 1 deletion
src/plugins/annotationCreationCompanionWindow.js
with
17 additions
and
11 deletions
src/AnnotationCreation.js
+
13
−
8
View file @
801a525b
...
@@ -143,8 +143,14 @@ class AnnotationCreation extends Component {
...
@@ -143,8 +143,14 @@ class AnnotationCreation extends Component {
strokeWidth
:
3
,
strokeWidth
:
3
,
...(
props
.
config
.
annotation
.
defaults
||
{}),
...(
props
.
config
.
annotation
.
defaults
||
{}),
};
};
const
timeState
=
props
.
currentTime
!==
null
?
{
tend
:
Math
.
floor
(
props
.
currentTime
)
+
10
,
tstart
:
Math
.
floor
(
props
.
currentTime
)
}
:
{
tend
:
null
,
tstart
:
null
};
this
.
state
=
{
this
.
state
=
{
...
toolState
,
...
toolState
,
...
timeState
,
textBody
:
''
,
textBody
:
''
,
activeTool
:
'
cursor
'
,
activeTool
:
'
cursor
'
,
closedMode
:
'
closed
'
,
closedMode
:
'
closed
'
,
...
@@ -155,9 +161,7 @@ class AnnotationCreation extends Component {
...
@@ -155,9 +161,7 @@ class AnnotationCreation extends Component {
popoverAnchorEl
:
null
,
popoverAnchorEl
:
null
,
popoverLineWeightAnchorEl
:
null
,
popoverLineWeightAnchorEl
:
null
,
svg
:
null
,
svg
:
null
,
tend
:
Math
.
floor
(
props
.
currentTime
)
+
10
,
textEditorStateBustingKey
:
0
,
textEditorStateBustingKey
:
0
,
tstart
:
Math
.
floor
(
props
.
currentTime
),
imgConstrain
:
false
,
imgConstrain
:
false
,
imgHeight
:
{
imgHeight
:
{
lastSubmittedValue
:
''
,
lastSubmittedValue
:
''
,
...
@@ -477,7 +481,8 @@ class AnnotationCreation extends Component {
...
@@ -477,7 +481,8 @@ class AnnotationCreation extends Component {
textBody
,
image
,
imgWidth
,
imgHeight
,
imgUrl
,
tags
,
xywh
,
svg
,
textBody
,
image
,
imgWidth
,
imgHeight
,
imgUrl
,
tags
,
xywh
,
svg
,
imgConstrain
,
tstart
,
tend
,
textEditorStateBustingKey
,
imgConstrain
,
tstart
,
tend
,
textEditorStateBustingKey
,
}
=
this
.
state
;
}
=
this
.
state
;
const
annoBody
=
{
value
:
!
textBody
.
length
?
`
${
secondsToHMS
(
tstart
)}
->
${
secondsToHMS
(
tend
)}
`
:
textBody
};
const
t
=
(
tstart
&&
tend
)
?
`
${
tstart
}
,
${
tend
}
`
:
null
;
const
annoBody
=
{
value
:
(
!
textBody
.
length
&&
t
)
?
`
${
secondsToHMS
(
tstart
)}
->
${
secondsToHMS
(
tend
)}
`
:
textBody
};
let
imgBody
;
let
imgBody
;
if
(
imgWidth
.
validity
===
1
&&
imgHeight
.
validity
===
1
&&
imgUrl
.
validity
===
1
)
{
if
(
imgWidth
.
validity
===
1
&&
imgHeight
.
validity
===
1
&&
imgUrl
.
validity
===
1
)
{
...
@@ -497,7 +502,7 @@ class AnnotationCreation extends Component {
...
@@ -497,7 +502,7 @@ class AnnotationCreation extends Component {
const
anno
=
new
WebAnnotation
({
const
anno
=
new
WebAnnotation
({
body
:
annoBody
,
body
:
annoBody
,
canvasId
:
canvas
.
id
,
canvasId
:
canvas
.
id
,
fragsel
:
{
t
:
`
${
tstart
}
,
${
tend
}
`
,
xywh
},
fragsel
:
{
t
,
xywh
},
id
:
(
annotation
&&
annotation
.
id
)
||
`
${
uuid
()}
`
,
id
:
(
annotation
&&
annotation
.
id
)
||
`
${
uuid
()}
`
,
image
:
imgBody
,
image
:
imgBody
,
manifestId
:
canvas
.
options
.
resource
.
id
,
manifestId
:
canvas
.
options
.
resource
.
id
,
...
@@ -519,10 +524,10 @@ class AnnotationCreation extends Component {
...
@@ -519,10 +524,10 @@ class AnnotationCreation extends Component {
this
.
setState
({
this
.
setState
({
image
:
false
,
image
:
false
,
svg
:
null
,
svg
:
null
,
tend
:
0
,
tend
:
null
,
textBody
:
''
,
textBody
:
''
,
textEditorStateBustingKey
:
textEditorStateBustingKey
+
1
,
textEditorStateBustingKey
:
textEditorStateBustingKey
+
1
,
tstart
:
0
,
tstart
:
null
,
xywh
:
null
,
xywh
:
null
,
});
});
}
}
...
@@ -919,7 +924,7 @@ AnnotationCreation.propTypes = {
...
@@ -919,7 +924,7 @@ AnnotationCreation.propTypes = {
),
),
}),
}),
}).
isRequired
,
}).
isRequired
,
currentTime
:
PropTypes
.
number
,
currentTime
:
PropTypes
.
oneOfType
([
PropTypes
.
number
,
PropTypes
.
instanceOf
(
null
)])
,
id
:
PropTypes
.
string
.
isRequired
,
id
:
PropTypes
.
string
.
isRequired
,
paused
:
PropTypes
.
bool
,
paused
:
PropTypes
.
bool
,
receiveAnnotation
:
PropTypes
.
func
.
isRequired
,
receiveAnnotation
:
PropTypes
.
func
.
isRequired
,
...
@@ -932,7 +937,7 @@ AnnotationCreation.defaultProps = {
...
@@ -932,7 +937,7 @@ AnnotationCreation.defaultProps = {
annotation
:
null
,
annotation
:
null
,
canvases
:
[],
canvases
:
[],
closeCompanionWindow
:
()
=>
{},
closeCompanionWindow
:
()
=>
{},
currentTime
:
0
,
currentTime
:
null
,
paused
:
true
,
paused
:
true
,
setCurrentTime
:
()
=>
{},
setCurrentTime
:
()
=>
{},
setSeekTo
:
()
=>
{},
setSeekTo
:
()
=>
{},
...
...
This diff is collapsed.
Click to expand it.
src/WebAnnotation.js
+
3
−
2
View file @
801a525b
...
@@ -58,9 +58,10 @@ export default class WebAnnotation {
...
@@ -58,9 +58,10 @@ export default class WebAnnotation {
return
bodies
;
return
bodies
;
}
}
/** */
/**
Fill target object with selectors (if any), else returns target url
*/
target
()
{
target
()
{
if
(
!
this
.
svg
&&
!
this
.
fragsel
)
{
if
(
!
this
.
svg
&&
(
!
this
.
fragsel
||
!
Object
.
values
(
this
.
fragsel
).
find
((
e
)
=>
e
!==
null
)))
{
return
this
.
canvasId
;
return
this
.
canvasId
;
}
}
const
target
=
{
source
:
this
.
source
()
};
const
target
=
{
source
:
this
.
source
()
};
...
...
This diff is collapsed.
Click to expand it.
src/plugins/annotationCreationCompanionWindow.js
+
1
−
1
View file @
801a525b
...
@@ -25,7 +25,7 @@ function mapStateToProps(state, { id: companionWindowId, windowId }) {
...
@@ -25,7 +25,7 @@ function mapStateToProps(state, { id: companionWindowId, windowId }) {
const
canvases
=
getVisibleCanvases
(
state
,
{
windowId
});
const
canvases
=
getVisibleCanvases
(
state
,
{
windowId
});
const
annotation
=
getPresentAnnotationsOnSelectedCanvases
(
state
,
{
windowId
})
const
annotation
=
getPresentAnnotationsOnSelectedCanvases
(
state
,
{
windowId
})
.
flatMap
((
annoPage
)
=>
annoPage
.
json
.
items
)
.
flatMap
((
annoPage
)
=>
annoPage
.
json
.
items
||
[]
)
.
find
((
annot
)
=>
annot
.
id
===
annotationid
);
.
find
((
annot
)
=>
annot
.
id
===
annotationid
);
return
{
return
{
...
...
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