Ignore:
Timestamp:
Sep 18, 2014, 1:27:14 PM (10 years ago)
Author:
JanisV
Message:

Code cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/Fotorama/template/slideshow.tpl

    r29615 r29621  
    22{combine_script id='fotorama' require='jquery' load='header' path='plugins/Fotorama/fotorama/fotorama.js'}
    33
    4 {literal}
    5 <script type="text/javascript">
    6 var image_w = {/literal}{$item_height}{literal}
    7 var image_h = {/literal}{$item_height}{literal}
     4<script>
     5var image_w = {$item_height};
     6var image_h = {$item_height};
    87</script>
    9 {/literal}
    108
    119<div id="slideshow">
     
    1311        <div class="browsePath">
    1412          {if isset($U_SLIDESHOW_STOP) }
    15                 [ <a href="{$U_SLIDESHOW_STOP}">{'stop the slideshow'|@translate}</a> ]
     13                [ <a href="{$U_SLIDESHOW_STOP}">{'stop the slideshow'|translate}</a> ]
    1614          {/if}
    1715          <h2 class="showtitle">{$current.TITLE}</h2>
     
    2725      <div class="fotorama" data-startindex="{$current_rank}" data-ratio="16/9" data-auto="false"
    2826        data-width="100%" data-maxheight="100%" data-minheight="200" data-height="{$item_height}"
    29         data-shadows="{if $Fotorama['shadows']}true{else}false{/if}" data-nav="{$Fotorama['nav']}" data-fit="{$Fotorama['fit']}"
    30         data-allowfullscreen="{$Fotorama['allowfullscreen']}" data-autoplay="{if $Fotorama['autoplay']}true{else}false{/if}"
    31         data-transition="{$Fotorama['transition']}" data-stopautoplayontouch="{if $Fotorama['stopautoplayontouch']}true{else}false{/if}"
    32         data-loop="{if $Fotorama['loop']}true{else}false{/if}" data-captions="false" data-thumbheight="{$Fotorama['thumbheight']}" data-thumbwidth="{$Fotorama['thumbheight']}">
     27        data-shadows="{if $Fotorama.shadows}true{else}false{/if}" data-nav="{$Fotorama.nav}" data-fit="{$Fotorama.fit}"
     28        data-allowfullscreen="{$Fotorama.allowfullscreen}" data-autoplay="{if $Fotorama.autoplay}true{else}false{/if}"
     29        data-transition="{$Fotorama.transition}" data-stopautoplayontouch="{if $Fotorama.stopautoplayontouch}true{else}false{/if}"
     30        data-loop="{if $Fotorama.loop}true{else}false{/if}" data-captions="false" data-thumbheight="{$Fotorama.thumbheight}" data-thumbwidth="{$Fotorama.thumbheight}">
    3331      {foreach from=$items item=thumbnail}
    34         <a href="{$thumbnail['derivative']->get_url()}"
    35           data-full="{$thumbnail['derivative_big']->get_url()}" data-url="{$thumbnail['url']}" data-caption="{$thumbnail['TITLE']}"
    36           {if $Fotorama['nav'] == 'thumbs' || $Fotorama['fullscreen_nav'] == 'thumbs'}data-thumb="{$thumbnail['derivative_thumb']->get_url()}"{/if}>
     32        <a href="{$thumbnail.derivative->get_url()}"
     33          data-full="{$thumbnail.derivative_big->get_url()}" data-url="{$thumbnail.url}" data-caption="{$thumbnail.TITLE}"
     34          {if $Fotorama.nav == 'thumbs' || $Fotorama.fullscreen_nav == 'thumbs'}data-thumb="{$thumbnail.derivative_thumb->get_url()}"{/if}>
    3735        </a>
    3836      {/foreach}
     
    4240</div>
    4341
    44 {footer_script require='jquery'}{literal}
     42{footer_script require='jquery'}
    4543  var fullscreen = false;
    4644  jQuery().ready(function() {
     
    5048            function (e, fotorama, extra) {
    5149              if (!fullscreen) {
    52                 {/literal}{if isset($replace_picture)}{literal}
     50                {if isset($replace_picture)}
    5351                history.replaceState(null, null, fotorama.activeFrame['url']);
    54                 {/literal}{else}{literal}
     52                {else}
    5553                history.replaceState(null, null, fotorama.activeFrame['url']+'&slideshow=');
    5654                jQuery('#slideshow .browsePath a').attr('href', fotorama.activeFrame['url']);
    57                 {/literal}{/if}{literal}
     55                {/if}
    5856
    5957                jQuery('#slideshow .showtitle').text(fotorama.activeFrame['caption']);
    60                 jQuery('#slideshow .imageNumber').text((fotorama.activeFrame['i'])+'/'+{/literal}{count($items)}{literal});
    61                 document.title = fotorama.activeFrame['caption'] + ' | {/literal}{$GALLERY_TITLE|@escape:javascript}{literal}';
     58                jQuery('#slideshow .imageNumber').text((fotorama.activeFrame['i'])+'/{count($items)}');
     59                document.title = fotorama.activeFrame['caption'] + ' | {$GALLERY_TITLE|escape:javascript}';
    6260              }
    6361            }
     
    6664            function (e, fotorama, extra) {
    6765              fotorama.setOptions({
    68                 nav: "{/literal}{$Fotorama['fullscreen_nav']}{literal}",
    69                 {/literal}{if $Fotorama['enable_caption']}{literal}
     66                nav: "{$Fotorama.fullscreen_nav}",
     67                {if $Fotorama.enable_caption}
    7068                captions: "true",
    71                 {/literal}{/if}{literal}
     69                {/if}
    7270              });
    7371              fotorama.startAutoplay();
     
    7977        .on('fotorama:fullscreenexit',
    8078            function (e, fotorama, extra) {
    81               {/literal}{if $Fotorama['only_fullscreen']}{literal}
     79              {if $Fotorama.only_fullscreen}
    8280              window.location.replace(fotorama.activeFrame['url']);
    83               {/literal}{else}{literal}
     81              {else}
    8482
    8583              fotorama.setOptions({
    86                 nav: "{/literal}{$Fotorama['nav']}{literal}",
    87                 {/literal}{if $Fotorama['enable_caption']}{literal}
     84                nav: "{$Fotorama.nav}",
     85                {if $Fotorama.enable_caption}
    8886                captions: "false",
    89                 {/literal}{/if}{literal}
     87                {/if}
    9088              });
    9189
    92               {/literal}{if isset($replace_picture)}{literal}
     90              {if isset($replace_picture)}
    9391              history.replaceState(null, null, fotorama.activeFrame['url']);
    94               {/literal}{else}{literal}
     92              {else}
    9593              history.replaceState(null, null, fotorama.activeFrame['url']+'&slideshow=');
    9694              jQuery('#slideshow .browsePath a').attr('href', fotorama.activeFrame['url']);
    97               {/literal}{/if}{literal}
     95              {/if}
    9896
    9997              jQuery('#slideshow .showtitle').text(fotorama.activeFrame['caption']);
    100               jQuery('#slideshow .imageNumber').text((fotorama.activeFrame['i'])+'/'+{/literal}{count($items)}{literal});
    101               document.title = fotorama.activeFrame['caption'] + ' | {/literal}{$GALLERY_TITLE|@escape:javascript}{literal}';
     98              jQuery('#slideshow .imageNumber').text((fotorama.activeFrame['i'])+'/{count($items)}');
     99              document.title = fotorama.activeFrame['caption'] + ' | {$GALLERY_TITLE|escape:javascript}';
    102100
    103101              fullscreen = false;
    104               {/literal}{/if}{literal}
     102              {/if}
    105103            }
    106104        )
     
    108106        .fotorama();
    109107     
    110       {/literal}{if $Fotorama['only_fullscreen']}{literal}
     108      {if $Fotorama.only_fullscreen}
    111109      jQuery('.fotorama').data('fotorama').requestFullScreen();
    112       {/literal}{/if}{literal}
     110      {/if}
    113111  });
    114 {/literal}{/footer_script}
     112{/footer_script}
Note: See TracChangeset for help on using the changeset viewer.