1 | {combine_script id='jquery.colorbox' load='footer' require='jquery' path='themes/default/js/plugins/jquery.colorbox.min.js'} |
---|
2 | {combine_css path="themes/default/js/plugins/colorbox/style2/colorbox.css"} |
---|
3 | {footer_script} |
---|
4 | jQuery("a.preview-box").colorbox({ldelim} |
---|
5 | rel: ".preview-box", |
---|
6 | title: function() {ldelim} |
---|
7 | var title = $(this).attr("title"); |
---|
8 | {if $F_ACTION} title+= ' · <a href="{$collection_toggle_url}&collection_toggle='+ $(this).data('id') +'" class="addCollection" data-id="'+ $(this).data('id') +'">{'Remove from collection'|@translate}</a>';{/if} |
---|
9 | title+= ' · <a href="'+ $(this).data('url') +'" target="_blank">{'jump to photo'|@translate} →</a>'; |
---|
10 | return title; |
---|
11 | } |
---|
12 | }); |
---|
13 | jQuery(document).on("click", "#cboxTitle .addCollection", function() {ldelim} |
---|
14 | jQuery.colorbox.close(); |
---|
15 | jQuery("#thumbnails a.addCollection[data-id='"+ $(this).data('id')+"']").trigger("click"); |
---|
16 | return false; |
---|
17 | }); |
---|
18 | {/footer_script} |
---|
19 | |
---|
20 | {if !empty($thumbnails)}{strip} |
---|
21 | {*define_derivative name='derivative_params' width=160 height=90 crop=true*} |
---|
22 | {html_style} |
---|
23 | {*Set some sizes according to maximum thumbnail width and height*} |
---|
24 | .thumbnails SPAN, |
---|
25 | .thumbnails .wrap2 A, |
---|
26 | .thumbnails LABEL{ldelim} |
---|
27 | width: {$derivative_params->max_width()+2}px; |
---|
28 | } |
---|
29 | |
---|
30 | .thumbnails .wrap2{ldelim} |
---|
31 | height: {$derivative_params->max_height()+3}px; |
---|
32 | } |
---|
33 | {if $derivative_params->max_width() > 600} |
---|
34 | .thumbLegend {ldelim}font-size: 130%} |
---|
35 | {else} |
---|
36 | {if $derivative_params->max_width() > 400} |
---|
37 | .thumbLegend {ldelim}font-size: 110%} |
---|
38 | {else} |
---|
39 | .thumbLegend {ldelim}font-size: 90%} |
---|
40 | {/if} |
---|
41 | {/if} |
---|
42 | {/html_style} |
---|
43 | {foreach from=$thumbnails item=thumbnail} |
---|
44 | {assign var=derivative value=$pwg->derivative($derivative_params, $thumbnail.src_image)} |
---|
45 | {if !$derivative->is_cached()} |
---|
46 | {combine_script id='jquery.ajaxmanager' path='themes/default/js/plugins/jquery.ajaxmanager.js' load='footer'} |
---|
47 | {combine_script id='thumbnails.loader' path='themes/default/js/thumbnails.loader.js' require='jquery.ajaxmanager' load='footer'} |
---|
48 | {/if} |
---|
49 | <li> |
---|
50 | <span class="wrap1"> |
---|
51 | <span class="wrap2"> |
---|
52 | <a href="{$thumbnail.FILE_SRC}" class="preview-box" title="{$thumbnail.NAME}" data-url="{$thumbnail.URL}" data-id="{$thumbnail.id}"> |
---|
53 | <img class="thumbnail" {if $derivative->is_cached()}src="{$derivative->get_url()}"{else}src="{$ROOT_URL}{$themeconf.img_dir}/ajax-loader-small.gif" data-src="{$derivative->get_url()}"{/if} alt="{$thumbnail.TN_ALT}" title="{$thumbnail.TN_TITLE}"> |
---|
54 | </a> |
---|
55 | </span> |
---|
56 | {if $SHOW_THUMBNAIL_CAPTION } |
---|
57 | <span class="thumbLegend"> |
---|
58 | <span class="thumbName">{$thumbnail.NAME}</span> |
---|
59 | {if !empty($thumbnail.icon_ts)} |
---|
60 | <img title="{$thumbnail.icon_ts.TITLE}" src="{$ROOT_URL}{$themeconf.icon_dir}/recent.png" alt="(!)"> |
---|
61 | {/if} |
---|
62 | {if isset($thumbnail.NB_COMMENTS)} |
---|
63 | <span class="{if 0==$thumbnail.NB_COMMENTS}zero {/if}nb-comments"> |
---|
64 | <br> |
---|
65 | {$pwg->l10n_dec('%d comment', '%d comments',$thumbnail.NB_COMMENTS)} |
---|
66 | </span> |
---|
67 | {/if} |
---|
68 | |
---|
69 | {if isset($thumbnail.NB_HITS)} |
---|
70 | <span class="{if 0==$thumbnail.NB_HITS}zero {/if}nb-hits"> |
---|
71 | <br> |
---|
72 | {$pwg->l10n_dec('%d hit', '%d hits',$thumbnail.NB_HITS)} |
---|
73 | </span> |
---|
74 | {/if} |
---|
75 | </span> |
---|
76 | {/if} |
---|
77 | </span> |
---|
78 | </li> |
---|
79 | {/foreach}{/strip} |
---|
80 | {/if} |
---|