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 | <div class="fotorama" data-startindex="{$current_rank}" data-ratio="16/9" data-auto="false" |
---|
5 | data-width="100%" data-maxheight="100%" data-minheight="200" data-height="{$item_height}" |
---|
6 | data-shadows="{if $Fotorama.shadows}true{else}false{/if}" data-nav="{$Fotorama.nav}" data-fit="{$Fotorama.fit}" |
---|
7 | data-allowfullscreen="{$Fotorama.allowfullscreen}" data-autoplay="{if $Fotorama.autoplay}true{else}false{/if}" |
---|
8 | data-transition="{$Fotorama.transition}" data-stopautoplayontouch="{if $Fotorama.stopautoplayontouch}true{else}false{/if}" |
---|
9 | data-loop="{if $Fotorama.loop}true{else}false{/if}" data-captions="false" data-thumbheight="{$Fotorama.thumbheight}" |
---|
10 | data-thumbwidth="{$Fotorama.thumbheight}"{if $Fotorama.clicktransition_crossfade} data-clicktransition="crossfade"{/if} |
---|
11 | data-keyboard="true"> |
---|
12 | {foreach from=$items item=thumbnail} |
---|
13 | <a href="{$thumbnail.derivative->get_url()}" |
---|
14 | data-full="{$thumbnail.derivative_big->get_url()}" data-url="{$thumbnail.url}" data-caption="{$thumbnail.TITLE}" |
---|
15 | {if $Fotorama.nav == 'thumbs' || $Fotorama.fullscreen_nav == 'thumbs'}data-thumb="{$thumbnail.derivative_thumb->get_url()}"{/if}> |
---|
16 | </a> |
---|
17 | {/foreach} |
---|
18 | </div> |
---|
19 | |
---|
20 | {footer_script require='jquery'} |
---|
21 | var fullscreen = false; |
---|
22 | jQuery().ready(function() { |
---|
23 | jQuery('.fotorama') |
---|
24 | // Listen to the events |
---|
25 | .on('fotorama:showend ', |
---|
26 | function (e, fotorama, extra) { |
---|
27 | if (!fullscreen) { |
---|
28 | {if isset($replace_picture)} |
---|
29 | history.replaceState(null, null, fotorama.activeFrame['url']); |
---|
30 | {else} |
---|
31 | history.replaceState(null, null, fotorama.activeFrame['url']+'&slideshow='); |
---|
32 | jQuery('#slideshow .browsePath a').attr('href', fotorama.activeFrame['url']); |
---|
33 | {/if} |
---|
34 | |
---|
35 | jQuery('#slideshow .showtitle').text(fotorama.activeFrame['caption']); |
---|
36 | jQuery('#slideshow .imageNumber').text((fotorama.activeFrame['i'])+'/{count($items)}'); |
---|
37 | document.title = fotorama.activeFrame['caption'] + ' | {$GALLERY_TITLE|escape:javascript}'; |
---|
38 | } |
---|
39 | } |
---|
40 | ) |
---|
41 | .on('fotorama:fullscreenenter', |
---|
42 | function (e, fotorama, extra) { |
---|
43 | fotorama.setOptions({ |
---|
44 | nav: "{$Fotorama.fullscreen_nav}", |
---|
45 | {if $Fotorama.enable_caption} |
---|
46 | captions: "true", |
---|
47 | {/if} |
---|
48 | }); |
---|
49 | fotorama.startAutoplay(); |
---|
50 | |
---|
51 | if (jQuery('.fotorama').attr('data-allowfullscreen') == 'native') |
---|
52 | fullscreen = true; |
---|
53 | } |
---|
54 | ) |
---|
55 | .on('fotorama:fullscreenexit', |
---|
56 | function (e, fotorama, extra) { |
---|
57 | {if $Fotorama.only_fullscreen} |
---|
58 | {if isset($replace_picture)} |
---|
59 | window.location.replace('{$U_SLIDESHOW_STOP}'); |
---|
60 | {else} |
---|
61 | window.location.replace(fotorama.activeFrame['url']); |
---|
62 | {/if} |
---|
63 | {else} |
---|
64 | |
---|
65 | fotorama.setOptions({ |
---|
66 | nav: "{$Fotorama.nav}", |
---|
67 | {if $Fotorama.enable_caption} |
---|
68 | captions: "false", |
---|
69 | {/if} |
---|
70 | }); |
---|
71 | |
---|
72 | {if isset($replace_picture)} |
---|
73 | history.replaceState(null, null, fotorama.activeFrame['url']); |
---|
74 | {else} |
---|
75 | history.replaceState(null, null, fotorama.activeFrame['url']+'&slideshow='); |
---|
76 | jQuery('#slideshow .browsePath a').attr('href', fotorama.activeFrame['url']); |
---|
77 | {/if} |
---|
78 | |
---|
79 | jQuery('#slideshow .showtitle').text(fotorama.activeFrame['caption']); |
---|
80 | jQuery('#slideshow .imageNumber').text((fotorama.activeFrame['i'])+'/{count($items)}'); |
---|
81 | document.title = fotorama.activeFrame['caption'] + ' | {$GALLERY_TITLE|escape:javascript}'; |
---|
82 | |
---|
83 | fullscreen = false; |
---|
84 | {/if} |
---|
85 | } |
---|
86 | ) |
---|
87 | // Initialize fotorama manually |
---|
88 | .fotorama(); |
---|
89 | |
---|
90 | {if $Fotorama.only_fullscreen} |
---|
91 | jQuery('.fotorama').data('fotorama').requestFullScreen(); |
---|
92 | {/if} |
---|
93 | }); |
---|
94 | {/footer_script} |
---|