Java Server Faces (JSF) vs. Shadowbox -- FIXED

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Java Server Faces (JSF) vs. Shadowbox -- FIXED

coronad0
This post was updated on .
I know I'm missing something obvious here ...

I'm using relative paths to the shadowbox-yui and shadowbox .js files as well as the css files and when I preview my site through Microsoft Expression Web, using the local copy of my website, shadowbox works great ...

When I open the JSF site using the full URL to my site, shadowbox does not do anything in IE, but simply opens the "shadowbox'd site" like a regular link.

I am using the exact same relative paths to the .js  and css files (and yes, I've got the DOC type up there as a strict.dtd) as the example index.html for shadowbox.js (which does work on my site with the full URL) and I'm only calling:

<script type="text/javascript"> window.onload = Shadowbox.init; </script>
EDIT: I double checked for strict.dtd consistency and now am able to get one of my shadowbox'd URL's to work, it is external to my site (using google.com) and works fine. But all of the internally referenced URL's do not work at all ... I'm using the EXACT same code for the google.com rel as the others.

EDIT Pt.2: Turining on script error checking in IE and using Firebug in Firefox gives me the following error when I click on my shadowbox'd URLs:

'current_gallery[...]type' is null or not an object which is line 1034 in shadowbox.js

Odd thing is I may be misinterpreting the error, but I do not have my URLs in any gallery setup as you would with a static image.

HALP!
Reply | Threaded
Open this post in threaded view
|

Java Server Faces (JSF) vs. Shadowbox

coronad0
This post was updated on .
Might have found the issue ...

The URLs I am linking to are .jsf pages ... which are not in the "unsupported" section of shadowbox.js, only 'html' is listed.

So, just have to add a section in shadowbox.js to handle the jsf page, yes?

EDIT: As in Vaskerville's post under "Multiple html instances", a very similar issue I am having, I changed line 1034 to simply reference 'jsf' and my site will now init shadowbox ... but the linked page does not show up, it sits there laughing at me with the loading.gif spinning away ... the other sites (google.com) still show up fine in shadowbox.

This still does not explain why in "preview" mode in my website development app, everything works fine, but through a full URL to my site, only the non-jsf pages work.

T/S continues ...

24 March Update: Now, for some odd reason, when I use the IP address of my Apache server to link to my shadowbox page, everything works ... when I use our full URL, non of the shadowbox links work ... hmmmm ...
Reply | Threaded
Open this post in threaded view
|

Shadowbox.js *BUG FIX*

coronad0
In reply to this post by coronad0
Had one of my Java 1337 friends figure this one out ... here is his addition to shadowbox.js that fixes a bug in the getPlayerType function (Either add the fix, or replace your getPlayerType with the one below) ... this may fix many of you who have noticed shadowbox working on your test webserver and then failing on the production, or that you've noticed certain web types returning "unsupported" instead of just putting it in an iframe; Chris' bug note is in the code:

-- THE CODE BELOW IS UNSUPPORTED, MIGHT WORK FOR YOU, MIGHT NOT, AND COMES WITH NO WARRANTIES

    var getPlayerType = function(url){
        if(RE.img.test(url)) return 'img';
        var match = url.match(RE.domain);
        var this_domain = match ? document.domain == match[1] : false;
        if(url.indexOf('#') > -1 && this_domain) return 'inline';
        var q_index = url.indexOf('?');
        if(q_index > -1) url = url.substring(0, q_index); // strip query string for player detection purposes
        if(RE.swf.test(url)) return plugins.fla ? 'swf' : 'unsupported-swf';
        if(RE.flv.test(url)) return plugins.fla ? 'flv' : 'unsupported-flv';
        if(RE.qt.test(url)) return plugins.qt ? 'qt' : 'unsupported-qt';
        if(RE.wmp.test(url)){
            if(plugins.wmp){
                return 'wmp';
            }else if(plugins.f4m){
                return 'qt';
            }else{
                return isMac ? (plugins.qt ? 'unsupported-f4m' : 'unsupported-qtf4m') : 'unsupported-wmp';
            }
        }else if(RE.qtwmp.test(url)){
            if(plugins.qt){
                return 'qt';
            }else if(plugins.wmp){
                return 'wmp';
            }else{
                return isMac ? 'unsupported-qt' : 'unsupported-qtwmp';
            }
        }
                /**
                 * BUG NOTE(CSD): The "else" clause below is incorrect.  If you have a
                 * link to a URL that has no file extension (e.g. "http://abc.com/foo")
                 * and that link IS in the same domain, then the RE.iframe.test(url)
                 * will always return false, so you'll get 'unsupported'.  And if you
                 * get 'unsupported', there are other bugs that cause ALL the links to
                 * fail.
                 *
                 * So instead, we just always return 'iframe' if we get to this point.
                 */
                /*
                else if(!this_domain || RE.iframe.test(url)){
            return 'iframe';
        }
        return 'unsupported';
                */
                return 'iframe';
    };