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

Code cleanup

Location:
extensions/Fotorama/template
Files:
2 edited

Legend:

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

    r29615 r29621  
    66
    77<fieldset id="Fotorama">
    8 <legend>{'Configuration'|@translate}</legend>
     8<legend>{'Configuration'|translate}</legend>
    99<ul>
    1010  <li>
    1111    <label for="allowfullscreen">
    12       <b>{'Allows fullscreen'|@translate}</b>
     12      <b>{'Allows fullscreen'|translate}</b>
    1313    </label>
    1414    <select class="categoryDropDown" id="allowfullscreen" name="allowfullscreen">
    15       <option value="false"{if $Fotorama.allowfullscreen == 'false'} selected{/if}>{'false'|@translate}</option>
    16       <option value="true"{if $Fotorama.allowfullscreen == 'true'} selected{/if}>{'true'|@translate}</option>
    17       <option value="native"{if $Fotorama.allowfullscreen == 'native'} selected{/if}>{'native'|@translate}</option>
     15      <option value="false"{if $Fotorama.allowfullscreen == 'false'} selected{/if}>{'false'|translate}</option>
     16      <option value="true"{if $Fotorama.allowfullscreen == 'true'} selected{/if}>{'true'|translate}</option>
     17      <option value="native"{if $Fotorama.allowfullscreen == 'native'} selected{/if}>{'native'|translate}</option>
    1818    </select>
    1919  </li>
     
    2121    <input type="checkbox" id="only_fullscreen" name="only_fullscreen"{if $Fotorama.only_fullscreen} checked="checked"{/if}>
    2222    <label for="only_fullscreen">
    23       <b>{'Only fullscreen mode'|@translate}</b>
     23      <b>{'Only fullscreen mode'|translate}</b>
    2424    </label>
    2525  </li>
    2626  <li>
    2727    <label for="fit">
    28       <b>{'How to fit an image'|@translate}</b>
     28      <b>{'How to fit an image'|translate}</b>
    2929    </label>
    3030    <select class="categoryDropDown" id="fit" name="fit">
    31       <option value="contain"{if $Fotorama.fit == 'contain'} selected{/if}>{'contain'|@translate}</option>
    32       <option value="cover"{if $Fotorama.fit == 'cover'} selected{/if}>{'cover'|@translate}</option>
    33       <option value="scaledown"{if $Fotorama.fit == 'scaledown'} selected{/if}>{'scaledown'|@translate}</option>
    34       <option value="none"{if $Fotorama.fit == 'none'} selected{/if}>{'none'|@translate}</option>
     31      <option value="contain"{if $Fotorama.fit == 'contain'} selected{/if}>{'contain'|translate}</option>
     32      <option value="cover"{if $Fotorama.fit == 'cover'} selected{/if}>{'cover'|translate}</option>
     33      <option value="scaledown"{if $Fotorama.fit == 'scaledown'} selected{/if}>{'scaledown'|translate}</option>
     34      <option value="none"{if $Fotorama.fit == 'none'} selected{/if}>{'none'|translate}</option>
    3535    </select>
    3636  </li>
    3737  <li>
    3838    <label for="transition">
    39       <b>{'What transition to use'|@translate}</b>
     39      <b>{'What transition to use'|translate}</b>
    4040    </label>
    4141    <select class="categoryDropDown" id="transition" name="transition">
    42       <option value="slide"{if $Fotorama.transition == 'slide'} selected{/if}>{'slide'|@translate}</option>
    43       <option value="crossfade"{if $Fotorama.transition == 'crossfade'} selected{/if}>{'crossfade'|@translate}</option>
    44       <option value="dissolve"{if $Fotorama.transition == 'dissolve'} selected{/if}>{'dissolve'|@translate}</option>
     42      <option value="slide"{if $Fotorama.transition == 'slide'} selected{/if}>{'slide'|translate}</option>
     43      <option value="crossfade"{if $Fotorama.transition == 'crossfade'} selected{/if}>{'crossfade'|translate}</option>
     44      <option value="dissolve"{if $Fotorama.transition == 'dissolve'} selected{/if}>{'dissolve'|translate}</option>
    4545    </select>
    4646  </li>
    4747  <li>
    4848    <label for="nav">
    49       <b>{'Navigation style'|@translate}</b>
     49      <b>{'Navigation style'|translate}</b>
    5050    </label>
    5151    <select class="categoryDropDown" id="nav" name="nav">
    52       <option value="false"{if $Fotorama.nav == 'false'} selected{/if}>{'false'|@translate}</option>
    53       <option value="dots"{if $Fotorama.nav == 'dots'} selected{/if}>{'dots'|@translate}</option>
    54       <option value="thumbs"{if $Fotorama.nav == 'thumbs'} selected{/if}>{'thumbs'|@translate}</option>
     52      <option value="false"{if $Fotorama.nav == 'false'} selected{/if}>{'false'|translate}</option>
     53      <option value="dots"{if $Fotorama.nav == 'dots'} selected{/if}>{'dots'|translate}</option>
     54      <option value="thumbs"{if $Fotorama.nav == 'thumbs'} selected{/if}>{'thumbs'|translate}</option>
    5555    </select>
    5656  </li>
    5757  <li>
    5858    <label for="fullscreen_nav">
    59       <b>{'Fullscreen navigation style'|@translate}</b>
     59      <b>{'Fullscreen navigation style'|translate}</b>
    6060    </label>
    6161    <select class="categoryDropDown" id="fullscreen_nav" name="fullscreen_nav">
    62       <option value="false"{if $Fotorama.fullscreen_nav == 'false'} selected{/if}>{'false'|@translate}</option>
    63       <option value="dots"{if $Fotorama.fullscreen_nav == 'dots'} selected{/if}>{'dots'|@translate}</option>
    64       <option value="thumbs"{if $Fotorama.fullscreen_nav == 'thumbs'} selected{/if}>{'thumbs'|@translate}</option>
     62      <option value="false"{if $Fotorama.fullscreen_nav == 'false'} selected{/if}>{'false'|translate}</option>
     63      <option value="dots"{if $Fotorama.fullscreen_nav == 'dots'} selected{/if}>{'dots'|translate}</option>
     64      <option value="thumbs"{if $Fotorama.fullscreen_nav == 'thumbs'} selected{/if}>{'thumbs'|translate}</option>
    6565    </select>
    6666  </li>
    6767  <li>
    6868    <label for="thumbheight">
    69       <b>{'Tumbnail height (when present)'|@translate}</b>
     69      <b>{'Tumbnail height (when present)'|translate}</b>
    7070    </label>
    7171    <input type="number" size="2" maxlength="3" name="thumbheight" value="{$Fotorama.thumbheight}" min="5" max="300" style="width: 50px;">&nbsp;px
     
    7474    <input type="checkbox" id="shadows" name="shadows"{if $Fotorama.shadows} checked="checked"{/if}>
    7575    <label for="shadows">
    76       <b>{'Enables shadows'|@translate}</b>
     76      <b>{'Enables shadows'|translate}</b>
    7777    </label>
    7878  </li>
     
    8080    <input type="checkbox" id="autoplay" name="autoplay"{if $Fotorama.autoplay} checked="checked"{/if}>
    8181    <label for="autoplay">
    82       <b>{'Enables autoplay'|@translate}</b>
     82      <b>{'Enables autoplay'|translate}</b>
    8383    </label>
    8484  </li>
     
    8686    <input type="checkbox" id="stopautoplayontouch" name="stopautoplayontouch"{if $Fotorama.stopautoplayontouch} checked="checked"{/if}>
    8787    <label for="stopautoplayontouch">
    88       <b>{'Stops slideshow at any user action with the fotorama'|@translate}</b>
     88      <b>{'Stops slideshow at any user action with the fotorama'|translate}</b>
    8989    </label>
    9090  </li>
     
    9292    <input type="checkbox" id="loop" name="loop"{if $Fotorama.loop} checked="checked"{/if}>
    9393    <label for="loop">
    94       <b>{'Enables loop'|@translate}</b>
     94      <b>{'Enables loop'|translate}</b>
    9595    </label>
    9696  </li>
     
    9898    <input type="checkbox" id="enable_caption" name="enable_caption"{if $Fotorama.enable_caption} checked="checked"{/if}>
    9999    <label for="enable_caption">
    100       <b>{'Show caption with image title'|@translate}</b>
     100      <b>{'Show caption with image title'|translate}</b>
    101101    </label>
    102102  </li>
     
    104104    <input type="checkbox" id="replace_picture" name="replace_picture"{if $Fotorama.replace_picture} checked="checked"{/if}>
    105105    <label for="replace_picture">
    106       <b>{'Replace picture page'|@translate}</b>
     106      <b>{'Replace picture page'|translate}</b>
    107107    </label>
    108108  </li>
     
    110110    &nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" id="replace_picture_only_users" name="replace_picture_only_users"{if $Fotorama.replace_picture_only_users} checked="checked"{/if}>
    111111    <label for="replace_picture_only_users">
    112       <b>{'except an administrator'|@translate}</b>
     112      <b>{'except an administrator'|translate}</b>
    113113    </label>
    114114  </li>
     
    118118<p class="formButtons">
    119119  <input type="hidden" name="pwg_token" value="{$PWG_TOKEN}">
    120   <input type="submit" name="submit" value="{'Save Settings'|@translate}">
     120  <input type="submit" name="submit" value="{'Save Settings'|translate}">
    121121</p>
    122122</form>
  • 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.