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 18, 2024
1 parent 6cd4fe0 commit 8a4a870
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 12 deletions.
10 changes: 5 additions & 5 deletions app/assets/javascripts/request_viewer_state.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
},

setupRequestButton: function() {
$('#request-state').on('click', (event) => {
this.formId = event.target.dataset.formId;
this.itemId = event.target.dataset.itemId;
this.requestState();
});
document.querySelector('#request-state').addEventListener('click', (event) => {
this.formId = event.target.dataset.formId;
this.itemId = event.target.dataset.itemId;
this.requestState();
});
},

setupIframeMessageListener: function() {
Expand Down
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 @@ -46,14 +46,15 @@ Blacklight.onLoad(function () {
if (mutation.type === 'childList') {
mutation.addedNodes.forEach(node => {
if (node.nodeType === 1 && node.tagName === 'LI') {
SelectImageArea.init(node);
const isEmbed = node.closest('[data-type]').dataset.type == 'solr_documents_embed';
if (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.
13 changes: 10 additions & 3 deletions spec/views/catalog/_embedded_mirador3.html.erb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,19 @@
before do
without_partial_double_verification do
allow(view).to receive_messages(
document: document
document: document,
block: nil
)
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 +32,10 @@

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 8a4a870

Please sign in to comment.