Changeset 19744 for extensions
- Timestamp:
- Jan 3, 2013, 10:51:15 AM (12 years ago)
- Location:
- extensions/Autosize
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Autosize/autosize.inc.php
r19707 r19744 53 53 $ma_page=isset($page['body_id'])?$page['body_id']:"" ; 54 54 if ($ma_page !='thePicturePage') return ; 55 $default_size = $conf['derivative_default_size']; 56 //============================================================ 57 self::get_cookies(); 55 58 $types = array_intersect(array_keys(ImageStdParams::get_defined_type_map()), array("Autosize","SelMaxi")); 56 59 if (count($types)==0){ … … 70 73 $infos_message .= "POST:" . cl_print_var($_POST) ; 71 74 $infos_message .= "$pictureDeriv $pictureSelType $pictureMap "; 72 // die("#138: ".$DEBUG_autosize);75 // self::Fin_php ("#138: ".$DEBUG_autosize); 73 76 } 74 77 if(!isset($_COOKIE['picture_deriv'] )){ 75 78 if(preg_match("|test_1|", $DEBUG_autosize, $val)) { 76 79 $infos_message .= "not COOKIE['picture_deriv'] -> reload(): <br>"; 77 echo $infos_message;78 die("#78 autosize_calcContent:" . $DEBUG_autosize);80 81 self::Fin_php("#78 autosize_calcContent:" . $DEBUG_autosize ); 79 82 } 80 self::reload( );81 die("#81 autosize_calcContent:" + $DEBUG_autosize);83 self::reload("#80"); 84 self::Fin_php("#81 autosize_calcContent:" + $DEBUG_autosize); 82 85 } 83 86 … … 87 90 $infos_message .= "not COOKIE['autosize_reload'] -> reload(): <br>"; 88 91 echo $infos_message; 89 die("#89 autosize_calcContent:" . $DEBUG_autosize);92 self::Fin_php("#89 autosize_calcContent:" . $DEBUG_autosize); 90 93 } 91 self::reload( );92 die("#92 autosize_calcContent:" + $DEBUG_autosize);94 self::reload("#81"); 95 self::Fin_php("#92 autosize_calcContent:" + $DEBUG_autosize); 93 96 94 97 } … … 155 158 $infos_message .= "POST:" . cl_print_var($_POST) ; 156 159 $infos_message .= "$pictureDeriv $pictureSelType $pictureMap "; 157 // die("#138: ".$DEBUG_autosize);160 // self::Fin_php("#138: ".$DEBUG_autosize); 158 161 } 159 162 $autosize_parametres = cl_autosize_Get_Options(); … … 220 223 if(preg_match("|c1|", $DEBUG_autosize, $val)) { 221 224 echo "<!-- " . $theImageWidth . "x" . $theImageHeight . " " .cl_print_var($content) ." -->"; 222 die("#230: " . $DEBUG_autosize);225 self::Fin_php("#222: " . $DEBUG_autosize); 223 226 } 224 227 return $content; … … 315 318 echo "left:".$theImageLeft."px;top:".$theImageTop."px;width:".$theImageWidth ."px;height:" .$theImageHeight."px;"; 316 319 echo "<div style='position:absolute;left:".$theImageLeft."px;top:".$theImageTop."px;width:".$theImageWidth ."px;height:" . $theImageHeight."px;background-color:green;'>"; 317 die("#317 : " . $content + $DEBUG_autosize);320 self::Fin_php("#317 : " . $content + $DEBUG_autosize); 318 321 319 322 } //INIT2 … … 321 324 * 322 325 ***************************/ 323 static public function reload( ){326 static public function reload($id_ret){ 324 327 //========================================= 325 328 include_once ( "include/functions_cookie.inc.php"); … … 330 333 $set_miniature = "<!DOCTYPE html><html><head> 331 334 <meta http-equiv='content-type' content='text/html; charset=UTF-8'/> 332 <script type='text/javascript' src='themes/default/js/jquery.min.js'></script><script type='text/javascript' src='plugins/Autosize/js/autosizeDetect.js'></script> 335 <script type='text/javascript' src='themes/default/js/jquery.min.js'></script> 336 <script type='text/javascript' src='plugins/Autosize/js/autosizeDetect.js'></script> 333 337 <script type='text/javascript' src='plugins/Autosize/js/autosize.cookie.js'></script> 334 338 <script type='text/javascript' src='".PHPWG_ROOT_PATH."themes/default/js/plugins/jquery.ajaxmanager.js'></script>"; 339 335 340 $set_miniature .= "<script type='text/javascript' src='".PHPWG_ROOT_PATH."plugins/Autosize/js/autosize_ajax.js' id='autosize_ajax' > </script >"; 336 341 337 342 $set_var = "<script type='text/javascript'>\n var COOKIE_PATH = '".cookie_path()."';\n"; 338 343 if(preg_match("|noreload|", $DEBUG_autosize, $val)) { 344 $set_var .= " var reload = 'false';\n"; 345 } else { 346 $set_var .= " var reload = 'true';\n"; 347 } 348 $set_var .= " var ret_id = '". $id_ret . "';\n"; 339 349 $set_var .= " var mapage = '". $ma_page . "';\n"; 340 350 $set_var .= " var theme = '" .$user['theme']. "';\n"; … … 348 358 </head> 349 359 <body onload=on_load() style='background-color:black;color :white;font-size:30px ' > 350 please wait, loading ...360 please wait, loading($id_ret)... 351 361 <div></div> 352 362 </body></html>"; 353 363 354 364 355 365 $default_size = $conf['derivative_default_size']; … … 381 391 echo "INIT <pre>"; 382 392 print_r($_COOKIE); 383 die(400); 384 } 385 386 if(preg_match("|vue_init|", $DEBUG_autosize, $val)) { 387 echo "Reload: $userst <br> $usertype <br> autosize_parametres:" . cl_print_var($autosize_parametres) ; 388 echo $infos_message ; 389 if ( isset($_COOKIE['pwg_id']) ) unset ($_COOKIE['pwg_id']) ; 393 self::Fin_php("#385: ".$DEBUG_autosize); 394 } 395 396 if(preg_match("|vue_init|", $DEBUG_autosize, $val)) { 397 $infos_message.="Reload: $userst <br> $usertype <br> autosize_parametres:" . cl_print_var($autosize_parametres) ; 398 if ( isset($_COOKIE['pwg_id']) ) unset ($_COOKIE['pwg_id']) ; 390 399 echo "Reload: SESSION:" . cl_print_var($_SESSION) ; 391 400 echo "Reload: COOKIE:" . cl_print_var($_COOKIE) ; 392 401 echo "GET:" . cl_print_var($_GET) ; 393 402 echo "POST:" . cl_print_var($_POST) ; 394 die("#442: ".$DEBUG_autosize); 395 } 403 self::Fin_php("#396: ".$DEBUG_autosize); 404 } 405 406 $infos_message.="Reload: $userst <br> $usertype <br> autosize_parametres:" . cl_print_var($autosize_parametres) ; 407 396 408 echo $set_miniature ; 397 409 echo $set_var ; 398 echo $autoscript;399 die();400 //=========================================401 410 411 echo $autoscript; 412 self::Fin_php("#401: ".$DEBUG_autosize); 413 402 414 } 403 415 … … 455 467 ); 456 468 if( preg_match("|c2|", $DEBUG_autosize, $val) ){ 457 die( "446: " . $DEBUG_autosize);469 self::Fin_php( "446: " . $DEBUG_autosize); 458 470 return $content ; 459 471 … … 672 684 $pictureMap=$_COOKIE['picture_map']; 673 685 $infos_message .= "<br />SelType:" . $pictureSelType."; pictureDeriv:".$pictureDeriv ."; pictureMap:".$pictureMap; 674 echo $infos_message;675 die ("#657: ".$DEBUG_autosize);686 687 self::Fin_php("#677: ".$DEBUG_autosize); 676 688 } 677 689 cl_aff_infos_plus(); … … 1095 1107 ****************************/ 1096 1108 static public function get_cookies(){ 1097 global $pictureDeriv,$pictureSelType,$pictureDeriv ;1109 global $pictureDeriv,$pictureSelType,$pictureDeriv,$pictureMap; 1098 1110 if(!isset($_COOKIE['picture_deriv'])){ 1099 1111 $pictureDeriv= pwg_get_session_var('picture_deriv'); … … 1115 1127 ****************************/ 1116 1128 static public function save_cookies(){ 1117 global $pictureDeriv,$pictureSelType,$pictureDeriv;1129 global $pictureDeriv,$pictureSelType,$pictureDeriv,$pictureMap; 1118 1130 1119 1131 pwg_set_session_var('picture_deriv',$pictureDeriv); … … 1141 1153 $_COOKIE['picture_deriv']=$pictureDeriv; 1142 1154 $_COOKIE['picture_map']=$pictureDeriv; 1155 } 1156 1157 static public function Fin_php($message_){ 1158 global $infos_message; 1159 echo "End :".$message_."<br>"; 1160 die($infos_message); 1143 1161 } 1144 1162 //================================================== -
extensions/Autosize/js/autosizeDetect.js
r18735 r19744 43 43 jQuery.cookie('theMainImage', theMainImageWidth, { path: COOKIE_PATH }); 44 44 */ 45 retval = jQuery.cookie('autosize_reload'); 46 if (retval == "ok") return; 45 47 46 48 jQuery.cookie('autosize_reload', "ok", { path: COOKIE_PATH }); 47 48 document.location.reload(false); // from cache 49 if (reload=="true") { 50 //document.location.reload(false); // from cache 51 try { 49 52 53 var retval = document.location.reload(true); 54 } 55 catch (err) { 56 var retval = window.location.reload(); 57 } 58 } 50 59 } -
extensions/Autosize/main.inc.php
r19707 r19744 2 2 /* 3 3 Plugin Name: AutoSize 4 Version: 3.0. 34 Version: 3.0.4 5 5 Description: Ajuste l'affichage des photos en fonction de la hauteur de la fenetre de navigation 6 6 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=448
Note: See TracChangeset
for help on using the changeset viewer.