Changeset 9803 for extensions


Ignore:
Timestamp:
Mar 21, 2011, 11:20:00 AM (13 years ago)
Author:
plg
Message:

compatibility with Piwigo 2.2 : combine_css, footer_script (require jQuery instead of pure javascript) and sprites for icons

Location:
extensions/kardon
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/kardon/slideshow.css

    r6458 r9803  
    2828body div#imageToolBar  {
    2929        position: absolute;
    30         width: 230px;
     30        width: 260px;
    3131        margin: 0;
    3232        right: 0;
  • extensions/kardon/template/slideshow.tpl

    r6458 r9803  
    1 {html_head}
    2 <link rel="stylesheet" type="text/css" href="themes/kardon/slideshow.css">
    3 {/html_head}
     1{combine_css path="themes/kardon/slideshow.css"}
     2
     3{footer_script require="jquery"}{literal}
     4jQuery(document).ready(function() {
     5  var maxWidth = maxHeight  = margin =  0;
     6  var finalW = w = {/literal}{$WIDTH_IMG}{literal}, finalH = h = {/literal}{$HEIGHT_IMG}{literal};
     7  if (typeof( window.innerWidth ) == 'number') {
     8    // Non-IE
     9    maxWidth = window.innerWidth;
     10    maxHeight = window.innerHeight;
     11  }
     12  else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
     13    //IE 6+ in 'standards compliant mode'
     14    maxWidth = document.documentElement.clientWidth;
     15    maxHeight = document.documentElement.clientHeight;
     16  }
     17  else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
     18    // IE 4 compatible
     19    maxWidth = document.body.clientWidth;
     20    maxHeight = document.body.clientHeight;
     21  }
     22
     23  maxHeight = maxHeight-32;
     24  if ((h > maxHeight) || (w > maxWidth)) {
     25    if ((h > maxHeight) && (w > maxWidth)) {
     26      if (maxHeight-h < maxWidth-w) {
     27        finalH = maxHeight;
     28        finalW = w * finalH / h;
     29      }
     30      else {
     31        finalW = maxWidth;
     32        finalH = h * finalW / w;
     33      }
     34    }
     35    else if ((h > maxHeight) && (w < maxWidth)) {
     36      finalH = maxHeight;
     37      finalW = w * finalH / h;
     38    }
     39    else if ((h < maxHeight) && (w > maxWidth)) {
     40      finalW = maxWidth;
     41      finalH = h * finalW / w;
     42    }
     43  }
     44  if ((maxHeight-finalH) > 0) {
     45    margin =  Math.round((maxHeight-finalH) / 2)
     46  }
     47
     48  jQuery("#theImage").append('<img style="margin-top:'+margin+'px; width:'+finalW+'px;height:'+finalH+'px" src="{/literal}{$SRC_IMG}{literal}" alt="">');
     49});
     50{/literal}{/footer_script}
    451
    552<div id="imageHeaderBar">
     
    2067
    2168<div id="theImage">
    22 {literal}
    23 <script type="text/javascript">//<!--
    24 
    25 var maxWidth = maxHeight  = margin =  0;
    26 var finalW = w = {/literal}{$WIDTH_IMG}{literal}, finalH = h = {/literal}{$HEIGHT_IMG}{literal};
    27 if( typeof( window.innerWidth ) == 'number' ) {
    28         //Non-IE
    29         maxWidth = window.innerWidth;
    30         maxHeight = window.innerHeight;
    31 } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    32         //IE 6+ in 'standards compliant mode'
    33         maxWidth = document.documentElement.clientWidth;
    34         maxHeight = document.documentElement.clientHeight;
    35 } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    36         //IE 4 compatible
    37         maxWidth = document.body.clientWidth;
    38         maxHeight = document.body.clientHeight;
    39 }
    40 maxHeight = maxHeight-32;
    41 if ((h > maxHeight) || (w > maxWidth)) {
    42         if ((h > maxHeight) && (w > maxWidth)) {
    43                 if (maxHeight-h < maxWidth-w) {
    44                         finalH = maxHeight;
    45                         finalW = w * finalH / h;
    46                         }
    47                 else {
    48                         finalW = maxWidth;
    49                         finalH = h * finalW / w;
    50                 }
    51         }
    52         else if ((h > maxHeight) && (w < maxWidth)) {
    53                 finalH = maxHeight;
    54                 finalW = w * finalH / h;
    55         }
    56         else if ((h < maxHeight) && (w > maxWidth)) {
    57                 finalW = maxWidth;
    58                 finalH = h * finalW / w;
    59         }
    60 }
    61 if ((maxHeight-finalH) > 0) {
    62         margin =  Math.round((maxHeight-finalH) / 2)
    63 }
    64 document.writeln("<img style=\"margin-top:"+margin+"px; width:"+finalW+"px;height:"+finalH+"px\" src=\"{/literal}{$SRC_IMG}{literal}\" alt=\"\">");
    65 
    66 //-->
    67 </script>
    68 {/literal}
    6969<noscript>
    7070  <div>
  • extensions/kardon/theme.css

    r6458 r9803  
    3838        font-style: italic;
    3939} /*}}}*/
     40
     41
     42.pwg-icon {
     43        background-image: url(icon/icons_sprite.png);
     44}
     45
     46#imageToolBar .pwg-button {
     47  width:28px;
     48}
     49
     50A:hover .pwg-icon {
     51        background-image: url(icon/icons_sprite_hover.png);
     52}
    4053
    4154
Note: See TracChangeset for help on using the changeset viewer.