Ignore:
Timestamp:
May 11, 2011, 7:17:49 PM (13 years ago)
Author:
mistic100
Message:

improve process, add options for link effect

Location:
extensions/Back2Front/template
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/Back2Front/template/picture_content.tpl

    r10821 r10852  
    33{footer_script require="jquery"}
    44jQuery(document).ready(function () {ldelim}
     5
     6{if $b2f_switch_mode == 'click'}
    57  jQuery('.reverse').click(function() {ldelim}
    68    if (jQuery(this).attr('rel') == 'front') {ldelim}
    7       /* picture attributes */
    8       jQuery('#theImage img:first-child').attr({ldelim}
     9{else}
     10  jQuery('.reverse').hover(function() {ldelim}
     11{/if}
     12
     13      /* picture switch */
     14    {if $b2f_transition == 'fade'}
     15      jQuery('img[alt="{$ALT_IMG}"]').animate({ldelim}
     16        opacity:0
     17      }, 400, function() {ldelim}
     18        jQuery(this).animate({ldelim}
     19          width:'{$VERSO_WIDTH}px',
     20          height:'{$VERSO_HEIGHT}px'
     21        }, 200, function() {ldelim}
     22            jQuery(this).attr('src', '{$VERSO_URL}');
     23            jQuery(this).animate({ldelim}
     24              opacity:1
     25            }, 400);
     26        });
     27      });
     28    {else}
     29      jQuery('img[alt="{$ALT_IMG}"]').attr({ldelim}
    930        src: '{$VERSO_URL}',
    10         style: 'width:;height:;',
     31        style: 'width:{$VERSO_WIDTH}px;height:{$VERSO_HEIGHT}px;',
    1132      });
    12      
    13       /* hd link atributes */
     33    {/if}
     34   
     35    {if $b2f_switch_mode == 'click'}
     36      /* hd link */
    1437      {if isset($VERSO_HD)}
    15       jQuery('#theImage a:first-child').attr({ldelim}
     38      jQuery('img[alt="{$ALT_IMG}"]').parent().attr({ldelim}
    1639        href: "javascript:phpWGOpenWindow('{$VERSO_HD}','{$high.UUID}','scrollbars=yes,toolbar=no,status=no,resizable=yes')"
    1740      });
    1841      {/if}
    19      
     42   
    2043      /* B2F link content */
    2144      jQuery(this).html('<img src="{$B2F_PATH}template/rotate_2.png"/> {'See front'|@translate}');
    2245      jQuery(this).attr('rel', 'back');
     46    {/if}
    2347     
     48{if $b2f_switch_mode == 'click'}
    2449    } else if (jQuery(this).attr('rel') == 'back') {ldelim}
    25       jQuery('#theImage img:first-child').attr({ldelim}
     50{else}
     51  }, function() {ldelim}
     52{/if}
     53
     54    {if $b2f_transition == 'fade'}
     55      jQuery('img[alt="{$ALT_IMG}"]').animate({ldelim}
     56        opacity:0
     57      }, 400, function() {ldelim}
     58        jQuery(this).animate({ldelim}
     59          width:'{$WIDTH_IMG}px',
     60          height:'{$HEIGHT_IMG}px'
     61        }, 200, function() {ldelim}
     62            jQuery(this).attr('src', '{$SRC_IMG}');
     63            jQuery(this).animate({ldelim}
     64              opacity:1
     65            }, 400);
     66        });
     67      });
     68    {else}
     69      jQuery('img[alt="{$ALT_IMG}"]').attr({ldelim}
    2670        src: '{$SRC_IMG}',
    2771        style: 'width:{$WIDTH_IMG}px;height:{$HEIGHT_IMG}px;',
    2872      });
     73    {/if}
    2974     
    30       {if isset($VERSO_HD)}
    31       jQuery('#theImage a:first-child').attr({ldelim}
    32         href: "javascript:phpWGOpenWindow('{$high.U_HIGH}','{$high.UUID}','scrollbars=yes,toolbar=no,status=no,resizable=yes')')"
     75    {if $b2f_switch_mode == 'click'}
     76      {if isset($high.U_HIGH)}
     77      jQuery('img[alt="{$ALT_IMG}"]').parent().attr({ldelim}
     78        href: "javascript:phpWGOpenWindow('{$high.U_HIGH}','{$high.UUID}','scrollbars=yes,toolbar=no,status=no,resizable=yes')"
    3379      });
    3480      {/if}
     
    3682      jQuery(this).html('<img src="{$B2F_PATH}template/rotate_1.png"/> {'See back'|@translate}');
    3783      jQuery(this).attr('rel', 'front');
     84    {/if}
     85     
     86{if $b2f_switch_mode == 'click'}
    3887    }
    3988  });
     89{else}
     90  });
     91{/if}
     92
    4093});
    4194{/footer_script}
    4295
    43 <a class="reverse" rel="front" href="#">
    44   <img src="{$B2F_PATH}template/rotate_1.png"/>
    45   {'See back'|@translate}
     96<img src="{$VERSO_URL}" style="display:none;"> {* <!-- force preload the verso --> *}
     97
     98<a class="reverse" rel="front" name="verso-link" {if $b2f_switch_mode == 'hover'}href="javascript:phpWGOpenWindow('{$VERSO_HD}','{$high.UUID}','scrollbars=yes,toolbar=no,status=no,resizable=yes')"{/if}>
     99  <img src="{$B2F_PATH}template/rotate_1.png"/> {'See back'|@translate}
    46100</a>
     101<br/>
  • extensions/Back2Front/template/picture_modify.tpl

    r10821 r10852  
    22$(document).ready(function () {ldelim}
    33  $('input[name="b2f_is_verso"]').change(function () {ldelim}
    4     if (this.checked) {ldelim}
    5       $('.frontside_id').css('visibility', '');
    6     } else {ldelim}
    7       $('.frontside_id').css('visibility', 'hidden');
    8     }
     4     $('.frontside_param').toggle();
    95  });
    106});
     
    2117      <tr>
    2218        <td><b>{'This picture has a backside :'|@translate}</b></td>
    23         <td><a href="{$B2F_VERSO_URL}">{$B2F_VERSO_ID} - {$B2F_VERSO_NAME}</a></td>
     19        <td><a href="{$B2F_VERSO_URL}">{$B2F_VERSO_ID}</a></td>
    2420      </tr>
    2521    </table>
    2622  {else}
    27     <table>
     23    <table style="min-width:400px;">
    2824      <tr>
    2925        <td><b>{'This picture is a backside...'|@translate}</b></td>
    30         <td><input type="checkbox" name="b2f_is_verso" {$B2F_IS_VERSO}></td>
     26        <td style="width:70px"><input type="checkbox" name="b2f_is_verso" {$B2F_IS_VERSO}></td>
    3127      </tr>
    32 
    33       <tr class="frontside_id" {if !isset($B2F_IS_VERSO)}style="visibility:hidden;"{/if}>
     28     
     29      <tr class="frontside_param" {if !isset($B2F_IS_VERSO)}style="display:none;"{/if}>
    3430        <td><b>{'...of the picture n°'|@translate}</b></td>
    3531        <td><input type="text" size="4" name="b2f_front_id" value="{$B2F_FRONT_ID}"></td>
    3632      </tr>
    3733     
    38       <tr class="frontside_id" {if !isset($B2F_IS_VERSO)}style="visibility:hidden;"{/if}>
     34      <tr class="frontside_param" {if !isset($B2F_IS_VERSO)}style="display:none;"{/if}>
    3935        <td><b>{'Move backside to private album'|@translate}</b></td>
    40         <td><input type="checkbox" name="b2f_move_verso" checked="checked"></td>
     36        <td><input type="checkbox" name="b2f_move_verso" {$B2F_MOVE_VERSO}></td>
    4137      </tr>
    4238    </table>
  • extensions/Back2Front/template/style.css

    r10819 r10852  
    66  font-size:15px;
    77  font-style:italic;   
     8  height:1em;
    89}
    910a.reverse img {
     11  margin:0 !important;
    1012  vertical-align:top;
    1113  border:none !important;
Note: See TracChangeset for help on using the changeset viewer.