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
ccbc4552
Commit
ccbc4552
authored
Jan 23, 2023
by
Anthony
Browse files
Options
Downloads
Patches
Plain Diff
Manifest found display as ul
parent
c4b38472
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/CanvasListItem.js
+15
-7
15 additions, 7 deletions
src/CanvasListItem.js
src/utils.js
+4
-7
4 additions, 7 deletions
src/utils.js
with
19 additions
and
14 deletions
src/CanvasListItem.js
+
15
−
7
View file @
ccbc4552
...
...
@@ -27,13 +27,17 @@ class CanvasListItem extends Component {
/** */
componentDidMount
()
{
const
searchManifest
=
async
()
=>
{
const
manifests
=
await
searchManifestAndAddButton
(
this
.
props
.
children
[
0
][
0
].
props
.
children
[
0
].
props
.
htmlString
);
console
.
log
(
this
.
props
);
searchManifestAndAddButton
(
this
.
props
.
children
[
0
][
0
].
props
.
children
[
0
].
props
.
htmlString
)
.
then
((
values
)
=>
{
if
(
values
)
{
console
.
log
(
values
);
this
.
setState
({
manifests
,
manifests
:
values
.
flat
(),
});
console
.
log
(
this
.
state
);
}
});
};
searchManifest
();
}
/** */
...
...
@@ -141,7 +145,11 @@ class CanvasListItem extends Component {
>
{
children
}
<
/li
>
<
h2
>
{
manifests
}
<
/h2
>
{
manifests
&&
<
ul
>
{
manifests
.
map
((
object
)
=>
(
<
li
>
{
object
}
<
/li>
))
}
<
/ul
>
}
<
/div
>
);
}
...
...
This diff is collapsed.
Click to expand it.
src/utils.js
+
4
−
7
View file @
ccbc4552
...
...
@@ -22,7 +22,7 @@ export function secondsToHMSarray(secs) {
return
[
h
,
Math
.
floor
(
secs
/
60
)
-
h
*
60
,
secs
%
60
];
}
/** */
export
function
searchManifestAndAddButton
(
html
)
{
export
async
function
searchManifestAndAddButton
(
html
)
{
const
urls
=
html
.
match
(
/
((
http|https
)\:\/\/[
a-z0-9
\/
:%_+.,#?!@&=-
]
+
)
/g
,
);
...
...
@@ -35,18 +35,15 @@ export function searchManifestAndAddButton(html) {
return
request
;
});
Promise
.
all
(
requestsArray
.
map
((
request
)
=>
{
return
Promise
.
all
(
requestsArray
.
map
((
request
)
=>
{
return
fetch
(
request
).
then
((
response
)
=>
{
return
response
.
json
();
}).
then
((
data
)
=>
{
if
(
data
.
type
===
'
Manifest
'
)
{
return
data
;
return
data
.
id
;
}
return
null
;
});
})).
then
((
values
)
=>
{
console
.
log
(
'
values
'
,
values
);
return
values
;
});
}));
}
}
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