Hello everyone!

Since the greybox module uses a version of greybox which doesn't support fullscreen, I adapted the module to greybox 5.5. Here is, for your information, the result (you need to patch the gb_scripts.js as well, to put the directory in there);

  if (file_exists($path .'/greybox/gb_styles.css')) {
    drupal_add_css($path . '/greybox/gb_styles.css');
    drupal_add_js($path . "/greybox/AJS.js");
    drupal_add_js($path . "/greybox/gb_scripts.js");
    drupal_add_js(array('greybox' => array('sitepath' => base_path() . $path )), 'setting');
        drupal_add_js('$(document).ready(function(){
        $("a.' . $class_text . '").click(function(){
          var t = this.title || $(this).text() || this.href;
          GB_showPage(t,this.href);
          return false;
        }); });', 'inline');
  }

When I don't have cache enabled, it includes the css, the scripts correctly, and also the inline script as it should:

<script type="text/javascript">$(document).ready(function(){
        $("a.greybox").click(function(){
          var t = this.title || $(this).text() || this.href;
          GB_showPage(t,this.href);
          return false;
        }); });</script>

</head>

However, if I enable caching (the normal one, the one supposed to work), I get a file with:

<script type="text/javascript">$(document).ready(function(){
        $("a.greybox").click(function(){
          var t = this.title || $(this).text() || this.href;
          GB_showPage(t,this.href);
          return false;
        }); });</script>

<script type="text/javascript">$(document).ready(function(){
        $("a.greybox").click(function(){
          var t = this.title || $(this).text() || this.href;
          GB_showPage(t,this.href);
          return false;
        }); });</script>
</head>

The js and css files are included normally, just as well, but stil...

This is the absolute end of my knowledge, I've got really no idea what to do about that. I emptied the cache, disabled and enabled it again, nothing. I puts a double script in there, which is extremely annoying, as it kills the script (or at least the closing function, bad enough).

I would be really glad if someone could help me out with this.

Thank you very much in advance,

Felix.

Comments

felixsmile’s picture

Should I put this post somewhere else, maybe? In one of the bug reporting sections?

Maybe it's just the caching mechanism that has a flaw (or my script) and there's nothing I can do about it? I would be really happy if someone could help me out.

Thank you very much in advance,

Felix.