summaryrefslogtreecommitdiff
path: root/timelinejs.tpl.php
blob: 7fef98da7d721d1de5a6515da2517ae862e08234 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<!-- BEGIN Timeline Embed -->
<div id="timeline-embed" style="width:<?print $width; ?>; height: <?php print $height; ?>;"></div>
<script type="text/javascript">
  var timeline_config = {
      width:         "<?php print $width; ?>",
      height:        "<?php print $height; ?>",
      source:        "<?php print $source; ?>",
      start_at_end:   <?php print $start_at_end; ?>,
      hash_bookmark:  <?php print $hash_bookmark; ?>,
      css:           "<?php print $css; ?>",
      js:            "<?php print $js; ?>",
      font:          "<?php print $font; ?>",
      lang:          "<?php print $lang; ?>"
  }

  // Used to open links in the parent iframe when showing as a widget
  function MakeMenuLinksOpenInNewWindow() {
      var links = document.getElementsByTagName("a");
      for (var i = 0; i < links.length; i++) {
          if (links[i].protocol + '//' + links[i].hostname != "<?php global $base_url; print $base_url; ?>") {
            links[i].target = "_parent";
          }
          // FIXME
          //console.log(links[i].protocol + '//' + links[i].hostname + ' <?php print $base_url; ?>');
      }
  }

  if (typeof(timelineWidget) != "undefined" && timelineWidget == true) {
    MakeMenuLinksOpenInNewWindow();
  }
</script>
<script type="text/javascript" src="/<?php print $library_path; ?>/compiled/js/storyjs-embed.js"></script>
<!-- END Timeline Embed -->