Closed (fixed)
Project:
Shadowbox
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
28 Jan 2009 at 13:37 UTC
Updated:
5 Mar 2009 at 18:18 UTC
Jump to comment: Most recent file
"One question with this, is it possible to load these files dynamically rather than all of them every time. That way when you turn off some of the various types it would speed up page load." by nickorr
I've been trying to do this using array_diff but it's not working for me. Any proposed solution to this, even just conceptually?
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | shadowbox.module.zip | 10.2 KB | nickorr |
| #1 | shadowbox.tgz | 14.42 KB | psynaptic |
Comments
Comment #1
psynaptic commentedI started an attempt at this but it didn't really get very far. I'm not sure what the best way to handle this would be. If anyone wants to have a look at this and get it in shape so we can commit that would be great.
Comment #2
nickorr commentedWould this sort of code work :
$flv = variable_get('shadowbox_supported_flv', shadowbox_get_types('flv'));
$quicktime = variable_get('shadowbox_supported_quicktime', shadowbox_get_types('quicktime'));
$flv_support = array_filter($flv);
$quicktime_support = array_filter($quicktime);
if (!empty($flv_support)) {
drupal_add_js($path .'/shadowbox/build/player/shadowbox-flv.js');
}
if (!empty($quicktime_support)) {
drupal_add_js($path .'/shadowbox/build/player/shadowbox-qt.js');
}
I've left lots of bits out there, but it seems to work on my testing.
Cheers,
Nick
Comment #3
psynaptic commentedI don't think so. The problem is that shadowbox seems to need the media types defined in the JS settings.
See shadowbox_get_settings().
Comment #4
nickorr commentedI've put those changes into my test version and it seems to work. I've turned off everything except quicktime and images and it only loaded those two files and the overlay thing still happened.
Comment #5
psynaptic commentedI'm itching to try this out but I've just committed a massive set of changes to get the module fully working in views 2. I've done a diff against your changes to the version I uploaded. Thanks for keeping it focused, I will try this out when I get confirmation that the other fix works for everyone. If you could test it out too that would be great.
Comment #6
psynaptic commentedComment #7
psynaptic commentedOk, lack of response so I just went ahead and carried this out. Shame there are no testers today.
It works great so thanks for your help nickorr.
One caveat, and I guess it should be expected is this:
If the correct supported media option is not selected for a link to that type and you have a rel="shadowbox" on that link then it will cause a JS exception: can't find player qt. Just remove the rel="shadowbox" from that link or add the correct supported media type in the settings.
I'll try and get some more features in before making another stable release.
Comment #9
psynaptic commentedJust backported this to the Drupal 5.x-2.x version.