summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio <silvio@socioambiental.org>2013-06-26 17:18:34 -0300
committerSilvio <silvio@socioambiental.org>2013-06-26 17:18:34 -0300
commitf4f5bfc0f8e4a482dad81fee5eea77cf03191991 (patch)
tree7a756dab63c9b86978dc495fe006e0e059c900cb
parent94de2d83f14a02a91596e464ff9f3a31e292d5f8 (diff)
downloadtimelinejs-f4f5bfc0f8e4a482dad81fee5eea77cf03191991.tar.gz
timelinejs-f4f5bfc0f8e4a482dad81fee5eea77cf03191991.tar.bz2
Fixing library path
-rw-r--r--timelinejs.module13
-rw-r--r--timelinejs.tpl.php2
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,
),
),
@@ -78,6 +78,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.
*/
function timelinejs_load_events($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: "<?php print $lang; ?>"
}
</script>
-<script type="text/javascript" src="/<?php print $library_path; ?>/compiled/js/timeline-embed.js"></script>
+ <script type="text/javascript" src="/<?php print $library_path; ?>/compiled/js/storyjs-embed.js"></script>
<!-- END Timeline Embed -->