From f4f5bfc0f8e4a482dad81fee5eea77cf03191991 Mon Sep 17 00:00:00 2001 From: Silvio Date: Wed, 26 Jun 2013 17:18:34 -0300 Subject: Fixing library path --- timelinejs.module | 13 +++++++++++-- timelinejs.tpl.php | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/timelinejs.module b/timelinejs.module index da492cf..2fc660f 100644 --- a/timelinejs.module +++ b/timelinejs.module @@ -54,7 +54,7 @@ function timelinejs_theme($existing, $type, $theme, $path) { 'start_at_end' => 'false', 'hash_bookmark' => 'true', 'css' => NULL, - 'js' => '/'. libraries_get_path('timelinejs') .'/compiled/js/timeline.js', + 'js' => '/'. timelinejs_library_path() .'/compiled/js/timeline.js', 'lang' => NULL, ), ), @@ -77,6 +77,15 @@ function timelinejs_theme($existing, $type, $theme, $path) { ); } +/** + * Determine the library path. + */ +function timelinejs_library_path() { + // We have to use "timeline" instead of "timelinejs" because of + // this issue: https://github.com/VeriteCo/TimelineJS/issues/403 + return libraries_get_path('timeline'); +} + /** * Get a score nid from a timeline nid. */ @@ -197,7 +206,7 @@ function timelinejs($nid = NULL, $width = '960px', $height = '500px') { $node = node_load($nid); $theme_path = drupal_get_path('theme', $theme); - $library_path = libraries_get_path('timelinejs'); + $library_path = timelinejs_library_path(); // Determine stylesheet if (file_exists($theme_path .'/timeline.css')) { diff --git a/timelinejs.tpl.php b/timelinejs.tpl.php index e3af8a7..f5219d8 100644 --- a/timelinejs.tpl.php +++ b/timelinejs.tpl.php @@ -12,5 +12,5 @@ lang: "" } - + -- cgit v1.2.3