Changeset 19003 for extensions/Autosize


Ignore:
Timestamp:
Nov 13, 2012, 3:06:06 PM (11 years ago)
Author:
cljosse
Message:

[extensions] Autosize fix compatibility with 2.4 (fix bugs)

Location:
extensions/Autosize
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • extensions/Autosize/autosize.inc.php

    r18975 r19003  
    3636**************************/
    3737 static public function autosize_calcContent($content,$element_info){
    38  
    39   global $conf,$page, $template,$picture,$user;
     38   global $conf,$page, $template,$picture,$user;
    4039  global $defined_types,$pictureSelType ,$pictureDeriv ,$liste_type,$SRC_IMG;
    4140  global $autosize_parametres,$user_status;
     
    5251}
    5352 if(preg_match("|event|", $DEBUG_autosize, $val))  $infos_message =  "autosize_calcContent, " ;
    54  if(preg_match("|test|", $DEBUG_autosize, $val )) {
    55      echo cl_print_var($infos_message) ;
    56  if ( isset($_COOKIE['pwg_id']) ) unset ($_COOKIE['pwg_id']) ;
    57  echo "COOKIE:"  . cl_print_var($_COOKIE) ;
    58  echo "GET:"  . cl_print_var($_GET) ;
    59  echo "POST:"  . cl_print_var($_POST) ;
    60  die("#60:" . $DEBUG_autosize);
    61  }
    6253    $ma_page=isset($page['body_id'])?$page['body_id']:"" ; 
    6354   if ($ma_page !='thePicturePage') return ;
    64 
    65            $types = array_intersect(array_keys(ImageStdParams::get_defined_type_map()), array("Autosize","SelMaxi"));
     55    $types = array_intersect(array_keys(ImageStdParams::get_defined_type_map()), array("Autosize","SelMaxi"));
    6656    if (count($types)==0){ 
    6757        include_once (AUTOSIZE_PATH.'maintain.inc.php');
     
    7262          unset (  $_COOKIE['autosize_reload']) ;
    7363    }
    74     if(!isset($_COOKIE['windowHeight'] )){
     64
     65    if(!isset($_COOKIE['picture_deriv'] )){
    7566       self::reload();
    76        die("#76" . $DEBUG_autosize);
     67       die("#76 autosize_calcContent:" . $DEBUG_autosize);
    7768    }
    7869
     
    8071   if (!isset($_COOKIE['autosize_reload'])  ){ 
    8172           self::reload();
    82             die("#82 :" + $DEBUG_autosize);
     73            die("#82 autosize_calcContent:" + $DEBUG_autosize);
    8374
    8475    } 
     
    111102  global  $template,$version,$icon_path,$page,$picture,$conf;
    112103  global $user,$Css,$css_slideshow,$css_display,$liste_type;
    113   global  $has_pamoorama,$pictureSelType,$pictureDeriv;
     104  global  $has_pamoorama,$pictureSelType,$pictureDeriv,$pictureMap;
    114105  global $infos_message,$warnings_message;
    115106
     
    135126  $css_slideshow=isset($Css['.Autosize']['slideshow'])?$Css['.Autosize']['slideshow']:"yes";
    136127  $css_display= isset($Css['.Autosize']['display'])?$Css['.Autosize']['display']:"block"; 
     128  $default_size =  $conf['derivative_default_size'];
     129//============================================================
     130self::get_cookies();
    137131 //==============================================================
    138   $pictureDeriv = pwg_get_session_var('picture_deriv',$conf['derivative_default_size']);
    139   $default_size =  $conf['derivative_default_size'];
     132 if(preg_match("|test|", $DEBUG_autosize, $val)) {
     133    echo "Init:SESSION:"  . cl_print_var($_SESSION) ;
     134       if ( isset($_COOKIE['pwg_id']) ) unset ($_COOKIE['pwg_id']) ;
     135        echo "Init: COOKIE:"  . cl_print_var($_COOKIE) ;
     136        echo "GET:"  . cl_print_var($_GET) ;
     137        echo "POST:"  . cl_print_var($_POST) ;
     138        echo "$pictureDeriv $pictureSelType $pictureMap ";
     139      //  die("#135: ".$DEBUG_autosize);
     140 }
    140141  $autosize_parametres = cl_autosize_Get_Options();
    141 //=======================================================================
    142 $pictureSelType = pwg_get_session_var('picture_sel_type',$pictureSelType); 
     142
     143//=====================================================================
     144  $current = $template->get_template_vars('current');
     145   //=== Zone affichage ==       
     146      $windowWidth=$_COOKIE['windowWidth'] ;
     147      $windowHeight=$_COOKIE['windowHeight'] ;
     148
     149      $theImageTop= isset($_COOKIE['theImageTop'])?$_COOKIE['theImageTop']:0;
     150      $theImageLeft=isset($_COOKIE['theImageLeft'])?$_COOKIE['theImageLeft']:0;
     151
     152       $theImageRight=isset($_COOKIE['theImageRight'])?$_COOKIE['theImageRight']:0;
     153       $theImageBottom=isset($_COOKIE['theImageBottom'])?$_COOKIE['theImageBottom']:0;
     154
     155
     156       $theImageMargeWidth=isset($_COOKIE['theImageMargeWidth']) ? $_COOKIE['theImageMargeWidth']:0;
     157       $theImageMargeHeight=isset($_COOKIE['theImageMargeHeight'])?$_COOKIE['theImageMargeHeight']:0;
     158
     159      $theImageMargeHeight -= 2;
     160if(isset($_COOKIE['theImageWidth'])){
     161       $theImageWidth=    $_COOKIE['theImageWidth'];
     162       $theImageHeight=  $_COOKIE['theImageHeight'] ;
     163}
     164       $theImageWidth=    $windowWidth -  $theImageLeft - $theImageMargeWidth;
     165       $theImageHeight=   $windowHeight - $theImageTop  - $theImageMargeHeight ;
     166 
     167   if (isset($element_info['is_gvideo']) && $element_info['is_gvideo'] ){
     168    $pictureDeriv=$default_size;
     169
     170   }else{
     171
     172
     173    $retour = self::get_min_max() ;
     174
     175    $theMainImageSize = $retour->get_size();
     176    $theMainImageWidth=   isset($_COOKIE['theMainImageWidth'])?$_COOKIE['theMainImageWidth']:$theMainImageSize[0];
     177    $theMainImageHeight=   isset($_COOKIE['theMainImageHeight'])?$_COOKIE['theMainImageHeight']:$theMainImageSize[1] ;
     178
     179  if($theImageHeight!=0 && $theImageWidth!=0){
     180      $pictureDeriv=$retour->type ;
     181   }else{
     182      $pictureDeriv=$default_size;
     183   }
     184}
    143185 
    144186 if(preg_match("|test|", $DEBUG_autosize, $val)) {
     187    echo "Init:SESSION:"  . cl_print_var($_SESSION) ;
    145188    echo $infos_message ;
    146189    if ( isset($_COOKIE['pwg_id']) ) unset ($_COOKIE['pwg_id']) ;
     
    148191        echo "GET:"  . cl_print_var($_GET) ;
    149192        echo "POST:"  . cl_print_var($_POST) ;
    150         die("#147: ".$DEBUG_autosize);
     193     echo ("#201: ".$DEBUG_autosize);
    151194 }
    152  
    153 
    154 if(!isset($_COOKIE['picture_sel_type'])){
    155    if($autosize_parametres->defaut_type=="off")
    156       $pictureSelType = pwg_get_session_var('picture_sel_type',"SelMaxi");
    157    else
    158       $pictureSelType = pwg_get_session_var('picture_sel_type',"Autosize");
    159        
    160 }else{
    161      $pictureSelType = $_COOKIE['picture_sel_type'] ;
    162 }
    163 
    164 //=====================================================================
    165   $current = $template->get_template_vars('current');
    166    //=== Zone affichage ==       
    167       $windowWidth=$_COOKIE['windowWidth'] ;
    168       $windowHeight=$_COOKIE['windowHeight'] ;
    169 
    170       $theImageTop= isset($_COOKIE['theImageTop'])?$_COOKIE['theImageTop']:0;
    171       $theImageLeft=isset($_COOKIE['theImageLeft'])?$_COOKIE['theImageLeft']:0;
    172 
    173        $theImageRight=isset($_COOKIE['theImageRight'])?$_COOKIE['theImageRight']:0;
    174        $theImageBottom=isset($_COOKIE['theImageBottom'])?$_COOKIE['theImageBottom']:0;
    175 
    176 
    177        $theImageMargeWidth=isset($_COOKIE['theImageMargeWidth']) ? $_COOKIE['theImageMargeWidth']:0;
    178        $theImageMargeHeight=isset($_COOKIE['theImageMargeHeight'])?$_COOKIE['theImageMargeHeight']:0;
    179 
    180       $theImageMargeHeight -= 2;
    181 if(isset($_COOKIE['theImageWidth'])){
    182        $theImageWidth=    $_COOKIE['theImageWidth'];
    183        $theImageHeight=  $_COOKIE['theImageHeight'] ;
    184 }
    185        $theImageWidth=    $windowWidth -  $theImageLeft - $theImageMargeWidth;
    186        $theImageHeight=   $windowHeight - $theImageTop  - $theImageMargeHeight ;
    187  
    188    if (isset($element_info['is_gvideo']) && $element_info['is_gvideo'] ){
    189     $pictureDeriv=$default_size;
    190 
    191    }else{
    192 
    193 
    194     $retour = self::get_min_max() ;
    195 
    196     $theMainImageSize = $retour->get_size();
    197     $theMainImageWidth=   isset($_COOKIE['theMainImageWidth'])?$_COOKIE['theMainImageWidth']:$theMainImageSize[0];
    198     $theMainImageHeight=   isset($_COOKIE['theMainImageHeight'])?$_COOKIE['theMainImageHeight']:$theMainImageSize[1] ;
    199 
    200   if($theImageHeight!=0 && $theImageWidth!=0){
    201       $pictureDeriv=$retour->type ;
    202    }else{
    203       $pictureDeriv=$default_size;
    204    }
    205 }
    206 //============================================================
    207   pwg_set_session_var('picture_deriv',$pictureDeriv);
    208   setcookie( 'picture_deriv',
    209             $pictureDeriv,
    210             0,
    211             cookie_path()
    212           );
    213 //============================================================
    214 pwg_set_session_var('picture_sel_type',$pictureSelType);
    215   setcookie( 'picture_sel_type',
    216             $pictureSelType,
    217             0,
    218             cookie_path()
    219           );
    220 //=============================================================
    221 $_COOKIE['picture_sel_type']=$pictureSelType;
    222 $_COOKIE['picture_deriv']=$pictureDeriv;
    223 
    224195 $pattern = array();
    225196  if($has_pamoorama=="true"){
     
    255226      $content=str_replace( "<object" , "<object id='theMainImage_obj' name='theMainImage' "  ,$content,$ncount);
    256227      $content=str_replace( "<embed" ,  "<embed id='theMainImage_emb' name='theMainImage' "  ,$content,$ncount);
    257       $content=str_replace( 'id="video"',"id='theMainImage_obj'  name='theMainImage' " ,$content,$ncount);
     228      $content=str_replace( 'id="video"',"id='theMainImage_vid'  name='theMainImage' " ,$content,$ncount);
     229  $content=str_replace( '<video"',"<video id='theMainImage_vid'  name='theMainImage' " ,$content,$ncount);
    258230  }else{
    259231      $content=str_replace( "<iframe" ,  "<iframe id='iframe' name='theMainImage' "  ,$content,$ncount);
     
    261233  $content=  preg_replace($pattern, "", $content);
    262234
    263   $content= "<div id='theMainImage' style='height:".$theImageHeight."px  ;width:".$theImageWidth."px '>". $content . "<img src='".AUTOSIZE_PATH . "images/transparent.gif' /></div>";
     235  $content= "<div id='theMainImage' style='height:".$theImageHeight."px  ;width:".$theImageWidth."px '>". $content . "</div>";
    264236 $content= "<style>#theImageAndInfos{height:auto;width:auto;position:relative}
    265   #theImage{height:auto;align:center;text-align:center;width:100%;position:relative}
     237  #theImage{height:auto;align:center;text-align:center;position:relative}
    266238  #theMainImage{height:auto;align:center;text-align:center;position:static} 
    267239  #charlie{display:none }
     
    270242return  $content;
    271243 }
    272  $content=  preg_replace($pattern, "", $content);
     244 
     245   $content=  preg_replace($pattern, "", $content);
    273246
    274247  return  $content;
     
    291264  if(preg_match("|event|", $DEBUG_autosize, $val)) { $infos_message .= "init2, ";} ;
    292265   global $theImageHeight,$theImageWidth,$theImageLeft,$theImageTop,$windowWidth,$windowHeight,$theMainImageSize;
    293 
    294 
    295266  //-- si Autosize correction redim ---------------
    296267  $current = $template->get_template_vars('current');
    297268  if (!isset($current)) return ;
    298  
    299 //  if( $has_pamoorama=="true") return $content ;
    300    if($pictureSelType!="Autosize") return $content ;
    301 
    302 $pattern =Array('/width=\"(\d+)\"/','/height=\"(\d+)\"/');
    303 $replacement = Array('',"style='height:".$theImageHeight."px'");
    304 $content= preg_replace($pattern, $replacement, $content);
     269  if($pictureSelType!="Autosize") return $content ; 
     270    $pattern =Array('/width=\"(\d+)\"/','/height=\"(\d+)\"/');
     271    $replacement = Array('',"style='height:".$theImageHeight."px'");
     272      $replacement = Array('',"");
     273    $content= preg_replace($pattern, $replacement, $content);
    305274if( $has_pamoorama=="true") return $content ;
    306275
    307276if( !preg_match("|c1|", $DEBUG_autosize, $val) ) return $content ;
    308 
    309277//************************  c1 ***************************************
    310278   echo "theMainImageWidth :" . $theMainImageSize[0] . " X " . $theMainImageSize[1]  . "<br >";
    311279   echo "theImageWidth :" . $theImageWidth . " X " . $theImageHeight . "<br >";
    312 
    313280   echo $infos_message."<br />";
    314    
    315281   $Ratio = $theMainImageSize[0]/$theMainImageSize[1];
    316282
     
    331297         echo "left:".$theImageLeft."px;top:".$theImageTop."px;width:".$theImageWidth ."px;height:" .$theImageHeight."px;";
    332298        echo "<div style='position:absolute;left:".$theImageLeft."px;top:".$theImageTop."px;width:".$theImageWidth ."px;height:" .  $theImageHeight."px;background-color:green;'>";
    333  
    334  
    335299 die("#317 : " . $content + $DEBUG_autosize);
    336  $theImageHeight =abs($theImageHeight);
    337  $theImageWidth =abs($theImageWidth);
    338 
    339     if ( preg_match("|<img|", $content, $val) ){
    340         $chars=substr($pictureDeriv,0,2);   
    341         $content=str_replace("<img ","<!--img ",$content);
    342         $content=str_replace(">","-->",$content);
    343         $src=explode( 'src=',$content);
    344         $src=explode( ' ',$src[1]);
    345         $src=$src[0];   
    346         $char2=substr($src,-7);
    347         $content=str_replace("$char2", $chars.'.JPG"',$content);   
    348         $ncount=1;
    349         $content=str_replace( "width" ,  "old_w"  ,$content,$ncount);
    350         $content=str_replace( "height" , "old_h" ,$content,$ncount);
    351         if (isset($theImageHeight) && isset($theImagewidth))
    352         $content=str_replace(" old_w","style='height:".$theImageHeight."px; width:".$theImageWidth."px;' old_w",$content,$ncount);
    353         $content=str_replace("<!--img ","<img ",$content);
    354         $content=str_replace("-->",">",$content);   
    355        
    356        $content=$content. "<span><br> height:".$theImageHeight."px; width:".$theImageWidth."px; </span>" ;
    357         return $content ;
    358     }
    359      // id="charlie"
    360      if ( preg_match("|charlie|", $content, $val) ){
    361    
    362 
    363      //    return $content ;
    364 
    365  }
    366 
    367  
    368 
    369      
    370300   
    371301} //INIT2
     
    374304***************************/
    375305static public  function reload(){
    376     //=========================================
    377     include_once ( "include/functions_cookie.inc.php");
     306//=========================================
     307include_once ( "include/functions_cookie.inc.php");   
     308global $ma_page,$user,$element_info,$infos_message,$DEBUG_autosize;
     309global $pictureDeriv,$pictureSelType,$pictureMap;
     310      global $conf;
     311
    378312  $set_miniature = "<!DOCTYPE html><html><head>
    379313   <meta http-equiv='content-type' content='text/html; charset=UTF-8'/>
     
    384318
    385319   $set_var = "<script type='text/javascript'>\n var COOKIE_PATH =  '".cookie_path()."';\n"; 
    386    global $ma_page,$user,$element_info;
     320
    387321   $set_var .= " var mapage =  '". $ma_page . "';\n"; 
    388322   $set_var .= " var theme =  '" .$user['theme']. "';\n"; 
     
    399333     <div></div>
    400334      </body></html>";   
     335
     336 
     337  $default_size =  $conf['derivative_default_size'];
     338//=======================================================================
     339$pictureSelType = pwg_get_session_var('picture_sel_type',$default_size); 
     340$pictureDeriv = pwg_get_session_var('picture_deriv',$default_size); 
     341$pictureMap = pwg_get_session_var('picture_map',$default_size); 
     342//=======================================================================
     343   $autosize_parametres = cl_autosize_Get_Options();
     344   $userst= $user['status']."_enabled" ;
     345 $userst=$autosize_parametres-> $userst;
     346 $usertype= $user['status']."_type" ;
     347 $usertype = $autosize_parametres->$usertype;
     348if($userst=='off'){
     349 
     350}else{
     351      if($usertype!="Autosize" && $usertype!="SelMaxi" ){
     352          $pictureSelType = $usertype;
     353          $pictureDeriv = $usertype;
     354      }else if($autosize_parametres->defaut_type=="off"){
     355          $pictureSelType = pwg_get_session_var('picture_sel_type',"SelMaxi");
     356      }else {
     357          $pictureSelType = pwg_get_session_var('picture_sel_type',"Autosize"); 
     358      }
     359}       
     360//============================================================
     361  self::save_cookies();
     362if( !isset($_COOKIE['picture_deriv'])  ){
     363  echo "INIT <pre>";
     364  print_r($_COOKIE);
     365  die(400);
     366}
     367
     368if(preg_match("|vue_init|", $DEBUG_autosize, $val)) {
     369        echo "Reload: $userst <br> $usertype <br> autosize_parametres:"  . cl_print_var($autosize_parametres) ;
     370        echo $infos_message ;
     371    if ( isset($_COOKIE['pwg_id']) ) unset ($_COOKIE['pwg_id']) ;
     372        echo "Reload: SESSION:"  . cl_print_var($_SESSION) ;
     373        echo "Reload: COOKIE:"  . cl_print_var($_COOKIE) ;
     374        echo "GET:"  . cl_print_var($_GET) ;
     375        echo "POST:"  . cl_print_var($_POST) ;
     376        die("#442: ".$DEBUG_autosize);
     377 }
    401378        echo $set_miniature ;
    402379        echo $set_var ;
    403380        echo $autoscript; 
    404                  die();
     381        die();
    405382      //=========================================     
    406383
     
    422399 //==== mise à l'échelle ===
    423400    $current = $template->get_template_vars('current');
    424       $default_size =  $conf['derivative_default_size'];
     401    $default_size =  $conf['derivative_default_size'];
    425402
    426403    if(isset($current['selected_derivative'])) {
     
    443420    $autosize_parametres =       cl_autosize_Get_Options() ;                   
    444421    $theme=$user['theme'];
    445 
    446422    //==============================================================================
    447  
    448423    $template->assign(
    449424      array(   
     
    458433          'AUTOSIZE_PATH_ABS' => AUTOSIZE_PATH_ABS,
    459434          'Version_pwg' => PHPWG_VERSION ,
    460           'slideshow' => $page['slideshow']
     435          'slide_show' => $page['slideshow']
    461436         )
    462437    );
     
    488463    $theme=$user['theme'];
    489464    if ($has_pamoorama=="false" ) return ;
    490     if ($css_slideshow="no" and isset($_GET['slideshow'])) return ;   
     465    if ($css_slideshow == "no" and isset($_GET['slideshow'])) return ;   
    491466                        $AUTOSIZE_PATH = dirname(__FILE__).'/';
    492 
    493467//=====================================================================
    494 
    495 
    496468                        $template->assign(
    497469                                        array(
     
    501473                                        'theme' => $theme  ,
    502474                                        'DEBUG_autosize' => $DEBUG_autosize   ,
    503                                         'AUTOSIZE_PATH' => AUTOSIZE_PATH
    504          
     475                                        'AUTOSIZE_PATH' => AUTOSIZE_PATH         
    505476                                        )
    506477                                                );
    507 
    508478                        $autoscript="<script type='text/javascript'>
    509479                        /* cl_autosize_script_2 */
     
    558528*************************/     
    559529        static public function cl_autosize_affiche(){
    560 
    561 
    562530  if (!defined('AUTOSIZE_PATH')) {
    563531      define(  'AUTOSIZE_PATH',   PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/' );
     
    565533        define(  'AUTOSIZE_PATH_ABS',  realpath(AUTOSIZE_PATH)."/");
    566534}
    567 
    568535
    569536    global $user, $picture, $template,$page,$known_script;
     
    575542    global $autosize_parametres,$user_status;   
    576543    global  $has_pamoorama,$pictureSelType,$pictureDeriv;
    577      global $DEBUG_autosize;
     544    global $DEBUG_autosize;
     545      global $css_slideshow,$css_display; 
    578546      if(preg_match("|event|", $DEBUG_autosize, $val)) { $infos_message .=  "cl_autosize_affiche, " ;} ;
    579 
    580547$ma_page=isset($page['body_id'])?$page['body_id']:"" ;
    581548if ($ma_page !='thePicturePage') return ; 
     549//============================================================
     550 self::save_cookies();
     551
    582552    if(isset($set_miniature)){
    583 
    584553          $set_miniature = self::cl_autosize_nofile($set_miniature) ;
    585554          $set_miniatures= explode("script",$set_miniature);
     
    594563          $template->append('footer_elements',$set_miniature); 
    595564      }
    596          
    597   global $css_slideshow,$css_display;
    598                 $AUTOSIZE_PATH = dirname(__FILE__).'/';
    599    $theme=$user['theme']; 
    600                 load_language('plugin.lang', AUTOSIZE_PATH);
    601                 include_once (AUTOSIZE_PATH."include/affiche.php");     
    602   
     565 if ($css_slideshow == "no" and isset($_GET['slideshow'])) return ;   
     566 
     567  $AUTOSIZE_PATH = dirname(__FILE__).'/';
     568  $theme=$user['theme']; 
     569  load_language('plugin.lang', AUTOSIZE_PATH);
     570
     571 include_once (AUTOSIZE_PATH."include/affiche.php");  
    603572
    604573     $file =AUTOSIZE_PATH_ABS.'template/picture_1.tpl' ;
     
    613582     if($pictureSelType == $pictureDeriv ) {
    614583         if(preg_match("|event|", $DEBUG_autosize, $val)) {  cl_aff_infos_plus();} ;
    615      //   return ;
     584   
    616585     }
    617          if (defined('GMAPS_VERSION')) $gmaps_function="true";
     586     
     587    if (defined('GMAPS_VERSION')) $gmaps_function="true";
    618588          else $gmaps_function="false" ;
     589
     590
    619591
    620592        $template->set_filenames(array('autosize_content_header'=> $file ));
     
    669641        $template->parse('mes_script');
    670642      }   
    671      
    672         cl_aff_infos_plus();
     643     
     644
     645if(preg_match("|vue_cookies|", $DEBUG_autosize, $val)) {
     646
     647  $pictureSelType=$_COOKIE['picture_sel_type'];
     648  $pictureDeriv=$_COOKIE['picture_deriv'];
     649  $infos_message .= "cl_autosize_affiche: $pictureSelType  <--> $pictureDeriv \n" ;
     650
     651}
     652   cl_aff_infos_plus();
     653   if(preg_match("|test|", $DEBUG_autosize, $val)) {
     654    echo "cl_autosize_affiche:_COOKIE:"  . cl_print_var($_COOKIE) ;
     655    echo $infos_message ;
     656    $pictureMap=$_COOKIE['picture_map'];
     657    echo "SelType:" . $pictureSelType." pictureDeriv:".$pictureDeriv ." pictureMap:".$pictureMap;
     658    die ("#710: ".$DEBUG_autosize);
     659 }
    673660        return $template->parse( 'autosize_content', false);
    674    
    675        
    676 
    677661        } //public function cl_autosize_affiche
    678662
     
    10421026    $img_url  = $img_select->get_url();
    10431027    if(!file_exists(PHPWG_ROOT_PATH.$img_url)){   
    1044       $img_type  =  $img_select->get_type();     
     1028      $img_type  =  $img_select->get_type();     
     1029     
    10451030      $file_id=explode("?",$img_url);
    10461031      if(count($file_id) ==1){
     
    10531038              $file_no->id=$id ;
    10541039              $file_no->type=$img_type ;
    1055               array_push($nofiles,serialize($file_no)) ;             
     1040              array_push($nofiles,serialize($file_no)) ;   
     1041               if( $img_type == $pictureDeriv){
     1042         
     1043          break ;
     1044    }           
    10561045      }
    10571046      $ok=false ;     
     
    10661055      $nosrc=true ;
    10671056    } 
    1068    
    1069      
    1070    $exec_miniatures ="";
     1057    $exec_miniatures ="";
    10711058      $script_miniatures .= "<script type='text/javascript'>
    10721059        var nofile=Array(";
     
    10921079    }
    10931080 }
     1081 /***************************
     1082 *  get_cookies
     1083 ****************************/
     1084 static public  function  get_cookies(){
     1085  global $pictureDeriv,$pictureSelType,$pictureDeriv;
     1086  if(!isset($_COOKIE['picture_deriv'])){
     1087      $pictureDeriv= pwg_get_session_var('picture_deriv');
     1088      $pictureSelType = pwg_get_session_var('picture_sel_type');
     1089      $pictureMap = pwg_get_session_var('picture_map') | $pictureDeriv;
     1090  }else{
     1091      $pictureDeriv = $_COOKIE['picture_deriv'];
     1092      $pictureSelType = isset( $_COOKIE['picture_sel_type'])?$_COOKIE['picture_sel_type']:$pictureDeriv;
     1093     
     1094      $pictureMap =  isset($_COOKIE['picture_map'])?$_COOKIE['picture_map']:$pictureDeriv;
     1095  }
     1096  $_COOKIE['picture_sel_type']=$pictureSelType;
     1097  $_COOKIE['picture_deriv']=$pictureDeriv;
     1098  $_COOKIE['picture_map']=$pictureMap;
     1099
     1100 }
     1101 /***************************
     1102 * save_cookies
     1103 ****************************/
     1104 static public  function  save_cookies(){
     1105 global $pictureDeriv,$pictureSelType,$pictureDeriv;
     1106
     1107  pwg_set_session_var('picture_deriv',$pictureDeriv);
     1108  pwg_set_session_var('picture_sel_type',$pictureSelType);
     1109  pwg_set_session_var('picture_map',$pictureDeriv);
     1110//============================================================
     1111  setcookie( 'picture_sel_type',
     1112            $pictureSelType,
     1113            time()+5,
     1114            cookie_path()
     1115          );
     1116//=============================================================
     1117  setcookie( 'picture_map',
     1118            $pictureDeriv,
     1119            time()+5,
     1120            cookie_path()
     1121          );
     1122//============================================================
     1123  setcookie( 'picture_deriv',
     1124            $pictureDeriv,
     1125            time()+5,
     1126            cookie_path()
     1127          );
     1128$_COOKIE['picture_sel_type']=$pictureSelType;
     1129$_COOKIE['picture_deriv']=$pictureDeriv;
     1130$_COOKIE['picture_map']=$pictureDeriv;
     1131}
    10941132 //==================================================
    10951133} // class
  • extensions/Autosize/css/kardon.css

    r18325 r19003  
    1 
    2 
    3   #theImage {
    4   border: 1px solid Transparent;
    5  
     1#theImage {
     2 margin-top :2px;
     3  border: 0px solid red;
     4 
    65}
    76.contentWithMenu {
     
    1312  text-align: center;
    1413}
     14#content{ border: 1px solid Transparent;
     15
     16}
  • extensions/Autosize/include/affiche.php

    r18949 r19003  
    5858$COOKIE_PATH= cookie_path() ;
    5959 global $DEBUG_autosize;
    60      
     60
     61 $slide_show = isset($page['slideshow'])?$page['slideshow']:false;
     62
    6163        $template->assign(
    6264                                        array( 
     
    6971            'liste_type' => $liste_type ,
    7072            'COOKIE_PATH' =>  $COOKIE_PATH  ,
     73            'slide_show' => $slide_show,
    7174             
    7275            'ratio' =>$imgSizeWH[0]/$imgSizeWH[1] ,   
  • extensions/Autosize/js/Affiche_script.js

    r18975 r19003  
    66  *  document ready
    77  ********************************************/
    8 
    9 
    108  jQuery(document).ready(function (jQuery) {
    119    var Type_Img;
     
    3230      parametres.windowWidth = jQuery(window).width();
    3331      try {
     32        if (parametres.pictureDeriv) jQuery.cookie('picture_deriv', parametres.pictureDeriv, { path: COOKIE_PATH });
    3433        if (parametres.pictureSelType) jQuery.cookie('picture_sel_type', parametres.pictureSelType, { path: COOKIE_PATH });
    35         if (parametres.pictureDeriv) jQuery.cookie('picture_deriv', parametres.pictureDeriv, { path: COOKIE_PATH });
    3634        if (parametres.pictureMap) jQuery.cookie('picture_map', parametres.pictureMap, { path: COOKIE_PATH });
    3735        if (parametres.imgSrc) jQuery.cookie('img_src', parametres.imgSrc, { path: COOKIE_PATH });
     
    5149        }
    5250      } catch (e) {
    53 
     51        n = 1;
    5452      }
    5553
     
    6462        pictureDeriv: jQuery.cookie('picture_deriv'),
    6563        pictureMap: jQuery.cookie('picture_map'),
     64        pictureSelType: jQuery.cookie('picture_sel_type'),
     65
    6666        imgSrc: jQuery.cookie('img_src'),
    67         pictureSelType: jQuery.cookie('picture_sel_type'),
    6867        theMainImageHeight: jQuery.cookie('theMainImageHeight'),
    6968        theMainImageWidth: jQuery.cookie('theMainImageWidth'),
    70 
    7169
    7270        windowHeight: jQuery.cookie('windowHeight'),
     
    228226
    229227        }
     228        jQuery("#derivativeSwitchBox span").removeClass("auto_details linkAutosize");
     229        jQuery("#derivativeSwitchBox a").removeClass("auto_details linkAutosize");
     230        if (options.pictureSelType == "Autosize" || options.pictureSelType == "SelMaxi") {
     231          spans = jQuery("#derivativeChecked" + options.pictureSelType).next();
     232          spans.addClass("linkAutosize");
     233          spans.find("span").addClass("auto_details");
     234          jQuery(".auto_details").text("");
     235        }
    230236        if (options.pictureDeriv) {
     237          if (options.pictureSelType == "Autosize" || options.pictureSelType == "SelMaxi")
     238            jQuery("#derivativeChecked" + options.pictureSelType).css("visibility", "visible");
     239          else
     240            jQuery("#derivativeChecked" + options.pictureDeriv).css("visibility", "visible");
    231241          jQuery('.auto_details').text(" (" + Zone_image.image.width + " x " + Zone_image.image.height + ") " + options.pictureDeriv);
    232242        }
     
    247257      }
    248258      Affiche_limite(pictureSelType_user);
    249       jQuery("#derivativeChecked" + options.pictureDeriv).css({ visibility: 'visible'      });
    250 
    251259    }
    252260    //____________________ set_cl _____________________________
     
    306314    ********************************************/
    307315    jQuery(window).load(function () {
    308       href = location.href;
     316      location_href = location.href;
    309317      var aff_ok = false;
    310318      //=======================================================================
     
    312320      infos_theMainImage = jQuery(theMainImage_id).infos({ absolute: true });
    313321      infos_theImageAndInfos = jQuery(theImageAndInfos_id).infos();  // Cadre general
    314       theMainImage_obj = "theMainImage_obj";
    315       infos_theMainImage_obj = jQuery("#" + theMainImage_obj).infos({ absolute: true });
     322      the_mainImage_obj = "theMainImage_obj";
     323      infos_theMainImage_obj = jQuery("#" + the_mainImage_obj).infos({ absolute: true });
    316324
    317325      infos_theMainImage_obj.rapport = infos_theMainImage_obj.width / infos_theMainImage_obj.height;
     
    484492    }
    485493    options = jQuery.extend(Autosize_options, options);
    486     var COOKIE_PATH = options.COOKIE_PATH;
    487     var cookies = Get_cookies();
     494
    488495
    489496    var defaults = {
     
    505512    options.marge_gauche = jQuery(".Autosize").Get_Val_int(jQuery(".Autosize").css("left"));
    506513    options.marge_droite = jQuery(".Autosize").Get_Val_int(jQuery(".Autosize").css("right"));
     514
    507515    jQuery(".Autosize").hide();
     516    DEBUG_autosize = options.DEBUG_autosize;
     517    var COOKIE_PATH = options.COOKIE_PATH;
     518    var cookies = Get_cookies();
    508519
    509520    fade_in = options.fade_in || 0;
     
    516527    }
    517528
    518     DEBUG_autosize = options.DEBUG_autosize;
     529
    519530    Get_type_img();
    520531
     
    571582      path_names = new Array();
    572583      jQuery("#derivativeSwitchBox a").css('visibility', 'hidden');
    573       jQuery(".switchCheck").css('visibility', 'hidden');
     584      // jQuery(".switchCheck").css('visibility', 'hidden');
    574585      var maxi_display = false;
    575586      jQuery("#derivativeSwitchBox a").each(function (i) {
    576587        href_path = jQuery(this).attr("href");
     588        if (!href_path) {
     589          href_path = jQuery(this).html();
     590          return;
     591        }
     592        pt = href_path.replace(/(javascript|changeImgSrc)|[('):]/gi, "");
     593
    577594        patname = href_path.replace("javascript\:", "");
    578         path_names.push(patname);
    579         pt[i] = href_path.split("','");
    580         tsz = pt[i][2].replace("')", "");
     595        pt = pt.split(",");
     596        tsz = pt[pt.length - 1];
    581597        if (!maxi_display)
    582598          jQuery(this).css('visibility', 'visible');
     
    595611          if (tsz == "Original" && (pictureSelType_Maxi != "Autosize" && pictureSelType_Maxi != "SelMaxi")) {
    596612            maxi_display = true;
    597           }
    598           if (tsz == pictureSelType_Maxi && (pictureSelType_Maxi != "Autosize" && pictureSelType_Maxi != "SelMaxi")) {
     613          } else if (tsz == pictureSelType_Maxi && (pictureSelType_Maxi != "Autosize" && pictureSelType_Maxi != "SelMaxi")) {
    599614            maxi_display = true;
    600615
    601           }
     616          } else if (tsz == "Autosize" || tsz == "SelMaxi") {
     617            patname = old_path.replace("')", "','" + tsz + "')");
     618          } else
     619            old_path = patname;
     620          path_names.push(patname);
    602621
    603622        }
     
    759778      function decode_href(myObj) {
    760779        hrefPath = jQuery(myObj).attr("href");
    761         if (hrefPath.indexOf("changeImg") == 0) {
     780        if (hrefPath.indexOf("changeImgSrc") < 0) {
    762781          pt = hrefPath;
    763782        } else {
    764           pt = hrefPath.split("(");
    765           pt = pt[1].split(")");
    766           pt = pt[0].replace(RegExp("'", "g"), "");
    767         }
    768         pt = pt.replace(RegExp(" ", "g"), "");
     783          pt = hrefPath.replace(/(javascript|phpWGOpenWindow|javascript|changeImgSrc)|[('):]/gi, "");
     784
     785        }
    769786        pt = pt.split(",");
    770787        source = pt[0];
    771 
    772         pictureDeriv = pt[1];
    773         pictureMap = pt[2];
    774         if (pt.length > 3)
    775           pictureSelType = pt[3];
    776         else
    777           pictureSelType = pt[1];
    778 
     788        if (hrefPath.indexOf("phpWGOpenWindow") < 0) {
     789          pictureDeriv = pt[1];
     790          pictureMap = pt[2];
     791          pictureSelType = pt[pt.length - 1];
     792        } else {
     793          pictureDeriv = options.pictureDeriv;
     794          pictureMap = options.pictureMap;
     795          pictureSelType = options.pictureSelType;
     796        }
    779797        return { source: source,
    780798          pictureDeriv: pictureDeriv,
     
    801819
    802820        }
    803 
    804         jQuery("#derivativeSwitchBox span").removeClass("auto_details linkAutosize");
    805         jQuery("#derivativeSwitchBox a").removeClass("auto_details linkAutosize");
    806         if (options.pictureSelType == "Autosize" || options.pictureSelType == "SelMaxi") {
    807           spans = jQuery("#derivativeChecked" + options.pictureSelType).next();
    808           spans.addClass("linkAutosize");
    809           spans.find("span").addClass("auto_details");
    810           jQuery(".auto_details").text("");
    811         }
    812821        Autosize_resize(true, options);
    813822      }
     
    918927
    919928        if (Type_Img == "charlie" || Type_Img == "iframe") {
    920 
    921 
    922929          if (Type_Img == "charlie") {
    923930            dp1 = jQuery("#charlie").offset();
    924             dp = jQuery("#" + theMainImage_obj).offset();
     931            dp = jQuery("#" + the_mainImage_obj).offset();
    925932            if (dp) {
    926933              if (wpng == 0)
    927                 wpng = (dp.left - dp1.left) * 2;
     934                wpng = Math.abs(dp.left - dp1.left) * 2;
    928935            }
    929             mrgl = (jQuery("#" + "theImage").width() - Zone_image.image.width) / 2;
    930936            png_h = jQuery("#" + Type_Img + " div").height();
    931             jQuery("#" + Type_Img).css({ marginLeft: mrgl + "px" });
    932             jQuery("#" + Type_Img).width(Zone_image.image.width);
    933             jQuery("#" + Type_Img).height(Zone_image.image.height);
    934 
    935             w01 = jQuery("#" + theMainImage_obj).width();
    936             jQuery("#" + theMainImage_obj).attr("width", Zone_image.image.width - wpng);
    937             jQuery("#" + theMainImage_obj).attr("height", Zone_image.image.height);
    938             jQuery("#theMainImage_emb").attr("width", Zone_image.image.width - wpng);
    939             jQuery("#theMainImage_emb").attr("height", Zone_image.image.height);
     937            w01 = Math.ceil(jQuery("#" + "theImage").width() - wpng);
     938            jQuery("#" + "theImage").css({ padding: 0 });
     939            if (!png_h) {
     940              png_h = jQuery("#theMainImage").height();
     941              h01 = png_h;
     942            } else
     943              h01 = Math.ceil(w01 / Zone_image.image.rapport);
     944            //==== Zone Affichage =====
    940945            jQuery("#theMainImage").height(png_h);
     946            jQuery("#theMainImage").width(w01 + wpng);
     947            jQuery("#theMainImage").css({ verticalAlign: "middle", align: "center", textAlign: "center", margin: "auto" });
     948
     949            jQuery("#" + the_mainImage_obj).attr("width", w01);
     950            jQuery("#" + the_mainImage_obj).attr("height", h01);
     951
     952            jQuery("#theMainImage_emb").attr("width", w01); //firefox opera
     953            jQuery("#theMainImage_emb").attr("height", h01);
     954
     955            if (jQuery("#theMainImage_vid").length > 0) {
     956              jQuery("#theMainImage_vid").attr("width", w01);
     957              jQuery("#theMainImage_vid").attr("height", h01);
     958            }
     959            if (jQuery("video").length > 0) {
     960              jQuery("video").attr("width", w01);
     961              jQuery("video").attr("height", h01);
     962            }
    941963            jQuery("#" + Type_Img).height(png_h);
    942964
    943965
     966            jQuery("#" + Type_Img + " div").width(w01);
     967
     968
     969
    944970          } else {
    945             jQuery("#" + theMainImage_obj).attr("width", Zone_image.image.width);
    946             jQuery("#" + theMainImage_obj).attr("height", Zone_image.image.height);
    947             jQuery("#" + Type_Img).attr("width", Zone_image.image.width);
    948             jQuery("#" + Type_Img).attr("height", Zone_image.image.height);
     971            jQuery("#theImage").css({ height: "auto" });
     972            jQuery("#theMainImage").css({ width: "auto", height: "auto" });
     973            jQuery("#" + Type_Img).attr("width", Zone_image.image.width - (infos_theMainImage.borderwidth.left + infos_theMainImage.borderwidth.right));
     974            jQuery("#" + Type_Img).attr("height", Zone_image.image.height - (infos_theMainImage.borderwidth.top + infos_theMainImage.borderwidth.bottom));
    949975          }
    950 
    951 
    952 
    953976          jQuery("#" + Type_Img).show(options.fade_in);
    954977        }
     
    967990    ******************/
    968991    changeImgSrc = function (url, typeSave, typeMap, type) {
    969       if (url) {
    970         if (url.match(RegExp("i.php", "gi"))) {
    971           urls = url.split("?");
    972           urls = urls[1].split("?");
    973           //   Set_images(urls);
    974 
    975         }
    976       }
    977       url2 = jQuery("#theMainImage").attr("src");
    978       if (typeof type != "undefined")
     992
     993      if (COOKIE_PATH == type) {
     994        type = options.pictureSelType;
     995      }
     996      if (typeof type != "undefined") {
    979997        options.pictureSelType = type;
    980       else {
    981         options.pictureSelType = typeSave;
    982         type = typeSave;
    983 
     998      } else {
     999        type = options.pictureSelType;
    9841000      }
    9851001      options.pictureDeriv = typeSave;
    9861002      typeMap = typeSave;
    987 
     1003      options.pictureMap = typeMap;
     1004      options.pictureDeriv = typeSave;
     1005      jQuery.cookie('picture_deriv', typeSave, { path: COOKIE_PATH });
     1006
     1007      url_old = jQuery("#theMainImage").attr("src");
     1008      if (url != url_old) {
     1009        jQuery("#theMainImage").attr("src", url);
     1010      }
    9881011      jQuery('#derivativeSwitchBox .switchCheck').css('visibility', 'hidden');
    9891012      if (typeof type != "undefined" && (type == "Autosize" || type == "SelMaxi")) {
    9901013        jQuery('#derivativeChecked' + type).css('visibility', 'visible');
    991         document.cookie = 'picture_sel_type=' + type + ';path=' + COOKIE_PATH;
     1014        jQuery.cookie('picture_sel_type', type, { path: COOKIE_PATH });
    9921015      } else {
    9931016
    9941017        jQuery('#derivativeChecked' + typeSave).css('visibility', 'visible');
    995         document.cookie = 'picture_sel_type=' + typeSave + ';path=' + COOKIE_PATH;
    996       }
    997       options.pictureMap = typeMap;
    998       options.pictureDeriv = typeSave;
    999       document.cookie = 'picture_deriv=' + typeSave + ';path=' + COOKIE_PATH;
    1000       jQuery("#theMainImage").attr("src", url);
     1018        jQuery.cookie('picture_sel_type', typeSave, { path: COOKIE_PATH });
     1019      }
    10011020
    10021021      // jQuery("#theMainImage," + theMainImage_id + ",.preload, .next1 , ")
     
    10141033          // le fichier n'est pas present
    10151034          imgsrc = jQuery(this).attr("src");
    1016 
    10171035          return false;
    1018 
    1019           imgsrc = jQuery(this).attr("src").replace("./_data/i/", "", 1);
    1020           imgsrc = this.src.split("/_data/i")[1];
    1021           if (typeof imgsrc == "undefined") return false;
    1022           url = 'i.php?' + imgsrc + "&ajaxload=true";
    1023           jQuery(theMainImage_id).attr("src", url);
    1024           //  getDerivativeUrls(imgsrc);
    10251036        }
    10261037
     
    10661077              if (data.src) { }
    10671078              if (options.pictureDeriv == "Original" && data.src.match(RegExp("\-.." + ".jpg", "gi"))) {
    1068                 Autosize_resize(true, options);
     1079                //    Autosize_resize(true, options);
    10691080              } else if (data.src.match(RegExp(options.pictureDeriv.substr(0, 2) + ".jpg", "gi"))) {
    1070                 Autosize_resize(true, options);
     1081                //    Autosize_resize(true, options);
    10711082              } else {
    10721083
    1073               }
    1074               type = options.pictureSelType;
    1075               typeSave = options.pictureDeriv;
    1076               jQuery('#derivativeSwitchBox .switchCheck').css('visibility', 'hidden');
    1077               if (typeof type != "undefined" && (type == "Autosize" || type == "SelMaxi")) {
    1078                 jQuery('#derivativeChecked' + type).css('visibility', 'visible');
    1079               } else {
    1080                 jQuery('#derivativeChecked' + typeSave).css('visibility', 'visible');
    10811084              }
    10821085
     
    10841087      //_________ theMainImage  ___________
    10851088
    1086 
    1087       document.cookie = 'picture_deriv=' + typeSave + ';path=' + COOKIE_PATH;
    10881089    }
    10891090
     
    11651166    }).mouseover(function (i) {
    11661167
    1167     })
    1168 
     1168    });
    11691169
    11701170    Wait_pamoorama_time = function () {
    11711171      if (nopano == true) return true;
    1172 
    1173 
    1174 
    11751172      if (jQuery("#pamoorama").length) {
    11761173        tempo = tempo + 1;
     
    14481445        identique = Zone_image.src.match(RegExp(imgSrc, "gi"));
    14491446        if (identique) return;
    1450         href = get_href(IMg.pictureDeriv);
    1451         href_path = "javascript:" + href;
    1452         jQuery(".linkAutosize").attr("href", href_path);
     1447        href_path = get_href(IMg.pictureDeriv);
     1448        jQuery(".linkAutosize").attr("href", "javascript:" + href_path);
    14531449        theImg = document.getElementById(theMainImage_id.replace("#", ""));
    14541450
     
    14591455        } else {
    14601456          last_id = IMg.pictureDeriv;
    1461           eval(href);
    1462           //changeImgSrc(imgSrc, last_id, IMg.pictureMap, options.pictureSelType);
     1457          eval(href_path);
     1458          // changeImgSrc(imgSrc.replace("./",""), last_id, IMg.pictureMap, options.pictureSelType);
    14631459        }
    14641460
     
    14841480
    14851481    get_href = function (NewpictureDeriv) {
     1482      ref = path_names[0];
    14861483      for (i = 0; i < path_names.length; i++) {
    14871484        newHref = path_names[i];
     
    14911488          href = newHref;
    14921489          if (options.pictureSelType == "Autosize" || options.pictureSelType == "SelMaxi") {
    1493             href = href.replace("')", "','" + options.pictureSelType + "')");
     1490            ref = href.replace("')", "','" + options.pictureSelType + "')");
     1491          } else {
     1492            ref = href;
    14941493          }
    14951494          break;
     
    14971496
    14981497      }
    1499       return href;
     1498
     1499
     1500      return ref;
    15001501    };
    15011502
     
    16281629      // copyright
    16291630
     1631      if (options.slideshow) {
     1632
     1633
     1634      } else {
     1635
     1636      }
    16301637
    16311638
     
    16511658        infos_the_page.margin.left = 20;  //taille fleche
    16521659        infos_the_page.margin.right = 20;
    1653       }
    1654 
    1655 
    1656       if (test_theme("elegant")) {
     1660
     1661      } else if (test_theme("kardon")) {
     1662
     1663      } else if (test_theme("elegant")) {
    16571664
    16581665        if (infos_imageInfos.visible == true) {
     
    16691676
    16701677      } else if (test_theme("simple")) {
    1671 
    1672 
     1678        infos_menubar = jQuery("#menubar").infos({ absolute: true });
     1679        infos_imageInfoBar = jQuery("#imageInfoBar").infos({ absolute: true });
     1680
     1681        jQuery("#theImage").width(infos_imageInfoBar.left - infos_theImage.left - 2);
     1682        marge_left += 0;
     1683        marge_right += 0;
    16731684
    16741685      } else if (test_theme("OS")) {
     
    17051716      if (!options.check_desc_v)
    17061717        options.marge_bottom_2 = 0;
     1718      else
     1719        options.marge_bottom = 0;
     1720
    17071721      marge_bottom = options.marge_bottom_2 + options.marge_bottom;
    17081722      //================== Limite Format Image =====================
     
    17861800
    17871801      options.theImageBottom = new_win.height - new_dim.out.bottom;
    1788       options.marge_top = Math.ceil(new_img.top - new_dim.top);
     1802      if (options.slideshow) {
     1803
     1804        options.marge_top = 0;
     1805      } else {
     1806        options.marge_top = Math.ceil(new_img.top - new_dim.top);
     1807      }
    17891808
    17901809      if (options.theImageBottom_2 < 0) {
     
    19801999      sav_p = options.pictureSelType;
    19812000      options.pictureSelType = "SelMaxi";
    1982       href = get_href(options.pictureDeriv);
    1983       href_path = "javascript:" + href;
    1984 
     2001      href_path = get_href(options.pictureDeriv);
    19852002      spans = jQuery("#derivativeCheckedSelMaxi").next();
    1986       spans.attr("href", href_path);
     2003      spans.attr("href", "javascript:" + href_path);
    19872004      spans.attr("name", "SelMaxi");
    19882005      spans = spans.find("span");
     
    19912008      //==========================================================
    19922009      options.pictureSelType = "Autosize";
    1993       href = get_href(options.pictureDeriv);
    1994       href_path = "javascript:" + href;
    1995 
     2010      href_path = get_href(options.pictureDeriv);
    19962011      spans = jQuery("#derivativeCheckedAutosize").next();
    1997       spans.attr("href", href_path);
     2012      spans.attr("href", "javascript:" + href_path);
    19982013      spans.attr("name", "Autosize");
    19992014      spans = spans.find("span");
     
    20022017      //==========================================================
    20032018      options.pictureSelType = sav_p;
    2004 
     2019      jQuery('#derivativeSwitchBox .switchCheck').css('visibility', 'hidden');
    20052020      if (options.pictureSelType == "Autosize" || options.pictureSelType == "SelMaxi") {
     2021        jQuery('#derivativeChecked' + options.pictureSelType).css('visibility', 'visible');
    20062022        spans = jQuery("#derivativeChecked" + options.pictureSelType).next();
    20072023        spans.addClass("linkAutosize");
    20082024        spans.find("span").addClass("auto_details");
     2025      } else {
     2026        jQuery('#derivativeChecked' + options.pictureDeriv).css('visibility', 'visible');
    20092027      }
    20102028      pictureDeriv = options.pictureDeriv;
    20112029      Autosize_resize(true, options);
    20122030      Autosize_resize(true, options);
    2013 
     2031      jQuery("#" + Type_Img).show(options.fade_in);
    20142032    };
    20152033    //_______________________ init_gen _______________________
     
    22192237
    22202238
    2221   });                           // ready
     2239  });                                                                                       // ready
    22222240
    22232241
  • extensions/Autosize/main.inc.php

    r18936 r19003  
    22/*
    33Plugin Name: AutoSize
    4 Version: 2.11.1
     4Version: 3.0.1
    55Description: Ajuste l'affichage des photos en fonction de la hauteur de la fenetre de navigation
    66Plugin URI: http://piwigo.org/ext/extension_view.php?eid=448
  • extensions/Autosize/template/autosize.tpl

    r18735 r19003  
    77        COOKIE_PATH:'{$COOKIE_PATH}',
    88        has_pamoorama: '{$has_pamoorama}',
    9         slideshow: '{$slideshow}',
     9        slideshow: '{$slide_show}',
    1010
    1111        pictureSelType:'{$pictureSelType}',       
Note: See TracChangeset for help on using the changeset viewer.