Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
IIIF
Mirador
Mirador annotations
Commits
b022a5db
Commit
b022a5db
authored
Mar 18, 2021
by
Lutz Helm
Browse files
Options
Downloads
Patches
Plain Diff
Rename "download" to "export"
parent
a2ee3f60
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/AnnotationExportDialog.js
+16
-16
16 additions, 16 deletions
src/AnnotationExportDialog.js
src/plugins/miradorAnnotationPlugin.js
+17
-17
17 additions, 17 deletions
src/plugins/miradorAnnotationPlugin.js
with
34 additions
and
34 deletions
demo/src/index.js
+
1
−
1
View file @
b022a5db
...
...
@@ -9,7 +9,7 @@ const config = {
annotation
:
{
adapter
:
(
canvasId
)
=>
new
LocalStorageAdapter
(
`localStorage://?canvasId=
${
canvasId
}
`
),
// adapter: (canvasId) => new AnnototAdapter(canvasId, endpointUrl),
download
LocalStorageAnnotations
:
false
,
export
LocalStorageAnnotations
:
false
,
},
id
:
'
demo
'
,
window
:
{
...
...
This diff is collapsed.
Click to expand it.
src/Annotation
Download
Dialog.js
→
src/Annotation
Export
Dialog.js
+
16
−
16
View file @
b022a5db
...
...
@@ -11,12 +11,12 @@ import Typography from '@material-ui/core/Typography';
import
PropTypes
,
{
bool
}
from
'
prop-types
'
;
/** */
class
Annotation
Download
Dialog
extends
Component
{
class
Annotation
Export
Dialog
extends
Component
{
/** */
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
download
Links
:
[],
export
Links
:
[],
};
this
.
closeDialog
=
this
.
closeDialog
.
bind
(
this
);
}
...
...
@@ -46,8 +46,8 @@ class AnnotationDownloadDialog extends Component {
return
resolvedAcc
;
};
if
(
canvases
&&
canvases
.
length
>
0
)
{
canvases
.
reduce
(
reducer
,
[]).
then
((
download
Links
)
=>
{
this
.
setState
({
download
Links
});
canvases
.
reduce
(
reducer
,
[]).
then
((
export
Links
)
=>
{
this
.
setState
({
export
Links
});
});
}
}
...
...
@@ -56,36 +56,36 @@ class AnnotationDownloadDialog extends Component {
/** */
closeDialog
()
{
const
{
handleClose
}
=
this
.
props
;
this
.
setState
({
download
Links
:
[]
});
this
.
setState
({
export
Links
:
[]
});
handleClose
();
}
/** */
render
()
{
const
{
handleClose
,
open
}
=
this
.
props
;
const
{
download
Links
}
=
this
.
state
;
const
{
export
Links
}
=
this
.
state
;
return
(
<
Dialog
aria
-
labelledby
=
"
annotation-
download
-dialog-title
"
id
=
"
annotation-
download
-dialog
"
aria
-
labelledby
=
"
annotation-
export
-dialog-title
"
id
=
"
annotation-
export
-dialog
"
onClose
=
{
handleClose
}
onEscapeKeyDown
=
{
this
.
closeDialog
}
open
=
{
open
}
>
<
DialogTitle
id
=
"
annotation-
download
-dialog-title
"
disableTypography
>
<
Typography
variant
=
"
h2
"
>
Download
Annotations
<
/Typography
>
<
DialogTitle
id
=
"
annotation-
export
-dialog-title
"
disableTypography
>
<
Typography
variant
=
"
h2
"
>
Export
Annotations
<
/Typography
>
<
/DialogTitle
>
<
DialogContent
>
{
download
Links
===
undefined
||
download
Links
.
length
===
0
?
(
{
export
Links
===
undefined
||
export
Links
.
length
===
0
?
(
<
Typography
variant
=
"
body1
"
>
No
annotations
stored
yet
.
<
/Typography
>
)
:
(
<
List
>
{
download
Links
.
map
((
dl
)
=>
(
{
export
Links
.
map
((
dl
)
=>
(
<
ListItem
button
component
=
"
a
"
key
=
{
dl
.
canvasId
}
aria
-
label
=
{
`
Download
annotations for
${
dl
.
label
}
`
}
aria
-
label
=
{
`
Export
annotations for
${
dl
.
label
}
`
}
href
=
{
dl
.
url
}
download
=
{
`
${
dl
.
id
}
.json`
}
>
...
...
@@ -93,7 +93,7 @@ class AnnotationDownloadDialog extends Component {
<
GetAppIcon
/>
<
/ListItemIcon
>
<
ListItemText
>
{
`
Download
annotations for "
${
dl
.
label
}
"`
}
{
`
Export
annotations for "
${
dl
.
label
}
"`
}
<
/ListItemText
>
<
/ListItem
>
))}
...
...
@@ -105,7 +105,7 @@ class AnnotationDownloadDialog extends Component {
}
}
Annotation
Download
Dialog
.
propTypes
=
{
Annotation
Export
Dialog
.
propTypes
=
{
canvases
:
PropTypes
.
arrayOf
(
PropTypes
.
shape
({
id
:
PropTypes
.
string
,
index
:
PropTypes
.
number
}),
).
isRequired
,
...
...
@@ -118,4 +118,4 @@ AnnotationDownloadDialog.propTypes = {
open
:
bool
.
isRequired
,
};
export
default
Annotation
Download
Dialog
;
export
default
Annotation
Export
Dialog
;
This diff is collapsed.
Click to expand it.
src/plugins/miradorAnnotationPlugin.js
+
17
−
17
View file @
b022a5db
...
...
@@ -5,7 +5,7 @@ import AddBoxIcon from '@material-ui/icons/AddBox';
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
Annotation
Download
Dialog
from
'
../Annotation
Download
Dialog
'
;
import
Annotation
Export
Dialog
from
'
../Annotation
Export
Dialog
'
;
import
LocalStorageAdapter
from
'
../LocalStorageAdapter
'
;
/** */
...
...
@@ -14,10 +14,10 @@ class MiradorAnnotation extends Component {
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
annotation
Download
DialogOpen
:
false
,
annotation
Export
DialogOpen
:
false
,
};
this
.
openCreateAnnotationCompanionWindow
=
this
.
openCreateAnnotationCompanionWindow
.
bind
(
this
);
this
.
toggleCanvas
Download
Dialog
=
this
.
toggleCanvas
Download
Dialog
.
bind
(
this
);
this
.
toggleCanvas
Export
Dialog
=
this
.
toggleCanvas
Export
Dialog
.
bind
(
this
);
}
/** */
...
...
@@ -32,10 +32,10 @@ class MiradorAnnotation extends Component {
}
/** */
toggleCanvas
Download
Dialog
(
e
)
{
const
{
annotation
Download
DialogOpen
}
=
this
.
state
;
toggleCanvas
Export
Dialog
(
e
)
{
const
{
annotation
Export
DialogOpen
}
=
this
.
state
;
const
newState
=
{
annotation
Download
DialogOpen
:
!
annotation
Download
DialogOpen
,
annotation
Export
DialogOpen
:
!
annotation
Export
DialogOpen
,
};
this
.
setState
(
newState
);
}
...
...
@@ -45,10 +45,10 @@ class MiradorAnnotation extends Component {
const
{
canvases
,
config
,
TargetComponent
,
targetProps
,
}
=
this
.
props
;
const
{
annotation
Download
DialogOpen
}
=
this
.
state
;
const
{
annotation
Export
DialogOpen
}
=
this
.
state
;
const
storageAdapter
=
config
.
annotation
&&
config
.
annotation
.
adapter
(
'
poke
'
);
const
offer
Download
Dialog
=
config
.
annotation
&&
storageAdapter
instanceof
LocalStorageAdapter
&&
config
.
annotation
.
download
LocalStorageAnnotations
;
const
offer
Export
Dialog
=
config
.
annotation
&&
storageAdapter
instanceof
LocalStorageAdapter
&&
config
.
annotation
.
export
LocalStorageAnnotations
;
return
(
<
div
>
<
TargetComponent
...
...
@@ -61,21 +61,21 @@ class MiradorAnnotation extends Component {
>
<
AddBoxIcon
/>
<
/MiradorMenuButton
>
{
offer
Download
Dialog
&&
(
{
offer
Export
Dialog
&&
(
<
MiradorMenuButton
aria
-
label
=
"
Download
local annotations for visible items
"
onClick
=
{
this
.
toggleCanvas
Download
Dialog
}
aria
-
label
=
"
Export
local annotations for visible items
"
onClick
=
{
this
.
toggleCanvas
Export
Dialog
}
size
=
"
small
"
>
<
GetAppIcon
/>
<
/MiradorMenuButton
>
)}
{
offer
Download
Dialog
&&
(
<
Annotation
Download
Dialog
{
offer
Export
Dialog
&&
(
<
Annotation
Export
Dialog
canvases
=
{
canvases
}
config
=
{
config
}
handleClose
=
{
this
.
toggleCanvas
Download
Dialog
}
open
=
{
annotation
Download
DialogOpen
}
handleClose
=
{
this
.
toggleCanvas
Export
Dialog
}
open
=
{
annotation
Export
DialogOpen
}
/
>
)}
<
/div
>
...
...
@@ -91,7 +91,7 @@ MiradorAnnotation.propTypes = {
config
:
PropTypes
.
shape
({
annotation
:
PropTypes
.
shape
({
adapter
:
PropTypes
.
func
,
download
LocalStorageAnnotations
:
PropTypes
.
bool
,
export
LocalStorageAnnotations
:
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