Changeset 13545
- Timestamp:
- Mar 14, 2012, 9:19:25 AM (12 years ago)
- Location:
- trunk/themes/smartpocket
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/themes/smartpocket/template/footer.tpl
r13243 r13545 15 15 </div> 16 16 {/if} 17 {footer_script require='jquery'} 18 document.cookie = 'screen_size='+jQuery(document).width()+'x'+jQuery(document).height()+';path={$COOKIE_PATH}'; 19 {/footer_script} 17 20 {get_combined_scripts load='footer'} 18 21 </div><!-- /page --> -
trunk/themes/smartpocket/template/mainpage_categories.tpl
r13472 r13545 1 {define_derivative name='derivative_params_square' type='square'}2 3 1 <ul data-role="listview" data-inset="true"> 4 2 {foreach from=$category_thumbnails item=cat} 5 3 <li> 6 4 <a href="{$cat.URL}"> 7 <img src="{$pwg->derivative_url($ derivative_params_square, $cat.representative.src_image)}">5 <img src="{$pwg->derivative_url($thumbnail_derivative_params, $cat.representative.src_image)}"> 8 6 <h3>{$cat.NAME}</h3> 9 7 <p class="Nb_images">{$cat.CAPTION_NB_IMAGES}</p> -
trunk/themes/smartpocket/template/thumbnails.tpl
r13472 r13545 6 6 {combine_script id='thumbnails.loader' path='themes/default/js/thumbnails.loader.js' require='jquery.ajaxmanager' load='footer'} 7 7 8 {define_derivative name='derivative_params_square' type='square'}9 {define_derivative name='derivative_params_large' type='large'}10 11 8 <ul class="thumbnails"> 12 9 {foreach from=$thumbnails item=thumbnail}{strip} 13 {assign var=derivative value=$pwg->derivative($ derivative_params_square, $thumbnail.src_image)}10 {assign var=derivative value=$pwg->derivative($thumbnail_derivative_params, $thumbnail.src_image)} 14 11 {if isset($page_selection[$thumbnail.id])} 15 12 <li> 16 <a href="{$pwg->derivative_url($ derivative_params_large, $thumbnail.src_image)}" rel="external">13 <a href="{$pwg->derivative_url($picture_derivative_params, $thumbnail.src_image)}" rel="external"> 17 14 <img {if !$derivative->is_cached()}data-{/if}src="{$derivative->get_url()}" alt="{$thumbnail.TN_ALT}"> 18 15 </a> … … 20 17 {else} 21 18 <li style="display:none;"> 22 <a href="{$pwg->derivative_url($ derivative_params_large, $thumbnail.src_image)}" rel="external"></a>19 <a href="{$pwg->derivative_url($picture_derivative_params, $thumbnail.src_image)}" rel="external"></a> 23 20 </li> 24 21 {/if} -
trunk/themes/smartpocket/themeconf.inc.php
r13234 r13545 13 13 ); 14 14 15 // Redirect if page is not compatible with mobile theme 16 if (!in_array(script_basename(), array('index', 'register', 'profile', 'identification'))) 17 redirect(duplicate_index_url()); 18 15 19 //Retrive all pictures on thumbnails page 16 20 add_event_handler('loc_index_thumbnails_selection', 'sp_select_all_thumbnails'); … … 25 29 } 26 30 31 // Get better derive parameters for screen size 32 if (!empty($_COOKIE['screen_size'])) 33 { 34 $screen_size = explode('x', $_COOKIE['screen_size']); 35 $derivative_params = new ImageStdParams; 36 $derivative_params->load_from_db(); 37 $type = IMG_LARGE; 38 39 foreach ($derivative_params->get_all_type_map() as $type => $map) 40 { 41 if (max($map->sizing->ideal_size) >= max($screen_size) and min($map->sizing->ideal_size) >= min($screen_size)) 42 break; 43 } 44 pwg_set_session_var('sp_picture_deriv', $type); 45 } 46 47 $this->assign('picture_derivative_params', ImageStdParams::get_by_type(pwg_get_session_var('sp_picture_deriv', IMG_LARGE))); 48 $this->assign('thumbnail_derivative_params', ImageStdParams::get_by_type(IMG_SQUARE)); 49 27 50 ?>
Note: See TracChangeset
for help on using the changeset viewer.