-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace pul_uv_rails #3696
Replace pul_uv_rails #3696
Conversation
4d83de0
to
dc92d9d
Compare
@no-reply failing with |
@geekscruff If you rebase from master you should get an updated circleci config which might work better. |
a49ad6c
to
cd73f28
Compare
…v_rail is no longer maintained.
For the historical record, what made the iframe necessary, rather than an ordinary div on page as before? |
@jrochkind I'm following what seems to be a common pattern for UV these days, used by Princeton and in examples provided by UV themselves, and (as @jcoyne mentioned) it self-contains the javascript code to avoid version clashes. I'm very much open constructive feedback on the approach. |
Co-Authored-By: geekscruff <julie.allinson@london.ac.uk>
* Replace pul_uv_rails with a direct install of universal viewer. pul_uv_rail is no longer maintained. Co-Authored-By: geekscruff <julie.allinson@london.ac.uk>
* Replace pul_uv_rails with a direct install of universal viewer. pul_uv_rail is no longer maintained. Co-Authored-By: geekscruff <julie.allinson@london.ac.uk> This commit was produced by running the following: ```shell git cherry-pick de959fa ``` As of this PR, the following tags contain the above commit: ```shell $ git tag --contains de959fa v2.5.2 v3.0.0 v3.0.0-rc1 v3.0.0-rc2 v3.0.0.pre.beta3 v3.0.0.pre.rc1 v3.0.0.pre.rc2 v3.0.0.pre.rc3 v3.0.0.pre.rc4 v3.0.1 v3.0.2 v3.1.0 v3.2.0 v3.3.0 v3.4.0 v3.4.1 v3.4.2 v4.0.0.beta1 ``` Of note is that this has been back-ported to =v2.5.2=. With this change, a proposal is to mint v2.10.0 of Hyrax.
See #3232
Approach
By using an <iframe>, the universalviewer javascript is self-contained, and need not impact on the main application, allowing for the use of different versions, for example of jquery. It is also easier to swap out, for example, if you have a universal viewer server, you can skip installing universalviewer and customize the
uv.html
to direct to the new universal viewer location. Examples provided by universalviewer use this <iframe> approach.Suggested documentation:
Universal Viewer
In order to display the Universal Viewer, Hyrax requires the Unviersal Viewer javascript library. Hyrax expects to find the library at
{application_url}/uv/universalviewer
(customarily in public/uv/universalviewer).Installing with YARN
The
package.json
file located in the application root directory is configured to install universalviewer version 3 into public/uv/universalviewer. The following command will install universalviewer:Using a different Universal Viewer location
Hyrax uses an <iframe> to display Universal Viewer. The frame displays the default html page located at
public/uv.html
.There are two ways to use a different location for Universal Viewer:
public/uv.html
file.#universal_viewer_url_base
method inapp/helpers/hyrax/iiif_helper.rb
to point to a different viewer html locationUniversal Viewer Config
It is easy to configure Universal Viewer, for example to default the table of contents to be closed or to remove the download options. Hyrax provides a default (empty) configuration file at
public\uv_config.json
. Customise this file to change the Universal Viewer behavior.To use a different file altogether, override the
#universal_viewer_config_url
method inapp/helpers/hyrax/iiif_helper.rb
.