View Single Post
  #12  
Old 11-20-2011, 05:26 AM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default Re: Colorbox in 4.4.4

I'm gonna declare this a caching bug.

I've tried every conceivable way of calling colorbox, using 4 or more techniques.

Colorbox ALWAYS works as expected if "Use speed-up tool for Javascript" function is disabled.
Colorbox FAILS to load if "Use speed-up tool for Javascript" is checked.

I have done the following:

1. loaded the colorbox script in
/common_files/customer/service_head.tpl

Code:
{load_defer file="lib/colorbox/colorbox.css" type="css"} {load_defer file="lib/colorbox/jquery.colorbox-min.js" type="js"}

2. loaded colorbox ONLY on product detail pages, by putting an if around the js call:

Code:
{* BEGIN added by JR for COLORBOX js load on product pages *} {if $main eq "product"} {load_defer file="lib/colorbox/colorbox.css" type="css"} {load_defer file="lib/colorbox/jquery.colorbox-min.js" type="js"} {literal} <script> jQuery(document).ready(function () { $(".iframe").colorbox({iframe:true, width:"50%", height:"60%"}); }); </script> {/literal} {/if} {* END added by JR for COLORBOX js load on product pages *}

3. Tried putting it all into meta.tpl (no change)

4. Tried NOT using "load_defer" and simply used script/link code like the old days (tried this in service_head.tpl, meta.tpl, no change)

Code:
<script type="text/javascript" src="{$SkinDir}/lib/colorbox/jquery.colorbox-min.js"></script> <link rel="stylesheet" type="text/css" href="{$SkinDir}/lib/colorbox/colorbox.css" />

No change.

5. I have manually deleted js and css cache from /var/cache

The bottom line: IF "Use speed-up tool for Javascript" function is disabled, colorbox will work, regardless of how we call it. If "Use speed-up tool for Javascript" function is enabled, colorbox will fail.

Either I am doing something dreadfully wrong, or there is something defective in this caching code.

Steve -- you mentioned
Quote:
There was similar issue with Flyout menus and cache so I would say this very well is the problem.
And I think you are on to something. I will share this with bugtracker.

Anyone else reading this using 4.4.x and adding js code -- PLEASE share your results!

Thanks,

J
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote