Changeset 18925


Ignore:
Timestamp:
Nov 4, 2012, 12:03:50 PM (11 years ago)
Author:
cljosse
Message:

[extensions] Autosize fix compatibility with 2.4 (fix windowheigh...)

Location:
extensions/Autosize
Files:
3 edited

Legend:

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

    r18823 r18925  
    5858 echo "GET:"  . cl_print_var($_GET) ;
    5959 echo "POST:"  . cl_print_var($_POST) ;
    60  die();
     60 die("#60:" . $DEBUG_autosize);
    6161 }
    6262    $ma_page=isset($page['body_id'])?$page['body_id']:"" ; 
     
    7474    if(!isset($_COOKIE['windowHeight'] )){
    7575       self::reload();
    76        die();
     76       die("#76" . $DEBUG_autosize);
    7777    }
    7878
     
    8080   if (!isset($_COOKIE['autosize_reload'])  ){ 
    8181           self::reload();
    82             die();
     82            die("#82 :" + $DEBUG_autosize);
    8383
    8484    } 
     
    138138//=======================================================================
    139139$pictureSelType = pwg_get_session_var('picture_sel_type',$pictureSelType); 
    140 
     140 
    141141 if(preg_match("|test|", $DEBUG_autosize, $val)) {
    142142    echo $infos_message ;
     
    145145        echo "GET:"  . cl_print_var($_GET) ;
    146146        echo "POST:"  . cl_print_var($_POST) ;
    147         die();
     147        die("#147: ".$DEBUG_autosize);
    148148 }
    149149 
     
    183183       $theImageHeight=   $windowHeight - $theImageTop  - $theImageMargeHeight ;
    184184 
    185    if ($element_info['is_gvideo']){
     185   if (isset($element_info['is_gvideo']) && $element_info['is_gvideo'] ){
    186186    $pictureDeriv=$default_size;
    187187
     
    228228         if(preg_match("|c1|", $DEBUG_autosize, $val)) {
    229229         echo "<!-- " . $theImageWidth . "x" . $theImageHeight . " " .cl_print_var($content) ." -->";
    230          die();
     230         die("#230: " . $DEBUG_autosize);
    231231    }
    232232      return  $content;
     
    315315 
    316316 
    317  die($content);
     317 die("#317 : " . $content + $DEBUG_autosize);
    318318 $theImageHeight =abs($theImageHeight);
    319319 $theImageWidth =abs($theImageWidth);
     
    444444    );
    445445   if( preg_match("|c2|", $DEBUG_autosize, $val) ){
    446    die();
     446   die( "446: " . $DEBUG_autosize);
    447447   return $content ;
    448448
     
    588588      } 
    589589     if($pictureSelType == $pictureDeriv ) {
    590         return ;
     590         if(preg_match("|event|", $DEBUG_autosize, $val)) {  cl_aff_infos_plus();} ;
     591     //   return ;
    591592     }
    592593        $template->set_filenames(array('autosize_content_header'=> $file ));
     
    847848    $std_image  = (object) '';
    848849    $default_image=(object) '';
     850    $SelType_image=(object) '';
    849851    $last_image=(object) '';
    850852
     
    877879            }         
    878880             if(preg_match("|get_minfos|", $DEBUG_autosize, $val))
    879             $infos_message .=$img_url . " -> " . $img_type ."<br >";
     881                      $infos_message .=$img_url . " -> " . $img_type ."<br >";
    880882
    881883          if(file_exists(PHPWG_ROOT_PATH.$img_url)){    } // if file       
     
    903905                            $mini_image=  $img_select; 
    904906                          }
    905 
    906907                    $liste_type[$img_type]=$img_type.",".$img_url.",".$imgWH[0] .",".$imgWH[1] ;
     908                    if( $img_type==$pictureSelType){
     909                     if(preg_match("|get_minfos|", $DEBUG_autosize, $val))     $infos_message .= $pictureSelType . " <--> " . $img_type ."<br >";
     910
     911                          $SelType_image->type=$img_type;
     912                          $SelType_image->url=$img_url;
     913                          $SelType_image=$img_select;   
     914                    }
    907915                    if( $img_type=="Original" && $theImage_def==0 ){
    908916                          $theImage_def=1;
     
    948956 
    949957          $retour=(object)'' ;
    950 
    951 
    952          
    953 
    954958      if ($pictureSelType=="Autosize") $retour= $maxi_image ;
    955959      else if ($pictureSelType=="SelMaxi") $retour= $mini_image ;
    956 
    957       else  $retour=$last_image ;
    958         if (!isset( $retour->type)){
    959               $retour=$last_image;
    960               $retour->type =  $retour->get_type();
    961               $retour->url  =  $retour->get_path();
    962             }
    963    
    964       if($nofile > 0){     
    965 
    966                       $set_miniature=$No_files ;
    967                    
    968      
    969          
     960      else{     
     961      $types = array_intersect(array_keys($liste_type), array($pictureSelType));
     962      if(!count($types)){
     963        $pictureSelType="Original";
    970964      }
    971      
    972    
    973       if($retour->type=="Original")
    974         $retour->type=$last_derivative ;
     965        $retours=  explode(",",$liste_type[$pictureSelType]);
     966        $retour=$SelType_image;
     967        $retour->type=$retours[0];
     968        $retour->url=$retours[1];
     969     }
     970 
     971
     972  if (!isset( $retour->type)){     
     973                  $retour=$last_image;
     974                  $retour->type =  $retour->get_type();
     975                  $retour->url  =  $retour->get_path();
     976}
     977if (isset( $retour->type) && $retour->type=="Original" ){     
     978                  $retour=$last_image;
     979                  $retour->type =  $last_derivative;
     980                  $retour->url  =  $retour->get_path();
     981}
     982
     983         if(preg_match("|get_minfos|", $DEBUG_autosize, $val))     $infos_message .= $pictureSelType . " -> " .  $retour->type . "---" . $retour->url. "<br >";
     984
     985      if($nofile > 0){ 
     986        $set_miniature=$No_files ;
     987      }
     988
    975989
    976990    if(preg_match("|get_minfos|", $DEBUG_autosize, $val))
  • extensions/Autosize/js/Affiche_script.js

    r18823 r18925  
    630630         .error(function (e) {
    631631           if (!this.complete) {
    632              src = jQuery(this).attr("src").replace("./_data/i/","",1);
     632             src = jQuery(this).attr("src").replace("./_data/i/", "", 1);
    633633             jQuery.ajax({
    634634               type: 'GET',
    635                url: 'i.php?' +  src + "&ajaxload=true",
     635               url: 'i.php?' + src + "&ajaxload=true",
    636636               dataType: 'json',
    637637               success: (function (data) {
     
    641641             });
    642642
    643          
     643
    644644
    645645           }
     
    648648         .bind("Finish", function (e, data) {
    649649           if (typeof imageInfos_id == "undefined") return;
    650          
     650
    651651         })
    652652          .bind("ON", function (e, data) {
     
    660660              return;
    661661            }
    662             if (data.src) { 
    663              if (typeof imageInfos_id == "undefined") return;
    664               if (data.src.match(RegExp(options.pictureDeriv.substr(0, 2) + ".jpg", "gi"))) {             
    665              //   Autosize_resize(true, options);
     662            if (data.src) {
     663              if (typeof imageInfos_id == "undefined") return;
     664              if (data.src.match(RegExp(options.pictureDeriv.substr(0, 2) + ".jpg", "gi"))) {
     665                //   Autosize_resize(true, options);
    666666              }
    667667            }
     
    965965        //jQuery(theMainImage_id).height(Zone_image.image.height);
    966966      } else {
    967       if (options.imageAutosize==false)
    968         if (options.pictureSelType == "Autosize" || options.pictureSelType == "SelMaxi") {
    969           jQuery(theMainImage_id).height(Zone_image.image.height);
    970           jQuery(theMainImage_id).width(Zone_image.image.width);
    971 
    972         } else {
    973           jQuery(theMainImage_id).height(Zone_image.image.height);
    974           jQuery(theMainImage_id).width(Zone_image.image.width);
    975         }
     967        if (options.imageAutosize == false)
     968          if (options.pictureSelType == "Autosize" || options.pictureSelType == "SelMaxi") {
     969            jQuery(theMainImage_id).height(Zone_image.image.height);
     970            jQuery(theMainImage_id).width(Zone_image.image.width);
     971
     972          } else {
     973            jQuery(theMainImage_id).height(Zone_image.image.height);
     974            jQuery(theMainImage_id).width(Zone_image.image.width);
     975          }
    976976
    977977
     
    10091009        url2 = this.src;
    10101010        jQuery('#derivativeSwitchBox .switchCheck').css('visibility', 'hidden');
    1011         type = options.pictureSelType;
     1011        newtype = options.pictureSelType;
    10121012        if (typeof type != "undefined" && (type == "Autosize" || type == "SelMaxi")) {
    10131013
     
    10211021        options.pictureMap = typeMap;
    10221022        options.pictureDeriv = typeSave;
    1023 
    1024 
    10251023        document.cookie = 'picture_deriv=' + typeSave + ';path=' + COOKIE_PATH;
    10261024        Autosize_resize(true, options);
     1025        if (typeof type != "undefined" && (type == "Autosize" || type == "SelMaxi")) {
     1026
     1027        } else {
     1028          jQuery("#bp_img_cla").attr("src", "./plugins/Autosize/icons/button-maximize.png");
     1029          jQuery("#bp_cla span").text("");
     1030        }
    10271031      })
    10281032      .live("ON", function (e) {
     
    21962200
    21972201
    2198   });                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      // ready
     2202  });                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         // ready
    21992203
    22002204
  • extensions/Autosize/main.inc.php

    r18823 r18925  
    4646}
    4747if(!preg_match("|NO|", $DEBUG_autosize, $val)) { 
    48 
    4948// init cl_autosize_script_1 cl_autosize_affiche
    5049//Important avant pamooramics, gvideo
    51 
    5250add_event_handler('render_element_content', array(&$autosize_ctrl, 'autosize_calcContent'),EVENT_HANDLER_PRIORITY_NEUTRAL-11,2);
    53 
    5451/**/
    5552add_event_handler('render_element_content',  array(&$autosize_ctrl,'init'),EVENT_HANDLER_PRIORITY_NEUTRAL-1,2  );
     
    6259} ;
    6360
    64 
    65 
     61     
     62       
    6663
    6764?>
Note: See TracChangeset for help on using the changeset viewer.