Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Mirador Video
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 Video
Commits
287e7ef2
Commit
287e7ef2
authored
7 years ago
by
Dickson Law
Browse files
Options
Downloads
Patches
Plain Diff
Add back 1-level collection support for collectionUri on the classic manifests panel
parent
255aff18
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
js/src/viewer/manifestsPanel.js
+11
-0
11 additions, 0 deletions
js/src/viewer/manifestsPanel.js
spec/viewer/manifestsPanel.test.js
+33
-0
33 additions, 0 deletions
spec/viewer/manifestsPanel.test.js
with
44 additions
and
0 deletions
js/src/viewer/manifestsPanel.js
+
11
−
0
View file @
287e7ef2
...
...
@@ -55,6 +55,10 @@
_this
.
eventEmitter
.
subscribe
(
'
manifestReceived
'
,
function
(
event
,
newManifest
)
{
_this
.
onManifestReceived
(
event
,
newManifest
);
});
_this
.
eventEmitter
.
subscribe
(
'
collectionReceived
'
,
function
(
event
,
newCollection
)
{
_this
.
onCollectionReceived
(
event
,
newCollection
);
});
},
bindEvents
:
function
()
{
...
...
@@ -140,6 +144,13 @@
_this
.
element
.
find
(
'
#manifest-search
'
).
keyup
();
},
onCollectionReceived
:
function
(
event
,
newCollection
)
{
var
_this
=
this
;
jQuery
.
each
(
newCollection
.
getManifestUris
(),
function
(
_
,
v
)
{
_this
.
eventEmitter
.
publish
(
'
ADD_MANIFEST_FROM_URL
'
,
[
v
,
newCollection
.
location
]);
});
},
template
:
$
.
Handlebars
.
compile
([
'
<div id="manifest-select-menu">
'
,
'
<div class="container">
'
,
...
...
This diff is collapsed.
Click to expand it.
spec/viewer/manifestsPanel.test.js
+
33
−
0
View file @
287e7ef2
...
...
@@ -17,12 +17,21 @@ describe('ManifestsPanel', function() {
it
(
'
should listen for actions
'
,
function
()
{
var
manifest
=
new
Mirador
.
Manifest
(
null
,
'
Dummy Location
'
,
this
.
dummyManifestContent
);
var
collection
=
new
Mirador
.
Collection
(
null
,
'
Dummy Location
'
,
{
"
@context
"
:
"
http://iiif.io/api/presentation/2/context.json
"
,
"
@id
"
:
"
http://example.org/iiif/collection/top
"
,
"
@type
"
:
"
sc:Collection
"
,
"
label
"
:
"
Top Level Collection for Example Organization
"
});
spyOn
(
this
.
panel
,
'
onPanelVisible
'
);
spyOn
(
this
.
panel
,
'
onManifestReceived
'
);
spyOn
(
this
.
panel
,
'
onCollectionReceived
'
);
this
.
eventEmitter
.
publish
(
'
manifestsPanelVisible.set
'
);
this
.
eventEmitter
.
publish
(
'
manifestReceived
'
,
manifest
);
this
.
eventEmitter
.
publish
(
'
collectionReceived
'
,
collection
,
"
http://example.org/iiif/collection/top
"
)
expect
(
this
.
panel
.
onPanelVisible
).
toHaveBeenCalled
();
expect
(
this
.
panel
.
onManifestReceived
).
toHaveBeenCalled
();
expect
(
this
.
panel
.
onCollectionReceived
).
toHaveBeenCalled
();
});
it
(
'
should bind events
'
,
function
()
{
...
...
@@ -121,4 +130,28 @@ describe('ManifestsPanel', function() {
expect
(
this
.
panel
.
manifestListItems
.
length
).
toBe
(
1
);
});
it
(
'
should receive a collection and grab its manifests
'
,
function
()
{
spyOn
(
this
.
eventEmitter
,
'
publish
'
);
var
collection
=
new
Mirador
.
Collection
(
null
,
'
Digital Library @ Villanova
'
,
{
"
@context
"
:
"
http://iiif.io/api/presentation/2/context.json
"
,
"
@id
"
:
"
http://example.org/iiif/collection/top
"
,
"
@type
"
:
"
sc:Collection
"
,
"
label
"
:
"
Top Level Collection for Example Organization
"
,
"
manifests
"
:
[
{
"
label
"
:
"
The 'Adventurer's Oaths' from the Cardboard Drama of Esmeralda Grande
"
,
"
@id
"
:
"
https://digital.library.villanova.edu/Item/vudl:2176/Manifest
"
,
"
@type
"
:
"
sc:Manifest
"
},
{
"
label
"
:
"
The Adventures of Seumas Beg The Visit From Abroad
"
,
"
@id
"
:
"
https://digital.library.villanova.edu/Item/vudl:2112/Manifest
"
,
"
@type
"
:
"
sc:Manifest
"
}
]
});
this
.
panel
.
onCollectionReceived
(
null
,
collection
);
expect
(
this
.
eventEmitter
.
publish
).
toHaveBeenCalledWith
(
'
ADD_MANIFEST_FROM_URL
'
,
[
"
https://digital.library.villanova.edu/Item/vudl:2176/Manifest
"
,
"
Digital Library @ Villanova
"
]);
expect
(
this
.
eventEmitter
.
publish
).
toHaveBeenCalledWith
(
'
ADD_MANIFEST_FROM_URL
'
,
[
"
https://digital.library.villanova.edu/Item/vudl:2112/Manifest
"
,
"
Digital Library @ Villanova
"
]);
})
});
\ No newline at end of file
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