Changeset 13472


Ignore:
Timestamp:
03/03/12 19:09:10 (8 years ago)
Author:
patdenice
Message:

Multisize and mobile theme.
Use ajax loader for thumbnails in mobile theme.
Use standard square parameters for mobile theme.
Change square parameters to 120px.

Location:
trunk
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/derivative_std_params.inc.php

    r13038 r13472  
    161161  { 
    162162    self::$watermark = new WatermarkParams(); 
    163     self::$type_map[IMG_SQUARE] = new DerivativeParams( SizingParams::square(100,100) ); 
     163    self::$type_map[IMG_SQUARE] = new DerivativeParams( SizingParams::square(120,120) ); 
    164164    self::$type_map[IMG_THUMB] = new DerivativeParams( SizingParams::classic(144,144) ); 
    165165    self::$type_map[IMG_SMALL] = new DerivativeParams( SizingParams::classic(240,240) ); 
  • trunk/include/page_tail.php

    r13426 r13472  
    6767 
    6868//------------------------------------------------------------- mobile version 
    69 if ( !empty($conf['mobile_theme']) && get_device() != 'desktop') 
     69if ( !empty($conf['mobile_theme']) && (get_device() != 'desktop' || mobile_theme())) 
    7070{ 
    7171  $template->assign('TOGGLE_MOBILE_THEME_URL', 
    7272      add_url_params( 
    73         make_index_url(), 
     73        duplicate_index_url(), 
    7474        array('mobile' => mobile_theme() ? 'false' : 'true') 
    7575      ) 
  • trunk/themes/smartpocket/template/mainpage_categories.tpl

    r13235 r13472  
    1 {define_derivative name='derivative_params' width=120 height=120 crop=true} 
     1{define_derivative name='derivative_params_square' type='square'} 
    22 
    33<ul data-role="listview" data-inset="true"> 
     
    55        <li> 
    66                <a href="{$cat.URL}"> 
    7                 <img src="{$pwg->derivative_url($derivative_params, $cat.representative.src_image)}"> 
     7                <img src="{$pwg->derivative_url($derivative_params_square, $cat.representative.src_image)}"> 
    88    <h3>{$cat.NAME}</h3> 
    99                <p class="Nb_images">{$cat.CAPTION_NB_IMAGES}</p> 
  • trunk/themes/smartpocket/template/thumbnails.tpl

    r13234 r13472  
    22{combine_script id='klass' path='themes/smartpocket/js/klass.min.js'} 
    33{combine_script id='photoswipe' path='themes/smartpocket/js/code.photoswipe.jquery.min.js' require='klass,jquery.mobile'} 
     4{combine_script id='smartpocket' path='themes/smartpocket/js/smartpocket.js' require='photoswipe'} 
     5{combine_script id='jquery.ajaxmanager' path='themes/default/js/plugins/jquery.ajaxmanager.js' load='footer'} 
     6{combine_script id='thumbnails.loader' path='themes/default/js/thumbnails.loader.js' require='jquery.ajaxmanager' load='footer'} 
    47 
    5 {define_derivative name='derivative_params_thumb' width=120 height=120 crop=true} 
    6 {define_derivative name='derivative_params_full' type='large'} 
     8{define_derivative name='derivative_params_square' type='square'} 
     9{define_derivative name='derivative_params_large' type='large'} 
    710 
    8 {footer_script}{literal} 
    9 (function(window, $, PhotoSwipe){ 
    10   $(document).ready(function(){ 
    11     var options = { 
    12       jQueryMobile: true, 
    13       imageScaleMethod: "fitNoUpscale" 
    14     }; 
    15     $(".thumbnails a").photoSwipe(options); 
    16     $(document).bind('orientationchange', set_thumbnails_width); 
    17     set_thumbnails_width(); 
    18   }); 
    19 }(window, window.jQuery, window.Code.PhotoSwipe)); 
    20  
    21 function set_thumbnails_width() { 
    22   nb_thumbs = Math.max(3, Math.ceil($('.thumbnails').width() / 130)); 
    23   width = Math.floor(1000000 / nb_thumbs) / 10000; 
    24   $('.thumbnails li').css('width', width+'%'); 
    25 } 
    26  
    27 {/literal}{/footer_script} 
    2811<ul class="thumbnails"> 
    2912{foreach from=$thumbnails item=thumbnail}{strip} 
     13{assign var=derivative value=$pwg->derivative($derivative_params_square, $thumbnail.src_image)} 
    3014{if isset($page_selection[$thumbnail.id])} 
    31         <li> 
    32           <a href="{$pwg->derivative_url($derivative_params_full, $thumbnail.src_image)}" rel="external"> 
    33       <img src="{$pwg->derivative_url($derivative_params_thumb, $thumbnail.src_image)}" alt="{$thumbnail.TN_ALT}"> 
     15  <li> 
     16    <a href="{$pwg->derivative_url($derivative_params_large, $thumbnail.src_image)}" rel="external"> 
     17     <img {if !$derivative->is_cached()}data-{/if}src="{$derivative->get_url()}" alt="{$thumbnail.TN_ALT}"> 
    3418    </a> 
    3519  </li> 
    3620{else} 
    37         <li style="display:none;"> 
    38           <a href="{$pwg->derivative_url($derivative_params_full, $thumbnail.src_image)}" rel="external"></a> 
     21  <li style="display:none;"> 
     22    <a href="{$pwg->derivative_url($derivative_params_large, $thumbnail.src_image)}" rel="external"></a> 
    3923  </li> 
    4024{/if} 
Note: See TracChangeset for help on using the changeset viewer.