Changeset 17503
- Timestamp:
- Aug 9, 2012, 8:35:17 PM (12 years ago)
- Location:
- extensions/Autosize
- Files:
-
- 1 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Autosize/admin/admin_autosize.php
r11442 r17503 97 97 $visible=true; 98 98 $path = AUTOSIZE_PATH; 99 $autosize_parametres = cl_autosize_Get_Options(); 99 global $has_pamoorama,$select_type,$autosize_parametres; 100 global $defined_types,$maxi_img ,$pictureDeriv ,$liste_type,$SRC_IMG; 101 $defined_types = array_keys(ImageStdParams::get_defined_type_map()); 102 $autosize_parametres = cl_autosize_Get_Options(); 100 103 101 104 if (isset($_POST['submit'])) { … … 109 112 unset($_POST); 110 113 } 111 include (AUTOSIZE_PATH."include/affiche.php");114 include (AUTOSIZE_PATH."include/affiche.php"); 112 115 //================================================================================ 113 116 $base_url = get_root_url().'admin_autosize.php'; … … 127 130 <div class='autosize' 128 131 autosize='MargeBasse:30px;MargeHaute:30px;parent:fieldset;ResizePicture:true'> 129 <img src='./plugins/Autosize/images/ ECO_050.jpg ' width='100%' />132 <img src='./plugins/Autosize/images/quadrille_100.png ' width='100%' /> 130 133 </div> 131 134 </fieldset>"; -
extensions/Autosize/autosize.inc.php
r17308 r17503 21 21 // +-----------------------------------------------------------------------+ 22 22 class autosize_controler { 23 //============================================================ 24 /* 25 * cl_autosize_script_1 26 */ 27 static public function cl_autosize_script_1() 28 { 23 /********************************* 24 * cl_autosize_admin 25 **********************************/ 26 static public function cl_autosize_admin($menu) { 27 global $lang ; 28 array_push($menu, array('NAME' => 'Autosize', 29 'URL' => get_admin_plugin_menu_link(AUTOSIZE_PATH . 'admin/admin_autosize.php'))); 30 return $menu; 31 } //function cl_autosize_admin 32 /********************* 33 * INIT 34 *********************/ 35 static public function init($content){ 36 // header ('X-UA-Compatible: n=7') ; 37 // header ('X-UA-Compatible: IE=Edge') ; 38 global $template,$version,$icon_path,$page,$picture,$conf; 39 40 $current = $template->get_template_vars('current'); 41 42 $model= $_COOKIE['picture_deriv'] ; 43 $has_pamoorama=isset($template->files['pamooramics_content']); 44 //==================================================================== 45 $pictureDeriv = pwg_get_session_var('picture_deriv',$conf['derivative_default_size']); 46 $SRC_IMG=""; 47 $selected_derivative = $current['derivatives'][$pictureDeriv]; 48 if (!isset($current['selected_derivative'])){ 49 $template->append('current', array( 50 'selected_derivative' => $selected_derivative 51 ), 52 true); 53 $current = $template->get_template_vars('current'); 54 } 55 56 if(isset($current['derivatives'][$model])) { 57 $selected_derivative = $current['derivatives'][$model]; 58 $template->assign('current[selected_derivative]', $selected_derivative 59 , true); 60 $current = $template->get_template_vars('current'); 61 } 62 63 return $content; 64 65 }//INIT 66 /************************** 67 * autosize_calcContent * 68 **************************/ 69 static public function autosize_calcContent($content){ 70 global $conf,$page, $template,$picture,$user; 71 global $defined_types,$maxi_img ,$pictureDeriv ,$liste_type,$SRC_IMG,$select_type; 72 global $has_pamoorama; 73 global $autosize_parametres,$user_status; 74 $defined_types = array_keys(ImageStdParams::get_defined_type_map()); 75 //=============================================================== 76 if(isset($page['body_id']) && $page['body_id'] == 'theAdminPage' ) return ; 77 if (!isset($_COOKIE['autosize_reload'])){ 78 $autoscript="<script type='text/javascript' src='themes/default/js/jquery.min.js'></script> <script type='text/javascript' src='plugins/autosize/js/autosizeDetect.js'></script> 79 <script type='text/javascript' src='plugins/Autosize/js/autosize.cookie.js'></script> 80 <body onload=on_load() style='background-color:black;color :white;font-size:30px ' > 81 please wait, loading... 82 </body>"; 83 echo $autoscript; 84 die(); 85 } 86 $current = $template->get_template_vars('current'); 87 if (!isset($current)) return ; 88 //=============================================================== 89 $derivative = $current['src_image'] ; 90 $imgScaledWH = $derivative->get_size(); 91 $SRC_IMG = $derivative->get_url(); 92 $picture['current']['scaled_width']=$imgScaledWH[0]; 93 $picture['current']['scaled_height']= $imgScaledWH[1]; 94 $picture['current']['high_url']= $SRC_IMG; 95 $picture['current']['image_url']=$SRC_IMG; 96 //=============================================================== 97 98 $user_status = $user['status'] ; 99 $autosize_parametres = cl_autosize_Get_Options(); 100 $user_type= get_user_status($user_status)."_type"; 101 $select_type=$autosize_parametres->$user_type ; 102 103 104 if (isset($_COOKIE['theImageHeight'])){ 105 pwg_set_session_var('theImageWidtht',$_COOKIE['theImageWidth']); 106 pwg_set_session_var('theImageHeight',$_COOKIE['theImageHeight']); 107 } 108 if (isset($_COOKIE['theMainImageHeight'])) pwg_set_session_var('theMainImageHeight',$_COOKIE['theMainImageHeight']); 109 if (isset($_COOKIE['theMainImageWidth'])) pwg_set_session_var('theImageWidth',$_COOKIE['theMainImageWidth']); 110 111 112 if (isset($_COOKIE['picture_deriv'])) 113 pwg_set_session_var('picture_deriv',$_COOKIE['picture_deriv']); 114 else 115 pwg_set_session_var('picture_deriv',$select_type); 116 117 118 $model= $conf['derivative_default_size'] ; // par defaut 119 $pictureDeriv = pwg_get_session_var('picture_deriv', $model); 120 121 122 $model=$pictureDeriv ; 123 124 $value=0; 125 $liste_type=""; 126 $maxi_info=""; 127 if($model!="Autosize" & $model!="SelMaxi"){ 128 129 }else{ 130 $model=$conf['derivative_default_size'] ; 131 } 132 $derivative=$current['derivatives'][$model] ; 133 $img_all= $derivative->get_all($derivative->src_image); 134 $maxi_img=""; 135 $mini_img=""; 136 $maxi_url=""; 137 $imgSizeWH = $derivative->get_size(); 138 //==== valeur taille image ==== 139 140 $window_width=$imgSizeWH[0]; 141 $window_height=$imgSizeWH[1]; 142 //echo "<div style='background-color:black;color:white' >INIT: $model w:$window_width x h:$window_height </div>"; 143 144 145 $window_width = pwg_get_session_var('theMainImageWidth',$imgSizeWH[0]); 146 $window_height = pwg_get_session_var('theMainImageHeight',$imgSizeWH[1]); 147 148 if (!isset($_COOKIE['theMainImageHeight'])) setcookie('theMainImageHeight', $window_height ); 149 if (!isset($_COOKIE['theMainImageWidth'])) setcookie('theMainImageWidth',$window_width); 150 151 // echo "<div style='background-color:black;color:white' >$select_type w: $window_width x h: $window_height </div>"; 152 153 $last_defined=ImageStdParams::get_defined_type_map(); 154 foreach ($img_all as $img_select){ 155 $img_type = $img_select->get_type(); 156 if ($img_type=="square" || $img_type=="thumb" ) continue ; 157 158 $img_url = $img_select->get_url(); 159 $imgSizeWH = $img_select->get_size(); 160 if($img_type=="Autosize" || $img_type=="SelMaxi"){ 161 $img_url = $img_select->src_image->get_url(); 162 $imgSizeWH = $img_select->src_image->get_size(); 163 $liste_type[$img_type]=$img_type.",".$img_url.",".$imgSizeWH[0] .",".$imgSizeWH[1] ; 164 }else{ 165 $liste_type[$img_type]=$img_type.",".$img_url.",".$imgSizeWH[0] .",".$imgSizeWH[1] ; 166 if ($img_type=="Original"){ 167 168 break ; 169 } 170 171 172 173 if($window_height < $imgSizeWH[0] ){ 174 $maxi_img= $img_type; 175 $maxi_url= $img_url; 176 $maxi_i=$img_select; 177 } 178 if($window_height < $imgSizeWH[0] && $mini_img==""){ 179 $mini_img= $img_type; 180 $mini_url= $img_url; 181 $mini_i=$img_select; 182 183 }else if($imgSizeWH[0] > 10 && $maxi_img==""){ 184 $last_img=$img_select; 185 } 186 187 188 if($select_type==$img_type){ 189 if($maxi_img==""){ 190 $maxi_img= $img_type; 191 $maxi_url= $img_url; 192 $maxi_i=$img_select; 193 } 194 195 break ; 196 } 197 } 198 199 } 200 201 //============================================================== 202 //==== Réécriture selection ==== 203 if( $img_type=="SelMaxi"){ 204 $maxi_img= $mini_img; 205 $maxi_url= $mini_img; 206 } 207 if ( !array_key_exists($maxi_img, $last_defined) ){ 208 $maxi_img = $last_img->get_type(); 209 $maxi_url = $last_img->get_url(); 210 $imgSizeWH = $last_img->get_size(); 211 } 212 $model= $maxi_img; 213 pwg_set_session_var('picture_deriv', $maxi_img); 214 $_COOKIE['picture_deriv']=$maxi_img ; 215 $_COOKIE['picture_map']= $maxi_img ; 216 $_COOKIE['imgSrc']= $maxi_url; 217 218 if (isset($_COOKIE['picture_deriv'])){ 219 if ( array_key_exists($_COOKIE['picture_deriv'], ImageStdParams::get_defined_type_map()) ){ 220 pwg_set_session_var('picture_deriv', $_COOKIE['picture_deriv']); 221 }else{ 222 echo "<pre>".$_COOKIE['picture_deriv']. "No exist " ; 223 print_r($img_all ); 224 die(); 225 } 226 setcookie('picture_deriv', false, 0, cookie_path() ); 227 } 228 229 230 return false ; 231 232 } 233 234 /************************ 235 * cl_autosize_affiche 236 *************************/ 237 static public function cl_autosize_affiche(){ 238 global $user, $picture, $template,$page,$known_script; 239 global $content, $element_info; 240 global $infos_message,$erreur_message; 241 global $conf,$lang ,$user,$userdata; 242 global $defined_types,$maxi_img ,$pictureDeriv ,$liste_type,$SRC_IMG,$select_type; 243 global $has_pamoorama; 244 global $autosize_parametres,$user_status; 245 246 if(isset($page['body_id']) && $page['body_id'] == 'theAdminPage' ) return ; 247 248 if ('kardon' == $user['theme'] and isset($_GET['slideshow'])) return ; 249 load_language('plugin.lang', AUTOSIZE_PATH); 250 $AUTOSIZE_PATH = dirname(__FILE__).'/'; 251 if (isset( $page['body_id']) && $page['body_id']=='thePicturePage' ) { 252 253 if ( isset($picture['current'])){ 254 include (AUTOSIZE_PATH."include/affiche.php"); 255 256 $file =AUTOSIZE_PATH_ABS.'template/picture_1.tpl' ; 257 $template->set_filenames(array('autosize_content_header'=> $file )); 258 $template->assign( 259 array( 260 'select_type' =>$select_type, 261 )); 262 263 $template->concat('autosize_content', $template->parse('autosize_content_header', true)); 264 265 $file =AUTOSIZE_PATH_ABS.'template/header.tpl' ; 266 $template->set_filenames(array('autosize_init_header'=> $file )); 267 $template->parse( 'autosize_init_header', false); 268 269 $theme=$user['theme']; 270 271 if($autosize_parametres->check_icon_v == 'on'){ 272 $template->assign('cl_autosize_button', 273 array( 'cl_autosize_info' => 'cl_autosize_info' , 274 'cl_autosize_info_1' => 'cl_autosize_info_' , 275 'cl_autosize_info_2' => 'cl_autosize_info_2' , 276 'URL' => $_SERVER['REQUEST_URI'] , 277 'ICON2' => AUTOSIZE_PATH . 'icons/button-maximize.png', 278 'ICON' => AUTOSIZE_PATH . 'icons/button-minimize.png', 279 'ICON1' => AUTOSIZE_PATH . 'icons/button-no.png' 280 ) 281 282 ); 283 $template->set_filenames(array('cl_bp' => $AUTOSIZE_PATH. 'template/picture.tpl')); 284 $template->concat('PLUGIN_PICTURE_ACTIONS', $template->parse('cl_bp', true)); 285 } 286 $template->set_filenames( 287 array('autosize_content'=> $AUTOSIZE_PATH.'template/autosize.tpl', 288 'theme' => $theme ) 289 ); 290 $template->concat('autosize_content', $template->parse('autosize_content_header', true)); 291 292 if(isset($conf['go_up_down']) && ($conf['go_up_down']==true) ){ 293 $template->set_filenames(array('mes_script' => realpath(AUTOSIZE_PATH).'/template/mes_scripts.tpl') ); 294 $template->func_combine_script(array('id'=>'my_script_2', 295 'path'=> AUTOSIZE_PATH.'/js/JScript.js', 296 'require' => 'jquery'), 297 $template->smarty); 298 $template->assign(array( 299 'MY_FOOTER_PATH' =>AUTOSIZE_PATH 300 )); 301 $template->parse('mes_script'); 302 } 303 return $template->parse( 'autosize_content', false); 304 } 305 } 306 307 } //public function cl_autosize_affiche 308 309 /************************ 310 * cl_autosize_script_1 311 *************************/ 312 static public function cl_autosize_script_1(){ 29 313 global $user,$page,$template,$cl_plugin; 30 // header ('X-UA-Compatible: n=7') ;31 // header ('X-UA-Compatible: IE=Edge') ;32 314 if(isset($page['body_id']) && $page['body_id'] == 'theAdminPage' ) return ; 315 33 316 $ma_page=isset($page['body_id'])?$page['body_id']:"" ; 34 if ($ma_page=='thePiwiShackControllerPage') return ; 35 if (!isset($template->files['pamooramics_content'])) return ; 317 if ($ma_page=='thePiwiShackControllerPage') return ; 36 318 if ('kardon' == $user['theme'] and isset($_GET['slideshow'])) return ; 319 global $has_pamoorama; 37 320 $has_pamoorama=isset($template->files['pamooramics_content']); 38 39 $file =AUTOSIZE_PATH_ABS.'template/header.tpl' ; 40 $template->set_filenames(array('autosize_init_header'=> $file )); 321 if (!$has_pamoorama) return ; 322 41 323 $template->set_filenames(array('autosize_init'=>AUTOSIZE_PATH_ABS. "template/conflit.tpl" ) ); 42 //================================================================43 $DEBUG_autosize = isset($_POST['cl_debug_conflit']) ? $_POST['cl_debug_conflit'] : "false" ;44 $DEBUG_autosize = isset($_GET['cl_debug_conflit']) ? $_GET['cl_debug_conflit'] : $DEBUG_autosize ;45 $DEBUG_autosize = isset($conf['cl_debug_conflit']) ? $conf['cl_debug_conflit'] : $DEBUG_autosize ;46 //======================================================================47 324 $autosize_parametres = cl_autosize_Get_Options() ; 48 325 $theme=$user['theme']; 326 //============================================================================== 327 $DEBUG_autosize = isset($_POST['cl_debug_conflit']) ? $_POST['cl_debug_conflit'] : "false" ; 328 $DEBUG_autosize = isset($_GET['cl_debug_conflit']) ? $_GET['cl_debug_conflit'] : $DEBUG_autosize ; 329 $DEBUG_autosize = isset($conf['cl_debug_conflit']) ? $conf['cl_debug_conflit'] : $DEBUG_autosize ; 330 //============================================================================== 49 331 $template->assign( 50 332 array( … … 54 336 'name' => $cl_plugin['name'] , 55 337 'pamoorama' => $has_pamoorama, 56 'theme' => $theme , 57 'DEBUG_autosize' => $DEBUG_autosize,338 'theme' => $theme , 339 'DEBUG_autosize' => $DEBUG_autosize, 58 340 'AUTOSIZE_PATH' => str_replace("../","",AUTOSIZE_PATH) , 59 341 'AUTOSIZE_PATH_ABS' => AUTOSIZE_PATH_ABS, 60 342 'Version_pwg' => PHPWG_VERSION ) 61 343 ); 62 $template->concat('cl_conflit_init', $template->parse('autosize_init_header', true)); 63 return $template->parse( 'autosize_init', false); 344 return $template->parse( 'autosize_init', false); 64 345 }// function cl_autosize_script_1 65 346 … … 71 352 global $template,$user,$conf,$picture ,$page, $cl_plugin,$known_script ; 72 353 global $template,$user,$conf,$picture ,$page, $cl_plugin ; 354 if(isset($page['body_id']) && $page['body_id'] == 'theAdminPage' ) return ; 355 73 356 if ('kardon' == $user['theme'] and isset($_GET['slideshow'])) return ; 74 if (!isset($PAMOORAMICS_PATH)) return ; 357 global $has_pamoorama; 358 if (!$has_pamoorama) return ; 359 75 360 $AUTOSIZE_PATH = dirname(__FILE__).'/'; 76 361 //================================================================ … … 88 373 $src_img_h=isset($_POST['src_img_h'])?$_POST['src_img_h']: $img_width ; 89 374 $src_img_w= isset($_POST['src_img_w'])?$_POST['src_img_w']:$img_height ; 375 376 377 include_once (PHPWG_ROOT_PATH.'include/functions_cookie.inc.php') ; 90 378 if(isset($_COOKIE['img_w'])){ 91 379 $src_img_w=$_COOKIE['img_w']; … … 93 381 } 94 382 95 $window_height= isset($_ POST['window_height'])?$_POST['window_height']: $img_scaled_height ;96 $window_width= isset($_ POST['window_width'])?$_POST['window_width']: $img_scaled_width ;383 $window_height= isset($_SESSION['height'])?$_SESSION['height']: $img_scaled_height ; 384 $window_width= isset($_SESSION['width'])?$_SESSION['width']: $img_scaled_width ; 97 385 98 386 … … 118 406 ) 119 407 ); 120 include_once (PHPWG_ROOT_PATH.'include/functions_cookie.inc.php') ; 408 121 409 $autoscript="<script type='text/javascript'> 122 410 /* cl_autosize_script_2 */ … … 131 419 * cl_autosize_script_3() 132 420 **************************************/ 133 static public function cl_autosize_script_3() 134 { 135 global $template; 136 137 138 $has_pamoorama=isset($template->files['pamooramics_content']); 139 if (!$has_pamoorama) return ; 140 141 $autoscript="<div id='debug' >TEST</div> 142 <script type='text/javascript'> 421 static public function cl_autosize_script_3() { 422 global $template,$page; 423 if(isset($page['body_id']) && $page['body_id'] == 'theAdminPage' ) return ; 424 global $has_pamoorama; 425 if (!$has_pamoorama) return ; 426 427 $autoscript="<script type='text/javascript'> 143 428 if (typeof (Ajout_Ajax) == 'function') 144 429 Ajout_Ajax(); … … 148 433 }// function cl_autosize_script_3 149 434 150 //================================================================151 /*152 * cl_autosize_admin153 */154 static public function cl_autosize_admin($menu)155 {156 global $lang ;157 array_push($menu, array('NAME' => 'Autosize',158 'URL' => get_admin_plugin_menu_link(AUTOSIZE_PATH . 'admin/admin_autosize.php')));159 return $menu;160 } //function cl_autosize_admin161 //=====================================162 163 164 // this is the default handler that generates the display for the element165 static public function autosize_calcContent($content)166 {167 global $conf;168 169 global $page, $template,$picture;170 171 172 $current = $template->get_template_vars('current');173 $defined_types = array_keys(ImageStdParams::get_defined_type_map());174 if (isset($current)){175 if (!isset($current['selected_derivative'])){176 $model= $defined_types[count($defined_types)-1];177 $selected_derivative = $current['derivatives'][$model];178 $template->append('current', array(179 'selected_derivative' => $selected_derivative180 ), true);181 182 183 $current = $template->get_template_vars('current');184 }185 186 $derivative=$current['selected_derivative'] ;187 $imgScaledWH=$derivative->src_image->get_size();188 $imgSizeWH = $derivative->get_size();189 $img_type = $derivative->get_type();190 $img_url = $derivative->get_url();191 $img_all= $derivative->get_all($derivative->src_image);192 $scaled_size=$derivative->get_size_hr(); //792 x 441193 $scaled_size=$derivative->get_scaled_size_htm(); // width="792" height="441"194 //================= taille mis a l'échelle195 $scaled_size=$derivative->get_scaled_size(100,100); // array([0]=>100,[1]=>55)196 $src= $derivative->src_image ;197 198 }199 200 $img_scaled_width=isset($imgScaledWH)?$imgScaledWH[0]:"480";201 $img_scaled_height=isset($imgScaledWH)?$imgScaledWH[1]:"320";202 $current = $template->get_template_vars('picture');203 $picture['current']['scaled_width']=$img_scaled_width;204 $picture['current']['scaled_height']= $img_scaled_height;205 $picture['current']['image_url']=$src->rel_path;206 207 }208 209 //===============================================================210 /*211 *212 */213 static public function cl_autosize_affiche()214 {215 global $user, $picture, $template,$page,$known_script;216 global $content, $element_info;217 global $infos_message,$erreur_message;218 global $conf,$lang ,$user,$userdata;219 if ('kardon' == $user['theme'] and isset($_GET['slideshow'])) return ;220 load_language('plugin.lang', AUTOSIZE_PATH);221 222 $AUTOSIZE_PATH = dirname(__FILE__).'/';223 if (isset( $page['body_id']) && $page['body_id']=='thePicturePage' ) {224 if ( isset($picture['current'])){225 $autosize_parametres = cl_autosize_Get_Options();226 include (AUTOSIZE_PATH."include/affiche.php");227 $file =AUTOSIZE_PATH_ABS.'template/picture_1.tpl' ;228 $template->set_filenames(array('autosize_content_header'=> $file ));229 $template->concat('autosize_content', $template->parse('autosize_content_header', true));230 $template->set_filenames(array('autosize_init_header'=> $file ));231 $theme=$user['theme'];232 $deriv_type = pwg_get_session_var('picture_deriv', IMG_LARGE);233 $defined_types = array_keys(ImageStdParams::get_defined_type_map());234 235 if($autosize_parametres->check_icon_v == 'on'){236 $template->assign('cl_autosize_button',237 array( 'cl_autosize_info' => 'cl_autosize_info' ,238 'cl_autosize_info_1' => 'cl_autosize_info_' ,239 'cl_autosize_info_2' => 'cl_autosize_info_2' ,240 'URL' => $_SERVER['REQUEST_URI'] ,241 'ICON2' => AUTOSIZE_PATH . 'icons/button-maximize.png',242 'ICON' => AUTOSIZE_PATH . 'icons/button-minimize.png',243 'ICON1' => AUTOSIZE_PATH . 'icons/button-no.png'244 )245 246 );247 $template->set_filenames(array('cl_bp' => $AUTOSIZE_PATH. 'template/picture.tpl'));248 $template->concat('PLUGIN_PICTURE_ACTIONS', $template->parse('cl_bp', true));249 }250 $template->set_filenames(251 array('autosize_content'=> $AUTOSIZE_PATH.'template/autosize.tpl',252 'theme' => $theme )253 );254 $template->concat('autosize_content', $template->parse('autosize_content_header', true));255 if(isset($conf['go_up_down']) && ($conf['go_up_down']==true) ){256 $template->set_filenames(array('mes_script' => realpath(AUTOSIZE_PATH).'/template/mes_scripts.tpl') );257 $template->func_combine_script(array('id'=>'my_script_2',258 'path'=> AUTOSIZE_PATH.'/js/JScript.js',259 'require' => 'jquery'),260 $template->smarty);261 $template->assign(array(262 'MY_FOOTER_PATH' =>AUTOSIZE_PATH263 ));264 265 $template->parse('mes_script');266 }267 268 return $template->parse( 'autosize_content', false);269 }270 }271 272 } //public function cl_autosize_affiche273 435 //=============================================================== 274 436 /* … … 520 682 pwg_query($query); 521 683 } 522 684 if (!isset($conf['cl_derivatives_sav'])) { 685 $q = ' 686 INSERT INTO '.CONFIG_TABLE.' (param, value, comment) 687 VALUES ("cl_derivatives_sav","","sauvegarde derivatives") 688 ;'; 689 pwg_query($q); 690 } 523 691 } 524 692 525 function auto_memo_var($variables)693 function print_var($variables) 526 694 { 527 695 ob_start(); -
extensions/Autosize/css/autosize.css
r17308 r17503 44 44 45 45 } 46 #theImage { 47 48 } 46 #theImage {/* 47 background-color: #DDE3E3; 48 background-image: url('../images/quadrille_100.png');*/ 49 /*height:auto; 50 */ 51 } 52 /* 49 53 .imageComment{ 50 54 background-color: green; 55 background-image: url('../images/quadrille_100.png'); 51 56 } 52 57 .licencetag { 53 58 background-color:blue; 59 background-image: url('../images/quadrille_100.png'); 54 60 } 55 61 56 62 #theMainImage { 57 63 58 } 64 } */ 59 65 #imageInfos{ 60 66 overflow:hidden ; 61 67 62 68 63 69 } 64 70 65 71 #imageInfoBar { 66 72 -
extensions/Autosize/include/affiche.php
r17309 r17503 1 1 <?php 2 $visible=(isset($visible))?$visible:false;3 2 3 $visible=(isset($visible))?$visible:false; 4 4 $cl_version=isset($cl_version)?$cl_version:""; 5 5 $cl_plugin=isset($cl_plugin)?$cl_plugin:""; 6 6 $cl_visible=isset($conf['cl_auto']) ? $conf['cl_auto'] : 7 (isset($_GET['cl_visible'])?$_GET['cl_visible']:'true') 7 (isset($_GET['cl_visible'])?$_GET['cl_visible']:'true'); 8 //============================================================================== 9 $DEBUG_autosize = isset($_POST['cl_debug']) ? $_POST['cl_debug'] : "false" ; 10 $DEBUG_autosize = isset($_GET['cl_debug']) ? $_GET['cl_debug'] : $DEBUG_autosize ; 11 $DEBUG_autosize = isset($conf['cl_debug']) ? $conf['cl_debug'] : $DEBUG_autosize ; 12 //=========================================================================== 13 $cookies="' x '"; 8 14 9 ;10 //==============================================================================11 $DEBUG_autosize = isset($_POST['cl_debug_conflit']) ? $_POST['cl_debug_conflit'] : "false" ;12 $DEBUG_autosize = isset($_GET['cl_debug_conflit']) ? $_GET['cl_debug_conflit'] : $DEBUG_autosize ;13 $DEBUG_autosize = isset($conf['cl_debug_conflit']) ? $conf['cl_debug_conflit'] : $DEBUG_autosize ;14 //===========================================================================15 $cookies="' x '";16 17 $current = $template->get_template_vars('current');18 if (isset($_COOKIE['picture_deriv']))19 {20 if (isset($_COOKIE['theImageWidth']))21 $cookies = '"'.$_COOKIE['theImageWidth']." x ". $_COOKIE['theImageHeight'] .'"';22 23 if ( array_key_exists($_COOKIE['picture_deriv'], ImageStdParams::get_defined_type_map()) )24 {25 pwg_set_session_var('picture_deriv', $_COOKIE['picture_deriv']);26 }27 setcookie('picture_deriv', false, 0, cookie_path() );28 }29 $deriv_type = pwg_get_session_var('picture_deriv', $conf['derivative_default_size']);30 $defined_types = array_keys(ImageStdParams::get_defined_type_map());31 32 if (isset($current)){33 if (!isset($current['selected_derivative'])){34 $model= $defined_types[count($defined_types)-1];35 $selected_derivative = $current['derivatives'][$model];36 $img_all= $derivative->get_all($derivative->src_image);37 $template->append('current', array(38 'selected_derivative' => $selected_derivative39 ), true);40 41 42 $current = $template->get_template_vars('current');43 }44 $derivative=$current['selected_derivative'] ;45 $imgScaledWH=$derivative->src_image->get_size();46 $imgSizeWH = $derivative->get_size();47 $img_type = $derivative->get_type();48 $img_url = $derivative->get_url();49 $img_all= $derivative->get_all($derivative->src_image);50 $scaled_size=$derivative->get_size_hr(); //792 x 44151 $scaled_size=$derivative->get_scaled_size_htm(); // width="792" height="441"52 //================= taille mis a l'échelle53 $scaled_size=$derivative->get_scaled_size(100,100); // array([0]=>100,[1]=>55)54 $src= $derivative->src_image ;55 56 }57 58 15 $img_width=isset($imgScaledWH)?$imgSizeWH[0]:"480"; 59 16 $img_height=isset($imgScaledWH)?$imgSizeWH[1]:"320"; … … 61 18 $img_scaled_width=isset($imgScaledWH)?$imgScaledWH[0]:"480"; 62 19 $img_scaled_height=isset($imgScaledWH)?$imgScaledWH[1]:"320"; 63 64 65 20 66 21 $src_img_h=isset($_POST['src_img_h'])?$_POST['src_img_h']: $img_height ; 67 22 $src_img_w= isset($_POST['src_img_w'])?$_POST['src_img_w']: $img_width ; 23 24 $window_height= isset($_SESSION['windowHeight'])?$_SESSION['windowHeight']: $img_scaled_height ; 25 $window_width= isset($_SESSION['windowWidth'])?$_SESSION['windowWidth']: $img_scaled_width ; 68 26 69 $window_height= isset($_POST['window_height'])?$_POST['window_height']: $img_scaled_height ;70 $window_width= isset($_POST['window_width'])?$_POST['window_width']: $img_scaled_width ;71 27 global $size ; 72 28 $size= array( … … 76 32 'window_width' => $window_width 77 33 ); 78 34 79 35 $my_path = AUTOSIZE_PATH_ABS; 80 36 $theme=$user['theme']; 37 38 81 39 $user_status = $user['status'] ; 82 40 … … 88 46 ); 89 47 if (!isset($conf['prefix_thumbnail'])) $conf['prefix_thumbnail']="TN_"; 48 //====================================================== 49 50 //=== type possible === 51 if(isset($defined_types)) 52 foreach ($defined_types as $type_size){ 53 $value = $type_size; 54 $options[$value] = $type_size; 55 } 56 57 //=========================================== 58 $template->assign( 59 array( 60 'select_type' =>$select_type, 61 'select_map' =>$select_type, 62 63 'pictureDeriv' =>$pictureDeriv , 64 65 'maxi_img' =>$maxi_img , 66 'ratio' =>$img_scaled_width/$img_scaled_height , 90 67 91 68 92 //======================================================93 94 $options['Autosize'] = ''.l10n('Autosize').'';95 foreach ($defined_types as $type_size){96 $value = $type_size;97 $options[$value] = $type_size;98 }99 //===================100 $value=0;101 $liste_type="";102 if(isset($img_all ))103 foreach ($img_all as $img_select){104 $imgSizeWH = $img_select->get_size();105 $img_type = $img_select->get_type();106 $img_url = $img_select->get_url();107 108 $liste_type .= $img_type.",".$img_url.",".$imgSizeWH[0] .",".$imgSizeWH[1]."|" ;109 if(strtolower($img_type)=="original") break ;110 111 112 }113 114 //===================================115 116 $template->assign(117 array(118 'ratio' =>$img_scaled_width/$img_scaled_height ,119 'cookies' => $cookies ,120 'deriv_type' =>$deriv_type ,121 'liste_type' => $liste_type ,122 69 'webmaster_type' => array( 123 70 'OPTIONS' => $options, … … 150 97 151 98 'theme' => $theme, 99 100 'windowHeight' => $window_height, 101 'windowWidth' => $window_width, 102 152 103 'SCALED_WIDTH' => $img_scaled_width, 153 104 'SCALED_HEIGHT' => $img_scaled_height, … … 158 109 'MINI_HEIGHT' => $autosize_parametres->mini_height, 159 110 'MINI_WIDTH' => $autosize_parametres->mini_width, 111 160 112 'MINI_HEIGHT2' => $autosize_parametres->mini_height2, 161 113 'MINI_WIDTH2' => $autosize_parametres->mini_width2, … … 176 128 177 129 'user_status' => get_user_status($user_status) , 178 'Size' => $size 179 130 'SRC_IMG' => $SRC_IMG, 131 'liste_type' => $liste_type , 132 'Size' => $size 180 133 181 134 ) -
extensions/Autosize/js/Affiche_script.js
r17308 r17503 1 2 1 // problème avec GMaps+diaporama: 3 2 // corriger gmaps_pip.class.inc.php ajouter ligne 90 if ( !isset($_GET['slideshow'])) … … 7 6 * document ready 8 7 ********************************************/ 8 9 9 10 jQuery(document).ready(function (jQuery) { 11 12 13 14 10 15 var Type_Img; 11 16 var theImg; 17 var Zone_image; 18 12 19 /****************************************** 13 20 * Save_cookies 14 21 ******************************************/ 15 22 Save_cookies = function (parametres) { 16 if (parametres.typeSave) document.cookie = 'picture_deriv=' + parametres.typeSave + ';path="' + "/" + '" '; 17 if (parametres.typeSave) jQuery.cookie('picture_deriv', parametres.typeSave, { path: "/" }); 18 if (parametres.pictureMap) jQuery.cookie('picture_map', parametres.pictureMap, { path: "/" }); 23 if (parametres.pictureDeriv) document.cookie = 'picture_deriv=' + parametres.pictureDeriv + ';path="' + "/" + '" '; 24 25 if (parametres.pictureDeriv) jQuery.cookie('picture_deriv', parametres.pictureDeriv, { path: "/" }); 26 if (parametres.pictureMap) jQuery.cookie('picture_map', parametres.pictureDeriv, { path: "/" }); 19 27 if (parametres.imgSrc) jQuery.cookie('imgSrc', parametres.imgSrc, { path: "/" }); 20 28 if (parametres.theMainImageHeight) jQuery.cookie('theMainImageHeight', parametres.theMainImageHeight, { path: "/" }); … … 23 31 if (parametres.theImageWidth) jQuery.cookie('theImageWidth', parametres.theImageWidth, { path: "/" }); 24 32 if (parametres.windowHeight) jQuery.cookie('windowHeight', parametres.windowHeight, { path: "/" }); 25 if (parametres.windowWidth) jQuery.cookie('windowWidth', parametres. WindowWidth, { path: "/" });33 if (parametres.windowWidth) jQuery.cookie('windowWidth', parametres.windowWidth, { path: "/" }); 26 34 } 27 35 //____________________ Save_cookies _____________________________ 28 36 Get_cookies = function () { 29 37 parametres = { 30 typeSave: jQuery.cookie('picture_deriv'),38 pictureDeriv: jQuery.cookie('picture_deriv'), 31 39 pictureMap: jQuery.cookie('picture_map'), 32 40 imgSrc: jQuery.cookie('imgSrc'), … … 116 124 //==================================== 117 125 set_cl = function (Valid) { 118 if (typeof Valid == "undefined") Valid = options. useMap.match(RegExp("Autosize", "gi")) || false;126 if (typeof Valid == "undefined") Valid = options.select_map.match(RegExp("Autosize", "gi")) || false; 119 127 if (typeof options.cl_visible == "undefined") return; 120 128 if (typeof src1 == "undefined") return; … … 131 139 } 132 140 133 if ((typeof Zone_image != "undefined") && typeof Zone_image.image != "undefined" && Valid) { 141 if (!Valid) { 142 Zone_image.image.height = Zone_image.image_init.height; 143 Zone_image.image.width = Zone_image.image_init.width; 144 src = src6; 145 } 146 if ((typeof Zone_image != "undefined") && typeof Zone_image.image != "undefined") { 147 134 148 Zone_image.zoom = (Zone_image.image.height / Zone_image.image_init.height); 135 149 zoom_cl = parseInt(100 * Zone_image.zoom); … … 161 175 color_back = jQuery('body').css("color"); 162 176 jQuery('#bp_cla span').css({ color: color_back, aling: "center" }); 163 jQuery('#auto_details').text(" (" + Zone_image.image.width + " x " + Zone_image.image.height + ")"); 164 177 if (options.src_deriv) { 178 jQuery('.auto_details').text(" (" + Zone_image.image.width + " x " + Zone_image.image.height + ") " + options.src_deriv); 179 } 165 180 //=============================================== 166 181 } else { 167 182 src = src6; 168 jQuery('#auto_details').text(""); 183 jQuery('.auto_details').text(""); 184 169 185 } 170 186 bp_scr = jQuery('#bp_img_cla'); … … 195 211 return; 196 212 } 197 nom_map = theImg.useMap.replace("#", ""); 213 if (theImg) 214 nom_map = theImg.useMap.replace("#", ""); 215 else 216 nom_map = "Autosize"; 198 217 maps = jQuery("map[name='" + nom_map + "']"); 199 218 if (maps.length == 0) return; … … 228 247 jQuery(window).load(function () { 229 248 href = location.href; 249 options.old_theme = options.theme; 250 230 251 var aff_ok = false; 231 252 if (DEBUG_autosize == "true") { … … 275 296 infos_imageInfos = jQuery(imageInfos_id).infos(true); // information 276 297 infos_theMainImage = jQuery(theMainImage_id).infos(true); // Image 277 if (infos_theMainImage.visible == false) { 278 279 } 298 280 299 jQuery("#loading").show(0); 281 300 282 301 if (options.check_desc_v) { 302 info_comments = jQuery("#comments").infos(true); 283 303 infos_Licence = jQuery(".licencetag").infos(true); 284 304 infos_imageComment = jQuery(imageComment_id).infos(true); 285 h01 = (infos_Licence.general.height); 286 h02 = (infos_imageComment.general.height); 287 options.marge_basse += Math.max(h01, h02); 305 h01 = info_comments.top - infos_theMainImage.bottom; 306 h02 = infos_imageComment.general.bottom - infos_theMainImage.bottom; 307 delta_h = infos_imageInfos.bottom - infos_imageInfos.top; 308 if (options.theme.match(RegExp("blanc", "gi")) || options.theme.match(RegExp("pure", "gi")) 309 || options.theme.match(RegExp("hr_", "gi"))) { 310 311 h01 = infos_Licence.general.bottom-infos_theMainImage.bottom; 312 options.marge_basse += h01; 313 options.marge_gauche += 10; 314 options.marge_droite += 10; 315 316 } else { 317 318 if (options.theme != "simple") 319 if (delta_h > 5 && (infos_imageInfos.top > infos_theMainImage.bottom)) { 320 if (infos_imageComment.visible) { 321 322 } 323 } 324 325 326 h01 = infos_Licence.general.bottom - infos_theMainImage.bottom; 327 h02 = infos_imageComment.general.bottom - infos_theMainImage.bottom; 328 329 if (Type_Img == "pamoorama") { 330 h01 = infos_Licence.general.bottom - infos_theMainImage.bottom; 331 332 ; 333 options.marge_basse += (h01); 334 } else 335 options.marge_basse += Math.max(h01, h01); 336 337 } 288 338 } 289 339 … … 303 353 container: { 304 354 width: infos_theImage.general.width, 305 height: infos_window.height - (infos_theImage.top) 306 } 307 } 355 height: infos_window.height - (infos_theImage.top), 356 margesWidth: infos_window.width - infos_theImage.width + (options.marge_droite + options.marge_gauche) 357 } 358 } 359 360 308 361 if (Type_Img == "pamoorama") { 309 362 jQuery(theMainImage_id).width(Zone_image.container.width); 363 jQuery(theMainImage_id).height(Zone_image.container.height); 364 jQuery(theImage_id).width(Zone_image.container.width); 365 jQuery(theImage_id).height(Zone_image.container.height); 310 366 } 311 367 … … 314 370 ***********************************************************/ 315 371 jQuery(window).resize(function (event, ui) { 372 infos_window = jQuery(window).infos(); 373 infos_imageInfos = jQuery("#imageInfos").infos(true); 374 old_w = infos_theImage.width; 316 375 infos_theImage = jQuery(theImage_id).infos(true); 317 infos_window = jQuery(window).infos(); 376 if (options.set_sw) { 377 if (Type_Img == "pamoorama") { 378 if (options.set_sw == "menuSwitcher") { 379 380 } else { 381 p_width = jQuery(theImage_id).width(); 382 } 383 if (infos_imageInfos.visible) 384 p_width = infos_window.width - infos_theImage.left - infos_imageInfos.width - 20; 385 else 386 p_width = infos_window.width - infos_theImage.left - 20; 387 jQuery(theImage_id).width(p_width); 388 infos_theImage = jQuery(theImage_id).infos(true); 389 390 391 } 392 } 393 if ((old_w - infos_theImage.width) != 0) { 394 Zone_image.container.width = infos_theImage.width; 395 } 396 397 318 398 infos_body = jQuery("body").infos(); 319 399 infos_content = jQuery(content_id).infos(); 320 400 401 402 // imageInfos 403 404 405 321 406 infos_theImageAndInfos = jQuery(theImageAndInfos_id).infos(); // Cadre general 322 Zone_image.container = { height: infos_window.height - (infos_theImage.top), 323 width: infos_theImage.width 407 //============================================================= 408 409 Zone_image.container = { 410 height: infos_window.height - (infos_theImage.top), 411 width: Zone_image.container.width, 412 margesWidth: infos_window.width - infos_theImage.width 324 413 }; 325 414 326 415 if (options.theme.match(RegExp("simple", "gi"))) { 327 416 jQuery(theMainImage_id).css({ maxWidth: "none" }); 328 Zone_image.container.height = infos_window.height - infos_theImage.top - infos_content.general.marges.height - (infos_theImage.general.marges.height);329 //jQuery("#menubar").css("margin-right", "0");330 417 infos_menubar = jQuery("#menubar").infos(true); 331 418 if (infos_menubar.visible == true) { … … 335 422 336 423 jQuery(theImage_id).height(Zone_image.container.height + 2); 424 425 if (DEBUG_autosize == "no") return; 426 427 Autosize_resize(true, options); 337 428 jQuery("#loading").hide(fade_in); 338 if (DEBUG_autosize == "no") return;339 Autosize_resize(true, options);340 341 429 }); 342 430 //_____________ widow.resize _______________ … … 352 440 infos_llgboh2 = jQuery("#llgboh2").infos(); 353 441 marges_llgbo = 0; 354 //========================================================================================== 355 jQuery("#loading").show(0); 356 if (DEBUG_autosize != "no") 357 init_gen(); 442 //========================================================================================== 443 444 init_gen(); 358 445 jQuery(window).resize(); 359 446 jQuery(window).resize(); 447 360 448 }); 361 449 //__________________window.onload_________________ … … 370 458 if (typeof theMainImage_id != "undefined") { 371 459 infos_window = jQuery(window).infos(true); 372 infos_theImage = jQuery("#" + infos_theImage.id).infos(true); 373 infos_theMainImage = jQuery("#" + theMainImage.id).infos(true); 374 useMap = options.useMap; 375 460 infos_theImage = jQuery(theImage_id).infos(true); 461 infos_theMainImage = jQuery(theMainImage_id).infos(true); 376 462 Save_cookies({ 377 463 pictureMap: cookies.pictureMap, 378 typeSave: cookies.typeSave,464 pictureDeriv: cookies.pictureDeriv, 379 465 windowHeight: infos_window.height, 380 466 windowWidth: infos_window.width, … … 408 494 options = jQuery.extend(Autosize_options, options); 409 495 var defaults = { 410 useMap: '#Autosize',411 496 imageAutosizeMargin: 0, 412 497 imageAutosize: false, … … 417 502 options = jQuery.extend(defaults, options); 418 503 419 options.liste_type = options.liste_type.split("|"); 420 options.liste_type.pop(); 504 421 505 for (i = 0; i < options.liste_type.length; i++) { 422 506 options.liste_type[i] = options.liste_type[i].split(","); … … 447 531 //=================== 448 532 var cookies = Get_cookies(); 449 var Zone_image; 533 534 450 535 var theMainImage_id = "#theMainImage"; 451 536 var theImage_id = "#theImage"; … … 459 544 var llgbo_id = "#llgbo0"; 460 545 var marges_llgbo = 0; 461 var type_size = cookies.typeSave; // xxx546 var pictureDeriv = cookies.pictureDeriv; // xxx 462 547 var useMap = cookies.pictureMap; // #mapxxx 463 548 var user_status = options.user_status; 464 var type_size_maxi = eval("options." + user_status + "_type"); //limite taille549 var pictureDeriv_maxi = eval("options." + user_status + "_type"); //limite taille 465 550 466 551 … … 471 556 //============================================================= 472 557 jQuery("#theMainImage," + theMainImage_id + ",.preload, .next1 , ").load(function (e) { 473 if (this.complete) {474 jQuery("#loading").hide(1000);475 }476 //_________ theMainImage ___________558 jQuery("#loading").hide(1000); 559 jQuery(this).removeAttr("width"); 560 jQuery(this).removeAttr("height"); 561 jQuery(this).css({ height: "", width: "" }); 477 562 478 563 if (typeof theMainImage_id != "undefined") 479 if ( init_img(this))564 if (!init_img(this)) { 480 565 nu_img = 0; 481 }); 566 } 567 568 jQuery('#derivativeSwitchBox .switchCheck').css('visibility', 'hidden'); 569 jQuery('#derivativeChecked' + options.pictureDeriv).css('visibility', 'visible'); 570 571 jQuery(window).resize(); 572 573 574 575 }); 576 //_________ theMainImage ___________ 482 577 483 578 … … 485 580 location.reload(); 486 581 }); 582 487 583 var mouseLocation = new Point(-500, -500); 488 //========================================================489 jQuery("#pamoorama").live("on", function (e) {490 myPamoorama = window.myPamoorama;491 });492 jQuery("#pamoorama_inner").live("on", function (e) {493 myPamoorama = window.myPamoorama;494 });495 496 584 function Point(x, y) { 497 585 this.x = x; this.y = y; … … 554 642 //========================================================== 555 643 jQuery("map area").mouseover(function (e) { 556 nok = theImg.useMap; 557 hok = this; 644 try { 645 nok = theImg.useMap; 646 hok = this; 647 } 648 catch (r) { 649 650 } 558 651 }); 559 652 … … 623 716 624 717 718 719 // Custom Event, ON to turn on a debug. 720 jQuery('.debug').live('ON', function (e) { 721 722 nu_img = jQuery(this).text(); 723 jQuery('.debug').trigger('OFF'); 724 jQuery(this).addClass('debugOn'); 725 726 }); 727 728 // On Click = debugs On 729 jQuery('.debug').live('click', function (e) { 730 i = jQuery(this).text(); 731 jQuery(this).trigger('ON'); 732 }); 733 734 // Custom Event, Turn off a debug 735 jQuery('.debug').live('OFF', function (e) { 736 jQuery(this).removeClass('debugOn'); 737 }); 738 739 // on Double Click, remove the debug from the DOM 740 jQuery('.debug').live('dblclick', function () { 741 jQuery(this).fadeOut(function () { jQuery(this).remove() }); 742 }); 743 744 // Add another debug to the DOM 745 jQuery('#adddebugs').click(function () { 746 i = jQuery('.debug').length; 747 jQuery('<div>' + i + '</div>') 748 .addClass('debug') 749 .appendTo('#debugsContainer'); 750 }); 751 752 753 /********************************* 754 * 755 ********************************/ 756 jQuery("#menuSwitcher,#infoSwitcher").click(function (e) { 757 options.set_sw = this.id; 758 setTimeout(function () { jQuery(window).resize() }, 10); 759 setTimeout(function () { jQuery(window).resize() }, 12); 760 nu_img = 0; 761 }); 762 763 764 //=========================================== 765 // jQuery("#theImageAndInfos").trigger("ON"); 766 //=========================================== 767 jQuery("#theImageAndInfos").live('ON', function (e) { 768 infos_theImageAndInfos = jQuery("#theImageAndInfos").infos(); 769 // setTimeout(function () { Autosize_resize(true) }, 100); 770 nu_img = 0; 771 }); // fin click #theImageAndInfos ON 772 jQuery("#theImageAndInfos").resize(function (e) { 773 774 nu_img = 0; 775 }); 776 777 778 jQuery("#linkAutosize").click(function (e) { 779 nu_img = 0; 780 }); 781 //================================== 782 // 783 //=================================== 784 jQuery('#derivativeCheckedAutosize').click(function () { 785 try { 786 pathnames = jQuery(this).attr("href").split(":"); 787 788 // eval(pathnames[1]); 789 } catch (e) { 790 n = false; 791 } 792 }); // fin click derivativeCheckedAutosize 793 //==================================================== 794 jQuery("#derivativeSwitchBox a").click(function () { 795 theImg = document.getElementById(theMainImage_id.replace("#", "")); 796 if (theImg) { 797 pathnames = jQuery(this).attr("href").split(":")[1].toString(); 798 selecteur = pathnames.split(",")[2].replace("')", "").replace("'", "").replace(" ", ""); 799 if (this.name) { 800 options.select_type = this.name; 801 options.pictureDeriv = this.name; 802 options.select_map = this.name; 803 pathnames = pathnames.replace(selecteur, this.name); 804 } else { 805 options.select_type = selecteur; 806 options.pictureDeriv = selecteur; 807 options.select_map = selecteur; 808 } 809 jQuery("#derivativeSwitchBox span").removeClass("auto_details linkAutosize"); 810 jQuery("#derivativeSwitchBox a").removeClass("auto_details linkAutosize"); 811 if (options.select_type == "Autosize" || options.select_type == "SelMaxi") { 812 spans = jQuery("#derivativeChecked" + options.select_type).next(); 813 spans.addClass("linkAutosize"); 814 spans.find("span").addClass("auto_details"); 815 jQuery(".auto_details").text(""); 816 } 817 818 try { 819 // eval(pathnames); 820 n = true; 821 } catch (e) { 822 n = false; 823 } 824 } 825 }); 826 //__________ fin click #derivativeSwitchBox a ____________ 827 828 jQuery("input").click(function () { 829 if (this.name.match(RegExp("_enabled", "gi"))) { 830 sel = "[name*=" + this.name + "]"; 831 obj = jQuery("tr" + sel); 832 833 if (this.checked) 834 obj.css({ backgroundColor: "green", color: "white" }); 835 else 836 obj.css({ backgroundColor: "red", color: "white" }); 837 return; 838 } 839 return; 840 }); 841 //____________________ set_llgbo _____________________________ 842 843 //==================================== 844 Autosize_init = function (name, value) { 845 img_defaut = { height: options.scaled_height, width: options.scaled_width }; 846 img_reelle = { height: options.img_height, width: options.img_width }; 847 img_init = { height: options.img_height, width: options.img_width }; // taille initiale 848 849 img_finale = img_init; 850 851 useMap = infos_theMainImage.useMap; // #mapmedium 852 853 useMap = cookies.pictureMap; // #mapxxx 854 pictureDeriv = cookies.pictureDeriv; //picturederiv xxx 855 856 857 old_img = cookies.imgSrc; 858 old_window_height = cookies.windowHeight || jQuery(window).height(); 859 old_window_width = cookies.windowWidth || jQuery(window).width(); 860 old_img_h = cookies.imgHeight; 861 old_img_w = cookies.imgWidth; 862 if (infos_theMainImage.visible == true) { 863 theImg = document.getElementById(theMainImage_id.replace("#", "")); 864 theImg.useMap = useMap; 865 } 866 fade_in = parseInt(options.fade_in || 0); 867 868 } 869 //____________________ Autosize_init _____________________ 870 871 /*************************** 872 * Autosize_resize 873 ***************************/ 874 Autosize_resize = function (force, parametres) { 875 if (Get_dimensions(force, parametres)) { 876 jQuery(theImageAndInfos_id).css({ height: "auto" }); 877 if (Type_Img == "pamoorama") { 878 Set_Pamoorama({ width: Zone_image.container.width, height: Zone_image.image.height }); 879 if (nopano) 880 if (window.myPamoorama.options.autoscrollOnLoad) { 881 window.myPamoorama.startAnimRight(); 882 } 883 } else { 884 885 jQuery(theMainImage_id).height(Zone_image.image.height); 886 jQuery(theMainImage_id).width(Zone_image.image.width); 887 } 888 889 890 set_cl(true); 891 } else { 892 jQuery(theImage_id).height(Zone_image.image.height + Zone_image.marges.height); 893 Set_Pamoorama({ width: Zone_image.container.width, height: Zone_image.image.height }); 894 set_cl(false); 895 896 } 897 898 899 Set_llbgo(true); 900 return true; 901 }; 902 //_________________Autosize ____________________________________ 903 904 /***************** 905 * changeImgSrc 906 ******************/ 907 changeImgSrc = function (url, typeSave, typeMap) { 908 theImg = document.getElementById(theMainImage_id.replace("#", "")); 909 if (theImg.src) { 910 theImg.removeAttribute("width"); 911 theImg.removeAttribute("height"); 912 // jQuery(theMainImage_id).eq(0).removeAttr("style"); 913 jQuery('#derivativeSwitchBox .switchCheck').css('visibility', 'hidden'); 914 jQuery('#derivativeChecked' + typeSave).css('visibility', 'visible'); 915 pictureMap = "#map" + typeMap; 916 theImg.useMap = pictureMap; 917 src = jQuery(theImg).css("backgroundImage"); 918 if (theImg.src) 919 if (theImg.src.match(RegExp(url, "gi"))) { 920 jQuery("#loading").hide(0); 921 } else { 922 jQuery("#loading").show(0); 923 } else { 924 jQuery("#loading").hide(0); 925 } 926 Zone_image.src = theImg.src; 927 theImg.src = url; // charge Image 928 //=================================================== 929 options.pictureDeriv = typeSave; 930 options.pictureMap = typeMap; 931 Save_cookies({ 932 pictureDeriv: typeSave, 933 pictureMap: pictureMap, 934 imgSrc: url 935 }); 936 cookies = Get_cookies(); 937 } 938 } 939 //__________________ changeImgSrc ______________________ 940 941 /***************************** 942 * pamoorama 943 ******************************/ 944 945 jQuery("#pamoorama").bind("on", function () { alert($(this).text()); }); 946 jQuery("#pamoorama").bind("on", function (e) { 947 myPamoorama = window.myPamoorama; 948 }); 949 jQuery("#pamoorama_inner").live("on", function (e) { 950 myPamoorama = window.myPamoorama; 951 }); 625 952 jQuery('#pamoorama').live('ON', function (e) { 626 953 jQuery(jQuery('.debug').get(1)).trigger('ON'); 627 if (typeof Bandeau_bas == "undefined" || Bandeau_bas.width == 0) { 628 629 } 954 jQuery(window).resize(); 630 955 }); 631 956 … … 635 960 jQuery("#theImage").live('Start_right', function (e) { 636 961 if (typeof Zone_image == "undefined") return 637 if (nu_img == "") nu_img = 7;638 jQuery(jQuery('.debug').get(nu_img)).trigger('ON');639 962 test_w = window.myPamoorama.autoSlideFx.to; 640 963 test_w = window.myPamoorama.autoScrollFx.to; … … 646 969 nw = (200 * Zone_image.container.width) / window.myPamoorama.imageWidth; 647 970 jQuery("#pamoorama_frame").width(nw); 648 649 650 651 971 }); 652 972 //=============================================== … … 664 984 }); 665 985 666 // Custom Event, ON to turn on a debug.667 jQuery('.debug').live('ON', function (e) {668 669 nu_img = jQuery(this).text();670 jQuery('.debug').trigger('OFF');671 jQuery(this).addClass('debugOn');672 673 });674 675 // On Click = debugs On676 jQuery('.debug').live('click', function (e) {677 i = jQuery(this).text();678 jQuery(this).trigger('ON');679 });680 681 // Custom Event, Turn off a debug682 jQuery('.debug').live('OFF', function (e) {683 jQuery(this).removeClass('debugOn');684 });685 686 // on Double Click, remove the debug from the DOM687 jQuery('.debug').live('dblclick', function () {688 jQuery(this).fadeOut(function () { jQuery(this).remove() });689 });690 691 // Add another debug to the DOM692 jQuery('#adddebugs').click(function () {693 i = jQuery('.debug').length;694 jQuery('<div>' + i + '</div>')695 .addClass('debug')696 .appendTo('#debugsContainer');697 });698 699 700 /*********************************701 *702 ********************************/703 jQuery("#menuSwitcher,#infoSwitcher").click(function (e) {704 705 setTimeout(function () { jQuery(window).resize() }, 10);706 setTimeout(function () { jQuery(window).resize() }, 12);707 nu_img = 0;708 });709 710 711 //===========================================712 // jQuery("#theImageAndInfos").trigger("ON");713 //===========================================714 jQuery("#theImageAndInfos").live('ON', function (e) {715 infos_theImageAndInfos = jQuery("#theImageAndInfos").infos();716 // setTimeout(function () { Autosize_resize(true) }, 100);717 nu_img = 0;718 }); // fin click #theImageAndInfos ON719 jQuery("#theImageAndInfos").resize(function (e) {720 721 nu_img = 0;722 });723 724 725 jQuery("#linkAutosize").click(function (e) {726 nu_img = 0;727 });728 //==================================729 //730 //===================================731 jQuery('#derivativeCheckedAutosize').click(function () {732 pathnames = jQuery(this).attr("href").split(":");733 try {734 eval(pathnames[1]);735 } catch (e) {736 n = false;737 }738 }); // fin click derivativeCheckedAutosize739 //====================================================740 jQuery("#derivativeSwitchBox a").click(function () {741 theImg = document.getElementById(theMainImage_id.replace("#", ""));742 if (theImg) {743 pathnames = jQuery(this).attr("href").split(":");744 745 try {746 eval(pathnames[1]);747 n = true;748 } catch (e) {749 n = false;750 }751 752 infos_theMainImage = jQuery(theMainImage_id).infos();753 754 theImg.removeAttribute("width");755 theImg.removeAttribute("height");756 757 var nw = "100% x 100%".split("x");758 if (jQuery(this).text().match(RegExp("x", "gi"))) {759 nw = jQuery(this).text().split("(")[1].split(")")[0];760 nw = nw.split("x");761 init_img(theImg);762 wx = parseInt(nw[0]);763 wh = parseInt(wx / Zone_image.image_init.rapport);764 765 jQuery(theImg).width(wx);766 jQuery(theImg).height(wh);767 set_cl(useMap == "#Autosize");768 Set_llbgo();769 }770 771 }772 773 }); // fin click #derivativeSwitchBox a774 775 jQuery("input").click(function () {776 if (this.name.match(RegExp("_enabled", "gi"))) {777 sel = "[name*=" + this.name + "]";778 obj = jQuery("tr" + sel);779 780 if (this.checked)781 obj.css({ backgroundColor: "green", color: "white" });782 else783 obj.css({ backgroundColor: "red", color: "white" });784 785 return;786 }787 788 789 790 return;791 792 793 794 795 });796 //____________________ set_llgbo _____________________________797 798 //====================================799 Autosize_init = function (name, value) {800 img_defaut = { height: options.scaled_height, width: options.scaled_width };801 img_reelle = { height: options.img_height, width: options.img_width };802 img_init = { height: options.img_height, width: options.img_width }; // taille initiale803 804 img_finale = img_init;805 806 useMap = infos_theMainImage.useMap; // #mapmedium807 808 useMap = cookies.pictureMap; // #mapxxx809 typeSave = cookies.typeSave; //picturederiv xxx810 811 812 old_img = cookies.imgSrc;813 old_window_height = cookies.windowHeight || jQuery(window).height();814 old_window_width = cookies.windowWidth || jQuery(window).width();815 old_img_h = cookies.imgHeight;816 old_img_w = cookies.imgWidth;817 if (infos_theMainImage.visible == true) {818 theImg = document.getElementById(theMainImage_id.replace("#", ""));819 theImg.useMap = useMap;820 }821 fade_in = parseInt(options.fade_in || 0);822 823 }824 //____________________ Autosize_init _____________________825 826 /***************************827 * Autosize_resize828 ***************************/829 Autosize_resize = function (force, parametres) {830 theImg = document.getElementById(theMainImage_id.replace("#", ""));831 if (theImg) {832 theImg.removeAttribute("width");833 theImg.removeAttribute("height");834 }835 if (Get_dimensions(force, parametres)) {836 837 jQuery(theImageAndInfos_id).css({ height: "auto" });838 if (Type_Img == "pamoorama") {839 Set_Pamoorama({ width: Zone_image.container.width - 5, height: Zone_image.image.height });840 if (nopano)841 if (window.myPamoorama.options.autoscrollOnLoad) {842 window.myPamoorama.startAnimRight();843 }844 } else {845 846 jQuery(theMainImage_id).height(Zone_image.image.height);847 jQuery(theMainImage_id).width(Zone_image.image.width);848 }849 850 851 set_cl(true);852 } else {853 854 Set_Pamoorama({ width: Zone_image.container.width, height: Zone_image.image.height });855 set_cl(false);856 }857 858 859 Set_llbgo(true);860 return true;861 };862 //_________________Autosize ____________________________________863 864 865 866 867 868 869 870 871 872 /*****************873 * changeImgSrc874 ******************/875 changeImgSrc = function (url, typeSave, useMap) {876 theImg = document.getElementById(theMainImage_id.replace("#", ""));877 if (theImg) {878 theImg.removeAttribute("width");879 theImg.removeAttribute("height");880 // theImg.useMap = "#map" + useMap;881 jQuery('#derivativeSwitchBox .switchCheck').css('visibility', 'hidden');882 jQuery('#derivativeChecked' + useMap.replace("#", "")).css('visibility', 'visible');883 options.useMap = useMap;884 if (useMap.match("Autosize")) {885 pictureMap = "#" + "Autosize";886 } else {887 pictureMap = "#map" + typeSave;888 }889 theImg.useMap = pictureMap;890 if (theImg.src.match(RegExp(url, "gi"))) {891 jQuery("#loading").hide(0);892 } else {893 jQuery("#loading").show(0);894 }895 theImg.src = url; // charge Image896 //===================================================897 Save_cookies({898 typeSave: typeSave,899 pictureMap: pictureMap,900 imgSrc: url901 });902 cookies = Get_cookies();903 }904 }905 //__________________ changeImgSrc ______________________906 907 986 /************************************ 908 * 987 * Wait_pamoorama 909 988 ************************************/ 910 989 Wait_pamoorama = function () { 911 990 if (Type_Img != "pamoorama") return; 912 913 // jQuery("#loading").attr("id", "theMainImage");914 991 tempo = 0; 915 916 992 Wait_pamoorama_st = false; 993 994 917 995 while (Wait_pamoorama_st == false) { 918 996 Wait_pamoorama_st = Wait_pamoorama_time(); … … 920 998 } 921 999 tempo = 0; 922 923 Wait_pamoorama_st = false; 924 while (Wait_pamoorama_st == false) { 925 Wait_pamoorama_st = Wait_pamoorama_time(); 926 jQuery.noop() 927 } 928 929 if (nopano) 1000 if (nopano) { 930 1001 if (window.myPamoorama.options.autoscrollOnLoad) { 931 1002 window.myPamoorama.startAnimRight(); 932 jQuery.noop() 933 } 1003 jQuery.noop(); 1004 } 1005 1006 } 934 1007 935 1008 } … … 937 1010 938 1011 Wait_pamoorama_time = function () { 939 1012 if (nopano == true) return true; 940 1013 if (jQuery("#pamoorama").length) { 941 1014 tempo = tempo + 1; 942 1015 jQuery("#loading").show(1000); 943 1016 mypanorama = window.myPamoorama; 944 1017 if (!mypanorama) { 945 jQuery("#loading").show(5000); 946 tempo = tempo + 1; 947 if (tempo > 5000) return true; 948 nopano = false; 1018 if (tempo > 500) return true; 949 1019 setTimeout("Wait_pamoorama_time()", 500); 950 1020 return false; … … 953 1023 954 1024 if (mypanorama.skipInit == false) { 955 if (tempo > 4000) return true;1025 if (tempo > 500) return true; 956 1026 setTimeout("Wait_pamoorama_time()", 500); 957 1027 return false; 958 1028 } 959 1029 //============================================================= 960 infos_pamoorama = jQuery("#pamoorama").infos(); 961 if (Math.abs(infos_pamoorama.height) < 50) { 1030 if (Math.abs(mypanorama.imageHeight) < 100) { 962 1031 setTimeout("Wait_pamoorama_time()", 500); 963 1032 return false; … … 965 1034 966 1035 nopano = true; 967 jQuery("#pamoorama").show(1000); 1036 Zone_image.image_init = { width: mypanorama.imageWidth, 1037 height: mypanorama.imageHeight 1038 } 1039 jQuery("#pamoorama").trigger("ON"); 968 1040 return true; 969 1041 … … 1026 1098 jQuery("#ret_autosize").val(infos_theMainImage.src); 1027 1099 if (typeof infos_theImage == "undefined") return; 1028 1029 1100 jQuery("#ret_autosize").trigger('ON', { 1030 1101 width: img_w, … … 1045 1116 **********************/ 1046 1117 init_img = function (theImg) { 1118 if (theImg.complete == false) { 1119 return; 1120 } 1047 1121 name_src = theImg.src; 1048 1122 img_init = { width: jQuery(theImg).width(), height: jQuery(theImg).height() } … … 1052 1126 if (typeof theImg.naturalHeight != "undefined") 1053 1127 img_init.height = theImg.naturalHeight; 1054 1055 1128 img_init.rapport = img_init.width / img_init.height; 1056 1057 if (typeof Zone_image.image == "undefined") Zone_image.image = { height: Zone_image.image_init.height, width: Zone_image.image_init.width }; ; 1058 1059 Zone_image.image_init.height = img_init.height; 1060 Zone_image.image_init.width = img_init.width; 1129 if (typeof Zone_image == "undefined") Zone_image = { image: {} }; 1130 if (typeof Zone_image.image == "undefined") Zone_image.image = { height: Zone_image.image_init.height, width: Zone_image.image_init.width }; 1131 theImg.width = img_init.height; 1132 theImg.width = img_init.width; 1133 1134 Zone_image.image_init = { height: img_init.height, width: img_init.width, rapport: img_init.rapport }; 1061 1135 Zone_image.zoom = Zone_image.image_init.height / img_init.height; 1062 Zone_image.image_init.rapport = img_init.rapport; 1063 nu_img = 0; 1136 1064 1137 if (typeof Zone_image.src == "undefined") { 1065 1138 Zone_image.src = name_src; 1066 1139 return false; 1067 1140 } 1068 stx = name_src.match(Zone_image.src); 1069 sty = infos_theMainImage.src; 1141 stx = name_src.match(RegExp(Zone_image.src, "gi")); 1070 1142 return stx; 1071 1143 } … … 1201 1273 // 1202 1274 //===================================== 1275 Get_Maxi = function (Maxi_image) { 1276 var pt = options.liste_type; 1277 if (pt.length > 0) { 1278 tw = Maxi_image.width; // valeur maxi 1279 th = Maxi_image.height; // valeur maxi 1280 n = 0; 1281 maxi_size = { w: Maxi_image.width, h: Maxi_image.height, idx: -1 }; 1282 mini_size = { w: tw, h: th, idx: 0 }; 1283 size_derive = { w: 0, h: 0 }; 1284 size_encours = { w: tw, h: th }; 1285 //================================= 1286 jQuery(pt).each(function (i) { 1287 vn = this; 1288 size_derive = { w: parseInt(vn[2]), h: parseInt(vn[3]) }; 1289 if (vn[0] != "square" && vn[0] != "thumb" && vn[0] != "SelMaxi" && vn[0] != "Autosize") { 1290 if (size_derive.h > size_encours.h) { 1291 if (maxi_size.idx < 0) { 1292 maxi_size = size_derive; 1293 maxi_size.idx = n; 1294 return false 1295 } 1296 } 1297 if (size_derive.h < size_encours.h && size_derive.h > 10) { 1298 mini_size = size_derive; 1299 mini_size.idx = n; 1300 } 1301 } 1302 n++; 1303 }); 1304 n = maxi_size.idx; 1305 if (n < 0) { 1306 n = mini_size.idx; 1307 } 1308 if (options.select_type.match(RegExp("SelMaxi", "gi"))) { 1309 n = mini_size.idx; 1310 1311 } 1312 if (options.select_type.match(RegExp("Autosize", "gi"))) { 1313 1314 } 1315 options.src_deriv = pt[n][0]; 1316 return { url: pt[n][1], pictureDeriv: pt[n][0], pictureMap: pt[n][0], width: pt[n][2], height: pt[n][3] }; 1317 } 1318 return { imgSrc: "", pictureDeriv: "", width: "", height: "" }; 1319 } 1320 //_______________ Get_Maxi ______ 1321 1203 1322 Select_Image = function () { 1204 1323 var pt = options.liste_type; … … 1207 1326 //===== calcul Image === 1208 1327 Calcul_Image(); 1209 tw = Zone_image.image.width; // valeur maxi 1210 th = Zone_image.image.height; // valeur maxi 1211 n = 0; 1212 maxi_size = { w: tw, h: th, idx: -1 }; 1213 mini_size = { w: tw, h: th, idx: 0 }; 1214 size_derive = { w: 0, h: 0 }; 1215 size_encours = { w: tw, h: th }; 1216 1217 jQuery(pt).each(function (i) { 1218 vn = this; 1219 size_derive = { w: parseInt(vn[2]), h: parseInt(vn[3]) }; 1220 if (size_derive.h > size_encours.h) { 1221 if (maxi_size.idx < 0) { 1222 maxi_size = size_derive; 1223 maxi_size.idx = n + 1; 1224 } 1225 } 1226 if (size_derive.h < size_encours.h) { 1227 mini_size = size_encours; 1228 mini_size.idx = n; 1229 } 1230 1231 n++; 1232 }); 1233 1234 1235 // n = n - 1 ; 1236 n = maxi_size.idx; 1237 1238 if (n > pt.length - 1) n = pt.length - 1; // format le plus grand 1239 if (n < 0) n = pt.length - 1; // format le plus grand 1240 1241 imgSrc = pt[n][1]; 1242 last_map = pt[n][0]; 1243 // if (Type_Img == "pamoorama") return; 1328 IMg = Get_Maxi(Zone_image.image); 1329 imgSrc = IMg.url; 1330 1331 ing_width = IMg.width; 1332 ing_height = IMg.height; 1333 if (Type_Img == "pamoorama") return; 1334 if (options.select_type != "SelMaxi" && options.select_type != "Autosize") return; 1244 1335 if (typeof Zone_image.src == "undefined") Zone_image.src = " "; 1245 status = imgSrc.match(RegExp(Zone_image.src, "gi")); 1336 status = imgSrc.match(RegExp(Zone_image.src, "gi")); // status = '' si == 1246 1337 status1 = (imgSrc.toString() == Zone_image.src.toString()); 1247 1338 1248 1339 if (status1 == true) return; 1340 href_path = "javascript:changeImgSrc('" + imgSrc + "', '" + options.select_type + "', '" + options.select_type + "')"; 1341 jQuery(".linkAutosize").attr("href", href_path); 1249 1342 theImg = document.getElementById(theMainImage_id.replace("#", "")); 1250 href_path = "javascript:changeImgSrc('" + imgSrc + "', '" + last_map + "', '" + "Autosize" + "')"; 1251 jQuery("#linkAutosize").attr("href", href_path); 1343 1252 1344 if (theImg.tagName != "IMG") { 1253 theImg.useMap = "# Autosize";1345 theImg.useMap = "#map" + options.select_type; 1254 1346 imgSrc_i = jQuery(theImg).css("backgroundImage"); 1255 1347 imgSrc_j = jQuery(theImg).css("background-image"); 1256 1348 1257 1349 } else { 1258 if (theImg.useMap.match(RegExp("map", "gi"))) return; 1259 if (theImg.src.match(RegExp(imgSrc, "gi"))) return; 1260 changeImgSrc(imgSrc, last_map, "#Autosize"); 1350 1351 // if (!theImg.useMap.match(RegExp("SelMaxi", "gi"))) return; 1352 // if (!theImg.useMap.match(RegExp("Autosize", "gi"))) return; 1353 1354 changeImgSrc(imgSrc, options.select_type, options.select_type); 1261 1355 } 1262 1356 return true; … … 1278 1372 1279 1373 }; 1280 1281 1282 1374 /************************************************* 1283 1375 * correction pamoorama 1284 1376 *************************************************/ 1285 1377 Set_Pamoorama = function (Format) { 1378 myPamoorama = window.myPamoorama; 1286 1379 if (Type_Img == "pamoorama") { 1287 if (!Format) return; 1288 1289 myPamoorama = window.myPamoorama; 1380 1290 1381 if (!nopano) { 1382 theMainImage_Id = "#pamoorama"; 1291 1383 nopano = false; 1292 1384 Wait_pamoorama(); 1293 } 1385 infos_theMainImage = jQuery(theMainImage_Id).infos(); 1386 //theMainImage_Id = "#pamoorama"; 1387 } 1388 1389 1294 1390 if (typeof myPamoorama == "undefined") { 1295 1391 return; … … 1297 1393 //========================================================= 1298 1394 if (!nopano) { 1395 //theMainImage_Id = "#pamoorama"; 1299 1396 nopano = false; 1300 1397 Wait_pamoorama(); 1301 } 1302 1303 jQuery("#pamoorama").show(1000); 1304 jQuery("#loading").hide(1000); 1305 1306 Wait_pamoorama(); 1307 window.myPamoorama.stopAnim(); 1308 infos_theMainImage = jQuery("#pamoorama").infos(true); 1398 infos_theMainImage = jQuery(theMainImage_Id).infos(); 1399 //theMainImage_Id = "#pamoorama"; 1400 } 1401 1402 1403 1404 infos_pamoorama = jQuery("#pamoorama").infos(); 1405 infos_pamoorama_outter = jQuery("#pamoorama_outter").infos(true); 1406 infos_pamoorama_inner = jQuery("#pamoorama_inner").infos(); 1407 1408 infos_pamoorama_frame = jQuery("#pamoorama_frame").infos(); 1409 infos_frame = jQuery(myPamoorama.frame).infos(); 1410 1411 1309 1412 //==================================================== 1310 1413 jQuery("#pamoorama").css({ … … 1313 1416 // height: Zone_Affichage.height + "px" , sinon déclenchement panorama sur la hauteur; 1314 1417 }); 1315 //============================================================ 1316 infos_pamoorama = jQuery("#pamoorama").infos(true); 1317 infos_pamoorama_outter = jQuery("#pamoorama_outter").infos(); 1318 infos_pamoorama_inner = jQuery("#pamoorama_inner").infos(); 1319 infos_pamoorama_footer = jQuery("#pamoorama_footer").infos(); 1320 infos_pamoorama_frame = jQuery("#pamoorama_frame").infos(); 1321 1322 infos_frame = jQuery(myPamoorama.frame).infos(); 1418 1323 1419 marges_w = infos_pamoorama.general.marges.width; 1324 1420 marges_h = infos_pamoorama.general.marges.height; 1421 1422 jQuery("#pamoorama_footer").css({ 1423 width: Format.width + "px" 1424 }); 1425 infos_pamoorama_footer = jQuery("#pamoorama_footer").infos(); 1325 1426 marges_h += infos_pamoorama_footer.general.height; 1427 1326 1428 jQuery("#pamoorama").css({ 1327 1429 width: "" 1328 1430 }); 1329 1431 1330 1331 outter_width = Format.width; 1332 pos = jQuery("#theImage").offset(); 1333 pos.top = infos_pamoorama.top; 1334 pos.left = infos_pamoorama.left; 1335 outter_height = Format.height - marges_h; 1336 /* 1337 jQuery("#theMainImage").width(outter_width); 1338 jQuery("#theMainImage").height(outter_height); 1339 jQuery("#theMainImage").css({ left: pos.left, top: pos.top, margin: "auto", border: "solid 1px red" 1340 1432 outter_height = Format.height; 1433 1434 Zoom_pano = (Format.height - marges_h) / Zone_image.image_init.height; 1435 new_image = { height: Math.ceil(Zone_image.image_init.height * Zoom_pano), 1436 width: Math.ceil(Zone_image.image_init.width * Zoom_pano) 1437 } 1438 1439 jQuery("#pamoorama_inner").css({ 1440 width: new_image.width + "px", height: new_image.height + "px", "background-size": "100%" 1341 1441 }); 1342 1442 1343 */1344 1345 Zoom_pano = outter_height / Format.height;1346 new_image = { height: Math.ceil(Format.height * Zoom_pano),1347 width: Math.ceil(Format * Zoom_pano)1348 }1349 1350 jQuery("#pamoorama_inner").css({ width: new_image.width, height: new_image.height, "background-size": "100%"1351 });1352 1353 // jQuery("#pamoorama_inner").width(Zone_image.width_init * Zoom_pano);1354 // jQuery("#pamoorama_inner").height(Zone_image.height_init * Zoom_pano);1355 1443 1356 1444 1357 1445 //---------- test largeur image 1358 1446 new_width = Format.width; 1447 1359 1448 if (new_width > new_image.width) { 1360 1449 new_width = new_image.width; 1361 1450 jQuery("#pamoorama_outter").css({ 1362 position: 'absolute', 1451 1363 1452 align: "center", 1364 1453 margin: "auto" … … 1367 1456 outter_width = new_width; 1368 1457 1369 1370 // jQuery("#pamoorama_thumb").width(200 / Zone_image.zoom);1371 1372 1458 jQuery("#pamoorama_outter").css({ 1373 1374 1459 align: 'center', 1375 1460 margin: 'auto', 1376 1461 width: outter_width + "px", 1377 height: outter_height+ "px"1462 height: Format.height - marges_h + "px" 1378 1463 }); 1379 1464 //============= Mise à l'echelle ================== 1380 jQuery("#pamoorama_footer").css({1381 width: Format.width + "px"1382 });1383 1384 1465 window.myPamoorama.options.width = Math.ceil(Format.width); 1385 1466 //================================================================== 1386 1467 new_max_left = new_image.width - outter_width; 1387 // jQuery(window.myPamoorama.inner).width(Zone_image.width_init* Zoom_pano);1388 // jQuery(window.myPamoorama.inner).height(Zone_image.height_init * Zoom_pano);1389 1390 1468 if (!window.myPamoorama.outter) return; 1391 1469 window.myPamoorama.outter.scrollTo(new_max_left, 0); … … 1398 1476 jQuery("#pamoorama_thumb img").width(200); 1399 1477 jQuery("#pamoorama_thumb img").height(nf); 1478 jQuery("#pamoorama_thumb").css({ 1479 position: "absolute", 1480 left: (Format.width - 215) + "px" 1481 }); 1400 1482 // 200=window.myPamoorama.width 1401 1483 // frame = Zone_image.container.width … … 1404 1486 jQuery("#pamoorama_frame").width(nw); 1405 1487 jQuery("#pamoorama").css({ 1406 width: outter_width , height: "auto"1488 width: outter_width + "px", height: Format.height + "px" 1407 1489 }); 1408 // jQuery("#theImage").trigger("Start_right"); 1409 jQuery("#theImage").height(Zone_image.container.height + 1); 1410 1411 jQuery("#theImage").css({ 1412 height: Zone_image.container.height 1413 }); 1414 1415 1416 return true 1417 } // test img 1490 1491 // jQuery("#theImage").css({ margin: "auto" }); 1492 // jQuery("#theImage").width(Format.width); 1493 1494 jQuery("#loading").css("display", "none"); 1495 } // 1418 1496 } // Set_Pamoorama 1497 1419 1498 /*********************************************************/ 1420 1499 … … 1502 1581 + Math.ceil(infos_theMainImage.general.marges.height); 1503 1582 retrait_img.height += 2; 1583 1504 1584 //=============================================================== 1505 1585 retrait_img.width = Math.ceil(infos_theMainImage.general.marges.width); // borderwidth+padding 1506 1586 retrait_img.width += Math.ceil(options.marges_llgbo || 0); 1507 1587 retrait_img.width += 2; 1588 1508 1589 1509 1590 //================== Limite Format Image ===================== 1510 1591 container.height_interne = container.height - marge_top - marge_bottom; 1511 1592 container.width_interne = container.width - marge_left - marge_right; 1593 1594 container.height_interne = Math.max(container.height_interne, Math.ceil(options.mini_height) + retrait_img.height), 1595 container.width_interne = Math.max(container.width_interne, Math.ceil(options.mini_width) + retrait_img.width) 1596 1597 1512 1598 image_max = { 1513 height: container.height_interne - retrait_img.height,1514 width: container.width_interne - retrait_img.width1599 height: (container.height_interne - retrait_img.height), 1600 width: (container.width_interne - retrait_img.width) 1515 1601 } 1516 1602 //========================= … … 1521 1607 1522 1608 if (Type_Img == "pamoorama") { 1523 1609 if (height_theMainImage > container.height_interne) { 1610 1611 } 1524 1612 } else { 1525 1613 1526 1614 height_theMainImage = Math.ceil(width_theMainImage / Zone_image.image_init.rapport); 1615 1616 1527 1617 1528 1618 if (height_theMainImage > container.height_interne) { … … 1544 1634 } 1545 1635 1636 1637 1638 1546 1639 } 1547 1640 //================================================================ 1548 1641 Zone_image.image = { 1549 1642 width: width_theMainImage, 1550 height: height_theMainImage 1643 height: height_theMainImage, 1644 rapport: width_theMainImage / height_theMainImage 1551 1645 }; 1552 1646 … … 1569 1663 Zone_image.src = infos_theMainImage.src; 1570 1664 } 1571 1572 1573 if (typeof Zone_image.image_init.rapport == "undefined") return; 1574 if (force && force == true) old_window.width = 0; 1575 1576 1577 if (infos_theMainImage.useMap.match(RegExp("Autosize", "gi"))) 1578 infos_theMainImage.useMap = "#Autosize"; 1579 1580 useMap = options.useMap; 1581 1582 1583 if (typeof useMap == "") useMap = "Autosize"; 1584 if (options.useMap) { 1585 // useMap = options.useMap; 1586 } 1665 if (typeof Zone_image.image_init.rapport == "undefined") { 1666 Zone_image.image_init.rapport = Zone_image.image_init.width / Zone_image.image_init.height; 1667 } 1668 useMap = options.select_type; 1669 1587 1670 if (useMap) { 1588 1671 if (!useMap.match(RegExp("Autosize", "gi"))) { … … 1601 1684 var chk = eval("options." + user_status + "_enabled"); 1602 1685 if (chk == "") { return; } 1603 1604 if (!options.useMap.match(RegExp("Autosize", "gi"))) {1605 1606 return;1607 }1608 1609 1686 Calcul_Image(); 1610 1687 jQuery("#loading").hide(); … … 1681 1758 1682 1759 case "pamoorama": 1683 1760 Wait_pamoorama(); 1684 1761 /* 1685 1762 1686 1763 infos_the_page = jQuery("#the_page").infos(); 1687 1764 */ … … 1692 1769 1693 1770 1694 //================= Vérification Taille image minimun autorisée ========1695 if ((Zone_image.image.height < options.mini_height) || (Zone_image.image.width < options.mini_width)) {1696 Zone_image.image.width = Math.ceil(Zone_image.width_init);1697 Zone_image.image.height = Math.ceil(Zone_image.image.width / Zone_image.image_init.rapport);1698 }1699 1771 1700 1772 //================================================= … … 1712 1784 if (Type_Img != "pamoorama") { 1713 1785 echelle_max = parseFloat(options.echelle_max, '3'); 1714 if (Zone_image.zoom > 1) {1715 Select_Image(); //+calcul1716 }1717 1786 if (Zone_image.zoom > echelle_max) { 1718 1787 Zone_image.zoom = echelle_max; 1719 Zone_image.image.width = parseInt(Zone_image. width_init* Zone_image.zoom);1788 Zone_image.image.width = parseInt(Zone_image.image_init.width * Zone_image.zoom); 1720 1789 if (Zone_image.image_init.rapport > 0) 1721 Zone_image.image.height = parseInt(Zone_image. width_init/ Zone_image.image_init.rapport);1790 Zone_image.image.height = parseInt(Zone_image.image_init.width / Zone_image.image_init.rapport); 1722 1791 } 1723 1792 } … … 1779 1848 options.marge_top += infos_theImage.general.marges.top + infos_content.general.marges.top + Math.ceil(options.marge_haute); 1780 1849 options.marge_bottom = Math.ceil(options.marge_basse); // +infos_content.general.marges.bottom; ; 1781 1850 if (cookies.pictureDeriv == null) 1851 options.first = true; 1852 else 1853 options.first = false; 1782 1854 //=================== Gestion liste photos size ============================ 1783 1855 us = 0; 1784 type_size = cookies.typeSave; // xxx 1785 useMap = cookies.pictureMap; // #mapxxx 1786 1856 if (options.first) { 1857 IMg = Get_Maxi(Zone_image.image); 1858 options.src_deriv = IMg.pictureDeriv; 1859 imgSrc = IMg.url; 1860 width = IMg.width; 1861 height = IMg.height; 1862 } 1787 1863 user_status = options.user_status; 1788 type_size_maxi = eval("options." + user_status + "_type"); //limite taille 1789 type_size = type_size || type_size_maxi; 1864 pictureDeriv_maxi = eval("options." + user_status + "_type"); //limite taille 1865 options.pictureDeriv_maxi = pictureDeriv_maxi; 1866 pictureDeriv_maxi = options.select_type; 1867 1868 //========================================================== 1869 href_path = "javascript:changeImgSrc('" + options.src_img + "', '" + "SelMaxi" + "', '" + "SelMaxi" + "')"; 1870 spans = jQuery("#derivativeCheckedSelMaxi").next(); 1871 spans.attr("href", href_path); 1872 spans.attr("name", "SelMaxi"); 1873 spans = spans.find("span"); 1874 spans.attr("name", "SelMaxi"); 1875 spans.text("(" + cookies.theMainImageWidth + " x " + cookies.theMainImageHeight + ")"); 1876 //========================================================== 1877 href_path = "javascript:changeImgSrc('" + options.src_img + "', '" + "Autosize" + "', '" + "Autosize" + "')"; 1878 1879 spans = jQuery("#derivativeCheckedAutosize").next(); 1880 spans.attr("href", href_path); 1881 spans.attr("name", "Autosize"); 1882 spans = spans.find("span"); 1883 spans.attr("name", "Autosize"); 1884 spans.text("(" + cookies.theMainImageWidth + " x " + cookies.theMainImageHeight + ")"); 1885 //========================================================== 1886 1887 Zone_image.image.width = cookies.theMainImageWidth; 1888 Zone_image.image.height = cookies.theMainImageHeight; 1889 1890 if (options.select_type == "Autosize" || options.select_type == "SelMaxi") { 1891 spans = jQuery("#derivativeChecked" + options.select_type).next(); 1892 spans.addClass("linkAutosize"); 1893 spans.find("span").addClass("auto_details"); 1894 } 1895 pictureDeriv = pictureDeriv || pictureDeriv_maxi; 1896 1897 IMg = Get_Maxi(Zone_image.image); 1898 imgSrc = IMg.url; 1899 1900 width = IMg.width; 1901 height = IMg.height; 1902 1790 1903 n = 0; 1791 1792 1904 var pt = new Array(); 1793 jQuery("#derivativeSwitchBox .switchCheck").css('visibility', 'hidden'); 1905 1906 1907 //uyu = jQuery(uyu + " span"); 1908 // 1909 1910 // auto_details 1911 //==== limite affichage selection = select_type ==== 1794 1912 jQuery("#derivativeSwitchBox a").css('visibility', 'hidden'); 1795 1796 1913 jQuery("#derivativeSwitchBox a").each(function (i) { 1797 1914 href_path = jQuery(this).attr("href"); 1798 1915 pt[i] = href_path.split("'"); 1799 1916 tsz = pt[i][5]; 1917 1800 1918 jQuery(this).css('visibility', 'visible'); 1801 1919 //--- recherche limite --- 1802 if (tsz.match(RegExp(type_size_maxi, "gi"))) { 1803 return false; 1920 if (tsz.match(RegExp(pictureDeriv_maxi, "gi"))) { 1921 if (tsz.match(RegExp(options.select_type, "gi"))) { 1922 us = n; 1923 } else { 1924 return false; 1925 } 1804 1926 } 1805 1927 //--- type en cours --- 1806 if (tsz.match(RegExp("^" + type_size, "gi"))) {1928 if (tsz.match(RegExp("^" + pictureDeriv, "gi"))) { 1807 1929 us = n; 1808 1930 } … … 1810 1932 n++; 1811 1933 }); 1812 1813 jQuery("derivativeChecked" + options.type_size).css('visibility', 'visible'); 1934 jQuery(".switchCheck").css('visibility', 'hidden'); 1935 jQuery("derivativeChecked" + pictureDeriv_maxi).css('visibility', 'visible'); 1936 /* */ 1814 1937 //==== en cours ============ 1815 n = pt.length - 1; 1816 if (n >= 0) { 1817 imgSrc = pt[n][1]; 1818 last_map = pt[n][5]; // dernière position 1819 //======================================= 1820 imgSrc = pt[us][1]; 1821 last_map = pt[us][5]; // taille selectionné. 1822 href_path = "javascript:changeImgSrc('" + imgSrc + "', '" + last_map + "', '" + "Autosize" + "')"; 1823 new_html = '<br /><span class="switchCheck" id="derivativeCheckedAutosize" style="visibility:visible" >✔ </span>'; 1824 new_html += '<a id="linkAutosize" href="' + href_path + '">'; 1825 new_html += 'Autosize<span class="derivativeSizeDetails" id="auto_details" > - Autosize</span> </a>'; 1826 if (!type_size.match(RegExp("Autosize", "gi"))) { 1827 jQuery("#derivativeSwitchBox br:last").before(new_html); 1828 } 1829 1830 useMap = "#" + type_size_maxi; // #mapxxx 1831 if (useMap == "#Autosize" && type_size_maxi == "Autosize") { 1832 1833 } else { 1834 useMap = last_map; 1835 } 1836 1837 typeSave = cookies.typeSave; //picturederiv xxx 1838 options.type_size = useMap.replace("#", ""); 1839 1840 type_size = options.type_size; 1841 cookies.pictureMap = "#" + type_size_maxi; // #mapxxx 1842 cookies.typeSave = type_size_maxi; //picturederiv xxx 1843 cookies.imgSrc = imgSrc; 1844 changeImgSrc(imgSrc, last_map, type_size); 1845 } else { 1846 type_size_maxi = cookies.pictureMap; // #mapxxx 1847 type_size_maxi = cookies.typeSave; //picturederiv xxx 1848 imgSrc = cookies.imgSrc; 1849 last_map = type_size_maxi; 1850 href_path = ""; 1851 } 1938 cookies.pictureMap = pictureDeriv_maxi; // #mapxxx 1939 cookies.pictureDeriv = pictureDeriv_maxi; //picturederiv xxx 1940 cookies.imgSrc = imgSrc; 1941 1942 changeImgSrc(imgSrc, cookies.pictureDeriv, cookies.pictureMap); 1943 imgSrc = cookies.imgSrc; 1944 pictureDeriv = pictureDeriv_maxi; 1945 href_path = ""; 1946 1852 1947 }; 1853 1948 //_______________________ init_gen _______________________ 1854 1949 1855 //============= Gestion Maps ================ 1856 nom_map = "Autosize"; 1857 a_up = jQuery("map[name='" + nom_map + "'] area[rel=up]"); 1858 a_prev = jQuery("map[name='" + nom_map + "'] area[rel=prev]"); 1859 a_next = jQuery("map[name='" + nom_map + "'] area[rel=next]"); 1860 new_html = '<map name="' + nom_map + '" >'; 1861 nb_zone = jQuery("div .navigationButtons a").length; 1862 Largeur_zone = (jQuery("#theMainImage").width() / nb_zone); 1863 Hauteur_zone = jQuery("#theMainImage").height(); 1864 init_zone = 0; 1865 j = 0; 1866 jQuery("div .navigationButtons a").each(function (e) { 1867 Hauteur_zone = jQuery("#theMainImage").height(); 1868 title = jQuery(this).attr("title"); 1869 h_ref = jQuery(this).attr("href"); 1870 init_zone = Largeur_zone * j; 1871 if (title.match(":")) { 1872 if (j == 0) 1873 rel = "prev"; 1874 else 1875 rel = "next"; 1876 } else { 1877 rel = "up"; 1878 Hauteur_zone = Hauteur_zone / 4; 1879 } 1880 coord = init_zone + "," + 0 + "," + Math.ceil(init_zone + Largeur_zone) + "," + Hauteur_zone; 1881 new_html += '<area rel="' + rel + '" title="' + title + '" href="' + h_ref + '" shape="rect" coords="' + coord + '" alt="' + title + '" />'; 1882 1883 j++; 1884 }); 1885 new_html += '</map>'; 1886 jQuery("#theImage map:last").after(new_html); 1887 1888 }); // ready 1889 1950 if (typeof changeImgSrc != "function") { 1951 1952 } 1953 }); // ready 1954 1955 1956 jQuery("#derivativeSwitchBox a").click(function (e) { 1957 k1 = 0; 1958 }); -
extensions/Autosize/js/JScript.js
r11961 r17503 18 18 } 19 19 return yWithScroll - innerh; 20 } 21 20 } 22 21 jQuery(document).ready(function (jQuery) { 23 22 jQuery(window).load(function () { -
extensions/Autosize/js/autosize.cookie.js
r17308 r17503 1 /**2 * Cookie plugin3 *4 * Copyright (c) 2006 Klaus Hartl (stilbuero.de)5 * Dual licensed under the MIT and GPL licenses:6 * http://www.opensource.org/licenses/mit-license.php7 * http://www.gnu.org/licenses/gpl.html8 *9 */10 11 /**12 * Create a cookie with the given name and value and other optional parameters.13 *14 * @example $.cookie('the_cookie', 'the_value');15 * @desc Set the value of a cookie.16 * @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });17 * @desc Create a cookie with all available options.18 * @example $.cookie('the_cookie', 'the_value');19 * @desc Create a session cookie.20 * @example $.cookie('the_cookie', null);21 * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain22 * used when the cookie was set.23 *24 * @param String name The name of the cookie.25 * @param String value The value of the cookie.26 * @param Object options An object literal containing key/value pairs to provide optional cookie attributes.27 * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.28 * If a negative value is specified (e.g. a date in the past), the cookie will be deleted.29 * If set to null or omitted, the cookie will be a session cookie and will not be retained30 * when the the browser exits.31 * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).32 * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).33 * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will34 * require a secure protocol (like HTTPS).35 * @type undefined36 *37 * @name $.cookie38 * @cat Plugins/Cookie39 * @author Klaus Hartl/klaus.hartl@stilbuero.de40 */41 42 /**43 * Get the value of a cookie with the given name.44 *45 * @example $.cookie('the_cookie');46 * @desc Get the value of a cookie.47 *48 * @param String name The name of the cookie.49 * @return The value of the cookie.50 * @type String51 *52 * @name $.cookie53 * @cat Plugins/Cookie54 * @author Klaus Hartl/klaus.hartl@stilbuero.de55 */56 1 jQuery.cookie = function(name, value, options) { 57 2 if (typeof value != 'undefined') { // name and value given, set cookie -
extensions/Autosize/js/autosize.dimensions.js
r17308 r17503 194 194 195 195 myposition = ""; 196 width = jQuery(elem).width(); 197 height = jQuery(elem).height(); 198 out_width = width; 199 out_height = height; 200 in_width = width; ; 201 in_height = height; 196 var myWidth = 0, myHeight = 0; 197 198 var xHeight = jQuery(document).height(); 199 var x2Height = jQuery(window).height(); 200 201 if (typeof (window.innerWidth) == 'number') { 202 //Non-IE 203 myWidth = window.innerWidth; 204 myHeight = window.innerHeight; 205 } else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) { 206 //IE 6+ in 'standards compliant mode' 207 myWidth = document.documentElement.clientWidth; 208 myHeight = document.documentElement.clientHeight; 209 } else if (document.body && (document.body.clientWidth || document.body.clientHeight)) { 210 //IE 4 compatible 211 myWidth = document.body.clientWidth; 212 myHeight = document.body.clientHeight; 213 } 214 215 if (myHeight != x2Height) { 216 width = myWidth; 217 } 218 219 width = myWidth; 220 height = myHeight; 221 out_width = myWidth; 222 out_height = myHeight; 223 in_width = myWidth; ; 224 in_height = myHeight; 202 225 203 226 } else { -
extensions/Autosize/main.inc.php
r17309 r17503 2 2 /* 3 3 Plugin Name: AutoSize 4 Version: 2.0 54 Version: 2.06 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 … … 34 34 add_event_handler('get_admin_plugin_menu_links', array(&$autosize_controler,'cl_autosize_admin') ); 35 35 36 add_event_handler('loc_after_page_header', array(&$autosize_controler, 'cl_autosize_script_1'), EVENT_HANDLER_PRIORITY_NEUTRAL );37 36 38 add_event_handler('loc_after_page_header', array(&$autosize_controler, 'cl_autosize_affiche'), EVENT_HANDLER_PRIORITY_NEUTRAL+21 ); 39 40 add_event_handler('loc_end_page_tail',array(&$autosize_controler, 'cl_autosize_script_3'), EVENT_HANDLER_PRIORITY_NEUTRAL-1); 37 // init cl_autosize_script_1 cl_autosize_affiche 41 38 42 39 43 add_event_handler('render_element_content', array(&$autosize_controler, 'autosize_calcContent'),40,2); 40 add_event_handler('render_element_content', array(&$autosize_controler,'init'),EVENT_HANDLER_PRIORITY_NEUTRAL,2 ); 41 42 //avant pamooramics 43 add_event_handler('render_element_content', array(&$autosize_controler, 'autosize_calcContent'),40,2); 44 45 add_event_handler('loc_after_page_header', array(&$autosize_controler, 'cl_autosize_script_2'), EVENT_HANDLER_PRIORITY_NEUTRAL ); 46 47 add_event_handler('loc_after_page_header', array(&$autosize_controler, 'cl_autosize_script_1'), EVENT_HANDLER_PRIORITY_NEUTRAL ); 48 49 add_event_handler('loc_after_page_header',array(&$autosize_controler, 'cl_autosize_script_3'), EVENT_HANDLER_PRIORITY_NEUTRAL ); 50 51 add_event_handler('loc_after_page_header', array(&$autosize_controler, 'cl_autosize_affiche'), EVENT_HANDLER_PRIORITY_NEUTRAL +21 ); 52 53 44 54 45 55 ?> -
extensions/Autosize/maintain.inc.php
r7193 r17503 30 30 { 31 31 global $conf; 32 33 if (!isset($conf['cl_autosize'])) 34 { 35 32 if (!isset($conf['cl_autosize'])){ 36 33 $q = ' 37 34 INSERT INTO '.CONFIG_TABLE.' (param, value, comment) … … 46 43 47 44 48 function plugin_uninstall() 49 { 45 function plugin_uninstall(){ 50 46 global $conf; 51 47 if (isset($conf['cl_autosize'])) … … 61 57 } 62 58 59 function plugin_deactivate(){ 60 global $conf ; 61 if (isset($conf['cl_derivatives_sav'])) { 62 $arr = @unserialize($conf['cl_derivatives_sav']); 63 if(isset($arr['d'])){ 64 $query = ' 65 UPDATE '.CONFIG_TABLE.' 66 SET value="'.addslashes(serialize($arr)).'" 67 WHERE param = "derivatives" 68 LIMIT 1'; 69 pwg_query($query); 70 71 $q = 'DELETE FROM '.CONFIG_TABLE.' WHERE param="cl_derivatives_sav" ;'; 72 pwg_query($q); 73 } 74 } 75 } 76 77 function plugin_activate(){ 78 global $conf ; 79 if (isset($conf['derivatives'])) { 80 $arr = @unserialize($conf['derivatives']); 81 if(isset($arr['d'])){ 82 if (!isset($conf['cl_derivatives_sav'])){ 83 $q = 'INSERT INTO '.CONFIG_TABLE.' (param, value, comment) 84 VALUES ("cl_derivatives_sav","","derivatives save") 85 ;'; 86 pwg_query($q); 87 88 $query = ' 89 UPDATE '.CONFIG_TABLE.' 90 SET value="'.addslashes(serialize($arr)).'" 91 WHERE param = "cl_derivatives_sav" 92 LIMIT 1'; 93 pwg_query($query); 94 95 $arr = @unserialize($conf['derivatives']); 96 if(!isset($arr['d']['Autosize'])){ 97 $arr['d']['SelMaxi']=ImageStdParams::get_custom(9,9); 98 $arr['d']['Autosize']=ImageStdParams::get_custom(10, 10); 99 $conf['derivatives']=serialize($arr); 100 $arr = @unserialize($conf['derivatives']); 101 $query = ' 102 UPDATE '.CONFIG_TABLE.' 103 SET value="'.addslashes(serialize($arr)).'" 104 WHERE param = "derivatives" 105 LIMIT 1'; 106 pwg_query($query); 107 } 108 } 109 } 110 } 111 } 112 63 113 ?> -
extensions/Autosize/template/autosize.tpl
r17308 r17503 2 2 {html_head} <!-- autosize/template/autosize.tpl --> 3 3 <script type="text/javascript"> 4 5 4 var Autosize_options={ldelim} 6 7 cookies :{$cookies} , 8 deriv_type :'{$deriv_type}' , 9 liste_type:'{$liste_type}' , 10 11 type_size:'{$deriv_type}' , 5 select_type:'{$select_type}', 6 maxi_img:'{$maxi_img}', 7 pictureDeriv :'{$pictureDeriv}' , 8 liste_type:new Array() , 12 9 DEBUG_autosize:'{$DEBUG_autosize}', 13 10 theme:'{$theme}', … … 23 20 img_height : '{ $IMG_HEIGHT }', 24 21 25 cookie_width:'{$COOKIE_WIDTH }',26 cookie_height : '{ $COOKIE_HEIGHT}',22 windowWidth:'{$windowWidth }', 23 windowHeight : '{ $windowHeight}', 27 24 28 25 marge_basse:'{ $MARGE_BASSE }', … … 50 47 user_status:'{$user_status}', 51 48 check_auto_w : '{$check_auto_w}', 52 check_desc_v : '{$check_desc_v}' 49 check_desc_v : '{$check_desc_v}' , 50 Size : new Array() 53 51 } ; 52 53 54 {if not empty($liste_type)} 55 {foreach from=$liste_type item=cl_size key=value} 56 Autosize_options.liste_type.push('{$cl_size}' ) 57 {/foreach} 58 {/if} 59 60 61 {if not empty($Size )} 62 {foreach from=$Size item=cl_size key=value} 63 Autosize_options.Size.push( {ldelim}'{$value}':{$cl_size}} ) 64 {/foreach} 65 {/if} 66 54 67 55 68 </script> -
extensions/Autosize/template/header.tpl
r17308 r17503 1 1 2 {if not empty($pamoorama)} 2 3 {combine_script id="conflit_script" load="header" path = $AUTOSIZE_PATH|@cat:"js/conflit.js" require="jquery" } … … 4 5 {combine_script id="autosize.dimensions" path = $AUTOSIZE_PATH|@cat:"js/autosize.dimensions.js" require="jquery"} 5 6 {combine_script id="conflit_script1" load="footer" path = $AUTOSIZE_PATH|@cat:"js/conflit_2.js" require="jquery" } 7 {else} 6 8 7 {else}8 9 {/if} 9 10 -
extensions/Autosize/template/picture_1.tpl
r17308 r17503 1 2 {if $select_type=="Autosize" || $select_type=="Selmaxi" }{/if} 1 3 {combine_script id="Affiche_script" path= $AUTOSIZE_PATH|@cat:"js/Affiche_script.js" require='jquery,autosize.dimensions' } 4 5 2 6 {if $theme != "elegant"} 3 7 {combine_script id="autosize.cookie" path = $AUTOSIZE_PATH|@cat:"js/autosize.cookie.js" require="jquery" }{/if}
Note: See TracChangeset
for help on using the changeset viewer.