Skip to content

Commit

Permalink
settings for stage testing
Browse files Browse the repository at this point in the history
  • Loading branch information
dnoneill committed Dec 17, 2024
1 parent 6cd4fe0 commit 3718feb
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 7 deletions.
5 changes: 3 additions & 2 deletions app/assets/javascripts/select_image_area.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,16 @@ Blacklight.onLoad(function () {
for (let mutation of mutationsList) {
if (mutation.type === 'childList') {
mutation.addedNodes.forEach(node => {
if (node.nodeType === 1 && node.tagName === 'LI') {
const isEmbed = node.closest('[data-type]') && node.closest('[data-type]').dataset.type == 'solr_documents_embed';
if (node.nodeType === 1 && node.tagName === 'LI' && isEmbed) {
SelectImageArea.init(node);
}
});
}
}
};

document.querySelectorAll('[data-type="solr_documents_embed"]').forEach(function(element, i) {
document.querySelectorAll('#page-content').forEach(function(element, i) {
const observer = new MutationObserver(callback);
observer.observe(element, {childList: true, subtree: true});
})
Expand Down
4 changes: 3 additions & 1 deletion config/initializers/oembed.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

OEmbed::Providers.register_all

purl_provider = OEmbed::Provider.new('http://purl.stanford.edu/embed.{format}?&hide_title=true')
#purl_provider = OEmbed::Provider.new('http://purl.stanford.edu/embed.{format}?&hide_title=true')
purl_provider = OEmbed::Provider.new('https://sul-purl-stage.stanford.edu/embed.{format}?&hide_title=true')
purl_provider << 'http://purl.stanford.edu/*'
purl_provider << 'https://purl.stanford.edu/*'
purl_provider << 'https://sul-purl-stage.stanford.edu/*'
purl_provider << 'http://searchworks.stanford.edu/*'

purl_uat_provider = OEmbed::Provider.new('https://sul-purl-uat.stanford.edu/embed.{format}?&hide_title=true')
Expand Down
2 changes: 1 addition & 1 deletion config/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ feature_flags:
traject:
processing_thread_pool: 1
iiif_embed:
url: https://embed.stanford.edu/iiif
url: https://embed-stage.stanford.edu/iiif
iiif_dnd_base_url: https://library.stanford.edu/iiif?%{query}
action_mailer:
default_options:
Expand Down
Binary file removed db/development.sqlite3-shm
Binary file not shown.
Empty file removed db/development.sqlite3-wal
Empty file.
8 changes: 5 additions & 3 deletions spec/views/catalog/_embedded_mirador3.html.erb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,21 @@
describe 'catalog/_embedded_mirador3' do
let(:document) { SolrDocument.new(id: 'abc', iiif_manifest_url_ssi: manifest_url) }
let(:manifest_url) { 'http://example.com/iiif/manifest' }
let(:block) { }

before do
without_partial_double_verification do
allow(view).to receive_messages(
document: document
document: document,
block: block
)
end
end

it 'renders an iframe' do
render

expect(rendered).to have_css "iframe[src='https://embed.stanford.edu/iiif?#{{ url: manifest_url }.to_query}']"
expect(rendered).to have_css "iframe[src='#{Settings.iiif_embed.url}?#{{ url: manifest_url, canvas_id: '', iiif_initial_viewer_config: ''}.to_query}']"
end

context 'with a local IIIF manifest' do
Expand All @@ -28,7 +30,7 @@

render

expect(rendered).to have_css "iframe[src='https://embed.stanford.edu/iiif?#{{ url: expected_url }.to_query}']"
expect(rendered).to have_css "iframe[src='#{Settings.iiif_embed.url}?#{{ url: expected_url, canvas_id: '', iiif_initial_viewer_config: '' }.to_query}']"
end
end
end

0 comments on commit 3718feb

Please sign in to comment.