source: extensions/ExtendedDescription/template/slider.tpl @ 26968

Revision 26968, 3.5 KB checked in by Eric, 6 years ago (diff)

Fix elseif syntax error

Line 
1{combine_script id='jquery.nivo.slider' path=$EXTENDED_DESC_PATH|cat:'template/nivoslider/jquery.nivo.slider.pack.js' require='jquery' load='footer'}
2{combine_css id='nivoslider' path=$EXTENDED_DESC_PATH|cat:'template/nivoslider/nivo-slider.css'}
3{combine_css id='nivoslider_theme' path=$EXTENDED_DESC_PATH|cat:'template/nivoslider/default.css'}
4
5{html_style}
6#slider{$SLIDER.id} {ldelim} margin:0 auto; }
7#slider{$SLIDER.id} .nivoSlider img {ldelim} border:none !important; }
8#slider{$SLIDER.id} .nivo-controlNav.nivo-thumbs-enabled img {ldelim}
9  width: {$SLIDER.thumbs_size}px; height: {$SLIDER.thumbs_size}px;
10}
11{/html_style}
12
13{if $SLIDER.elastic}
14{assign var=slider_full_height value=0}
15{else}
16{assign var=slider_full_height value=$SLIDER.img_size.h}
17{/if}
18{assign var=slider_full_width value=0}
19
20<div id="slider{$SLIDER.id}" class="slider-wrapper theme-default">
21  <div class="nivoSlider">
22  {foreach from=$SLIDER.elements item=thumbnail name=slider}{strip}
23    {assign var=derivative value=$pwg->derivative($SLIDER.derivative_params, $thumbnail.src_image)}
24    {if $SLIDER.control_thumbs}{assign var=derivative_thumb value=$pwg->derivative_url($SLIDER.derivative_params_thumb, $thumbnail.src_image)}{/if}
25    {if !$derivative->is_cached()}
26      {combine_script id='jquery.ajaxmanager' path='themes/default/js/plugins/jquery.ajaxmanager.js' load='footer'}
27      {combine_script id='thumbnails.loader' path='themes/default/js/thumbnails.loader.js' require='jquery.ajaxmanager' load='footer'}
28    {/if}
29
30    <img {if $derivative->is_cached()}src="{$derivative->get_url()}"{else}src="" data-src="{$derivative->get_url()}"{/if} alt="{$thumbnail.TN_ALT}" {$derivative->get_size_htm()} {if $show_title}title="<a href='{$thumbnail.URL}'>{$thumbnail.NAME|replace:'"':"'"}</a>"{/if} {if $SLIDER.control_thumbs}data-thumb="{$derivative_thumb}"{/if}>
31
32    {assign var=derivative_size value=$derivative->get_size()}
33    {math assign=slider_full_width equation="max(x,y)" x=$slider_full_width y=$derivative_size[0]}
34    {if $SLIDER.elastic}
35      {math assign=slider_full_height equation="max(x,y)" x=$slider_full_height y=$derivative_size[1]}
36    {else}
37      {math assign=slider_full_height equation="min(x,y)" x=$slider_full_height y=$derivative_size[1]}
38    {/if}
39    {if $smarty.foreach.slider.first}
40      {assign var=slider_init_width value=$derivative_size[0]}
41      {assign var=slider_init_height value=$derivative_size[1]}
42    {/if}
43  {/strip}
44  {/foreach}
45  </div>
46</div>
47
48{footer_script require='jquery.nivo.slider'}
49(function($){ldelim}
50  var $slider = $("#slider{$SLIDER.id} .nivoSlider");
51
52  $slider.nivoSlider({ldelim}
53    pauseTime: {$SLIDER.speed}*1000,
54    animSpeed: {$SLIDER.speed}*1000/6,
55    effect: '{$SLIDER.effect}',
56    directionNav: {if $SLIDER.arrows}true{else}false{/if},{*intval($SLIDER.arrows)*}
57    controlNav: {if $SLIDER.control}true{else}false{/if},{*intval($SLIDER.control)*}
58    controlNavThumbs: {if $SLIDER.control_thumbs}true{else}false{/if},{*intval($SLIDER.control_thumbs)*}
59    beforeChange: function() {ldelim}
60      if ($slider.data('nivo:vars').currentImage.attr('src') == "") {ldelim}
61        return false;
62      }
63      {if $SLIDER.elastic}
64      $slider.css({ldelim} height: 'auto' });
65      {/if}
66    }
67  });
68
69  $slider.parent().css({ldelim}
70    height: {$slider_full_height}{if $SLIDER.control_thumbs}+20+{$SLIDER.thumbs_size}{elseif $SLIDER.control}+40{/if},
71    width: {$slider_full_width}
72  });
73  $slider.css({ldelim}
74    height: {if $SLIDER.elastic}{$slider_init_height}{else}{$slider_full_height}{/if},
75    width: {$slider_init_width}
76  });
77}(jQuery));
78{/footer_script}
Note: See TracBrowser for help on using the repository browser.