Changeset 18725 for extensions/Autosize
- Timestamp:
- Oct 23, 2012, 3:04:22 PM (12 years ago)
- Location:
- extensions/Autosize
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Autosize/autosize.inc.php
r18723 r18725 91 91 *********************/ 92 92 static public function init($content,$element_info){ 93 94 95 93 global $template,$version,$icon_path,$page,$picture,$conf; 96 94 global $user,$Css,$css_slideshow,$css_display,$liste_type; … … 176 174 if($has_pamoorama=="true"){ 177 175 if($DEBUG_autosize == "c1") echo $theImageWidth . "x" . $theImageHeight ; 178 179 $pattern[0] = '/width\:(.*)(\d+),/';$replacement[0] = 'width: '.$theImageWidth.' ,'; 180 176 $pattern[0] = '/width\:(.*)(\d+),/';$replacement[0] = 'width: '.$theImageWidth.' ,'; 181 177 if(($theImageWidth!=0)){ 182 178 $content= preg_replace($pattern, $replacement, $content); … … 188 184 return $content; 189 185 } 190 186 if(isset($_GET['map'])){ 187 return $content; 188 } 191 189 $pattern[0] = '/width\:(.*)(\d+)px/';$replacement[0] = 'width:100% '; 192 190 $pattern[1] = '/height\:(.*)(\d+)px/';$replacement[1] = 'height:100% '; … … 195 193 196 194 if ( preg_match("|charlie|", $content, $val) ){ 197 198 199 195 $ncount=1; 200 196 $content=str_replace( "<object" , "<object id='theMainImage' name='theMainImage' " ,$content,$ncount); 201 197 $content=str_replace( "<embed" , "<embed id='theMainImage' name='theMainImage' " ,$content,$ncount); 202 198 $content= preg_replace($pattern, "", $content); 203 204 199 $content= "<div id='theMainImage' style='height:".$theImageHeight."px ;width:".$theImageWidth."px' >". $content . "<img src='".AUTOSIZE_PATH . "images/transparent.gif' /></div>"; 205 200 $content= "<style>#theImageAndInfos{height:auto;width:auto;border:1px solid red;position:relative} 206 201 #theImage{height:auto;border:1px solid blue;align:center;text-align:center;width:100%;position:relative} 207 #theMainImage{height:auto;border:10px solid blue;align:center;text-align:center;position:static} 208 209 202 #theMainImage{height:auto;border:10px solid blue;align:center;text-align:center;position:static} 210 203 </style>".$content; 211 212 213 204 return $content; 214 205 } 215 206 216 207 $content= preg_replace($pattern, "", $content); 217 208 return $content; 218 209 }//INIT 219 210 -
extensions/Autosize/js/Affiche_script.js
r18724 r18725 106 106 infos_pamoorama = jQuery("#pamoorama").infos({ absolute: true }); 107 107 108 } else if (jQuery("#map").length ) {108 } else if (jQuery("#map").length > 0 || jQuery("#mapPicture").length > 0) { 109 109 Type_Img = "map"; 110 110 } else if (jQuery("#Panorama").length) { … … 546 546 547 547 548 548 549 jQuery('#derivativeSwitchBox .switchCheck').css('visibility', 'hidden'); 549 550 jQuery('#derivativeChecked' + options.pictureSelType).css('visibility', 'visible'); … … 885 886 n = Get_dimensions(true, options); 886 887 888 if (n == false) return; 889 887 890 Save_cookies(options); 888 891 if (options.pictureSelType != "Autosize" && options.pictureSelType != "SelMaxi") { … … 891 894 } 892 895 infos_theImage = jQuery(theImage_id).infos(true); 893 if (typeof img_finale == "und ifined") img_finale = { width: Zone_image.image.width, height: Zone_image.image.height };896 if (typeof img_finale == "undefined") img_finale = { width: Zone_image.image.width, height: Zone_image.image.height }; 894 897 if (img_finale.width && (img_finale.width != Zone_image.image.width || img_finale.height != Zone_image.image.height)) { 895 896 898 img_finale = { width: Zone_image.image.width, height: Zone_image.image.height }; 897 899 } … … 1209 1211 //=========================================== 1210 1212 Set_Map = function (nds) { 1211 p0 = jQuery("#map"). position();1213 p0 = jQuery("#map").offset(); 1212 1214 if (!p0) return; 1213 1214 infos_map = jQuery("#map").infos(); 1215 // if (infos_map.width == (Zone_image.container.width - p0.left)) return ; 1216 nds = jQuery("#imageInfos").css("display"); 1217 if (nds != "none") { 1218 p2 = jQuery("#infoSwitcher").infos(); 1219 p0.left += 35; 1220 } 1221 jQuery("#map").width(Zone_image.image.width); 1222 jQuery("#map").css({ height: Zone_image.image.height + "px" }); 1223 1215 infos_mapPicture = jQuery("#mapPicture").infos({ absolute: true }); 1216 infos_theImage = jQuery("#theImage").infos({ absolute: true }); 1217 jQuery("#map").removeAttr("height"); 1218 jQuery("#map").removeAttr("width"); 1219 jQuery("#map").width(infos_theImage.width - (infos_mapPicture.width)); 1220 jQuery("#map").height(jQuery(window).height()-infos_theImage.top-infos_theImage.general.marges.height); 1224 1221 return true; 1225 1222 } … … 1493 1490 // commentContent 1494 1491 // copyright 1495 1492 1496 1493 1497 1494 … … 1660 1657 options.theImageWidth = new_dim.width; 1661 1658 options.theImageHeight = new_dim.height; 1662 1663 1664 1659 if (options.theImageBottom < 0) { 1665 1660 options.theImageBottom = 0; 1666 1661 } 1662 1663 1664 1667 1665 var chk = eval("options." + user_status + "_enabled"); 1668 1666 if (chk == "") { return; } 1669 1667 1670 Select_Image(); 1671 infos_theMainImage = jQuery(theMainImage_id).infos(); 1668 if (Type_Img == "img") 1669 Select_Image(); 1670 infos_theMainImage = jQuery(theMainImage_id).infos({ absolute: true }); 1672 1671 Zone_image.src = infos_theMainImage.src; 1673 1672 useMap = options.pictureSelType; … … 2139 2138 2140 2139 2141 }); // ready2140 }); // ready 2142 2141 2143 2142 -
extensions/Autosize/main.inc.php
r18716 r18725 43 43 /**/ 44 44 add_event_handler('render_element_content', array(&$autosize_controler,'init'),EVENT_HANDLER_PRIORITY_NEUTRAL-1,2 ); 45 46 45 add_event_handler('render_element_content', array(&$autosize_controler,'init2'),EVENT_HANDLER_PRIORITY_NEUTRAL+1,2 ); 47 46 add_event_handler('loc_after_page_header', array(&$autosize_controler, 'cl_autosize_script_1') ); … … 49 48 add_event_handler('loc_after_page_header',array(&$autosize_controler, 'cl_autosize_script_3') ); 50 49 add_event_handler('loc_after_page_header', array(&$autosize_controler, 'cl_autosize_affiche'), EVENT_HANDLER_PRIORITY_NEUTRAL +21 ); 51 52 50 } 53 51 52 53 54 54 55 ?>
Note: See TracChangeset
for help on using the changeset viewer.