Changeset 18124


Ignore:
Timestamp:
09/21/12 18:36:42 (7 years ago)
Author:
mistic100
Message:

new option to display thumbnails caption at mouseover

Location:
extensions/GThumb
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • extensions/GThumb/admin.php

    r15970 r18124  
    104104    'cache_big_thumb' => !empty($_POST['cache_big_thumb']), 
    105105    'method'          => $_POST['method'], 
     106    'show_thumbnail_caption' => !empty($_POST['show_thumbnail_caption']), 
    106107  ); 
    107108 
     
    150151    'CACHE_BIG_THUMB' => $params['cache_big_thumb'], 
    151152    'METHOD'          => $params['method'], 
     153    'SHOW_THUMBNAIL_CAPTION' => $params['show_thumbnail_caption'], 
    152154    'PWG_TOKEN'       => get_pwg_token(), 
    153155  ) 
  • extensions/GThumb/config_default.inc.php

    r12678 r18124  
    88  'cache_big_thumb' => true, 
    99  'method'          => 'crop', 
     10  'show_thumbnail_caption' => true, 
    1011); 
    1112 
  • extensions/GThumb/js/gthumb.js

    r13652 r18124  
    3737    var round_rest = 0; 
    3838    var main_width = jQuery('#thumbnails').width(); 
    39     var first_thumb = jQuery('#thumbnails img:first'); 
     39    var first_thumb = jQuery('#thumbnails img.thumbnail:first'); 
    4040    var best_size = {width:1,height:1}; 
    4141 
  • extensions/GThumb/language/en_UK/plugin.lang.php

    r12759 r18124  
    1414$lang['Delete images in GThumb+ cache.'] = 'Delete images in GThumb+ cache.'; 
    1515$lang['Finds images that have not been cached and creates the cached version.'] = 'Finds images that have not been cached and creates the cached version.'; 
     16$lang['Show thumbnails caption'] = 'Show thumbnails caption'; 
    1617 
    1718?> 
  • extensions/GThumb/language/fr_FR/plugin.lang.php

    r12759 r18124  
    1414$lang['Delete images in GThumb+ cache.'] = 'Efface les images du cache de GThumb+.'; 
    1515$lang['Finds images that have not been cached and creates the cached version.'] = "Met en cache les images qui n'ont pas encore été crées."; 
     16$lang['Show thumbnails caption'] = 'Afficher les légendes des miniatures'; 
    1617 
    1718?> 
  • extensions/GThumb/main.inc.php

    r16318 r18124  
    3333{ 
    3434  global $conf, $user, $page, $template; 
     35   
     36  // new param in 2.4.c 
     37  if (!isset($conf['GThumb']['show_thumbnail_caption'])) 
     38  { 
     39    $conf['GThumb']['show_thumbnail_caption'] = true; 
     40    conf_update_param('GThumb', serialize($conf['GThumb'])); 
     41  } 
     42   
    3543 
    3644  $template->set_prefilter('index', 'GThumb_prefilter'); 
     
    4048  $user['nb_image_page'] = $conf['GThumb']['nb_image_page']; 
    4149  $page['nb_image_page'] = $conf['GThumb']['nb_image_page']; 
     50  $conf['show_thumbnail_caption'] = $conf['GThumb']['show_thumbnail_caption']; 
    4251} 
    4352 
  • extensions/GThumb/template/admin.tpl

    r13653 r18124  
    2525  <tr> 
    2626    <td align="right">{'Double the size of the first thumbnail'|@translate} : &nbsp;&nbsp;</td> 
    27     <td><input type="radio" name="big_thumb" value="1" {if $BIG_THUMB}checked="checked"{/if}> {'Yes'|@translate} &nbsp; 
    28         <input type="radio" name="big_thumb" value="0" {if !$BIG_THUMB}checked="checked"{/if}> {'No'|@translate} 
     27    <td><label><input type="radio" name="big_thumb" value="1" {if $BIG_THUMB}checked="checked"{/if}> {'Yes'|@translate}</label> &nbsp; 
     28        <label><input type="radio" name="big_thumb" value="0" {if !$BIG_THUMB}checked="checked"{/if}> {'No'|@translate}</label> 
    2929    </td> 
    3030  </tr> 
     
    3232  <tr> 
    3333    <td align="right">{'Cache the big thumbnails (recommended)'|@translate} : &nbsp;&nbsp;</td> 
    34     <td><input type="radio" name="cache_big_thumb" value="1" {if $CACHE_BIG_THUMB}checked="checked"{/if}> {'Yes'|@translate} &nbsp; 
    35         <input type="radio" name="cache_big_thumb" value="0" {if !$CACHE_BIG_THUMB}checked="checked"{/if}> {'No'|@translate} 
     34    <td><label><input type="radio" name="cache_big_thumb" value="1" {if $CACHE_BIG_THUMB}checked="checked"{/if}> {'Yes'|@translate}</label> &nbsp; 
     35        <label><input type="radio" name="cache_big_thumb" value="0" {if !$CACHE_BIG_THUMB}checked="checked"{/if}> {'No'|@translate}</label> 
    3636    </td> 
    3737  </tr> 
     
    3939  <tr> 
    4040    <td align="right">{'Scale thumbnails'|@translate} : &nbsp;&nbsp;</td> 
    41     <td><input type="radio" name="method" value="crop" {if $METHOD == 'crop'}checked="checked"{/if}> {'Crop'|@translate} &nbsp; 
    42         <input type="radio" name="method" value="resize" {if $METHOD == 'resize'}checked="checked"{/if}> {'Resize'|@translate} 
     41    <td><label><input type="radio" name="method" value="crop" {if $METHOD == 'crop'}checked="checked"{/if}> {'Crop'|@translate}</label> &nbsp; 
     42        <label><input type="radio" name="method" value="resize" {if $METHOD == 'resize'}checked="checked"{/if}> {'Resize'|@translate}</label> 
     43    </td> 
     44  </tr> 
     45   
     46  <tr> 
     47    <td align="right">{'Show thumbnails caption'|@translate} : &nbsp;&nbsp;</td> 
     48    <td><label><input type="radio" name="show_thumbnail_caption" value="1" {if $SHOW_THUMBNAIL_CAPTION}checked="checked"{/if}> {'Yes'|@translate}</label> &nbsp; 
     49        <label><input type="radio" name="show_thumbnail_caption" value="0" {if !$SHOW_THUMBNAIL_CAPTION}checked="checked"{/if}> {'No'|@translate}</label> 
    4350    </td> 
    4451  </tr> 
  • extensions/GThumb/template/gthumb.css

    r12731 r18124  
    1313#thumbnails .gthumb a { 
    1414  position: absolute; 
     15  z-index:0; 
    1516} 
    1617 
    17 #thumbnails .gthumb img.thumbnail, 
    18 #thumbnails .gthumb img.thumbnail:hover { 
     18#thumbnails .gthumb a img.thumbnail, 
     19#thumbnails .gthumb a img.thumbnail:hover { 
    1920  border: 0 none; 
    2021  margin: 0; 
     
    2223  top: 0; 
    2324} 
     25 
     26#thumbnails .thumbLegend { 
     27  display:none; 
     28  position:absolute; 
     29  z-index:100; 
     30  top:50%; 
     31  margin-top:-20px; 
     32  height:30px; 
     33  padding:5px 0; 
     34  width:100%; 
     35  background:rgba(0,0,0,0.7); 
     36  text-align:center; 
     37  vertical-align:middle; 
     38  overflow:hidden; 
     39  box-shadow:0 0 3px rgb(0,0,0); 
     40  color:aaa; 
     41} 
     42  #thumbnails .gthumb:hover .thumbLegend { 
     43    display:block; 
     44  } 
     45#thumbnails .thumbLegend .thumbName { 
     46  display:block; 
     47  vertical-align:middle; 
     48  font-weight:bold; 
     49  color:#eee; 
     50} 
  • extensions/GThumb/template/gthumb.tpl

    r13652 r18124  
    33{assign var=derivative value=$pwg->derivative($GThumb_derivative_params, $thumbnail.src_image)} 
    44<li class="gthumb"> 
     5  {if $SHOW_THUMBNAIL_CAPTION } 
     6  <span class="thumbLegend"> 
     7    <span class="thumbName"> 
     8      {$thumbnail.NAME} 
     9      {if !empty($thumbnail.icon_ts)} 
     10      <img title="{$thumbnail.icon_ts.TITLE}" src="{$ROOT_URL}{$themeconf.icon_dir}/recent.png" alt="(!)"> 
     11      {/if} 
     12    </span> 
     13    {if isset($thumbnail.NB_COMMENTS)} 
     14    <span class="{if 0==$thumbnail.NB_COMMENTS}zero {/if}nb-comments"> 
     15      {$pwg->l10n_dec('%d comment', '%d comments',$thumbnail.NB_COMMENTS)} 
     16    </span> 
     17    {/if} 
     18    {if isset($thumbnail.NB_HITS)} 
     19    <span class="{if 0==$thumbnail.NB_HITS}zero {/if}nb-hits"> 
     20      {$pwg->l10n_dec('%d hit', '%d hits',$thumbnail.NB_HITS)} 
     21    </span> 
     22    {/if} 
     23  </span> 
     24  {/if} 
    525  <a href="{$thumbnail.URL}"> 
    626    <img class="thumbnail" {if !$derivative->is_cached()}data-{/if}src="{$derivative->get_url()}" alt="{$thumbnail.TN_ALT}" title="{$thumbnail.TN_TITLE}" {$derivative->get_size_htm()}> 
Note: See TracChangeset for help on using the changeset viewer.