Changeset 30901


Ignore:
Timestamp:
01/23/15 19:56:01 (4 years ago)
Author:
SergeD
Message:

version 1.0.15 - please refer to changelog for more details

Location:
extensions/GDThumb
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • extensions/GDThumb/changelog.txt

    r30890 r30901  
    2626 
    2727=== Changelog === 
     28version 1.0.15 
     29+ In Overlay Ex mode place "New Item" marker is placed in metadata area 
     30+ Further and final improvement for file type markers in Overlay Ex mode. Now sensitive to file extensions. Supports image, video, music, pdf, doc, xls, ppt formats with associated markers. 
     31- Fixed issue when "big thumb" for video files become smaller than desired min size 
     32 
    2833version 1.0.14 
    29 + Added integration with VideoJS plugin to allow display of "film" icon in square mode 
     34+ Added integration with VideoJS plugin to allow display of "film" icon in Overlay Ex mode 
    3035- Fixed issue with incorrect callback when "RV Thumb Scroller" plugin is used 
    3136 
  • extensions/GDThumb/css/gdthumb.css

    r30890 r30901  
    3939ul.thumbnails .gdthumb .thumbLegend.overlay-ex .thumbTitle { position: absolute; left: 10px; right: 10px; top: 10px;font-size: 1.2em; text-transform: uppercase; } 
    4040ul.thumbnails .gdthumb .thumbLegend.overlay-ex .thumbInfo  { position: absolute; bottom: 10px; left: 10px; right: 10px; padding-top: 6px; border-top: 1px solid #aaa; text-align: left; } 
    41 ul.thumbnails .gdthumb .overlay-ex.thumbLegend .thumbInfo .item-num  { background-color: #cc3333; min-width: 15px; height: 16px; display: block; color: #fff; float: left; line-height: 16px; padding: 1px; padding-top: 0px; padding-right: 4px; padding-left: 4px; margin-top: 4px; margin-right: 10px; font-size: 10px; text-align: center; } 
    42 ul.thumbnails .gdthumb .overlay-ex.thumbLegend .thumbInfo .hit-num   { background-color: #036FE5; min-width: 15px; height: 16px; display: block; color: #fff; float: left; line-height: 16px; padding: 1px; padding-top: 0px; padding-right: 4px; padding-left: 4px; margin-top: 4px; margin-right: 10px; font-size: 10px; text-align: center; } 
     41ul.thumbnails .gdthumb .thumbLegend.overlay-ex .thumbInfo span { display: inline-block; } 
     42ul.thumbnails .gdthumb .overlay-ex.thumbLegend .thumbInfo .item-num  { background-color: #cc3333; min-width: 15px; height: 16px; display: block; color: #fff; float: left; line-height: 16px; padding: 1px; padding-top: 0px; padding-right: 4px; padding-left: 4px; margin-top: 5px; margin-right: 6px; font-size: 10px; text-align: center; } 
     43ul.thumbnails .gdthumb .overlay-ex.thumbLegend .thumbInfo .hit-num   { background-color: #036FE5; min-width: 15px; height: 16px; display: block; color: #fff; float: left; line-height: 16px; padding: 1px; padding-top: 0px; padding-right: 4px; padding-left: 4px; margin-top: 4px; margin-right: 6px; font-size: 10px; text-align: center; } 
    4344ul.thumbnails .gdthumb .overlay-ex.thumbLegend .thumbInfo .rank-num  { float: right; margin-top: 2px; vertical-align: middle; height: 20px; line-height: 20px; } 
    4445 
    45 ul.thumbnails .gdthumb .overlay-ex.thumbLegend .thumbInfo .glyphicon-th-large { padding-top: 2px; font-size: 18px; } 
    46 ul.thumbnails .gdthumb .overlay-ex.thumbLegend .thumbInfo .glyphicon-picture  { padding-top: 1px; font-size: 18px; } 
    47 ul.thumbnails .gdthumb .overlay-ex.thumbLegend .thumbInfo .glyphicon-film     { padding-top: 3px; font-size: 18px; } 
     46ul.thumbnails .gdthumb .overlay-ex.thumbLegend .thumbInfo .glyphicon { padding-top: 3px; font-size: 17px; } 
    4847 
    4948ul.thumbnails.nowrap .gdthumb .thumbLegend { white-space: nowrap; overflow: hidden; height: auto; } 
  • extensions/GDThumb/js/gdthumb.js

    r30225 r30901  
    4848  build: function () { 
    4949 
    50     if ((GDThumb.method == 'square') && (GDThumb.big_thumb != null) && (GDThumb.big_thumb.height != GDThumb.big_thumb.width)) { 
     50    if ((GDThumb.method == 'square') && (GDThumb.big_thumb != null) && ((GDThumb.big_thumb.height != GDThumb.big_thumb.width) || (GDThumb.big_thumb.height < GDThumb.max_height))){ 
    5151      var main_width = jQuery('ul.thumbnails').width(); 
    5252      var max_col_count = Math.floor(main_width / GDThumb.max_height); 
  • extensions/GDThumb/main.inc.php

    r30890 r30901  
    22/* 
    33Plugin Name: gdThumb 
    4 Version: 1.0.14 
    5 Description: Display thumbnails as patchwork 
     4Version: 1.0.15 
     5Description: Apply Masonry style to album or image thumbs 
    66Plugin URI: http://piwigo.org/ext/extension_view.php?eid=771 
    77Author: Serge Dosyukov  
     
    1919// | Plugin constants                                               | 
    2020// +-----------------------------------------------------------------------+ 
    21 define('GDTHUMB_VERSION', '1.0.14'); 
     21define('GDTHUMB_VERSION', '1.0.15'); 
    2222define('GDTHUMB_ID',      basename(dirname(__FILE__))); 
    2323define('GDTHEME_PATH' ,   PHPWG_THEMES_PATH . 'greydragon/'); 
     
    5959function GDThumb_index() { 
    6060  global $template; 
    61    
     61 
     62  $template->smarty->registerPlugin("function", "media_type", "GDThumb_media_type"); 
    6263  $template->set_prefilter('index', 'GDThumb_prefilter'); 
    6364 
    6465  add_event_handler('loc_end_index_thumbnails', 'GDThumb_process_thumb', 50, 2); 
     66} 
     67                                                  
     68function GDThumb_endsWith($needles, $haystack) { 
     69  if(empty($needles) || empty($haystack)): 
     70    return false; 
     71  else: 
     72    $arr_needles = explode(',', $needles); 
     73     
     74    foreach ((array) $arr_needles as $needle) {  
     75      if ((string) $needle === substr($haystack, -strlen($needle))) return true;  
     76    }  
     77    return false;  
     78  endif; 
     79} 
     80 
     81function GDThumb_media_type($params, $smarty) { 
     82  if(empty($params["file"])) 
     83    return "image"; 
     84 
     85  $file = $params["file"]; 
     86  if (GDThumb_endsWith("webm,webmv,ogv,m4v,flv,mp4", $file)) 
     87    return "video"; 
     88  if (GDThumb_endsWith("mp3,ogg,oga,m4a,webma,fla,wav", $file)) 
     89    return "music"; 
     90  if (GDThumb_endsWith("pdf", $file)) 
     91    return "pdf"; 
     92  if (GDThumb_endsWith("doc,docx,odt", $file)) 
     93    return "doc"; 
     94  if (GDThumb_endsWith("xls,xlsx,ods", $file)) 
     95    return "xls"; 
     96  if (GDThumb_endsWith("ppt,pptx,odp", $file)) 
     97    return "ppt"; 
     98 
     99  return "image"; 
    65100} 
    66101 
  • extensions/GDThumb/template/gdthumb_cat.tpl

    r30225 r30901  
    1515      <span class="thumbName"> 
    1616        <span class="thumbTitle">{$cat.NAME} 
    17         {if !empty($cat.icon_ts)} 
    18         <img title="{$cat.icon_ts.TITLE}" src="{$ROOT_URL}{$themeconf.icon_dir}/recent{if $cat.icon_ts.IS_CHILD_DATE}_by_child{/if}.png" alt="(!)"> 
     17        {if $GDThumb.thumb_mode_album !== "overlay-ex"} 
     18          {if !empty($cat.icon_ts)} 
     19          <img title="{$cat.icon_ts.TITLE}" src="{$ROOT_URL}{$themeconf.icon_dir}/recent{if $cat.icon_ts.IS_CHILD_DATE}_by_child{/if}.png" alt="(!)"> 
     20          {/if} 
    1921        {/if} 
    2022        </span> 
    2123        {if $GDThumb.thumb_mode_album == "overlay-ex"} 
    22           <span class="thumbInfo"> 
    23             <span class="item-num">{$cat.count_images}</span> 
    24             <span class="glyphicon glyphicon-th-large grid-gallery-icon"></span> 
    25           </span> 
     24        <span class="thumbInfo"> 
     25          <span class="item-num">{$cat.count_images}</span> 
     26          <span class="glyphicon glyphicon-th-large grid-gallery-icon"></span> 
     27          {if !empty($cat.icon_ts)} 
     28          <span class="new-thumb glyphicon glyphicon-asterisk" title="{$cat.icon_ts.TITLE}" alt="(!)"></span> 
     29          {/if} 
     30        </span> 
    2631        {elseif $GDThumb.thumb_metamode !== "hide"} 
    2732          {if isset($cat.INFO_DATES) } 
  • extensions/GDThumb/template/gdthumb_thumb.tpl

    r30890 r30901  
    11{if !empty($thumbnails)} 
    2  
     2{* 
     3  {$thumbnails|print_r} 
     4*} 
    35{foreach from=$thumbnails item=thumbnail} 
    46{assign var=derivative value=$pwg->derivative($GDThumb_derivative_params, $thumbnail.src_image)} 
     7{assign var=media_type value={media_type file=$thumbnail.file}} 
     8 
    59<li class="gdthumb"> 
    610  {if $GDThumb.thumb_mode_photo !== "hide" } 
     
    2024      {/if} 
    2125    {/if} 
     26    {if $GDThumb.thumb_mode_album !== "overlay-ex"} 
    2227      {if !empty($thumbnail.icon_ts)} 
    2328      <img title="{$thumbnail.icon_ts.TITLE}" src="{$ROOT_URL}{$themeconf.icon_dir}/recent.png" alt="(!)"> 
    2429      {/if} 
     30    {/if} 
    2531    </span> 
    2632    {if $GDThumb.thumb_mode_album == "overlay-ex"} 
    2733      <span class="thumbInfo"> 
    2834        <span class="hit-num">{$thumbnail.hit}</span> 
    29         <span class="glyphicon {if $derivative->is_cached()}{if $derivative->get_url()|strstr:"/piwigo-videojs/"}glyphicon-film{else}glyphicon-picture{/if}{else}glyphicon-picture{/if}"></span> 
     35        <span class="glyphicon {if $media_type=="video"}glyphicon-film{elseif $media_type=="music"}glyphicon-music{elseif $media_type=="doc"}glyphicon-file{elseif $media_type=="pdf"}glyphicon-book{else}glyphicon-picture{/if}"></span> 
     36        {if !empty($thumbnail.icon_ts)} 
     37        <span class="new-thumb glyphicon glyphicon-asterisk" title="{$thumbnail.icon_ts.TITLE}" alt="(!)"></span> 
     38        {/if} 
    3039        {if $thumbnail.rating_score > 0} 
    3140        <span class="rank-num glyphicon glyphicon-star">{$thumbnail.rating_score|string_format:"%d"}</span> 
Note: See TracChangeset for help on using the changeset viewer.