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
0a82c70a
Commit
0a82c70a
authored
4 years ago
by
Lutz Helm
Browse files
Options
Downloads
Patches
Plain Diff
Rephrase some localstorage download terms
parent
38ccf333
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
demo/src/index.js
+1
-1
1 addition, 1 deletion
demo/src/index.js
src/AnnotationDownloadDialog.js
+2
-3
2 additions, 3 deletions
src/AnnotationDownloadDialog.js
src/plugins/miradorAnnotationPlugin.js
+8
-5
8 additions, 5 deletions
src/plugins/miradorAnnotationPlugin.js
with
11 additions
and
9 deletions
demo/src/index.js
+
1
−
1
View file @
0a82c70a
...
...
@@ -9,7 +9,7 @@ const config = {
annotation
:
{
adapter
:
(
canvasId
)
=>
new
LocalStorageAdapter
(
`localStorage://?canvasId=
${
canvasId
}
`
),
// adapter: (canvasId) => new AnnototAdapter(canvasId, endpointUrl),
//
download
Canvas
Annotations:
tru
e,
download
LocalStorage
Annotations
:
fals
e
,
},
id
:
'
demo
'
,
window
:
{
...
...
This diff is collapsed.
Click to expand it.
src/AnnotationDownloadDialog.js
+
2
−
3
View file @
0a82c70a
...
...
@@ -86,15 +86,14 @@ export class AnnotationDownloadDialog extends Component {
component
=
"
a
"
key
=
{
dl
.
canvasId
}
aria
-
label
=
{
`Download annotations for
${
dl
.
label
}
`
}
startIcon
=
{
<
GetAppIcon
/>
}
href
=
{
dl
.
url
}
download
=
{
`
annotations-
${
dl
.
id
}
.json`
}
download
=
{
`
${
dl
.
id
}
.json`
}
>
<
ListItemIcon
>
<
GetAppIcon
/>
<
/ListItemIcon
>
<
ListItemText
>
{
`Download annotations for
canvas
"
${
dl
.
label
}
"`
}
{
`Download annotations for "
${
dl
.
label
}
"`
}
<
/ListItemText
>
<
/ListItem
>
))}
...
...
This diff is collapsed.
Click to expand it.
src/plugins/miradorAnnotationPlugin.js
+
8
−
5
View file @
0a82c70a
...
...
@@ -6,6 +6,7 @@ import GetAppIcon from '@material-ui/icons/GetApp';
import
{
MiradorMenuButton
}
from
'
mirador/dist/es/src/components/MiradorMenuButton
'
;
import
{
getVisibleCanvases
}
from
'
mirador/dist/es/src/state/selectors/canvases
'
;
import
{
AnnotationDownloadDialog
}
from
'
../AnnotationDownloadDialog
'
;
import
LocalStorageAdapter
from
'
../LocalStorageAdapter
'
;
/** */
class
MiradorAnnotation
extends
Component
{
...
...
@@ -45,7 +46,9 @@ class MiradorAnnotation extends Component {
canvases
,
config
,
TargetComponent
,
targetProps
,
}
=
this
.
props
;
const
{
annotationDownloadDialogOpen
}
=
this
.
state
;
const
showDownloadDialog
=
config
.
annotation
&&
config
.
annotation
.
downloadCanvasAnnotations
;
const
storageAdapter
=
config
.
annotation
&&
config
.
annotation
.
adapter
(
'
poke
'
);
const
offerDownloadDialog
=
config
.
annotation
&&
storageAdapter
instanceof
LocalStorageAdapter
&&
config
.
annotation
.
downloadLocalStorageAnnotations
;
return
(
<
div
>
<
TargetComponent
...
...
@@ -58,16 +61,16 @@ class MiradorAnnotation extends Component {
>
<
AddBoxIcon
/>
<
/MiradorMenuButton
>
{
show
DownloadDialog
&&
(
{
offer
DownloadDialog
&&
(
<
MiradorMenuButton
aria
-
label
=
"
Download annotation
page for canva
s
"
aria
-
label
=
"
Download
local
annotation
s for visible item
s
"
onClick
=
{
this
.
toggleCanvasDownloadDialog
}
size
=
"
small
"
>
<
GetAppIcon
/>
<
/MiradorMenuButton
>
)}
{
show
DownloadDialog
&&
(
{
offer
DownloadDialog
&&
(
<
AnnotationDownloadDialog
canvases
=
{
canvases
}
config
=
{
config
}
...
...
@@ -88,7 +91,7 @@ MiradorAnnotation.propTypes = {
config
:
PropTypes
.
shape
({
annotation
:
PropTypes
.
shape
({
adapter
:
PropTypes
.
func
,
download
Canvas
Annotations
:
PropTypes
.
bool
,
download
LocalStorage
Annotations
:
PropTypes
.
bool
,
}),
}).
isRequired
,
TargetComponent
:
PropTypes
.
oneOfType
([
...
...
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