Skip to content

Commit

Permalink
Adding embedded Universal Viewer from Digital Collections
Browse files Browse the repository at this point in the history
  • Loading branch information
randalldfloyd committed Jul 21, 2023
1 parent 6ccdb23 commit 9f8ecfc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 18 deletions.
8 changes: 8 additions & 0 deletions app/renderers/universal_viewer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,12 @@ def to_partial_path
def manifest_url
@document.digital_objects.first.href
end

def uv_host
ENV['UV_HOST']
end

def uv_config_host
ENV['UV_CONFIG_HOST']
end
end
26 changes: 8 additions & 18 deletions app/views/viewers/_universal_viewer.html.erb
Original file line number Diff line number Diff line change
@@ -1,22 +1,12 @@
<div
id="uv"
class="uv"
data-locale="en-GB:English (GB),cy-GB:Cymraeg"
data-config="/uv_config.json"
data-uri=<%= viewer.manifest_url %>
data-collectionindex="0"
data-manifestindex="0"
data-sequenceindex="0"
data-canvasindex="0"
data-xywh="-2204,-248,7873,4957"
data-rotation="0"
style="width:560px; height:420px; background-color: #000">

<div>

<iframe
src="<%= viewer.uv_host %>/uv/uv.html#?manifest=<%= viewer.manifest_url %>&config=<%= viewer.uv_config_host %>/uv/uv_config.json&m=0&cv=0"
width="1024" height="640" allowfullscreen frameborder="0">
</iframe>

</div>
<script
type="text/javascript"
id="embedUV"
src="https://pages.dlib.indiana.edu/bower_includes/universalviewer/dist/uv-2.0.1/lib/embed.js">
</script>

<script>
(function() {
Expand Down

0 comments on commit 9f8ecfc

Please sign in to comment.