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

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

Added option for resizing

  • 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              fotorama.startAutoplay();
58
59              if (jQuery('.fotorama').attr('data-allowfullscreen') == 'native')
60                fullscreen = true;
61            }
62        )
63        .on('fotorama:fullscreenexit',
64            function (e, fotorama, extra) {
65              {if $Fotorama.only_fullscreen}
66              {if isset($replace_picture)}
67              window.location.replace('{$U_SLIDESHOW_STOP}');
68              {else}
69              window.location.replace(fotorama.activeFrame['url']);
70              {/if}
71              {else}
72
73              fotorama.setOptions({
74                nav: "{$Fotorama.nav}",
75                {if $Fotorama.enable_caption}
76                captions: "false",
77                {/if}
78              });
79
80              {if isset($replace_picture)}
81              history.replaceState(null, null, fotorama.activeFrame['url']);
82              {else}
83              history.replaceState(null, null, fotorama.activeFrame['url']+'&slideshow=');
84              jQuery('#slideshow .browsePath a').attr('href', fotorama.activeFrame['url']);
85              {/if}
86
87              jQuery('#slideshow .showtitle').text(fotorama.activeFrame['caption']);
88              jQuery('#slideshow .imageNumber').text((fotorama.activeFrame['i'])+'/{count($items)}');
89              document.title = fotorama.activeFrame['caption'] + ' | {$GALLERY_TITLE|escape:javascript}';
90
91              fullscreen = false;
92              {/if}
93            }
94        )
95        // Initialize fotorama manually
96        .fotorama();
97
98    {if $Fotorama.only_fullscreen}
99    jQuery('.fotorama').data('fotorama').requestFullScreen();
100    {else}
101      {if $Fotorama.resize}
102      jQuery('.fotorama').data('fotorama').resize({
103        height: jQuery(window).height()
104      });
105      jQuery('html,body').animate({ scrollTop: jQuery('.fotorama').offset().top }, 'slow');
106      {/if}
107    {/if}
108 
109  });
110
111  {if $Fotorama.close_button}
112  jQuery('.fotorama').on('fotorama:ready', function (e, fotorama) {
113    jQuery('.fotorama__close-icon').detach().insertAfter('.fotorama__fullscreen-icon');
114  });
115  {/if}
116{/footer_script}
Note: See TracBrowser for help on using the repository browser.