-
Notifications
You must be signed in to change notification settings - Fork 10
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
ISSUE-479: Adds the sbf_file_content extension #480
base: 1.5.0
Are you sure you want to change the base?
Conversation
works like this sbf_file_content("uuid_of_the_node", "uuid_of_the_file", "thename.jsonld"); Will return the content of a file if found/matches one of the mimetypes defined as valid for our metadata displays, now defined as constants at CONST ALLOWED_MIMETYPES = [ 'text/html' => 'HTML', 'application/json' => 'JSON', 'application/ld+json' => 'JSON-LD', 'application/xml' => 'XML', 'text/text' => 'TEXT', 'text/turtle' => 'RDF/TURTLE', 'text/csv' => 'CSV', ]; an error message in case of exception or an empty string if the file does not exist, the user has no permission, is not of an allowed type, etc (avoiding as much as possible errors) @alliomeria i am truly smartz! (and modest too!)
Basically keep doing that/delaying the event until (if ever) we have an event listener. Also attach the event listener only to the Body. We need it only once. Not more.
Also updates them. Probably missing some "side" effects of this
Hi Diego, I did some testing of this commit. Some things I noticed, though I'm not sure if they are new things (isn't that always the problem with requests to "test this"?!). In this table, "no" means I think this is or may be a problem, and "yes" means that I think it's correct.
|
I'm sorry that I did not include testing search, since I don't have that set up in this project. |
@patdunlavey sorry I don't understand the test matrix. I don't see the console errors, and also 1up/2up is not in what this delivers. Very confused. Could you provide more info? Thanks a lot |
…nder errors Next step is to make it "elegant"
The other important thing that I'm seeing is that, when "Custom Archipelago Mirador with Plugins" is selected, I'm seeing Mirador always load in "book" (2-up) display mode. If that's not something you're seeing, that will be useful to know. (I can't think of anything I might be doing to inadvertently change the default display mode.) |
@patdunlavey but that error is not at the Archipelago level. There is a different JS in your page (form.js) that is triggering handleFragmentLinkClickorHashChange (look at your debug stack) that is failing bc actually those IAbookreader hashes are not valid Document Element IDs at all. Not sure why you have the form.js loaded on a landing page though |
For the 1up/2up thing I will say "we won't implement". There are many reasons why a user will not want an enduser/link to mess up with the display (selected) based on the actual IIIF Manifest. The manifest (and you opened an ISSUE which I solved) can and will define the display mode using the IIIF specs. And with the Mirador override JSON we could even disable (and some users have requested that) the Display Mode change on the UI, so allowing a link to trigger that bypassing the choices is a bad idea |
I suspect form.js loads because we have the search form displayed on all pages (in the page header region). |
With form.js, The issue there is an order of operations problem with Drupal. I can not tell Drupal in which order their internal libraries will be loaded. Happy though to not use IAbookreaders pattern at all, but then we (maybe you?) will have to make a wrapper code that uses the "new-valid element id" hash and transform/read on the fly at the IAbookreader level, bc we need to unify this approach |
Does this look to you like it might be the (best) solution for the form.js thing? https://www.drupal.org/project/drupal/issues/2395065. I will test the patch and see if it solves the problem. |
I tested the patch and, while it makes the console error go away, it seems to simply swallow it. The page still doesn't load. |
Regarding the default 2-up thing I'm seeing, it seems to be consistent with
Am I misunderstanding the purpose of the "behavior" attribute in the iiif manifest? |
@patdunlavey not sure why that version of mirador (with the plugin) behaves like that. format_strawberryfield/js/mirador_strawberry.js Lines 366 to 388 in 728535f
Maybe the differentiated defaults we have for that JS are overriding the internal? Let me know |
|
@patdunlavey Will check if the way we alter the browser history is basically telling the caching of the browser that a reload is the same page or not. I can't reproduce the error you see and i get no errors in js at all, but will give this a try again |
See #479
works like this
Will return the content of a file if found/matches one of the mimetypes defined as valid for our metadata displays, now defined as constants at
an error message in case of exception or an empty string if the file does not exist, the user has no permission, is not of an allowed type, etc (avoiding as much as possible errors)
@alliomeria more tomorrow bc this solves VARIOUS use cases