source: extensions/Fotorama/template/slideshow.tpl @ 29622

Last change on this file since 29622 was 29622, checked in by JanisV, 10 years ago

Added option for clicktransition=crossfade

File size: 4.5 KB
Line 
1{combine_css path="plugins/Fotorama/fotorama/fotorama.css"}
2{combine_script id='fotorama' require='jquery' load='header' path='plugins/Fotorama/fotorama/fotorama.js'}
3
4<script>
5var image_w = {$item_height};
6var image_h = {$item_height};
7</script>
8
9<div id="slideshow">
10  <div id="imageHeaderBar">
11        <div class="browsePath">
12          {if isset($U_SLIDESHOW_STOP) }
13                [ <a href="{$U_SLIDESHOW_STOP}">{'stop the slideshow'|translate}</a> ]
14          {/if}
15          <h2 class="showtitle">{$current.TITLE}</h2>
16        </div>
17  </div>
18
19  <div id="imageToolBar">
20        <div class="imageNumber">{$PHOTO}</div>
21  </div>
22
23  <div id="content">
24        <div id="theImage">
25      <div class="fotorama" data-startindex="{$current_rank}" data-ratio="16/9" data-auto="false"
26        data-width="100%" data-maxheight="100%" data-minheight="200" data-height="{$item_height}"
27        data-shadows="{if $Fotorama.shadows}true{else}false{/if}" data-nav="{$Fotorama.nav}" data-fit="{$Fotorama.fit}"
28        data-allowfullscreen="{$Fotorama.allowfullscreen}" data-autoplay="{if $Fotorama.autoplay}true{else}false{/if}"
29        data-transition="{$Fotorama.transition}" data-stopautoplayontouch="{if $Fotorama.stopautoplayontouch}true{else}false{/if}"
30        data-loop="{if $Fotorama.loop}true{else}false{/if}" data-captions="false" data-thumbheight="{$Fotorama.thumbheight}"
31        data-thumbwidth="{$Fotorama.thumbheight}"{if $Fotorama.clicktransition_crossfade} data-clicktransition="crossfade"{/if}>
32      {foreach from=$items item=thumbnail}
33        <a href="{$thumbnail.derivative->get_url()}"
34          data-full="{$thumbnail.derivative_big->get_url()}" data-url="{$thumbnail.url}" data-caption="{$thumbnail.TITLE}"
35          {if $Fotorama.nav == 'thumbs' || $Fotorama.fullscreen_nav == 'thumbs'}data-thumb="{$thumbnail.derivative_thumb->get_url()}"{/if}>
36        </a>
37      {/foreach}
38      </div>
39        </div>
40  </div>
41</div>
42
43{footer_script require='jquery'}
44  var fullscreen = false;
45  jQuery().ready(function() {
46    jQuery('.fotorama')
47        // Listen to the events
48        .on('fotorama:showend ',
49            function (e, fotorama, extra) {
50              if (!fullscreen) {
51                {if isset($replace_picture)}
52                history.replaceState(null, null, fotorama.activeFrame['url']);
53                {else}
54                history.replaceState(null, null, fotorama.activeFrame['url']+'&slideshow=');
55                jQuery('#slideshow .browsePath a').attr('href', fotorama.activeFrame['url']);
56                {/if}
57
58                jQuery('#slideshow .showtitle').text(fotorama.activeFrame['caption']);
59                jQuery('#slideshow .imageNumber').text((fotorama.activeFrame['i'])+'/{count($items)}');
60                document.title = fotorama.activeFrame['caption'] + ' | {$GALLERY_TITLE|escape:javascript}';
61              }
62            }
63        )
64        .on('fotorama:fullscreenenter',
65            function (e, fotorama, extra) {
66              fotorama.setOptions({
67                nav: "{$Fotorama.fullscreen_nav}",
68                {if $Fotorama.enable_caption}
69                captions: "true",
70                {/if}
71              });
72              fotorama.startAutoplay();
73
74              if (jQuery('.fotorama').attr('data-allowfullscreen') == 'native')
75                fullscreen = true;
76            }
77        )
78        .on('fotorama:fullscreenexit',
79            function (e, fotorama, extra) {
80              {if $Fotorama.only_fullscreen}
81              window.location.replace(fotorama.activeFrame['url']);
82              {else}
83
84              fotorama.setOptions({
85                nav: "{$Fotorama.nav}",
86                {if $Fotorama.enable_caption}
87                captions: "false",
88                {/if}
89              });
90
91              {if isset($replace_picture)}
92              history.replaceState(null, null, fotorama.activeFrame['url']);
93              {else}
94              history.replaceState(null, null, fotorama.activeFrame['url']+'&slideshow=');
95              jQuery('#slideshow .browsePath a').attr('href', fotorama.activeFrame['url']);
96              {/if}
97
98              jQuery('#slideshow .showtitle').text(fotorama.activeFrame['caption']);
99              jQuery('#slideshow .imageNumber').text((fotorama.activeFrame['i'])+'/{count($items)}');
100              document.title = fotorama.activeFrame['caption'] + ' | {$GALLERY_TITLE|escape:javascript}';
101
102              fullscreen = false;
103              {/if}
104            }
105        )
106        // Initialize fotorama manually
107        .fotorama();
108     
109      {if $Fotorama.only_fullscreen}
110      jQuery('.fotorama').data('fotorama').requestFullScreen();
111      {/if}
112  });
113{/footer_script}
Note: See TracBrowser for help on using the repository browser.