Changeset 19030


Ignore:
Timestamp:
Nov 15, 2012, 11:21:22 AM (11 years ago)
Author:
cljosse
Message:

[extensions] Autosize fix compatibility with 2.4 (compatibility charlie's,iframe )

Location:
extensions/Autosize
Files:
4 edited

Legend:

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

    r19003 r19030  
    619619                                        $template->concat('PLUGIN_PICTURE_ACTIONS', $template->parse('cl_bp', true));
    620620                                }
    621 
    622621
    623622                                 $template->set_filenames(
     
    853852    $derivative=$current['derivatives'][$last_derivative] ;   
    854853    $img_all= $derivative->get_all($derivative->src_image);
    855    
    856854
    857855    $retour = (object) '';
     
    983981     }
    984982
    985    if(preg_match("|get_infos|", $DEBUG_autosize, $val)) $infos_message .= $retour->type . " " . $retour->url ;
    986983  if (!isset( $retour->type)){     
    987984                  $retour=$last_image;
     
    996993             
    997994}
    998 
    999 
    1000 
    1001995      if($nofile > 0){ 
    1002996        $set_miniature=$No_files ;
    1003997      }
    1004 
    1005998
    1006999    if(preg_match("|get_infos|", $DEBUG_autosize, $val))
  • extensions/Autosize/include/affiche.php

    r19003 r19030  
    5959 global $DEBUG_autosize;
    6060
     61          $user_type= get_user_status($user_status)."_type";
     62          $user_type=  $autosize_parametres->$user_type ; 
     63          $select_type=ImageStdParams::get_by_type($user_type);
     64          $ideal_size  =  $select_type->sizing->ideal_size ; 
     65          if($user_type=="Autosize" || $user_type=="SelMaxi"){
     66              $ideal_size[0]=$imgSizeWH[0];
     67              $ideal_size[1]=$imgSizeWH[1];
     68          }
     69
    6170 $slide_show = isset($page['slideshow'])?$page['slideshow']:false;
    6271
    6372        $template->assign(
    6473                                        array( 
     74            'ideal_size_width' => $ideal_size[0] ,
     75            'ideal_size_height' => $ideal_size[1] ,
    6576            'has_pamoorama' => $has_pamoorama,
    6677            'pictureMap' =>   $pictureDeriv ,
  • extensions/Autosize/js/Affiche_script.js

    r19021 r19030  
    164164    //====================================
    165165    set_cl = function (Valid) {
     166
    166167      if (typeof Valid == "undefined") Valid = options.pictureSelType.match(RegExp("Autosize", "gi")) || false;
    167168      if (typeof options.cl_visible == "undefined") return;
     
    190191
    191192      }
     193
    192194      if ((typeof Zone_image != "undefined") && typeof Zone_image.image != "undefined") {
    193195        Zone_image.zoom = (Zone_image.image.height / Zone_image.image_init.height);
     
    201203          }
    202204        }
     205        if (Type_Img == "pamoorama" || Type_Img == "iframe" || Type_Img == "charlie") {
     206          zoom_cl = "";
     207          src_info = "";
     208          src = src2;
     209        }
     210
    203211        jQuery('#bp_cla').attr('alt', src_info);
    204212        jQuery('#bp_cla').attr('title', src_info);
     
    573581      options.pictureDeriv = pictureDeriv;
    574582    }
    575     if (Type_Img == "pamoorama")
     583    if (Type_Img == "pamoorama" || Type_Img == "iframe" || Type_Img == "charlie") {
    576584      options.pictureSelType = "Autosize";
     585    }
    577586    for (i = 0; i < options.liste_type.length; i++) {
    578587      options.liste_type[i] = options.liste_type[i].split(",");
     
    600609
    601610        patname = href_path.replace("javascript\:", "");
     611       if(typeof old_path == "undefined") old_path = patname;
    602612        pt = pt.split(",");
    603613        tsz = pt[pt.length - 1];
     
    934944
    935945        if (Type_Img == "charlie" || Type_Img == "iframe") {
     946          init_w1 = Zone_image.image.width;
     947          init_h1 = Zone_image.image.height;
     948
     949          if (pictureSelType_user != "Autosize" && pictureSelType_user != "SelMaxi") {
     950            init_w1 = Autosize_options.ideal_size_width;
     951            init_h1 = Autosize_options.ideal_size_height;
     952          }
    936953          if (Type_Img == "charlie") {
    937954            dp1 = jQuery("#charlie").offset();
     
    941958                wpng = Math.abs(dp.left - dp1.left) * 2;
    942959            }
    943             png_h = jQuery("#" + Type_Img + " div").height();
    944             w01 = Math.ceil(jQuery("#" + "theImage").width() - wpng);
     960            png_h = init_h1;
     961            w01 = init_w1 - wpng;
     962
    945963            jQuery("#" + "theImage").css({ padding: 0 });
    946964            if (!png_h) {
     
    969987            }
    970988            jQuery("#" + Type_Img).height(png_h);
    971 
    972 
    973989            jQuery("#" + Type_Img + " div").width(w01);
    974 
    975 
    976 
     990            jQuery("#theImage").css({ height: "auto" });
    977991          } else {
    978992            jQuery("#theImage").css({ height: "auto" });
    979993            jQuery("#theMainImage").css({ width: "auto", height: "auto" });
    980             jQuery("#" + Type_Img).attr("width", Zone_image.image.width - (infos_theMainImage.borderwidth.left + infos_theMainImage.borderwidth.right));
    981             jQuery("#" + Type_Img).attr("height", Zone_image.image.height - (infos_theMainImage.borderwidth.top + infos_theMainImage.borderwidth.bottom));
     994            jQuery("#" + Type_Img).attr("width", init_w1 - (infos_theMainImage.borderwidth.left + infos_theMainImage.borderwidth.right));
     995            jQuery("#" + Type_Img).attr("height", init_h1 - (infos_theMainImage.borderwidth.top + infos_theMainImage.borderwidth.bottom));
    982996          }
    983997          jQuery("#" + Type_Img).show(options.fade_in);
     
    22442258
    22452259
    2246   });                                                                                           // ready
     2260  });                                                                                                     // ready
    22472261
    22482262
  • extensions/Autosize/template/autosize.tpl

    r19003 r19030  
    33 <script type="text/javascript">
    44var  Autosize_options={ldelim}
     5        ideal_size_width:'{$ideal_size_width}' ,
     6        ideal_size_height:'{$ideal_size_height}' ,
     7
    58        cl_version :'{$cl_version}',
    69        Version_pwg:'{$Version_pwg}',
Note: See TracChangeset for help on using the changeset viewer.