source: extensions/Fotorama/template/fotorama-content.tpl @ 29914

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

Fixed autoplay when disabled

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