Changeset 18735
- Timestamp:
- Oct 25, 2012, 3:24:09 PM (12 years ago)
- Location:
- extensions/Autosize
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Autosize/autosize.inc.php
r18731 r18735 43 43 //============================================================================== 44 44 global $DEBUG_autosize; 45 $DEBUG_autosize = isset($_POST['cl_debug']) ? $_POST['cl_debug'] : " false" ;45 $DEBUG_autosize = isset($_POST['cl_debug']) ? $_POST['cl_debug'] : "" ; 46 46 $DEBUG_autosize = isset($_GET['cl_debug']) ? $_GET['cl_debug'] : $DEBUG_autosize ; 47 $DEBUG_autosize = isset($conf['cl_debug']) ? $conf['cl_debug'] : $DEBUG_autosize ;47 $DEBUG_autosize = isset($conf['cl_debug']) ? $conf['cl_debug']."," . $DEBUG_autosize : $DEBUG_autosize ; 48 48 //=============================================================== 49 50 49 51 $ma_page=isset($page['body_id'])?$page['body_id']:"" ; 50 52 if ($ma_page !='thePicturePage') return ; … … 95 97 global $has_pamoorama,$pictureSelType,$pictureDeriv; 96 98 global $infos_message,$warnings_message; 99 100 global $set_miniature,$imgSizeWH,$DEBUG_autosize; 101 global $theImageHeight,$theImageWidth,$theImageLeft,$theImageTop,$windowWidth,$windowHeight,$theMainImageSize; 97 102 //======================================================= 98 103 global $has_pamoorama ; … … 124 129 $current = $template->get_template_vars('current'); 125 130 126 global $set_miniature,$imgSizeWH,$DEBUG_autosize; 127 global $theImageHeight,$theImageWidth,$theMainImageWidth; 131 128 132 //=== Zone affichage == 129 133 $theImageTop= isset($_COOKIE['theImageTop'])?$_COOKIE['theImageTop']:0; … … 132 136 $theImageRight=isset($_COOKIE['theImageRight'])?$_COOKIE['theImageRight']:0; 133 137 $theImageBottom=isset($_COOKIE['theImageBottom'])?$_COOKIE['theImageBottom']:0; 134 135 $windowWidth=$_COOKIE['windowWidth']; 136 $windowHeight=$_COOKIE['windowHeight']; 138 $windowWidth=$_COOKIE['windowWidth'] ; 139 $windowHeight=$_COOKIE['windowHeight'] ; 137 140 138 141 $theImageMargeWidth=isset($_COOKIE['theImageMargeWidth']) ? $_COOKIE['theImageMargeWidth']:0; … … 141 144 $theImageWidth= $windowWidth - $theImageRight - $theImageLeft - $theImageMargeWidth; 142 145 $theImageHeight= $windowHeight - $theImageTop - $theImageBottom - $theImageMargeHeight; 143 $theImageWidth=isset($_COOKIE['theImageWidth']) ? $_COOKIE['theImageWidth']:$theImageWidth; 144 $theImageHeight=isset($_COOKIE['theImageHeight'])?$_COOKIE['theImageHeight']:$theImageHeight; 145 146 $retour= autosize_controler::get_min_max() ; 147 146 147 148 $retour = autosize_controler::get_min_max() ; 149 $theMainImageSize = $retour->get_size(); 148 150 if($theImageHeight!=0 && $theImageWidth!=0){ 149 151 $pictureDeriv=$retour->type ; … … 151 153 $pictureDeriv=$default_size; 152 154 } 153 154 155 //============================================================ 155 156 pwg_set_session_var('picture_deriv',$pictureDeriv); … … 170 171 $_COOKIE['picture_deriv']=$pictureDeriv; 171 172 172 173 173 $pattern = array(); 174 174 if($has_pamoorama=="true"){ 175 if( $DEBUG_autosize == "c1") echo $theImageWidth . "x" . $theImageHeight ;175 if(preg_match("|c1|", $DEBUG_autosize, $val)) echo $theImageWidth . "x" . $theImageHeight ; 176 176 $pattern[0] = '/width\:(.*)(\d+),/';$replacement[0] = 'width: '.$theImageWidth.' ,'; 177 177 if(($theImageWidth!=0)){ 178 178 $content= preg_replace($pattern, $replacement, $content); 179 179 } 180 if( $DEBUG_autosize == "c1") {180 if(preg_match("|c1|", $DEBUG_autosize, $val)) { 181 181 echo "<!-- " . $theImageWidth . "x" . $theImageHeight . " " .cl_print_var($content) ." -->"; 182 182 die(); … … 204 204 return $content; 205 205 } 206 207 206 $content= preg_replace($pattern, "", $content); 207 208 208 return $content; 209 209 }//INIT … … 222 222 //===================================================================== 223 223 global $has_pamoorama,$pictureSelType,$pictureDeriv; 224 global $theImageHeight,$theImageWidth; 225 global $DEBUG_autosize; 224 225 global $DEBUG_autosize; 226 global $theImageHeight,$theImageWidth,$theImageLeft,$theImageTop,$windowWidth,$windowHeight,$theMainImageSize; 227 228 226 229 //-- si Autosize correction redim --------------- 227 230 $current = $template->get_template_vars('current'); … … 229 232 230 233 // if( $has_pamoorama=="true") return $content ; 231 // if($pictureSelType!="Autosize") return $content ; 232 233 $pattern = '/width=\"(\d+)\"/'; 234 $replacement = ''; 234 // if($pictureSelType!="Autosize") return $content ; 235 236 $pattern =Array('/width=\"(\d+)\"/','/height=\"(\d+)\"/'); 237 238 239 $replacement = Array('',"style='height:".$theImageHeight."px'"); 235 240 $content= preg_replace($pattern, $replacement, $content); 236 241 237 $pattern = '/height=\"(\d+)\"/';238 $replacement = '';239 $content= preg_replace($pattern, "", $content) ;240 241 242 if( $has_pamoorama=="true") return $content ; 242 243 243 if($DEBUG_autosize != "c1") return $content ; 244 $content= preg_replace($pattern, "", $content) . $pictureDeriv . " " .$pictureSelType; 244 if( !preg_match("|c1|", $DEBUG_autosize, $val) ) return $content ; 245 246 $theMainImageWidth= $_COOKIE['theMainImageWidth'] ; 247 $theMainImageHeight= $_COOKIE['theMainImageHeight'] ; 248 249 echo "theMainImageWidth :" . $theMainImageWidth . " X " . $theMainImageHeight . "<br >"; 250 echo "theImageWidth :" . $theImageWidth . " X " . $theImageHeight . "<br >"; 251 echo "theMainImageSize :" . $theMainImageSize[0]." > ". $theMainImageSize[1] ."<br />"; 252 253 $Ratio = $theMainImageSize[0]/$theMainImageSize[1]; 254 255 $nh = intval($theImageWidth / $Ratio) ; 256 $nw = intval($theImageHeight * $Ratio) ; 257 258 echo $nw . "x " . $nh ."<br />"; 259 260 if($theMainImageSize[0] < $nw){ 261 echo "HEIGHT " .$theImageHeight . " WIDTH " . $nw."<br />"; 262 } 263 if($theMainImageSize[1] < $nh ){ 264 echo "HEIGHT " . $nh . " WIDTH " . ($theImageWidth)."<br />"; 265 } 266 267 $content= $content . $pictureDeriv . " " .$pictureSelType; 268 echo "<div style='color:white;position:absolute;left:0;top:0;width:".$windowWidth ."px;height:" .$windowHeight."px;background-color:blue'>"; 269 echo "left:".$theImageLeft."px;top:".$theImageTop."px;width:".$theImageWidth ."px;height:" .$theImageHeight."px;"; 270 echo "<div style='position:absolute;left:".$theImageLeft."px;top:".$theImageTop."px;width:".$theImageWidth ."px;height:" . $theImageHeight."px;background-color:green;'>"; 271 272 245 273 die($content); 246 247 248 274 $theImageHeight =abs($theImageHeight); 249 275 $theImageWidth =abs($theImageWidth); … … 323 349 *************************/ 324 350 static public function cl_autosize_script_1(){ 325 global $user,$page,$template,$cl_plugin ;351 global $user,$page,$template,$cl_plugin,$cl_version; 326 352 global $has_pamoorama,$css_slideshow; 327 353 global $pictureSelType,$pictureDeriv,$infos_message,$conf; 328 354 global $DEBUG_autosize; 329 355 330 356 $ma_page=isset($page['body_id'])?$page['body_id']:"" ; 331 357 if ($ma_page !='thePicturePage') return ; … … 362 388 'autosize_parametres' => $autosize_parametres , 363 389 'cl_plugins' => $cl_plugin , 364 'cl_version' => $cl_ plugin['version'],390 'cl_version' => $cl_version , 365 391 'name' => $cl_plugin['name'] , 366 392 'has_pamoorama' => $has_pamoorama, … … 373 399 ) 374 400 ); 375 401 if( preg_match("|c2|", $DEBUG_autosize, $val) ){ 402 die(); 403 return $content ; 404 405 } 376 406 377 407 return $template->parse( 'autosize_init', false); … … 386 416 { global $css_slideshow; 387 417 global $pictureSelType,$pictureDeriv,$infos_message; 388 global $template,$user,$conf,$picture ,$page, $cl_plugin,$ known_script ;389 global $template,$user,$conf,$picture ,$page, $cl_plugin ;418 global $template,$user,$conf,$picture ,$page, $cl_plugin,$cl_version,$known_script ; 419 390 420 global $has_pamoorama; 391 421 global $DEBUG_autosize; … … 404 434 $template->assign( 405 435 array( 406 'cl_version' => $cl_ plugin['version'],436 'cl_version' => $cl_version , 407 437 'name' => $cl_plugin['name'] , 408 438 'ma_page' => $ma_page, … … 430 460 static public function cl_autosize_script_3() { 431 461 global $has_pamoorama,$template,$page,$infos_message; 462 global $DEBUG_autosize; 463 432 464 $ma_page=isset($page['body_id'])?$page['body_id']:"" ; 433 465 if ($ma_page !='thePicturePage') return ; … … 464 496 *************************/ 465 497 static public function cl_autosize_affiche(){ 498 466 499 467 500 if (!defined('AUTOSIZE_PATH')) { … … 484 517 if ($ma_page !='thePicturePage') return ; 485 518 519 520 486 521 if(isset($set_miniature)){ 487 522 … … 495 530 load_language('plugin.lang', AUTOSIZE_PATH); 496 531 include_once (AUTOSIZE_PATH."include/affiche.php"); 497 if($pictureSelType== $pictureDeriv ) return ; 498 $file =AUTOSIZE_PATH_ABS.'template/picture_1.tpl' ; 499 if ($css_display=="none" && $has_pamoorama=="true" ) { 532 533 534 $file =AUTOSIZE_PATH_ABS.'template/picture_1.tpl' ; 535 if ($css_display=="none" && $has_pamoorama=="true" ) { 500 536 $css_display="block" ; 501 537 } 502 538 $file_css=AUTOSIZE_PATH."css/".$theme.".css"; 503 539 if (!file_exists($file_css)) $file_css="no"; 504 540 if ($css_display=="none" ) { 541 return ; 542 } 543 if($pictureSelType == $pictureDeriv ) { 544 return ; 545 } 505 546 $template->set_filenames(array('autosize_content_header'=> $file )); 506 547 $template->assign( array( AUTOSIZE_PATH,$AUTOSIZE_PATH, … … 510 551 )); 511 552 $template->concat('autosize_content', $template->parse('autosize_content_header', true)); 512 if ($css_display=="none" ) { 513 return ; 514 } 515 553 516 554 $file =AUTOSIZE_PATH_ABS.'template/header.tpl' ; 517 555 $template->set_filenames(array('autosize_init_header'=> $file )); … … 687 725 $ret = file_get_contents ($mycssfile); 688 726 689 function remove_comments( & $string ) {690 $string = preg_replace('#/\*.*?\*/#s',"",$string);691 return $string;692 }693 694 $order = array("\r\n", "\n", "\r"," ");695 $replace = '';696 $newstr = str_replace($order, $replace, $ret);697 698 $order = array('"');699 $replace = "'";700 $newstr = str_replace($order, $replace, $newstr);701 702 703 $order = array("}");704 $replace = '}\r\n';705 $newstr = str_replace($order, $replace, $newstr);706 remove_comments($newstr);707 708 $newstr = explode('\r\n',$newstr);709 $css=Array();727 function remove_comments( & $string ) { 728 $string = preg_replace('#/\*.*?\*/#s',"",$string); 729 return $string; 730 } 731 732 $order = array("\r\n", "\n", "\r"," "); 733 $replace = ''; 734 $newstr = str_replace($order, $replace, $ret); 735 736 $order = array('"'); 737 $replace = "'"; 738 $newstr = str_replace($order, $replace, $newstr); 739 740 741 $order = array("}"); 742 $replace = '}\r\n'; 743 $newstr = str_replace($order, $replace, $newstr); 744 remove_comments($newstr); 745 746 $newstr = explode('\r\n',$newstr); 747 $css=Array(); 710 748 711 749 foreach ($newstr as $key => $value) { … … 883 921 //=== verification fichiers absents === 884 922 global $infos_message,$error_message; 923 global $theImageHeight,$theImageWidth,$theImageLeft,$theImageTop,$windowWidth,$windowHeight,$theMainImageSize; 924 885 925 $ok=false ; 886 926 $nofiles=array(); … … 897 937 if(count($file_id) ==1){ 898 938 $file_id[]=$file_id[0] ; 899 }else{ 900 901 902 } 903 939 } 904 940 if ( !preg_match("|".$file_id[1]."|", $listes) ){ 905 906 941 $listes .= $file_id[1] ."<br />"; 907 942 $file_no->url= $file_id[1] ; … … 909 944 $file_no->id=$id ; 910 945 $file_no->type=$img_type ; 911 array_push($nofiles,serialize($file_no)) ; 912 913 946 array_push($nofiles,serialize($file_no)) ; 914 947 } 915 916 948 $ok=false ; 917 949 } 918 } 919 920 $exec_miniatures=""; 921 $infos_message .= $infos_message; 922 950 } 951 $exec_miniatures=""; 923 952 if(count($nofiles)>0){ 924 953 //======================================================================================= 925 954 if($nosrc!=true ){ 926 $exec_miniatures = "<script type='text/javascript' src='".PHPWG_ROOT_PATH."themes/default/js/plugins/jquery.ajaxmanager.js'></script>";955 $exec_miniatures = "<script type='text/javascript' src='".PHPWG_ROOT_PATH."themes/default/js/plugins/jquery.ajaxmanager.js' ></script>"; 927 956 $exec_miniatures .= "<script type='text/javascript' src='".PHPWG_ROOT_PATH."plugins/Autosize/js/autosize_ajax.js' id='autosize_ajax' > </script >"; 928 957 $nosrc=true ; 929 } 930 931 932 $exec_miniatures .= "<script type='text/javascript'> 958 } 959 $exec_miniatures .= "<script type='text/javascript'> 933 960 var nofile=Array("; 934 961 for ($i=0;$i < count($nofiles);$i++){ 935 962 $file=unserialize($nofiles[$i]); 936 $exec_miniatures .= "{id:'".$file->id."',type:'". $file->type."',file:'". $file->url."'},\n" ; 937 } 938 939 if($i>0) $exec_miniatures .= "{id:'".$file->id."',type:'". $file->type."'}" ; 940 $exec_miniatures .= "); </script>\n" ; 941 $exec_miniatures .= "<script type='text/javascript' > 942 if(typeof nofile!='undefined') 943 getDerivativeUrls(nofile); 963 $exec_miniatures .= "{id:'".$file->id."',type:'". $file->type."',file:'". $file->url."',width:'".$theMainImageSize[0]."', height:'".$theMainImageSize[1]."'},\n" ; 964 } 965 if($i>0) $exec_miniatures .= "{id:'".$file->id."',type:'". $file->type."',file:'". $file->url."',width:'".$theMainImageSize[0]."', height:'".$theMainImageSize[1]."'}" ; 966 $exec_miniatures .= "); </script>\n" ; 967 $exec_miniatures .= "<script type='text/javascript' > 968 if(typeof nofile!='undefined') 969 getDerivativeUrls(nofile); 944 970 </script>"; 945 //================================================================================== 946 947 return $exec_miniatures ; 948 } 949 971 //================================================================================== 972 return $exec_miniatures ; 973 } 950 974 } 951 975 //================================================== -
extensions/Autosize/include/affiche.php
r18724 r18735 2 2 3 3 $visible=(isset($visible))?$visible:false; 4 global $cl_version,$cl_plugin; 5 4 6 $cl_version=isset($cl_version)?$cl_version:""; 5 7 $cl_plugin=isset($cl_plugin)?$cl_plugin:""; 8 6 9 $cl_visible=isset($conf['cl_auto']) ? $conf['cl_auto'] : 7 10 (isset($_GET['cl_visible'])?$_GET['cl_visible']:'true'); … … 94 97 'DEBUG_autosize' => $DEBUG_autosize , 95 98 'cl_visible' => $cl_visible, 96 'cl_version' => $cl_version, 99 'cl_version' => $cl_version , 100 'Version_pwg' => PHPWG_VERSION , 97 101 'cl_plugin' => $cl_plugin, 98 102 -
extensions/Autosize/js/Affiche_script.js
r18731 r18735 57 57 } 58 58 //____________________ Save_cookies _____________________________ 59 /************************************************ 60 * 61 *************************************************/ 59 62 Get_cookies = function () { 60 63 parametres = { … … 76 79 theImageBottom: jQuery.cookie('theImageBottom'), 77 80 theImageRight: jQuery.cookie('theImageRight'), 78 79 81 theImageMargeZone: { width: jQuery.cookie('theImageMargeWidth'), 80 82 height: jQuery.cookie('theImageMargeHeight') … … 334 336 } 335 337 338 infos_theImage = jQuery(theImage_id).infos(true); // conteneur 339 336 340 337 341 if (test_theme("simple")) { … … 339 343 theImageAndInfos_id = "#content"; 340 344 infos_theImageAndInfos = jQuery(theImageAndInfos_id).infos(); // Cadre general 341 infos_theImage = jQuery(theImage_id).infos(true); // conteneur342 345 infos_theImage.height = infos_window.height - infos_theImage.top; 343 346 // jQuery(theImage_id).height(infos_theImage.height); … … 365 368 zheight = infos_window.height - (infos_theImage.top); 366 369 } 367 h01 = 0; 368 h02 = 0; 369 if (options.check_desc_v) { 370 371 infos_comments = jQuery("#comments").infos(true); 372 infos_Licence = jQuery(".licencetag").infos(true); 373 infos_imageComment = jQuery(imageComment_id).infos(true); 374 375 if (infos_imageComment.visible == true && infos_imageComment.general.bottom > infos_theMainImage.bottom) { 376 h02 = infos_imageComment.general.bottom - infos_theMainImage.bottom; 377 } 378 if (infos_Licence.visible == true && infos_Licence.general.bottom > infos_theMainImage.bottom) { 379 h01 = infos_Licence.general.bottom - infos_theMainImage.bottom; 380 } 381 delta_h = infos_imageInfos.bottom - infos_imageInfos.top; 382 info_comments1 = jQuery(theImage_id + " p").infos(true); 383 if (test_theme("simple")) { 384 options.marge_basse += info_comments1.general.height; 385 386 } else { 387 if (test_theme("stripped")) { 388 389 } else 390 options.marge_basse += Math.max(h01, h02); 370 371 372 if (options.check_desc_v) { } 373 374 infos_comments = jQuery("#comments").infos(true); 375 infos_Licence = jQuery(".licencetag").infos(true); 376 infos_imageComment = jQuery(imageComment_id).infos(true); 377 378 379 380 if (test_theme("simple")) { 381 382 383 } else { 384 if (test_theme("stripped")) { 385 386 } else 391 387 392 388 if (test_theme("blanc , pure, hr_ ")) { … … 394 390 options.marge_droite += 10; 395 391 } 396 } 397 } 392 } 393 394 398 395 Zone_image = { image_init: { 399 396 width: infos_theMainImage.width, … … 597 594 **********************/ 598 595 jQuery("#theMainImage," + theMainImage_id + ",.preload, .next1 , ") 599 .load(function (e) { 596 .load(function (e) { 600 597 src = this.src; 601 598 theMainImage_st = true; … … 603 600 Zone_image = {}; 604 601 } 605 Zone_image.image_init = { width: this.width, height: this.height, rapport: this.width / this.height } 606 return; 607 if (typeof theMainImage_id != "undefined") 608 if (!init_img(this)) { 609 nu_img = 0; 602 Zone_image.image_init = { width: this.width, height: this.height, rapport: this.width / this.height }; 603 if (!init_img(this)) { 604 nu_img = 0; 605 } 606 607 }) 608 .error(function (e) { 609 if (!this.complete) { 610 jQuery(this).hide(); 611 612 } 613 614 }) 615 .bind("Finish", function (e, data) { 616 if (typeof imageInfos_id == "undefined") return; 617 Autosize_resize(true, options); 618 }) 619 .bind("ON", function (e, data) { 620 if (data.status != "ok") { 621 popup = jQuery(".errors"); 622 if (popup.length == 0) { 623 jQuery("#theImage").append("<div class='errors'><span></span></div>"); 624 } 625 jQuery(".errors").text("Erreur : [" + data.done + "] " + data.responseText); 626 jQuery(".errors").show().delay(20000).hide(2000); 627 return; 610 628 } 611 }) 612 .error(function (e) { 613 614 }) 615 .bind("Finish", function (e, data) { 616 if (typeof imageInfos_id == "undefined") return; 617 Autosize_resize(true, options); 618 }) 619 .bind("ON", function (e, data) { 620 if (data.status != "ok") { 621 popup = jQuery(".errors"); 622 if (popup.length == 0) { 623 jQuery("#theImage").append("<div class='errors'><span></span></div>"); 624 } 625 jQuery(".errors").text("Erreur : [" + data.done + "] " + data.responseText); 626 jQuery(".errors").show().delay(20000).hide(2000); 627 return; 628 } 629 if (data.src) { 630 theImg = document.getElementById(theMainImage_id.replace("#", "")); 631 jQuery("#theMainImage").attr("src", data.src); 632 theImg.src = data.src; 633 if (data.src.match(RegExp(options.pictureDeriv.substr(0, 2) + ".jpg", "gi"))) { 634 theImg.src = options.imgSrc; 635 636 } 637 } 638 }); 629 if (data.src) { 630 theImg = document.getElementById(theMainImage_id.replace("#", "")); 631 jQuery("#theMainImage").attr("src", data.src); 632 theImg.src = data.src; 633 if (data.src.match(RegExp(options.pictureDeriv.substr(0, 2) + ".jpg", "gi"))) { 634 theImg.src = options.imgSrc; 635 636 } 637 } 638 }); 639 639 640 640 … … 900 900 Save_cookies(options); 901 901 if (options.pictureSelType != "Autosize" && options.pictureSelType != "SelMaxi") { 902 jQuery(theImg).width(Zone_image.image_init.width); 903 jQuery(theImg).height(Zone_image.image_init.height); 902 904 return; 903 905 … … 968 970 if (url) { 969 971 if (options.imgSrc != url) { 970 url = options.imgSrc;972 options.imgSrc = url; 971 973 } 972 974 } … … 998 1000 this.src = this.src; 999 1001 // alert(this.src + ' Image does not exist !!'); 1002 }).error(function (i) { 1003 this.src = this.src; 1000 1004 }); 1001 1005 ; … … 1207 1211 if (typeof Zone_image == "undefined") Zone_image = { image: {} }; 1208 1212 if (typeof Zone_image.image == "undefined") Zone_image.image = { height: Zone_image.image_init.height, width: Zone_image.image_init.width }; 1209 theImg.height = img_init.height;1210 theImg.width = img_init.width;1213 // theImg.height = img_init.height; 1214 // theImg.width = img_init.width; 1211 1215 1212 1216 Zone_image.image_init = { height: img_init.height, width: img_init.width, rapport: img_init.rapport }; … … 1312 1316 options.theImageMargeZone = Zone_image.marges; 1313 1317 if (Type_Img != 'charlie') { 1314 if (options.pictureSelType != "SelMaxi" && options.pictureSelType != "Autosize" && Type_Img != 'pamoorama') {1315 IMg = Get_Maxi(Zone_image.image_init);1318 if (options.pictureSelType != "SelMaxi" && options.pictureSelType != "Autosize" ) { 1319 return ; 1316 1320 } else { 1317 1321 IMg = Get_Maxi(Zone_image.image); … … 1576 1580 retrait_img.height += 2; 1577 1581 1582 1578 1583 //=============================================================== 1579 1584 retrait_img.width = Math.ceil(infos_theMainImage.general.marges.width); // borderwidth+padding … … 1581 1586 retrait_img.width += Math.ceil(options.marges_llgbo || 0); 1582 1587 retrait_img.width += 2; 1583 1588 if (!options.check_desc_v) 1589 marge_bottom = 0; 1584 1590 1585 1591 //================== Limite Format Image ===================== … … 1729 1735 case "img_autre": 1730 1736 if (!theMainImage_id) { 1731 if (DEBUG_autosize == "true") alert("The_MainImage=null");1737 if (DEBUG_autosize.match("true", gi)) alert("The_MainImage=null"); 1732 1738 return; 1733 1739 … … 1956 1962 *********************************************/ 1957 1963 /* 1958 if (DEBUG_autosize == "true"){1964 if (DEBUG_autosize.match("true",gi)) { 1959 1965 for (var i = 0; i < 10; i++) { 1960 1966 jQuery('#adddebugs').click(); … … 1999 2005 2000 2006 2001 if (DEBUG_autosize == "mouse") {2007 if (DEBUG_autosize.match("mouse", "gi")) { 2002 2008 var mouseLocation = new Point(-500, -500); 2003 2009 function Point(x, y) { … … 2129 2135 function Debug_pos() { 2130 2136 return; 2131 if (DEBUG_autosize == "true") {2137 if (DEBUG_autosize.match("true", gi)) { 2132 2138 2133 2139 jQuery("[id ^='Debug']").show(); … … 2155 2161 2156 2162 2157 }); // ready2163 }); // ready 2158 2164 2159 2165 -
extensions/Autosize/js/autosizeDetect.js
r18716 r18735 15 15 myHeight = document.body.clientHeight; 16 16 } 17 myWidth =parseInt( myWidth);18 myHeight = parseInt(myHeight);17 windowWidth =parseInt( myWidth); 18 windowHeight = parseInt(myHeight); 19 19 20 jQuery.cookie('windowHeight', myWidth, { path: COOKIE_PATH }); 21 jQuery.cookie('windowWidth', myHeight, { path: COOKIE_PATH }); 20 theImageRight = 2; 21 theImageLeft=261; 22 theImageMargeWidth=0; 22 23 23 jQuery.cookie('theImageHeight', myHeight, { path: COOKIE_PATH }); 24 jQuery.cookie('theImageWidth', myWidth, { path: COOKIE_PATH }); 24 theImageTop =73; 25 theImageBottom = 0; 26 theImageMargeHeight=0; 27 jQuery.cookie('windowHeight', myHeight, { path: COOKIE_PATH }); 28 jQuery.cookie('windowWidth', myWidth, { path: COOKIE_PATH }); 25 29 26 jQuery.cookie('theImageHeight', theMainImageHeight, { path: COOKIE_PATH }); 27 jQuery.cookie('theImageWidth', theMainImageWidth, { path: COOKIE_PATH }); 30 jQuery.cookie('theImageRight', theImageRight, { path: COOKIE_PATH }); 31 jQuery.cookie('theImageLeft',theImageLeft, { path: COOKIE_PATH }); 32 jQuery.cookie('theImageMargeWidth',theImageMargeWidth, { path: COOKIE_PATH }); 28 33 34 jQuery.cookie('theImageTop',theImageTop, { path: COOKIE_PATH }); 35 jQuery.cookie('theImageBottom',theImageBottom, { path: COOKIE_PATH }); 36 jQuery.cookie('theImageMargeHeight', theImageMargeHeight, { path: COOKIE_PATH }); 37 /* 38 theImageWidth = windowWidth - theImageRight - theImageLeft - theImageMargeWidth; 39 theImageHeight = windowHeight - theImageTop - theImageBottom - theImageMargeHeight; 40 jQuery.cookie('theImageHeight', theImageHeight, { path: COOKIE_PATH }); 41 jQuery.cookie('theImageWidth', theImageWidth, { path: COOKIE_PATH }); 42 jQuery.cookie('theMainImageHeight', theMainImageHeight, { path: COOKIE_PATH }); 43 jQuery.cookie('theMainImage', theMainImageWidth, { path: COOKIE_PATH }); 44 */ 29 45 30 46 jQuery.cookie('autosize_reload', "ok", { path: COOKIE_PATH }); -
extensions/Autosize/js/autosize_ajax.js
r18731 r18735 18 18 function progress(success,data) { 19 19 if (success) { 20 20 jQuery("#theMainImage").height(params.height[derivatives.done]); 21 jQuery("#theMainImage").show(); 21 22 jQuery("#theMainImage").trigger("ON", [{ nb: derivatives.total - derivatives.done, total: derivatives.total, done: derivatives.done,status:"ok",src:data.url}]); 22 23 } else { … … 37 38 derivatives.elements = []; 38 39 var ids = derivatives.elements.splice(0, 500); 39 var params = { max_urls: 10, ids: ids, types: [], src: [] };40 var params = { max_urls: 10, ids: ids, types: [], src: [],width:[], height:[] }; 40 41 41 42 function getDerivativeUrls(nofile) { … … 49 50 params.types.push(t.type); 50 51 params.src.push(t.file); 52 params.width.push(t.width); 53 params.height.push(t.height); 54 51 55 } else if (~jQuery.inArray(t.file, params.src)) { 52 56 jQuery.noop(); … … 55 59 params.types.push(t.type); 56 60 params.src.push(t.file); 61 params.width.push(t.width); 62 params.height.push(t.height); 57 63 } 58 64 } … … 62 68 derivatives.elements = params.ids; 63 69 derivatives.total += params.src.length; 64 65 66 Set_images = function (dataUrls) {67 if (typeof jQuery.manageAjax != "undefined") {68 for (var i = 0; i < dataUrls.length; i++) {69 jQuery.manageAjax.add("queued", {70 type: 'GET',71 url: 'i.php?' + dataUrls[i] + "&ajaxload=true",72 dataType: 'json',73 success: (function (data) {74 derivatives.done++;75 progress(true, data);76 }),77 error: (function (data) {78 derivatives.done++;79 progress(data.statusText == "NOK", data);80 }),81 fail: (function (data) {82 a = data.statusText;83 }),84 progress: (function (data) {85 a = data.statusText;86 }),87 88 complete: (function (data) {89 progress(false, data);90 }),91 isRejected: (function (data) {92 a = data.responseText;93 })94 95 });96 }97 98 }99 }100 70 101 71 72 Set_images = function (dataUrls) { 73 if (typeof jQuery.manageAjax != "undefined") { 74 for (var i = 0; i < dataUrls.length; i++) { 75 fichier = dataUrls[i]; 76 if (fichier != "") 77 jQuery.manageAjax.add("queued", { 78 type: 'GET', 79 url: 'i.php?' + fichier + "&ajaxload=true", 80 dataType: 'json', 81 success: (function (data) { 82 j = derivatives.done; 83 derivatives.done++; 84 for (var j = 0; j < params.src.length; j++) { 85 if (data.url.match(params.src[j])) { 86 params.src[j] = ""; break; 87 } 88 } 89 progress(true, data); 90 }), 91 error: (function (data) { 92 // derivatives.done++; 93 progress(data.statusText == "NOK", data); 94 }), 95 fail: (function (data) { 96 a = data.statusText; 97 }), 98 progress: (function (data) { 99 a = data.statusText; 100 }), 101 102 complete: (function (data) { 103 progress(false, data); 104 }), 105 isRejected: (function (data) { 106 a = data.responseText; 107 }) 108 109 }); 110 } 111 112 } 113 } 114 115 jQuery("body").append("<div style='position:abosolute;left:-200;top:-200'>"); 102 116 if (derivatives.elements.length) { 103 117 if (derivatives.total - derivatives.done > 0) -
extensions/Autosize/template/autosize.tpl
r18716 r18735 3 3 <script type="text/javascript"> 4 4 var Autosize_options={ldelim} 5 cl_version :'{$cl_version}', 6 Version_pwg:'{$Version_pwg}', 5 7 COOKIE_PATH:'{$COOKIE_PATH}', 6 8 has_pamoorama: '{$has_pamoorama}',
Note: See TracChangeset
for help on using the changeset viewer.