summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 -->