-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restructuring the handling for UV URLs
- Loading branch information
1 parent
0054db6
commit 99c4b03
Showing
3 changed files
with
68 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
|
||
# Class modeling URLs for Universal Viewer installations | ||
class UniversalViewer | ||
|
||
# Constructor | ||
# @param base_url [String] URL to the installation | ||
# @param uv_params [Hash] GET parameters to pass to the URL | ||
def initialize(base_url, **uv_params) | ||
@base_url = base_url | ||
@params = uv_params | ||
end | ||
|
||
# Generate the string representation of the URL | ||
# @return [String] | ||
def url | ||
components = [@base_url.to_s] | ||
|
||
components << "#?" unless @params.empty? | ||
|
||
params = [] | ||
@params.each_pair do |name, value| | ||
params << "#{name.to_s}=#{CGI::escape(value)}" | ||
end | ||
components += [params.join('&')] | ||
|
||
components.join | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
<div class="uv__overlay"> | ||
<iframe allowFullScreen="true" src="https://figgy-staging.princeton.edu/uv/uv#?manifest=<%= document.manifest %>&config=<%= CGI::escape("https://figgy-staging.princeton.edu/viewer/exhibit/config?manifest=#{document.manifest}") %>"> | ||
</iframe> | ||
<%= link_to image_tag("iiif.png", class: "logo", alt: "IIIF Drag and Drop"), viewers_page_path(manifest: document.manifest, format: :html) %> | ||
<iframe allowfullscreen="true" src="<%= universal_viewer_url %>"></iframe> | ||
<%= link_to image_tag("iiif.png", class: "logo", alt: "IIIF Drag and Drop"), universal_viewer_url %> | ||
</div> |