Changeset 18949
- Timestamp:
- Nov 6, 2012, 3:30:32 PM (11 years ago)
- Location:
- extensions/Autosize
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Autosize/autosize.inc.php
r18936 r18949 91 91 $imgSizeWH = $derivative->get_size(); 92 92 $SRC_IMG = $derivative->get_url(); 93 93 94 $picture['current']['scaled_width']=$imgSizeWH[0]; 94 95 $picture['current']['scaled_height']= $imgSizeWH[1]; 95 96 $picture['current']['high_url']= $SRC_IMG; 96 97 $picture['current']['image_url']=$SRC_IMG; 98 $picture['current']['thumbnail']=$SRC_IMG; 99 97 100 //============================================================== 98 101 $autosize_parametres = cl_autosize_Get_Options(); … … 240 243 $pattern[3] = '/height=\"(\d+)\"/';$replacement[3] = ' '; 241 244 242 if ( preg_match("|charlie|", $content, $val) ){ 245 if ( 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 243 253 $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 } 246 261 $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>"; 248 264 $content= "<style>#theImageAndInfos{height:auto;width:auto;position:relative} 249 265 #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 } 251 269 </style>".$content; 252 270 return $content; … … 591 609 // return ; 592 610 } 611 if (defined('GMAPS_VERSION')) $gmaps_function="true"; 612 else $gmaps_function="false" ; 613 593 614 $template->set_filenames(array('autosize_content_header'=> $file )); 594 615 $template->assign( array( AUTOSIZE_PATH,$AUTOSIZE_PATH, 595 616 'file_css' =>$file_css, 596 617 'css_display' => $css_display, 597 'theme' =>$theme 618 'theme' =>$theme, 619 'gmaps_function' => $gmaps_function 598 620 )); 599 621 $template->concat('autosize_content', $template->parse('autosize_content_header', true)); -
extensions/Autosize/include/affiche.php
r18735 r18949 36 36 $my_path = AUTOSIZE_PATH_ABS; 37 37 $theme=$user['theme']; 38 39 38 40 39 $user_status = $user['status'] ; 41 42 40 $template->assign( array( 43 41 'AUTOSIZE_PATH_ABS' => AUTOSIZE_PATH_ABS, 44 42 'ROOT_URL' => ROOT_URL, 45 'AUTOSIZE_PATH' => AUTOSIZE_PATH ,43 'AUTOSIZE_PATH' => AUTOSIZE_PATH 46 44 ) 47 45 ); -
extensions/Autosize/js/Affiche_script.js
r18946 r18949 299 299 } 300 300 //__________ Set_llbgo _______________ 301 301 var wpng = 0; 302 302 /******************************************** 303 303 * window LOAD … … 310 310 infos_theMainImage = jQuery(theMainImage_id).infos({ absolute: true }); 311 311 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 313 315 infos_theMainImage_obj.rapport = infos_theMainImage_obj.width / infos_theMainImage_obj.height; 314 315 316 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") { 317 322 infos_theMainImage = jQuery("#charlie").infos(true); 318 323 theMainImage_id = "charlie"; … … 331 336 jQuery("#iframe").height(infos_theMainImage.height); 332 337 333 } else if (Type_Img == "pamoorama") { 334 infos_theMainImage = jQuery("#pamoorama").infos(true); 335 theMainImage_id = "#pamoorama"; 336 options.valide = true; 338 337 339 338 340 } else { 339 340 341 jQuery("img").each(function (i) { 341 342 342 imgSrc = options.imgSrc; 343 344 345 343 }); 346 344 infos_theMainImage = jQuery("#theImage img").infos(); 347 348 345 } 349 346 if (infos_theMainImage.id == "") … … 873 870 874 871 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); 880 906 } 881 907 … … 1335 1361 options.theImageMargeZone = Zone_image.marges; 1336 1362 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 */1349 1363 IMg = Get_Maxi(Zone_image.image); 1350 1364 imgSrc = IMg.url; … … 1374 1388 identique = Zone_image.src.match(RegExp(imgSrc, "gi")); 1375 1389 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 + "')"; 1377 1391 jQuery(".linkAutosize").attr("href", href_path); 1378 1392 theImg = document.getElementById(theMainImage_id.replace("#", "")); … … 1635 1649 } 1636 1650 if (Type_Img == "charlie") { 1651 width_theMainImage = height_theMainImage * options.ratio; 1652 Zone_image.image_init.rapport = options.ratio; 1637 1653 1638 1654 } else if (Type_Img == "pamoorama") { … … 1769 1785 case "charlie": 1770 1786 1787 Zone_image.zoom = 1; 1788 1771 1789 break 1772 1790 1773 1791 case "iframe": 1792 wpng = 0; 1774 1793 Zone_image.image.width = options.theImageWidth; 1775 1794 Zone_image.image.height = options.theImageHeight; … … 2128 2147 2129 2148 2130 }); // ready2149 }); // ready 2131 2150 2132 2151 -
extensions/Autosize/template/picture_1.tpl
r18329 r18949 19 19 {combine_script id="autosize.dimensions" path = $AUTOSIZE_PATH|@cat:"js/autosize.dimensions.js" require="jquery"} 20 20 {/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.