|
1 | 1 | <div id="full-record" class="gridband layout-3q1q wrap-full-record"> |
2 | | - <main class="col3q box-content region full-record" data-region="Full record"> |
| 2 | + <main class="col4q box-content region full-record" data-region="Full record"> |
3 | 3 | <h2 class="record-title"> |
4 | 4 | <span class="sr">Title: </span> |
5 | 5 | <% if @record['title'].present? %> |
|
66 | 66 | <li> |
67 | 67 | <%= link_to(link['text'] || 'unknown', link['url']) %> |
68 | 68 | </li> |
| 69 | + <% if link['kind'] == 'IIIF Manifest' %> |
| 70 | + Manefest detected! |
| 71 | +
|
| 72 | + <% content_for :additional_js do %> |
| 73 | + <script |
| 74 | + type="application/javascript" |
| 75 | + src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/UV.js" |
| 76 | + ></script> |
| 77 | +
|
| 78 | + <% end %> |
| 79 | +
|
| 80 | + <% content_for :additional_meta_tag do %> |
| 81 | + <link |
| 82 | + rel="stylesheet" |
| 83 | + href="https://cdn.jsdelivr.net/npm/[email protected]/dist/uv.css" |
| 84 | + /> |
| 85 | +
|
| 86 | + <style> |
| 87 | + #uv { |
| 88 | + width: 924px; |
| 89 | + height: 668px; |
| 90 | + } |
| 91 | + </style> |
| 92 | + <% end %> |
| 93 | +
|
| 94 | + <div class="uv" id="uv"></div> |
| 95 | +
|
| 96 | + <script> |
| 97 | + var urlAdaptor = new UV.IIIFURLAdaptor(); |
| 98 | +
|
| 99 | + const data = urlAdaptor.getInitialData({ |
| 100 | + manifest: "<%= link['url'] %>", |
| 101 | + embedded: true // needed for codesandbox frame |
| 102 | + }); |
| 103 | +
|
| 104 | + uv = UV.init("uv", data); |
| 105 | + urlAdaptor.bindTo(uv); |
| 106 | +
|
| 107 | + // override config using an inline json object |
| 108 | + uv.on("configure", function ({ config, cb }) { |
| 109 | + cb({ |
| 110 | + options: { footerPanelEnabled: true } |
| 111 | + }); |
| 112 | + }); |
| 113 | +
|
| 114 | + // this is loading an complete config file for reference |
| 115 | + // to increase loading speed, just use the specific settings you require |
| 116 | + // uv.on("configure", function ({ config, cb }) { |
| 117 | + // cb( |
| 118 | + // new Promise(function (resolve) { |
| 119 | + // fetch("uv-config.json").then(function (response) { |
| 120 | + // resolve(response.json()); |
| 121 | + // }); |
| 122 | + // }) |
| 123 | + // ); |
| 124 | + // }); |
| 125 | + </script> |
| 126 | + <% end %> |
69 | 127 | <% end %> |
70 | 128 | <% end %> |
71 | 129 | </ul> |
72 | 130 |
|
| 131 | +
|
73 | 132 | <% if @record['summary'].present? %> |
74 | 133 | <h3 class="section-title">Summary</h3> |
75 | 134 | <% @record['summary'].each do |paragraph| %> |
|
0 commit comments