Changeset 18949


Ignore:
Timestamp:
Nov 6, 2012, 3:30:32 PM (11 years ago)
Author:
cljosse
Message:

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

Location:
extensions/Autosize
Files:
4 edited

Legend:

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

    r18936 r18949  
    9191    $imgSizeWH = $derivative->get_size();
    9292    $SRC_IMG    = $derivative->get_url();
     93
    9394    $picture['current']['scaled_width']=$imgSizeWH[0];
    9495    $picture['current']['scaled_height']= $imgSizeWH[1];
    9596    $picture['current']['high_url']= $SRC_IMG;   
    9697    $picture['current']['image_url']=$SRC_IMG; 
     98    $picture['current']['thumbnail']=$SRC_IMG;
     99
    97100//==============================================================
    98101    $autosize_parametres = cl_autosize_Get_Options();
     
    240243 $pattern[3] = '/height=\"(\d+)\"/';$replacement[3] = ' ';
    241244
    242 if ( preg_match("|charlie|", $content, $val) ){   
     245if ( strstr( $content,"iframe")||strstr($content,"charlie" )){ 
     246 
     247$pictureSelType="Autosize";
     248$pictureDeriv=$conf['derivative_default_size'];
     249
     250$_COOKIE['picture_sel_type']=$pictureSelType;
     251$_COOKIE['picture_deriv']=$pictureDeriv;
     252
    243253  $ncount=1;   
    244   $content=str_replace( "<object" ,  "<object id='theMainImage_obj' name='theMainImage' "  ,$content,$ncount);
    245   $content=str_replace( "<embed" ,  "<embed id='theMainImage_emb' name='theMainImage' "  ,$content,$ncount);
     254  if (strstr($content,"charlie" )){   
     255      $content=str_replace( "<object" , "<object id='theMainImage_obj' name='theMainImage' "  ,$content,$ncount);
     256      $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);
     258  }else{
     259      $content=str_replace( "<iframe" ,  "<iframe id='iframe' name='theMainImage' "  ,$content,$ncount);
     260  }
    246261  $content=  preg_replace($pattern, "", $content);
    247   $content= "<div id='theMainImage' style='height:".$theImageHeight."px  ;width:".$theImageWidth."px' >". $content . "<img src='".AUTOSIZE_PATH . "images/transparent.gif' /></div>";
     262
     263  $content= "<div id='theMainImage' style='height:".$theImageHeight."px  ;width:".$theImageWidth."px '>". $content . "<img src='".AUTOSIZE_PATH . "images/transparent.gif' /></div>";
    248264 $content= "<style>#theImageAndInfos{height:auto;width:auto;position:relative}
    249265  #theImage{height:auto;align:center;text-align:center;width:100%;position:relative}
    250   #theMainImage{height:auto;align:center;text-align:center;position:static}   
     266  #theMainImage{height:auto;align:center;text-align:center;position:static} 
     267  #charlie{display:none }
     268  #iframe{display:none }
    251269 </style>".$content;
    252270return  $content;
     
    591609     //   return ;
    592610     }
     611         if (defined('GMAPS_VERSION')) $gmaps_function="true";
     612          else $gmaps_function="false" ;
     613
    593614        $template->set_filenames(array('autosize_content_header'=> $file ));
    594615        $template->assign(      array( AUTOSIZE_PATH,$AUTOSIZE_PATH,
    595616                                  'file_css' =>$file_css,
    596617                                  'css_display' => $css_display,                                 
    597                                   'theme' =>$theme
     618                                  'theme' =>$theme,
     619                                   'gmaps_function' => $gmaps_function
    598620                          ));
    599621        $template->concat('autosize_content', $template->parse('autosize_content_header', true));
  • extensions/Autosize/include/affiche.php

    r18735 r18949  
    3636  $my_path = AUTOSIZE_PATH_ABS;
    3737  $theme=$user['theme'];
    38 
    39 
     38 
    4039  $user_status = $user['status'] ;
    41 
    4240                   $template->assign( array(
    4341                   'AUTOSIZE_PATH_ABS' => AUTOSIZE_PATH_ABS,
    4442                   'ROOT_URL' => ROOT_URL,
    45                    'AUTOSIZE_PATH' => AUTOSIZE_PATH,
     43                   'AUTOSIZE_PATH' => AUTOSIZE_PATH
    4644                                                                                        )
    4745                                                                        );     
  • extensions/Autosize/js/Affiche_script.js

    r18946 r18949  
    299299    }
    300300    //__________  Set_llbgo _______________
    301 
     301    var wpng = 0;
    302302    /********************************************
    303303    *  window LOAD
     
    310310      infos_theMainImage = jQuery(theMainImage_id).infos({ absolute: true });
    311311      infos_theImageAndInfos = jQuery(theImageAndInfos_id).infos();  // Cadre general
    312       infos_theMainImage_obj = jQuery("#" + "theMainImage_obj").infos();
     312      theMainImage_obj = "theMainImage_obj";
     313      infos_theMainImage_obj = jQuery("#" + theMainImage_obj).infos({ absolute: true });
     314
    313315      infos_theMainImage_obj.rapport = infos_theMainImage_obj.width / infos_theMainImage_obj.height;
    314 
    315316      if (infos_theMainImage.width == 0) {
    316         if (Type_Img == "charlie") {
     317        if (Type_Img == "pamoorama") {
     318          infos_theMainImage = jQuery("#pamoorama").infos(true);
     319          theMainImage_id = "#pamoorama";
     320          options.valide = true;
     321        } else if (Type_Img == "charlie") {
    317322          infos_theMainImage = jQuery("#charlie").infos(true);
    318323          theMainImage_id = "charlie";
     
    331336          jQuery("#iframe").height(infos_theMainImage.height);
    332337
    333         } else if (Type_Img == "pamoorama") {
    334           infos_theMainImage = jQuery("#pamoorama").infos(true);
    335           theMainImage_id = "#pamoorama";
    336           options.valide = true;
     338
    337339
    338340        } else {
    339 
    340341          jQuery("img").each(function (i) {
    341 
    342342            imgSrc = options.imgSrc;
    343 
    344 
    345343          });
    346344          infos_theMainImage = jQuery("#theImage img").infos();
    347 
    348345        }
    349346        if (infos_theMainImage.id == "")
     
    873870
    874871        if (Type_Img == "charlie" || Type_Img == "iframe") {
    875           jQuery("#" + "theMainImage_obj").attr("width", Zone_image.image.height * infos_theMainImage_obj.rapport);
    876           jQuery("#" + "theMainImage_obj").attr("height", Zone_image.image.height);
    877           jQuery("#" + Type_Img).attr("width", Zone_image.image.width);
    878           jQuery("#" + Type_Img).attr("height", Zone_image.image.height);
    879           swfobj = jQuery("#" + Type_Img).infos({ absolute: true });
     872
     873
     874          if (Type_Img == "charlie") {
     875            dp1 = jQuery("#charlie").offset();
     876            dp = jQuery("#" + theMainImage_obj).offset();
     877            if (dp) {
     878              if (wpng == 0)
     879                wpng = (dp.left - dp1.left) * 2;
     880            }
     881            mrgl = (jQuery("#" + "theImage").width() - Zone_image.image.width) / 2;
     882            png_h = jQuery("#" + Type_Img + " div").height();
     883            jQuery("#" + Type_Img).css({ marginLeft: mrgl + "px" });
     884            jQuery("#" + Type_Img).width(Zone_image.image.width);
     885            jQuery("#" + Type_Img).height(Zone_image.image.height);
     886
     887            w01 = jQuery("#" + theMainImage_obj).width();
     888            jQuery("#" + theMainImage_obj).attr("width", Zone_image.image.width - wpng);
     889            jQuery("#" + theMainImage_obj).attr("height", Zone_image.image.height);
     890            jQuery("#theMainImage_emb").attr("width", Zone_image.image.width - wpng);
     891            jQuery("#theMainImage_emb").attr("height", Zone_image.image.height);
     892            jQuery("#theMainImage").height(png_h);
     893            jQuery("#" + Type_Img).height(png_h);
     894         
     895
     896          } else {
     897            jQuery("#" + theMainImage_obj).attr("width", Zone_image.image.width);
     898            jQuery("#" + theMainImage_obj).attr("height", Zone_image.image.height);
     899            jQuery("#" + Type_Img).attr("width", Zone_image.image.width);
     900            jQuery("#" + Type_Img).attr("height", Zone_image.image.height);
     901          }
     902
     903
     904
     905          jQuery("#" + Type_Img).show(options.fade_in);
    880906        }
    881907
     
    13351361        options.theImageMargeZone = Zone_image.marges;
    13361362        if (Type_Img != 'charlie') {
    1337           /*
    1338           if (options.pictureSelType != "SelMaxi" && options.pictureSelType != "Autosize") {
    1339           options.pictureMap = options.pictureDeriv;
    1340            
    1341           imgSrc = options.liste_type[6];
    1342           changeImgSrc(imgSrc, options.pictureDeriv, options.pictureMap, options.pictureSelType);
    1343           src = theImg.src;
    1344           return;
    1345           } else {
    1346           IMg = Get_Maxi(Zone_image.image);
    1347           }
    1348           */
    13491363          IMg = Get_Maxi(Zone_image.image);
    13501364          imgSrc = IMg.url;
     
    13741388        identique = Zone_image.src.match(RegExp(imgSrc, "gi"));
    13751389        if (identique) return;
    1376         href_path = "javascript:changeImgSrc('" + imgSrc + IMg.pictureDeriv + "', '" + "', '" + IMg.pictureMap + "', '" + options.pictureSelType + "')";
     1390        href_path = "javascript:changeImgSrc('" + imgSrc + "', '" + IMg.pictureDeriv + "', '" + IMg.pictureMap + "', '" + options.pictureSelType + "')";
    13771391        jQuery(".linkAutosize").attr("href", href_path);
    13781392        theImg = document.getElementById(theMainImage_id.replace("#", ""));
     
    16351649      }
    16361650      if (Type_Img == "charlie") {
     1651        width_theMainImage = height_theMainImage * options.ratio;
     1652        Zone_image.image_init.rapport = options.ratio;
    16371653
    16381654      } else if (Type_Img == "pamoorama") {
     
    17691785        case "charlie":
    17701786
     1787          Zone_image.zoom = 1;
     1788
    17711789          break
    17721790
    17731791        case "iframe":
     1792          wpng = 0;
    17741793          Zone_image.image.width = options.theImageWidth;
    17751794          Zone_image.image.height = options.theImageHeight;
     
    21282147
    21292148
    2130   });                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 // ready
     2149  });                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     // ready
    21312150
    21322151
  • extensions/Autosize/template/picture_1.tpl

    r18329 r18949  
    1919{combine_script id="autosize.dimensions" path = $AUTOSIZE_PATH|@cat:"js/autosize.dimensions.js" require="jquery"}
    2020{/if}
     21 
     22{if $gmaps_function=="true" }
     23{combine_script id="maps.google.com/api" path="http://maps.google.com/maps/api/js?sensor=false" require="jquery" }
     24{/if}
Note: See TracChangeset for help on using the changeset viewer.