Ignore:
Timestamp:
Jun 1, 2014, 9:38:49 PM (10 years ago)
Author:
Miklfe
Message:

Compatibilité avec Slim

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/Slimi/template/thumbnails.tpl

    r25998 r28586  
    1 {define_derivative name='carousel' width='300' height='300' min_width='300'}
     1{define_derivative name='carousel' width='300' height='350' min_width='350'}
    22{php}
    33    global $page, $template;
    44    $template->assign('cat_name', $page['category']['name']);
     5       
    56{/php}
     7{footer_script}{literal}
     8(function($) {
     9        $(document).ready(function(){
     10       
     11                var isTouch = (('ontouchstart' in window) || (navigator.msMaxTouchPoints > 0)),
     12                        start;
     13               
     14                if (isTouch==true){
     15                start="";
     16                }else{
     17                start="onStart";
     18                };
     19               
     20                $("div.carousel").smoothDivScroll({
     21                        autoScrollingMode: start,
     22                        touchScrolling: true,
     23                        autoScrollingStep: {/literal}{$Slimi.carousel_speed}{literal},
     24                        manualContinuousScrolling: true,
     25                        mousewheelScrolling: "allDirections",
     26               
     27                });     
     28                               
     29                $("div.carousel").bind("mouseover", function() {
     30                        $(this).smoothDivScroll("stopAutoScrolling");
     31                }).bind("mouseout", function() {
     32                        $(this).smoothDivScroll("startAutoScrolling");
     33                });     
     34       
     35               
     36        });
     37})(jQuery);
     38{/literal}{/footer_script}
    639
     40{if (($Slimi.lytebox_slimi)==1)}
     41{footer_script}{literal}
     42(function($) {
     43        $(document).ready(function(){
     44                $('.fancybox').fancybox({
     45                        helpers : {
     46                                title : {
     47                                        type : 'over'
     48                                },
     49                        },     
     50                        afterLoad: function() {
     51                        $("div.carousel").smoothDivScroll("stopAutoScrolling");
     52                        },
     53                        afterClose: function() {
     54                        $("div.carousel").smoothDivScroll("startAutoScrolling");
     55                        }
     56                });             
     57               
     58        });
     59})(jQuery);
     60{/literal}{/footer_script}
     61{/if}
    762
    8 <div id="carousel">
    9 <div id="wrap">
    10                 <div class="jcarousel">
    11 <ul>
    12                 {if !empty($category_thumbnails)}
    13                
    14                 {foreach from=$category_thumbnails item=cat}
    15 
    16 
    17                         <li>
    18                                         <div class="illustration">
    19                                                 <a href="{$cat.URL}">
    20                                                         <img src="{$pwg->derivative_url($carousel, $cat.representative.src_image)}" alt="{$cat.TN_ALT}" title="{$cat.NAME|@replace:'"':' '|@strip_tags:false} - {'display this album'|@translate}" min-width="{$carousel->max_width()}" height="{$carousel->max_height()}"/>
    21                                                 </a>
    22                                         </div>
    23                                        
    24                                                
     63        <div class="carousel">
     64                        {if !empty($category_thumbnails)}
     65                        {foreach from=$category_thumbnails item=cat}
     66                                                <div class="illustration">
     67                                                        <a href="{$cat.URL}">
     68                                                                <img src="{$pwg->derivative_url($carousel, $cat.representative.src_image)}" alt="{$cat.TN_ALT}" title="{$cat.NAME|@replace:'"':' '|@strip_tags:false} - {'display this album'|@translate}" min-width="{$carousel->max_width()}" height="{$carousel->max_height()-22}"/>
     69                                                       
    2570                                                <div class="CatMPdescription">
    2671                                                        <h3>
    27                                                                 <a href="{$cat.URL}">{$cat.NAME}</a>
     72                                                                {$cat.NAME}
    2873                                                        </h3>
    2974                                                        <div>
    30                                                         {$cat.CAPTION_NB_IMAGES}
     75                                                                {$cat.CAPTION_NB_IMAGES}
     76                                                </div>
    3177                                                        </div> 
     78                                                </a>
    3279                                                </div>
    33                         </li>
    34                 {/foreach}{/if}
    35 
    36 
    37         {foreach from=$thumbnails item=thumbnail}
    38         {assign var=derivative value=$pwg->derivative($carousel, $thumbnail.src_image)}
    39                         <li>
    40                                 <div class="illustration">
    41                                         <a href="{if ($Slimi.lytebox_slimi)==1}{$thumbnail.path}" class="lytebox" rev="slide:true group:name showNavigation:true navType:1 slideInterval:6000"{else}{$thumbnail.URL}"{/if} title="{$thumbnail.NAME|strip_tags:false|replace:'\'':'&#39;'|replace:'"':'&quot;'}">
    42                                         <img class="thumbnail" src="{$derivative->get_url()}" alt="{$thumbnail.TN_ALT}" title="{$thumbnail.TN_TITLE}" height="{$carousel->max_height()}"/>
    43                                                
     80                        {/foreach}
     81                        {/if}
     82                                {foreach from=$thumbnails item=thumbnail}
     83                                {assign var=derivative value=$pwg->derivative($carousel, $thumbnail.src_image)}
     84                                        <div class="illustration">
     85                                <a href="{if (($Slimi.lytebox_slimi)==1)}{$thumbnail.path}"  class="fancybox" data-fancybox-group="gallery"{else}{$thumbnail.URL}"{/if} title="{$thumbnail.NAME|strip_tags:false|replace:'\'':'&#39;'|replace:'"':'&quot;'}">   
     86                                <img class="thumbnail" src="{$derivative->get_url()}" alt="{$thumbnail.TN_ALT}" title="{$thumbnail.TN_TITLE}" height="{$carousel->max_height()-22}"/>
    4487                                                {if $SHOW_THUMBNAIL_CAPTION }
    4588                                                        <div class="CatMPdescription">
    4689                                                                <H3>
    4790                                                                        {$thumbnail.NAME}
    48                                                                        
    4991                                                                        {if !empty($thumbnail.icon_ts)}
    5092                                                                                <img title="{$thumbnail.icon_ts.TITLE}" src="{$ROOT_URL}{$themeconf.icon_dir}/recent.png" alt="(!)">
     
    5294                                                                </h3>
    5395                                                                {if isset($thumbnail.NB_COMMENTS) or isset($thumbnail.NB_HITS)}
    54                                                                 <div>
     96                                                                        <div>
    5597                                                                        {if isset($thumbnail.NB_COMMENTS)}
    5698                                                                                <p class="{if 0==$thumbnail.NB_COMMENTS}zero {/if}nb-comments">
    57                                                                                 {$pwg->l10n_dec('%d comment', '%d comments',$thumbnail.NB_COMMENTS)}
     99                                                                                        {$pwg->l10n_dec('%d comment', '%d comments',$thumbnail.NB_COMMENTS)}
    58100                                                                                </p>
    59101                                                                        {/if}
    60102                                                                        {if isset($thumbnail.NB_HITS)}
    61103                                                                                <p class="{if 0==$thumbnail.NB_HITS}zero {/if}nb-hits">
    62                                                                                 {$pwg->l10n_dec('%d hit', '%d hits',$thumbnail.NB_HITS)}
     104                                                                                        {$pwg->l10n_dec('%d hit', '%d hits',$thumbnail.NB_HITS)}
    63105                                                                                </p>
    64106                                                                        {/if}
    65                                                                 </div>
     107                                                                        </div>
    66108                                                                {/if}
    67109                                                        </div>
    68110                                                {/if}
    69                                         </a>   
    70                                 </div> 
    71                         </li>
    72         {/foreach}
    73 </ul>
     111                                                </a>   
     112                                        </div> 
     113                                {/foreach}
     114        </div>
    74115
    75 </div>
    76 </div>
    77         <a href="#" class="jcarousel-control-prev">&lsaquo;</a>
    78     <a href="#" class="jcarousel-control-next">&rsaquo;</a>
    79 </div>
Note: See TracChangeset for help on using the changeset viewer.