Perhaps these should be two issues but the first may be by design so I didn't bother creating an issue for it.

1) While .htm (etc.) extensions load the shadowbox as expected, if you want the home page of a site; using 'http://site.com/' will not. You must visit the site and determine the name of the home page, and code that in directly.

2) Even without modifying the iframe: extensions list, I tried a PDF file from another site and it loaded fine. But when I put in the URL of a local PDF file (absolute or relative) the shadowbox is not shown. The page is only an EMBED tag.

Any ideas?

Comments

design4effect’s picture

Category: bug » support

Moved to Support Request from Bug Report.

design4effect’s picture

Status: Active » Fixed

After using FireBug to check the source on page loads I discovered that the browsers (IE and Firefox) were not loading my changed .js files but were instead using the cached versions.

After deleting the cache, local PDFs were displayed in a shadowbox as suspected.

The fix that worked was:

1> Edit /sites/all/modules/shadowbox/shadowbox.js to add the .PDF extension to the 'iframes' ext list

Change this:

        :
      keysPrev:             Drupal.settings.shadowbox.keys_previous,
      keysNext:             Drupal.settings.shadowbox.keys_next,
      handleUnsupported:    Drupal.settings.shadowbox.handle_unsupported
    };
    Shadowbox.init(options);
        :

to this :

      keysPrev:             Drupal.settings.shadowbox.keys_previous,
      keysNext:             Drupal.settings.shadowbox.keys_next,
      handleUnsupported:    Drupal.settings.shadowbox.handle_unsupported,
      // 
      ext:     {
          img:        ['png', 'jpg', 'jpeg', 'gif', 'bmp'],
          qt:         ['dv', 'mov', 'moov', 'movie', 'mp4'],
          wmp:        ['asf', 'wm', 'wmv'],
          qtwmp:      ['avi', 'mpg', 'mpeg'],
          iframe:     ['asp', 'aspx', 'cgi', 'cfm', 'htm', 'html', 'pdf', 'pl', 'php',
                        'php3', 'php4', 'php5', 'phtml', 'rb', 'rhtml', 'shtml',
      }
    };
    Shadowbox.init(options);

Don't forget to add a comma after the handleUnsupported value before adding ext.

This is the simplest way I have found to control what gets handled by what.
Hopefully, future revisions will make this a setup option.

*** Then flush your browser's cache and it should work fine. ***

- Kent

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.