218. File Comparison Report

Produced on Mon May 12 13:05:15 2008 UTC. This report uses XHTML and CSS2, and is best viewed with a reasonably standards compliant browser such as the latest version of Firefox or Internet Explorer. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.

218.1 Files compared

# Location File Last Modified
1 Mon May 12 13:05:15 2008 UTC
2 Dolphin-v.6.1.0\inc\js jquery.dolPromo.js Wed Apr 23 09:41:28 2008 UTC

218.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 0 0
Changed 0 0
Inserted 1 92
Removed 0 0

218.3 Comparison options

Whitespace
Character case Differences in character case are significant
Line endings Differences in line endings (CR and LF characters) are ignored
CR/LF characters Not shown in the comparison detail

218.4 Active regular expressions

No regular expressions were active.

218.5 Comparison detail

    1   // jQuery  plugin - D olphin Pro mo Images
    2   (function( $){
    3       $.fn.d olPromo =  function(  iInterval,  fRatio )  {
    4           fu nction res izeMyImage ($Img) {
    5                $Img.css ( { width:  'auto', h eight: 'au to', left:  0, top: 0  } );
    6                
    7                if( $Img .width() >  $promo.wi dth() ) {
    8                    var  fImgRatio  =  $Img.he ight() / $ Img.width( );
    9                    $Img .width( $p romo.width () ).heigh t( Math.ro und( $prom o.width()  * fImgRati o ) );
    10                }
    11                
    12                if( $Img .height()  > $promo.h eight() )  {
    13                    var  fImgRatio  = $Img.wid th() / $Im g.height() ;
    14                    $Img .width( Ma th.round(  $promo.hei ght() * fI mgRatio )  ).height(  $promo.hei ght() );
    15                }
    16                
    17                if( $Img .width() <  $promo.wi dth() ) {
    18                    var  left = Mat h.round( (  $promo.wi dth() - $I mg.width()  ) / 2 );
    19                    $Img .css( 'lef t', left ) ;
    20                }
    21                
    22                if( $Img .height()  < $promo.h eight() )  {
    23                    var  top = Math .round( (  $promo.hei ght() - $I mg.height( ) ) / 2 );
    24                    $Img .css( 'top ', top );
    25                }
    26           }
    27           
    28           fu nction swi tchThem()  {
    29                if( type of ePrev ! = 'undefin ed' )
    30                    ePre v.fadeOut(  1000 );
    31                
    32                eNext.fa deIn( 1000  );
    33                
    34                ePrev =  eNext;
    35                eNext =  eNext.next ( 'img' );
    36                
    37                if( !eNe xt.length  )
    38                    eNex t = $( 'im g:first',  $promo );
    39           }
    40           
    41           fu nction res etPromoSiz e() {
    42                $promo.h eight( Mat h.round( $ promo.widt h() * fRat io ) );
    43           }
    44           
    45           // default pa rameters
    46           va r iInterva l = iInter val || 300 0; //switc hing inter val in mil liseconds
    47           va r fRatio =  fRatio ||  0.28125;  //main div  size prop ortion (he ight/width )
    48           
    49           va r $promo =  this;
    50           
    51           re setPromoSi ze();
    52           
    53           $(  'img', $p romo ) //g et all ima ges
    54           .e ach( funct ion() { // for each i mage
    55                var $Img  = $(this) ; //get cu rrent imag e
    56                
    57                var imgO nload = fu nction() {  //when th e image is  loaded
    58                    $Img .hide();
    59                    resi zeMyImage(  $Img );
    60                };
    61                
    62                if( docu ment.all )  //ie
    63                    $Img .ready( im gOnload );
    64                else
    65                    $Img .bind( 'lo ad', imgOn load );
    66           }  );
    67           
    68           // run switch ing
    69           va r eNext =  $( 'img:fi rst', $pro mo );
    70           va r ePrev;
    71           
    72           sw itchThem() ;
    73           se tInterval(  switchThe m, iInterv al );
    74           
    75           
    76           va r iOldWidt h = $promo .width()
    77           // attach eve nt on wind ow resize
    78           $( window).re size( func tion() {
    79                resetPro moSize();
    80                var iNew Width = $p romo.width ();
    81                
    82                if( iOld Width != i NewWidth )  { //if th e main div  width is  changed
    83                    iOld Width = $p romo.width ();
    84                    
    85                    $( ' img', $pro mo ).each(  function( ) {
    86                         var $Img =  $(this);
    87                         resizeMyIm age( $Img  );
    88                    } );
    89                }
    90           }  );
    91       };
    92   })(jQuery) ;