1 | {if !empty($thumbnails)} |
---|
2 | {combine_script id='jquery.ajaxmanager' path='themes/default/js/plugins/jquery.ajaxmanager.js' load='footer'} |
---|
3 | {combine_script id='thumbnails.loader' path='themes/default/js/thumbnails.loader.js' require='jquery.ajaxmanager' load='footer'} |
---|
4 | <div id="gallery"></div> |
---|
5 | {footer_script} |
---|
6 | {literal} |
---|
7 | var data = [ |
---|
8 | {/literal}{foreach from=$thumbnails item=thumbnail name=thumb} |
---|
9 | {assign var=d_thumb value=$pwg->derivative($stripped.thumbSize, $thumbnail.src_image)} |
---|
10 | {assign var=d_image value=$pwg->derivative($stripped.imageSize, $thumbnail.src_image)} |
---|
11 | {if ($stripped.hdSize == 'original')} |
---|
12 | {assign var=d_hd value=$thumbnail.src_image} |
---|
13 | {else} |
---|
14 | {assign var=d_hd value=$pwg->derivative($stripped.hdSize, $thumbnail.src_image)} |
---|
15 | {/if} |
---|
16 | {literal} |
---|
17 | { |
---|
18 | thumb: '{/literal}{$d_thumb->get_url()}{literal}', |
---|
19 | image: '{/literal}{$d_image->get_url()}{literal}', |
---|
20 | big: '{/literal}{if (($thumbnail.HD_ACCESS) && ($strippedgalleria.lightbox == 'hd'))}{$d_hd->get_url()}{else}{$d_image->get_url()}{/if}{literal}', |
---|
21 | title: '{/literal}{$thumbnail.NAME|strip_tags:false|replace:'\'':'''|replace:'"':'"'|nl2br|regex_replace:"/[\r\n]/":""}{literal}', |
---|
22 | description: '{/literal}{$thumbnail.DESCRIPTION|strip_tags:false|replace:'\'':'''|replace:'"':'"'|nl2br|regex_replace:"/[\r\n]/":""}{literal}', |
---|
23 | piwigo_id: {/literal}{$thumbnail.id}{literal}, |
---|
24 | hd_access: {/literal}{if ($thumbnail.HD_ACCESS)}true{else}false{/if}{literal} |
---|
25 | }{/literal}{if (!$smarty.foreach.thumb.last)},{/if} |
---|
26 | {/foreach}{literal} |
---|
27 | ]; |
---|
28 | var Htotal=jQuery(window).height()-1; |
---|
29 | var Hheader=jQuery("#content").position().top; |
---|
30 | var Hfooter=jQuery("#footer").height(); |
---|
31 | var Hgallery = Htotal - Hheader - Hfooter - 2; |
---|
32 | jQuery("#gallery").galleria({ |
---|
33 | dataSource: data, |
---|
34 | height: Hgallery, |
---|
35 | lightbox:{/literal}{if ($strippedgalleria.lightbox != 'none')}true{else}false{/if}{literal}, |
---|
36 | clicknext:{/literal}{if ($strippedgalleria.clicknext)}true{else}false{/if}{literal}, |
---|
37 | transition:'{/literal}{$strippedgalleria.transition}{literal}', |
---|
38 | showCounter:false, |
---|
39 | imageTimeout:600000, |
---|
40 | maxScaleRatio:1, |
---|
41 | extend:function() { |
---|
42 | this.attachKeyboard({ |
---|
43 | left: this.prev, |
---|
44 | right: this.next |
---|
45 | }); |
---|
46 | this.bind("image", function(e) { |
---|
47 | var gid = e.index; |
---|
48 | var pid = this.getData(gid).piwigo_id; |
---|
49 | var hdaccess = this.getData(gid).hd_access; |
---|
50 | if (hdaccess) { |
---|
51 | jQuery("#downloadlink").show(); |
---|
52 | jQuery("#downloadlink").prop("href","action.php?id="+pid+"&part=e&download"); |
---|
53 | } else { |
---|
54 | jQuery("#downloadlink").hide(); |
---|
55 | } |
---|
56 | jQuery.post("{/literal}{$get_root_url}{literal}themes/stripped-galleria/save_history.php", { |
---|
57 | imgid: "img-"+pid, |
---|
58 | {/literal}{if !empty($catid)} catid: "{$catid}"{/if}{literal}, |
---|
59 | {/literal}{if !empty($section)} section: "{$section}"{/if}{literal}, |
---|
60 | {/literal}{if !empty($tagids)} tagids: "{$tagids}"{/if}{literal} |
---|
61 | }); |
---|
62 | }); |
---|
63 | this.bind("lightbox_image", function() { |
---|
64 | var image=jQuery("img",".galleria-lightbox-content"); |
---|
65 | image.css("width","100%"); |
---|
66 | image.css("height","100%"); |
---|
67 | var gid=parseInt(jQuery(".galleria-lightbox-counter").text())-1; |
---|
68 | var pid = this.getData(gid).piwigo_id; |
---|
69 | jQuery.post("{/literal}{$get_root_url}{literal}themes/stripped-galleria/save_history.php", { |
---|
70 | imgid: "img-"+pid, |
---|
71 | {/literal}{if !empty($catid)} catid: "{$catid}"{/if}{literal}, |
---|
72 | {/literal}{if !empty($section)} section: "{$section}"{/if}{literal}, |
---|
73 | {/literal}{if !empty($tagids)} tagids: "{$tagids}"{/if}{literal} |
---|
74 | }); |
---|
75 | }); |
---|
76 | } |
---|
77 | }); |
---|
78 | {/literal} |
---|
79 | {/footer_script} |
---|
80 | {/if} |
---|