I was planning on working for an implementation for fullcalendar.
But this fails because my code depends on the beautytip js files and these get loaded AFTER my files, which leads to js errors.

You should use hook_library, create the library and than I can put a dependency on that library.
Deal? ;)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kleinmp’s picture

Category: bug » task

It's a deal. When I get a chance, I'll do this but I'm also open to patches.

aspilicious’s picture

FileSize
1.56 KB

Here is an untested patch (I think it should work but I can have made some typos)

aspilicious’s picture

Status: Active » Needs review
aspilicious’s picture

Status: Needs review » Needs work

Tested a bit, and isn't working somehow hook_librar doesn't get called :(

aspilicious’s picture

FileSize
14.83 KB

This is a first working step.
Only the IE stuff isn't working yet.

(This also contains the fixes needed to install beautytips in D7 without problems, see other issue)

aspilicious’s picture

Status: Needs work » Needs review
xurizaemon’s picture

Status: Needs review » Needs work

Can you elaborate on "the IE stuff isn't working yet"?

I stopped being excited about IE when the ability to change frameborder colours wore off, but if this doesn't work for IE then it's still "Needs Work" IMO.

aspilicious’s picture

+ //for IE add this
+ $expath = $path . '/other_libs/excanvas_r3';
+ if (count(file_scan_directory($expath, '/excanvas.compiled.js/', $options = array('recurse' => FALSE)))) {
+ $jsPath = array($expath . '/excanvas.compiled.js' => array());
+ array_merge($javascript, $jsPath);
+ }

this doesn't work yet (I think, its been a while since I looked at this)

xurizaemon’s picture

I think that code shouldn't use file_scan_directory with recurse and then assume the found file is at the top of the path?

This code adds the IE conditional tags for excanvas in D7. But I don't know how libraries module handles IE conditional tags, or if the excanvas reference should go in a separate library folder etc.

    //for IE add this
    $expath = $path . '/other_libs/excanvas_r3/excanvas.compiled.js';
    if (file_exists($expath)) {
      $exhtml = array(
        '#type' => 'markup',
        '#markup' => '<!--[if IE]><script language="javascript" type="text/javascript" src="/' . $expath . '"></script><![endif]-->',
      );      
      drupal_add_html_head($exhtml, 'beautytips');
    }
kleinmp’s picture

Status: Needs work » Fixed

I used the above patch, got the excanvas library loading, and committed this to the 7.x-2.x-dev branch. Please reopen if this does not work for you.

Status: Fixed » Closed (fixed)

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

SocialNicheGuru’s picture

where do I place the excanvas folder now?

Adam S’s picture

Status: Closed (fixed) » Needs work

I'm developing on Windows 7. Oh, joy! The file_exists() function doesn't work on Windows well. Doesn't the Libraries module have a mechanism to check this without using file_exists()? Also, for convention sake should the excanvas library be placed in sites/all/libraries for convention sake?

kleinmp’s picture

Priority: Major » Normal

The libraries api module uses file_exists in a bunch of places and it's used all over the place elsewhere in Drupal. If we can identify what's causing the file_exists to fail in Windows, then we can probably make it work.

Right now, it's checking the file starting from the drupal root, but it could check from the root of the disk using DRUPAL_ROOT constant. I don't have a good way of checking if this works in Windows or not.

Yeah, the excanvas should go into sites/all/libraries. Both of these items should probably be separate issues.

hefox’s picture

Re-open reason for this issue sounds like a new bug report, no?

Else there'd be no need for new issues, everyone would just re-open an the original feature request when they find any bug.

"needs work" with this issue title does not convey what the current is, at least.

pifagor’s picture

Issue summary: View changes
Status: Needs work » Closed (outdated)