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

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

Fixed processing question_mark_in_urls

  • Property svn:executable set to *
File size: 6.0 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{if $Fotorama.info_button}
8{combine_css path="plugins/Fotorama/template/info_button.css"}
9{/if}
10
11<div class="fotorama" data-startindex="{$current_rank}" data-ratio="16/9" data-auto="false"
12  data-width="100%" data-maxheight="100%" data-minheight="200" data-height="{$item_height}"
13  data-shadows="{if $Fotorama.shadows}true{else}false{/if}" data-nav="{$Fotorama.nav}" data-fit="{$Fotorama.fit}"
14  data-allowfullscreen="{$Fotorama.allowfullscreen}" data-autoplay="{if $Fotorama.autoplay}{$Fotorama.period}{else}false{/if}"
15  data-transition="{$Fotorama.transition}" data-stopautoplayontouch="{if $Fotorama.stopautoplayontouch}true{else}false{/if}"
16  data-loop="{if $Fotorama.loop}true{else}false{/if}" data-captions="false" data-thumbheight="{$Fotorama.thumbheight}"
17  data-thumbwidth="{$Fotorama.thumbheight}"{if $Fotorama.clicktransition_crossfade} data-clicktransition="crossfade"{/if}
18  data-keyboard="true">
19</div>
20
21{if isset($U_SLIDESHOW_STOP)}
22<a href="{$U_SLIDESHOW_STOP}" class="fotorama__close-icon"></a>
23{/if}
24<a class="fotorama__info-icon"></a>
25
26{footer_script require='jquery'}
27  window.blockFotoramaData = true;
28
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']+(fotorama.activeFrame['url'].indexOf('?')==-1 ? '?' : '&')+'slideshow=');
40                jQuery('#slideshow .browsePath a').attr('href', fotorama.activeFrame['url']);
41                {/if}
42
43                jQuery('a.fotorama__info-icon').attr('href', fotorama.activeFrame['url']+(fotorama.activeFrame['url'].indexOf('?')==-1 ? '?' : '&')+'slidestop=');
44
45                jQuery('#slideshow .showtitle').text(fotorama.activeFrame['caption']);
46                jQuery('#slideshow .imageNumber').text((fotorama.activeFrame['i'])+'/{count($items)}');
47                document.title = fotorama.activeFrame['caption'] + ' | {$GALLERY_TITLE|escape:javascript}';
48              }
49            }
50        )
51        .on('fotorama:fullscreenenter',
52            function (e, fotorama, extra) {
53              fotorama.setOptions({
54                nav: "{$Fotorama.fullscreen_nav}",
55                {if $Fotorama.enable_caption}
56                captions: "true",
57                {/if}
58              });
59              {if $Fotorama.autoplay}
60              fotorama.startAutoplay();
61              {/if}
62
63              if (jQuery('.fotorama').attr('data-allowfullscreen') == 'native')
64                fullscreen = true;
65            }
66        )
67        .on('fotorama:fullscreenexit',
68            function (e, fotorama, extra) {
69              {if $Fotorama.only_fullscreen}
70              {if isset($replace_picture)}
71              window.location.replace('{$U_SLIDESHOW_STOP}');
72              {else}
73              window.location.replace(fotorama.activeFrame['url']);
74              {/if}
75              {else}
76
77              fotorama.setOptions({
78                nav: "{$Fotorama.nav}",
79                {if $Fotorama.enable_caption}
80                captions: "false",
81                {/if}
82              });
83
84              {if isset($replace_picture)}
85              history.replaceState(null, null, fotorama.activeFrame['url']);
86              {else}
87              history.replaceState(null, null, fotorama.activeFrame['url']+(fotorama.activeFrame['url'].indexOf('?')==-1 ? '?' : '&')+'slideshow=');
88              jQuery('#slideshow .browsePath a').attr('href', fotorama.activeFrame['url']);
89              {/if}
90
91              jQuery('#slideshow .showtitle').text(fotorama.activeFrame['caption']);
92              jQuery('#slideshow .imageNumber').text((fotorama.activeFrame['i'])+'/{count($items)}');
93              document.title = fotorama.activeFrame['caption'] + ' | {$GALLERY_TITLE|escape:javascript}';
94
95              fullscreen = false;
96              {/if}
97            }
98        )
99        // Initialize fotorama manually
100        .fotorama({
101          data: [
102{foreach from=$items item=thumbnail}
103{
104caption: "{$thumbnail.TITLE|escape:javascript}",
105full: "{str_replace('&amp;', '&', $thumbnail.derivative_big->get_url())}",
106img: "{str_replace('&amp;', '&', $thumbnail.derivative->get_url())}",
107{if $Fotorama_has_thumbs}
108thumb: "{$thumbnail.derivative_thumb->get_url()}",
109{assign var=thumb_size value=$thumbnail.derivative_thumb->get_size()}
110thumbratio: {$thumb_size[0]/$thumb_size[1]},
111{/if}
112url: "{$thumbnail.url}"
113},{/foreach}
114          ]
115        });
116
117    {if $Fotorama.only_fullscreen}
118    jQuery('.fotorama').data('fotorama').requestFullScreen();
119    {else}
120      {if $Fotorama.resize}
121      jQuery('.fotorama').data('fotorama').resize({
122        height: jQuery(window).height()
123      });
124      jQuery('html,body').animate({ scrollTop: jQuery('.fotorama').offset().top }, 'slow');
125      {/if}
126    {/if}
127 
128  });
129
130  {if $Fotorama.close_button}
131  jQuery('.fotorama').on('fotorama:ready', function (e, fotorama) {
132    jQuery('.fotorama__close-icon').detach().insertAfter('.fotorama__fullscreen-icon');
133  });
134  {/if}
135  {if $Fotorama.info_button}
136  jQuery('.fotorama').on('fotorama:ready', function (e, fotorama) {
137    jQuery('.fotorama__info-icon').detach().insertAfter('.fotorama__fullscreen-icon');
138  });
139  {/if}
140 
141  {if $Fotorama.autoplay}
142  $(document).keypress(function(e) {
143    if(e.which == 43) {
144      jQuery('.fotorama').data('fotorama').setOptions({
145        autoplay: jQuery('.fotorama').data('fotorama').options['autoplay'] * 1.4
146      });
147    }
148    if(e.which == 45) {
149      jQuery('.fotorama').data('fotorama').setOptions({
150        autoplay: jQuery('.fotorama').data('fotorama').options['autoplay'] / 1.4
151      });
152    }
153  });
154  {/if}
155{/footer_script}
Note: See TracBrowser for help on using the repository browser.