Changeset 16931 for extensions/Autosize
- Timestamp:
- Jul 23, 2012, 3:01:09 PM (12 years ago)
- Location:
- extensions/Autosize
- Files:
-
- 6 added
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Autosize/admin/template/admin.tpl
r10845 r16931 1 {if PHPWG_VERSION < 2.2 } 2 {include file=$AUTOSIZE_PATH_ABS|@cat:'admin/template/header_2_1.tpl'} 3 {else} 4 {include file= $AUTOSIZE_PATH_ABS|@cat:'admin/template/header_2_2.tpl'} 5 {/if} 1 2 {include file= $AUTOSIZE_PATH_ABS|@cat:'admin/template/header.tpl'} 3 6 4 {html_head} 7 5 {literal} … … 14 12 {/literal} 15 13 <script type="text/javascript"> 16 var src_img = '{$SRC_IMG}'; 17 var fade_in = '{$fade_in}';18 19 var thumbnail = '{$thumbnail}';20 var scaled_width = '{$SCALED_WIDTH}'; // valeur par defaut21 var scaled_height = '{$SCALED_HEIGHT}'; // valeur par defaut22 var img_width='{$IMG_WIDTH }';23 var img_height = '{ $IMG_HEIGHT }';24 25 var marge_basse='{ $MARGE_BASSE }';26 var echelle_max='{ $ECHELLE_MAX }';27 var mini_width='{ $MINI_WIDTH }';28 var mini_height = '{ $MINI_HEIGHT }';29 var mini_width2 = '{ $MINI_WIDTH2 }';30 var mini_height2 = '{ $MINI_HEIGHT2 }';31 32 var webmaster_width='{$webmaster_width }';33 var webmaster_height = '{ $webmaster_height }';34 var webmaster_enabled = '{ $webmaster_enabled }';35 36 var admin_width='{ $admin_width }';37 var admin_height = '{ $admin_height }';38 var admin_enabled = '{ $admin_enabled }'; 39 40 var generic_width='{ $generic_width }';41 var generic_height = '{ $generic_height }'; 42 var generic_enabled = '{ $generic_enabled }';43 44 var guest_width='{ $guest_width }'; 45 var guest_height = '{$guest_height}';46 var guest_enabled = '{ $guest_enabled }';47 48 var normal_width='{$normal_width}';49 var normal_height = '{$normal_height}';50 var normal_enabled = '{ $normal_enabled }'; 51 52 var user_status='{$user_status}';53 54 var check_auto_w = '{$check_auto_w}';55 56 var check_desc_v = ('{$check_desc_v}' == 'checked="checked"') ? true : false;14 var Autosize_options={ldelim} 15 DEBUG_autosize:'{$DEBUG_autosize}', 16 theme:'{$theme}', 17 src_img : '{$SRC_IMG}', 18 fade_in : '{$fade_in}', 19 cl_visible : "{$cl_visible}" =="true", 20 thumbnail : '{$thumbnail}', 21 scaled_width : '{$SCALED_WIDTH}', // valeur par defaut 22 scaled_height : '{$SCALED_HEIGHT}', // valeur par defaut 23 img_width:'{$IMG_WIDTH }', 24 img_height : '{ $IMG_HEIGHT }', 25 cookie_width:'{$COOKIE_WIDTH }', 26 cookie_height : '{ $COOKIE_HEIGHT }', 27 marge_basse:'{ $MARGE_BASSE }', 28 echelle_max:'{ $ECHELLE_MAX }', 29 mini_width:'{ $MINI_WIDTH }', 30 mini_height : '{ $MINI_HEIGHT }', 31 mini_width2 : '{ $MINI_WIDTH2 }', 32 mini_height2 : '{ $MINI_HEIGHT2 }', 33 34 webmaster_type:'{$webmaster_type }', 35 webmaster_enabled : '{ $webmaster_enabled }', 36 37 admin_type:'{ $admin_type }', 38 admin_enabled : '{ $admin_enabled }', 39 40 generic_type:'{ $generic_type }', 41 generic_enabled : '{ $generic_enabled }', 42 43 guest_type:'{ $guest_type }', 44 guest_enabled : '{ $guest_enabled }', 45 46 normal_type:'{$normal_type}', 47 normal_enabled : '{ $normal_enabled }', 48 49 user_status:'{$user_status}', 50 51 check_desc_v : '{$check_desc_v}' 52 } ; 53 54 </script> 57 55 </script> 58 56 … … 85 83 {assign var="visible" value="none"} 86 84 {/if} 87 {if $check_auto_w == true} 88 {assign var="visible_w" value="visible"} 89 {else} 90 {assign var="visible_w" value="hidden"} 91 {/if} 85 92 86 <div class="titrePage"> 93 87 <h2>{'Autosize'|translate} {'version'|translate} {$cl_version}</h2> … … 105 99 <legend class="cluetip" title="{'cl_autosize_config_title_1'|@translate}|{'cl_autosize_hlp_line1'|@translate}">{'cl_autosize_config_title_1'|@translate}</legend> 106 100 <td class="td_autosize pluginBox">{'User status'|@translate}</td> 107 <td class="td_autosize pluginBox">{'cl_autosize_height'|@translate}</td> 108 <td class="td_autosize pluginBox">{'cl_autosize_width'|@translate} 109 <input type="checkbox" id="check_auto_w" name="check_auto_w" value="on" {$check_auto_w} /></td> 101 <td class="td_autosize pluginBox">{'Photo sizes'|@translate}</td> 110 102 <td class="td_autosize pluginBox">{'cl_autosize_enabled'|@translate}</td> 111 112 103 <tr name="webmaster_enabled"> 104 113 105 <td>{'user_status_webmaster'|@translate}</td> 114 <td><input name="webmaster_height" id="Text7" type="text" value ="{$webmaster_height}" /></td> 115 <td><input name="webmaster_width" id="webmaster_width" type="text" value="{$webmaster_width}" /></td> 106 <td> 107 {if isset ($webmaster_type)} 108 <select name="webmaster_type"> 109 {foreach from=$webmaster_type.OPTIONS item=type_size key=value} 110 <option value="{$value}" {if $value == $webmaster_type.SELECTED}selected="selected"{/if} {if is_numeric($value)}disabled="disabled"{/if}>{$type_size}</option> 111 {/foreach} 112 </select> 113 {/if} 114 </td> 116 115 <td ><input name="webmaster_enabled" id="webmaster_enabled" type="checkbox" value ="on" {$webmaster_enabled} /></td> 117 116 </tr> 117 118 118 <tr name="admin_enabled"> 119 119 <td>{'user_status_admin'|@translate}</td> 120 <td><input name="admin_height" id="admin_height" type="text" value ="{$admin_height}" /></td> 121 <td ><input name="admin_width" id="admin_width" type="text" value ="{$admin_width}" /></td> 122 <td ><input name="admin_enabled" id="admin_enabled" type="checkbox" value ="on" {$admin_enabled} /></td> 120 <td> {if isset ($admin_type)} 121 <select name="admin_type"> 122 {foreach from=$admin_type.OPTIONS item=type_size key=value} 123 <option value="{$value}" {if $value == $admin_type.SELECTED}selected="selected"{/if} {if is_numeric($value)}disabled="disabled"{/if}>{$type_size}</option> 124 {/foreach} 125 </select> 126 {/if} 127 </td> 128 <td ><input name="admin_enabled" id="admin_enabled" type="checkbox" value ="on" {$admin_enabled} /></td> 123 129 </tr> 124 130 <tr name="generic_enabled"> 125 131 <td>{'user_status_generic'|@translate}</td> 126 <td><input name="generic_height" id="Text1" type="text" value ="{$generic_height}" /></td> 127 <td><input name="generic_width" id="generic_width" type="text" value ="{$generic_width}" /></td> 128 <td ><input name="generic_enabled" id="generic_enabled" type="checkbox" value ="on" {$generic_enabled} /></td> 132 <td>{if isset ($generic_type)} 133 <select name="generic_type"> 134 {foreach from=$generic_type.OPTIONS item=type_size key=value} 135 <option value="{$value}" {if $value == $generic_type.SELECTED}selected="selected"{/if} {if is_numeric($value)}disabled="disabled"{/if}>{$type_size}</option> 136 {/foreach} 137 </select> 138 {/if} 139 </td> 140 <td ><input name="generic_enabled" id="generic_enabled" type="checkbox" value ="on" {$generic_enabled} /></td> 129 141 </tr> 130 142 <tr name="guest_enabled"> 131 143 <td>{'user_status_guest'|@translate}</td> 132 <td><input name="guest_height" id="Text3" type="text" value ="{$guest_height}" /></td> 133 <td><input name="guest_width" id="guest_width" type="text" value ="{$guest_width}" /></td> 144 <td>{if isset ($guest_type)} 145 <select name="guest_type"> 146 {foreach from=$guest_type.OPTIONS item=type_size key=value} 147 <option value="{$value}" {if $value == $guest_type.SELECTED}selected="selected"{/if} {if is_numeric($value)}disabled="disabled"{/if}>{$type_size}</option> 148 {/foreach} 149 </select> 150 {/if}</td> 134 151 <td ><input name="guest_enabled" id="guest_enabled" type="checkbox" value ="on" {$guest_enabled} /></td> 135 152 </tr> 136 153 <tr name="normal_enabled"> 137 154 <td>{'user_status_normal'|@translate}</td> 138 <td><input name="normal_height" id="Text5" type="text" value ="{$normal_height}" /></td> 139 <td><input name="normal_width" id="normal_width" type="text" value ="{$normal_width}" /></td> 140 <td ><input name="normal_enabled" id="normal_enabled" type="checkbox" value ="on" {$normal_enabled} /></td> 155 <td>{if isset ($normal_type)} 156 <select name="normal_type"> 157 {foreach from=$normal_type.OPTIONS item=type_size key=value} 158 <option value="{$value}" {if $value == $normal_type.SELECTED}selected="selected"{/if} {if is_numeric($value)}disabled="disabled"{/if}>{$type_size}</option> 159 {/foreach} 160 </select> 161 {/if}</td> 162 <td ><input name="normal_enabled" id="normal_enabled" type="checkbox" value ="on" {$normal_enabled} /></td> 141 163 </tr> 142 164 -
extensions/Autosize/admin/template/help.tpl
r10787 r16931 1 {html_head} {if PHPWG_VERSION < 2.2 } 2 {include file=$AUTOSIZE_PATH_ABS|@cat:'admin/template/header_2_1.tpl'} 3 {else} 4 {include file= $AUTOSIZE_PATH_ABS|@cat:'admin/template/header_2_2.tpl'} 5 {/if} 1 {html_head} 2 {include file= $AUTOSIZE_PATH_ABS|@cat:'admin/template/header.tpl'} 3 6 4 {/html_head} 7 5 <form action="" method="post"> -
extensions/Autosize/autosize.inc.php
r16579 r16931 37 37 $ma_page=isset($page['body_id'])?$page['body_id']:"" ; 38 38 if ($ma_page=='thePiwiShackControllerPage') return ; 39 40 41 if (PHPWG_VERSION < 2.2 ) 42 $file =AUTOSIZE_PATH_ABS.'template/header_2_1.tpl' ; 43 else 44 $file =AUTOSIZE_PATH_ABS.'template/header_2_2.tpl' ; 39 $file =AUTOSIZE_PATH_ABS.'template/header.tpl' ; 45 40 $template->set_filenames(array('autosize_init_header'=> $file )); 46 41 $template->set_filenames(array('autosize_init'=>AUTOSIZE_PATH_ABS. "template/conflit.tpl" ) ); 47 //================================================================ =================================42 //================================================================ 48 43 $DEBUG_autosize = isset($_POST['cl_debug_conflit']) ? $_POST['cl_debug_conflit'] : "false" ; 49 44 $DEBUG_autosize = isset($_GET['cl_debug_conflit']) ? $_GET['cl_debug_conflit'] : $DEBUG_autosize ; 50 45 $DEBUG_autosize = isset($conf['cl_debug_conflit']) ? $conf['cl_debug_conflit'] : $DEBUG_autosize ; 51 //====================================================================== ===========================46 //====================================================================== 52 47 $autosize_parametres = cl_autosize_Get_Options() ; 53 48 $theme=$user['theme']; … … 69 64 return $template->parse( 'autosize_init', false); 70 65 }// function cl_autosize_script_1 71 //=========================================================== 72 /* 73 74 * /66 67 /************************************* 68 * cl_autosize_script_2() 69 **************************************/ 75 70 static public function cl_autosize_script_2() 76 71 { … … 79 74 80 75 $AUTOSIZE_PATH = dirname(__FILE__).'/'; 81 //================================================================ =================================76 //================================================================ 82 77 $DEBUG_autosize = isset($_POST['cl_debug_conflit']) ? $_POST['cl_debug_conflit'] : "false" ; 83 78 $DEBUG_autosize = isset($_GET['cl_debug_conflit']) ? $_GET['cl_debug_conflit'] : $DEBUG_autosize ; 84 79 $DEBUG_autosize = isset($conf['cl_debug_conflit']) ? $conf['cl_debug_conflit'] : $DEBUG_autosize ; 85 //===================================================================== ============================80 //===================================================================== 86 81 87 82 … … 156 151 return $menu; 157 152 } //function cl_autosize_admin 153 //===================================== 154 155 156 // this is the default handler that generates the display for the element 157 static public function autosize_RenderContent($content, $element_info) 158 { 159 global $conf; 160 if ( !empty($content) ) 161 {// someone hooked us - so we skip; 162 return $content; 163 } 164 if (isset($_COOKIE['picture_deriv'])) 165 { 166 if ( array_key_exists($_COOKIE['picture_deriv'], ImageStdParams::get_defined_type_map()) ) 167 { 168 pwg_set_session_var('picture_deriv', $_COOKIE['picture_deriv']); 169 } 170 setcookie('picture_deriv', false, 0, cookie_path() ); 171 } 172 $deriv_type = pwg_get_session_var('picture_deriv', $conf['derivative_default_size']); 173 $selected_derivative = $element_info['derivatives'][$deriv_type]; 174 175 $unique_derivatives = array(); 176 $show_original = isset($element_info['element_url']); 177 $added = array(); 178 foreach($element_info['derivatives'] as $type => $derivative) 179 $element_info['derivatives']['Autosize']=$derivative; // last 180 181 foreach($element_info['derivatives'] as $type => $derivative) { 182 if ($type=='Autosize'){ 183 184 $url = $derivative->get_url(); 185 if (isset($added[$url])) 186 continue; 187 $added[$url] = 1; 188 $show_original &= !($derivative->same_as_source()); 189 $unique_derivatives[$type]= $derivative; 190 } 191 192 } 193 194 global $page, $template; 195 196 if ($show_original) 197 { 198 $template->assign( 'U_ORIGINAL', $element_info['element_url'] ); 199 } 200 201 $template->append('current', array( 202 'selected_derivative' => $selected_derivative, 203 'unique_derivatives' => $unique_derivatives, 204 ), true); 205 $file =AUTOSIZE_PATH_ABS.'template/picture_content.tpl' ; 206 $template->set_filenames( 207 array('autosize_content'=> $file) 208 ); 209 210 $template->assign( array( 211 'ALT_IMG' => $element_info['file'], 212 'COOKIE_PATH' => cookie_path(), 213 ) 214 ); 215 return $template->parse( 'autosize_content', false); 216 } 158 217 159 218 //=============================================================== … … 174 233 $autosize_parametres = cl_autosize_Get_Options(); 175 234 include (AUTOSIZE_PATH."include/affiche.php"); 176 177 if (PHPWG_VERSION < 2.2 ) 178 $file =AUTOSIZE_PATH_ABS.'template/picture_2_1.tpl' ; 179 else 180 $file =AUTOSIZE_PATH_ABS.'template/picture_2_2.tpl' ; 181 182 183 184 $template->set_filenames(array('autosize_content_header'=> $file )); 185 $template->concat('autosize_content', $template->parse('autosize_content_header', true)); 186 235 $file =AUTOSIZE_PATH_ABS.'template/picture_1.tpl' ; 236 $template->set_filenames(array('autosize_content_header'=> $file )); 237 $template->concat('autosize_content', $template->parse('autosize_content_header', true)); 187 238 $template->set_filenames(array('autosize_init_header'=> $file )); 188 239 $theme=$user['theme']; 240 $deriv_type = pwg_get_session_var('picture_deriv', IMG_LARGE); 189 241 if($autosize_parametres->check_icon_v == 'on'){ 190 242 $template->assign('cl_autosize_button', 191 243 array( 'cl_autosize_info' => 'cl_autosize_info' , 192 'cl_autosize_info_1' => 'cl_autosize_info_' ,244 'cl_autosize_info_1' => 'cl_autosize_info_' , 193 245 'cl_autosize_info_2' => 'cl_autosize_info_2' , 194 246 'URL' => $_SERVER['REQUEST_URI'] , 195 247 'ICON2' => AUTOSIZE_PATH . 'icons/button-maximize.png', 196 'ICON' => AUTOSIZE_PATH . 'icons/button-minimize.png' 248 'ICON' => AUTOSIZE_PATH . 'icons/button-minimize.png', 249 'ICON1' => AUTOSIZE_PATH . 'icons/button-no.png' 197 250 ) 198 251 … … 202 255 } 203 256 $template->set_filenames( 204 array('autosize_content'=> $AUTOSIZE_PATH.'template/autosize.tpl') 257 array('autosize_content'=> $AUTOSIZE_PATH.'template/autosize.tpl', 258 'theme' => $theme ) 205 259 ); 206 260 $template->concat('autosize_content', $template->parse('autosize_content_header', true)); … … 216 270 217 271 $template->parse('mes_script'); 218 } 219 220 272 } 221 273 222 274 return $template->parse( 'autosize_content', false); … … 318 370 $def_para['query'] = 'Qt' ; 319 371 $def_para['type'] = 'Ty' ; 320 $def_para['webmaster_height'] = '100%' ; 321 $def_para['webmaster_width'] = '100%' ; 322 $def_para['admin_height'] = '100%' ; 323 $def_para['admin_width'] = '100%' ; 324 $def_para['generic_height'] = '100%' ; 325 $def_para['generic_width'] = '100%' ; 326 327 $def_para['guest_height'] = '100%' ; 328 $def_para['guest_width'] = '100%' ; 329 330 $def_para['normal_height'] = '100%' ; 331 $def_para['normal_width'] = '100%' ; 372 373 $def_para['webmaster_type'] = 'Autosize' ; 374 $def_para['admin_type'] = 'Autosize' ; 375 $def_para['generic_type'] = 'Autosize' ; 376 $def_para['guest_type'] = 'Autosize' ; 377 $def_para['normal_type'] = 'Autosize' ; 378 332 379 333 380 … … 344 391 $def_para['check_desc_v'] = "off" ; 345 392 $def_para['check_icon_v'] = "off" ; 346 $def_para['check_auto_w'] = "off" ;393 347 394 $def_para['webmaster_enabled'] = "off" ; 348 395 $def_para['admin_enabled'] = "off" ; … … 403 450 //============================================================================= 404 451 $my_para=$autosize_parametres; 405 406 407 452 if (empty($my_para)) 408 453 $my_para = (object) ''; … … 411 456 $my_para->type=(isset($_POST['type']))? $_POST['type']: ((isset($my_para->type)) ? $my_para->type: 'Ty') ; 412 457 413 $my_para->webmaster_height =(isset($_POST['webmaster_height'])) ? $_POST['webmaster_height'] : ((isset($my_para->webmaster_height )) ? $my_para->webmaster_height : '100%' ) ; 414 $my_para->webmaster_width=(isset($_POST['webmaster_width']))? $_POST['webmaster_width']: ((isset($my_para->webmaster_width)) ? $my_para->webmaster_width: '100%') ; 415 416 $my_para->admin_height =(isset($_POST['admin_height'])) ? $_POST['admin_height'] : ((isset($my_para->admin_height )) ? $my_para->admin_height : '100%' ) ; 417 $my_para->admin_width=(isset($_POST['admin_width']))? $_POST['admin_width']: ((isset($my_para->admin_width)) ? $my_para->admin_width: '100%') ; 418 419 $my_para->generic_height =(isset($_POST['generic_height'])) ? $_POST['generic_height'] : ((isset($my_para->generic_height )) ? $my_para->generic_height : '100%' ) ; 420 $my_para->generic_width=(isset($_POST['generic_width']))? $_POST['generic_width']: ((isset($my_para->generic_width)) ? $my_para->generic_width: '100%') ; 421 422 $my_para->guest_height =(isset($_POST['guest_height'])) ? $_POST['guest_height'] : ((isset($my_para->guest_height )) ? $my_para->guest_height : '100%' ) ; 423 $my_para->guest_width=(isset($_POST['guest_width']))? $_POST['guest_width']: ((isset($my_para->guest_width)) ? $my_para->guest_width: '100%') ; 424 425 $my_para->normal_height =(isset($_POST['normal_height'])) ? $_POST['normal_height'] : ((isset($my_para->normal_height )) ? $my_para->normal_height : '100%' ) ; 426 $my_para->normal_width=(isset($_POST['normal_width']))? $_POST['normal_width']: ((isset($my_para->normal_width)) ? $my_para->normal_width: '100%') ; 458 $my_para->webmaster_type =(isset($_POST['webmaster_type'])) ? $_POST['webmaster_type'] : ((isset($my_para->webmaster_type )) ? $my_para->webmaster_type : 'Autosize' ) ; 459 460 $my_para->admin_type =(isset($_POST['admin_type'])) ? $_POST['admin_type'] : ((isset($my_para->admin_type )) ? $my_para->admin_type : 'Autosize' ) ; 461 462 $my_para->generic_type =(isset($_POST['generic_type'])) ? $_POST['generic_type'] : ((isset($my_para->generic_type )) ? $my_para->generic_type : 'Autosize' ) ; 463 464 465 $my_para->guest_type =(isset($_POST['guest_type'])) ? $_POST['guest_type'] : ((isset($my_para->guest_type )) ? $my_para->guest_type : 'Autosize' ) ; 466 467 468 $my_para->normal_type =(isset($_POST['normal_type'])) ? $_POST['normal_type'] : ((isset($my_para->normal_type )) ? $my_para->normal_type : 'Autosize' ) ; 469 427 470 428 471 … … 442 485 $my_para->check_desc_v = isset($_POST['check_desc_v']) ? $_POST['check_desc_v'] : "off" ; 443 486 $my_para->check_icon_v = isset($_POST['check_icon_v']) ? $_POST['check_icon_v'] : "off" ; 444 $my_para->check_auto_w = isset($_POST['check_auto_w']) ? $_POST['check_auto_w'] : "off" ;487 445 488 446 489 $my_para->webmaster_enabled = isset($_POST['webmaster_enabled']) ? $_POST['webmaster_enabled'] : "off" ; … … 453 496 $my_para->check_desc_v = isset($_POST['check_desc_v']) ? $_POST['check_desc_v'] : ( ( isset($my_para->check_desc_v) ) ? $my_para->check_desc_v : 'off') ; 454 497 $my_para->check_icon_v = isset($_POST['check_icon_v']) ? $_POST['check_icon_v'] : ( ( isset($my_para->check_icon_v) ) ? $my_para->check_icon_v : 'off') ; 455 $my_para->check_auto_w = isset($_POST['check_auto_w']) ? $_POST['check_auto_w'] : ( ( isset($my_para->check_auto_w) ) ? $my_para->check_auto_w : 'off') ; 498 456 499 457 500 -
extensions/Autosize/css/autosize.css
r16624 r16931 3 3 opacity: 100; 4 4 filter: alpha(opacity:100); 5 5 6 6 } 7 7 body{ … … 30 30 /**/ 31 31 #theImageAndInfos, #theImageAndTitle { 32 /* background-color: #FFFF00;*/ 32 /* background-color: #FF0000; */ 33 33 34 } 34 #content {/* 35 border: 5px solid #00FF00; 36 */ 35 #content { 36 /* 37 border: 5px solid #00FF00; 38 padding:10px; 39 margin:15px 40 */ 37 41 } 38 #theImage { 39 /* 40 border: 5px solid #f0FFf0; 41 padding: 10px; 42 margin: 10px; 43 background-color: #00FF00; 44 */ 45 } 42 #theImage { 43 /* padding: 10px; margin: 10px; 44 border: 5px solid #0000F0; 45 background-color: #0000FF; 46 background-image: url('../images/quadrille_100.gif'); 47 */ } 48 49 50 46 51 #theMainImage { 47 52 /* … … 58 63 padding: 20px; 59 64 60 background-color: #FF0000; */ 65 background-color: #FF0000; */ 66 } 67 #thePicturePage{ 68 /* background-color: #FF0000; 69 border: 5px solid #FFfF00;*/ 61 70 } 62 71 63 #theImageAndTitle { z-index: 4; } 72 -
extensions/Autosize/include/affiche.php
r16124 r16931 12 12 $DEBUG_autosize = isset($_GET['cl_debug_conflit']) ? $_GET['cl_debug_conflit'] : $DEBUG_autosize ; 13 13 $DEBUG_autosize = isset($conf['cl_debug_conflit']) ? $conf['cl_debug_conflit'] : $DEBUG_autosize ; 14 //================================================================================================= 14 //=========================================================================== 15 $cookies="' x '"; 15 16 16 $img_width=isset($picture['current']['width'])?$picture['current']['width']:"480"; 17 $img_height=isset($picture['current']['height'])?$picture['current']['height']:"320"; 18 $img_scaled_width=isset($picture['current']['scaled_width'])?$picture['current']['scaled_width']:"480"; 19 $img_scaled_height=isset($picture['current']['scaled_height'])?$picture['current']['scaled_height']:"320"; 17 $current = $template->get_template_vars('current'); 18 if (isset($_COOKIE['picture_deriv'])) 19 { 20 if (isset($_COOKIE['img_w'])) 21 $cookies = '"'.$_COOKIE['img_w']." x ". $_COOKIE['img_h'] .'"'; 20 22 21 $src_img_h=isset($_POST['src_img_h'])?$_POST['src_img_h']: $img_height ; 22 $src_img_w= isset($_POST['src_img_w'])?$_POST['src_img_w']: $img_width ; 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 31 if (isset($current)){ 32 $derivative=$current['selected_derivative'] ; 33 $imgScaledWH=$derivative->src_image->get_size(); 34 $imgSizeWH = $derivative->get_size(); 35 $img_type = $derivative->get_type(); 36 $img_url = $derivative->get_url(); 37 $img_all= $derivative->get_all($derivative->src_image); 38 $scaled_size=$derivative->get_size_hr(); //792 x 441 39 $scaled_size=$derivative->get_scaled_size_htm(); // width="792" height="441" 40 //================= taille mis a l'échelle 41 $scaled_size=$derivative->get_scaled_size(100,100); // array([0]=>100,[1]=>55) 42 $src= $derivative->src_image ; 43 44 } 45 46 $defined_types = array_keys(ImageStdParams::get_defined_type_map()); 47 48 49 50 $img_width=isset($imgScaledWH)?$imgSizeWH[0]:"480"; 51 $img_height=isset($imgScaledWH)?$imgSizeWH[1]:"320"; 52 53 $img_scaled_width=isset($imgScaledWH)?$imgScaledWH[0]:"480"; 54 $img_scaled_height=isset($imgScaledWH)?$imgScaledWH[1]:"320"; 55 56 57 58 $src_img_h=isset($_POST['src_img_h'])?$_POST['src_img_h']: $img_height ; 59 $src_img_w= isset($_POST['src_img_w'])?$_POST['src_img_w']: $img_width ; 60 23 61 $window_height= isset($_POST['window_height'])?$_POST['window_height']: $img_scaled_height ; 24 62 $window_width= isset($_POST['window_width'])?$_POST['window_width']: $img_scaled_width ; … … 41 79 ) 42 80 ); 43 44 if (!isset($conf['prefix_thumbnail'])) $conf['prefix_thumbnail']="TN_"; 81 if (!isset($conf['prefix_thumbnail'])) $conf['prefix_thumbnail']="TN_"; 82 83 84 //====================================================== 85 86 $options['Autosize'] = ''.l10n('Autosize').''; 87 foreach ($defined_types as $type_size){ 88 $value = $type_size; 89 $options[$value] = $type_size; 90 } 91 //====================================================== 92 45 93 $template->assign( 46 array( 94 array( 95 'ratio' =>$img_scaled_width/$img_scaled_height , 96 'cookies' => $cookies , 97 'deriv_type' =>$deriv_type , 98 'webmaster_type' => array( 99 'OPTIONS' => $options, 100 'SELECTED' => $autosize_parametres->webmaster_type 101 ), 102 'admin_type' => array( 103 'OPTIONS' => $options, 104 'SELECTED' => $autosize_parametres->admin_type 105 ), 106 'generic_type' => array( 107 'OPTIONS' => $options, 108 'SELECTED' => $autosize_parametres->generic_type 109 ), 110 'guest_type' => array( 111 'OPTIONS' => $options, 112 'SELECTED' => $autosize_parametres->guest_type 113 ), 114 'normal_type' => array( 115 'OPTIONS' => $options, 116 'SELECTED' => $autosize_parametres->normal_type 117 ), 47 118 'DEBUG_autosize' => $DEBUG_autosize , 48 119 'cl_visible' => $cl_visible, … … 56 127 'theme' => $theme, 57 128 'SCALED_WIDTH' => $img_scaled_width, 58 'SCALED_HEIGHT' => $img_scaled_height, 129 'SCALED_HEIGHT' => $img_scaled_height, 130 59 131 'IMG_WIDTH' => $img_width, 60 132 'IMG_HEIGHT' => $img_height, … … 68 140 'ECHELLE_MAX' => $autosize_parametres->echelle_max, 69 141 70 'check_auto_w' => ($autosize_parametres->check_auto_w == 'on') ? 'checked="checked"' : '' ,71 'check_icon_v' => ($autosize_parametres->check_icon_v == 'on') ? 'checked="checked"' : '' ,142 143 'check_icon_v' => ($autosize_parametres->check_icon_v == 'on') ? 'checked="checked"' : '' , 72 144 'check_desc_v' => ($autosize_parametres->check_desc_v == 'on') ? 'checked="checked"' : '' , 73 145 74 'webmaster_width' => $autosize_parametres->webmaster_width, 75 'webmaster_height' => $autosize_parametres->webmaster_height, 146 76 147 'webmaster_enabled' => ($autosize_parametres->webmaster_enabled == 'on') ? 'checked="checked"' : '' , 77 78 'admin_width' => $autosize_parametres->admin_width,79 'admin_height' => $autosize_parametres->admin_height,80 148 'admin_enabled' => ($autosize_parametres->admin_enabled == 'on') ? 'checked="checked"' : '' , 81 82 'generic_width' => $autosize_parametres->generic_width,83 'generic_height' => $autosize_parametres->generic_height,84 149 'generic_enabled' => ($autosize_parametres->generic_enabled == 'on') ? 'checked="checked"' : '' , 85 86 'guest_width' => $autosize_parametres->guest_width, 87 'guest_height' => $autosize_parametres->guest_height, 88 'guest_enabled' => ($autosize_parametres->guest_enabled == 'on') ? 'checked="checked"' : '' , 89 90 'normal_width' => $autosize_parametres->normal_width, 91 'normal_height' => $autosize_parametres->normal_height, 150 'guest_enabled' => ($autosize_parametres->guest_enabled == 'on') ? 'checked="checked"' : '' , 92 151 'normal_enabled' => ($autosize_parametres->normal_enabled == 'on') ? 'checked="checked"' : '' , 93 152 -
extensions/Autosize/js/Affiche_script.js
r16638 r16931 3 3 // corriger gmaps_pip.class.inc.php ajouter ligne 90 if ( !isset($_GET['slideshow'])) 4 4 //============================================================== 5 (function (jQuery) { 6 jQuery(document).ready(function () { 7 //=================== 8 // VARIABLES 9 //=================== 10 var theMainImage_obj = "#theMainImage"; 11 12 type_src = "div"; 13 old_window = { width: 0, height: 0 }; 14 List_autosize = new Array(); 5 jQuery(document).ready(function (jQuery) { 6 //============================================================= 7 // REPONSE ACTION 8 //============================================================= 9 jQuery("#reset").click(function () { 10 location.reload(); 11 }); 12 13 14 //=========================================================== 15 // REPONSE TRIGGER 16 //=========================================================== 17 jQuery('#pamoorama').live('ON', function (e) { 18 jQuery(jQuery('.debug').get(1)).trigger('ON'); 19 if (typeof Bandeau_bas == "undefined" || Bandeau_bas.width == 0) { 20 Bandeau_bas = infos_Description_f("#theImage"); 21 Bandeau = Bandeau_bas.top; 22 } 23 }); 24 //============================================================= 25 jQuery('#ret_autosize').live('ON', function (e) { 26 if (nu_img == "") nu_img = 8; 27 jQuery(jQuery('.debug').get(nu_img)).trigger('ON'); 28 29 }); 30 31 //========================================================== 32 jQuery("map area").mouseover(function (e) { 33 hok = this; 34 35 }); 36 37 //================================== 38 // jQuery("#llgbo").trigger("ON"); 39 //================================== 40 jQuery(llgbo_id).live('ON', function (e) { 41 n_id = this; 42 infos_llgbo = jQuery(llgbo_id).infos(); 43 if (infos_llgbo.visible == false) return; 44 45 marges_llgbo = 0; 46 if (infos_llgbo.height > 0) { 47 infos_llgboframe1 = jQuery(llgbo_id + " div:last").infos(); 48 infos_llgboframe31 = jQuery(llgbo_id + " div:first").infos(); 49 //============================================= 50 ll2 = infos_llgboframe1.width; // llgboframe1 51 ll1 = infos_llgboframe31.general.width; // llgboframe31 52 options.marges_llgbo = (ll1 - ll2); 53 infos_llgboh2 = jQuery("#llgboh2").infos(); 54 } 55 }); 56 //============================== 57 // jQuery("#mapPicture").trigger("ON"); 58 //============================== 59 jQuery("#mapPicture").live('ON', function (e) { 60 p2 = jQuery("#infoSwitcher").infos(); 61 }); 62 //============================== 63 // jQuery("#map").trigger("ON"); 64 //============================== 65 jQuery("#map").live('ON', function (e) { 66 67 }); 68 69 //=================================== 70 // jQuery("#theImage").trigger("ON"); 71 //=================================== 72 jQuery("#theImage").live('ON', function (e) { 73 target = e.target.id; 74 75 id = this.id; 76 theImage_init("#theImage"); 77 }); 78 79 /*********************** 80 * 81 **********************/ 82 jQuery("#theMainImage").error(function (e) { 83 alert(this.src + ' Image does not exist !!'); 84 }); 85 86 jQuery("#theMainImage,.preload, .next1 , ").load(function (e) { 87 if (init_img(this)) 88 setTimeout(function () { Autosize_resize(true) }, 100); 15 89 nu_img = 0; 16 tempo = 0; 17 //==================================================== 18 19 var infos_theImageAndInfos = jQuery("#theImageAndInfos").infos(); // Cadre general 20 var infos_theImage = jQuery("#theImage").infos(); // Container 21 var infos_theMainImage = jQuery(theMainImage_obj).infos(); // Image 22 var infos_imageInfos = jQuery("#imageInfos").infos(); // Informations 23 24 25 var infos_the_page = jQuery("#the_page").infos(); 26 var infos_content = jQuery("#content").infos(); 27 var infos_titrePage = jQuery("#titrePage").infos(); 28 var infos_imageInfoBar = jQuery("#imageInfoBar").infos(); 29 var infos_theHeader = jQuery("#theHeader").infos(); 30 var infos_imageToolBar = jQuery("#imageToolBar").infos(); 31 var infos_body = jQuery("body").infos(); 32 var infos_llgbo = jQuery("#llgbo").infos(); 33 var infos_llgboh2 = jQuery("#llgboh2").infos(); 34 if (typeof (options) == "undefined") { 35 options = { imageAutosize: false } 36 } 37 38 // jQuery(':Autosize'); 39 old_window = { width: 0, height: 0 }; 40 41 if (typeof (options) == "undefined") { 42 options = { imageAutosize: false } 43 } 44 45 var defaults = { 46 id_map: 'autosize', 47 imageAutosizeMargin: 0, 48 imageAutosize: false 49 }; 50 options = jQuery.extend(defaults, options); 51 52 //============================================================= 53 // REPONSE ACTION 54 //============================================================= 55 jQuery("#reset").click(function () { 56 location.reload(); 57 }); 58 59 //=========================================================== 60 // REPONSE TRIGGER 61 //=========================================================== 62 jQuery('#pamoorama').live('ON', function (e) { 63 jQuery(jQuery('.debug').get(1)).trigger('ON'); 64 if (typeof Bandeau_bas == "undefined" || Bandeau_bas.width == 0) { 65 Bandeau_bas = infos_Description_f("#theImage"); 66 Bandeau = Bandeau_bas.top; 67 } 68 }); 69 //============================================================= 70 jQuery('#ret_autosize').live('ON', function (e) { 71 if (nu_img == "") nu_img = 8; 72 jQuery(jQuery('.debug').get(nu_img)).trigger('ON'); 73 74 }); 75 76 //================================== 77 // jQuery("#llgbo").trigger("ON"); 78 //================================== 79 jQuery("#llgbo").live('ON', function (e) { 80 infos_llgbo = jQuery("#llgbo").infos(); 81 //llgboframe 82 marges_llgbo = 0; 83 84 if (infos_llgbo.height > 0) { 85 ll2 = jQuery("#llgbo div:last").infos(); 86 ll1 = jQuery("#llgbo div:first").infos(); 87 ll2 = ""; 88 jQuery("#llgbo div").each(function (i) { 89 if (this.id == "") return; 90 var llgbo_frame = document.getElementById(this.id); 91 this.removeAttribute("width"); 92 this.removeAttribute("height"); 93 ll2 = this; 94 }); 95 96 ll2 = jQuery(ll2).infos(); 97 ll1 = ll1.width; 98 ll2 = ll2.width - ll2.borderwidth.left - ll2.borderwidth.right; 99 marges_llgbo = (ll1 - ll2); 100 infos_llgbo.borderwidth.left = parseInt(marges_llgbo / 2); 101 infos_llgbo.borderwidth.right = parseInt(marges_llgbo / 2); 102 infos_llgbo.borderwidth.top = parseInt(marges_llgbo / 2); 103 infos_llgbo.borderwidth.bottom = parseInt(marges_llgbo / 2); 104 infos_llgboh2 = jQuery("#llgboh2").infos(); 105 } 106 }); 107 //============================== 108 // jQuery("#mapPicture").trigger("ON"); 109 //============================== 110 jQuery("#mapPicture").live('ON', function (e) { 111 p2 = jQuery("#infoSwitcher").infos(); 112 }); 113 //============================== 114 // jQuery("#map").trigger("ON"); 115 //============================== 116 jQuery("#map").live('ON', function (e) { 117 118 }); 119 120 //=================================== 121 // jQuery("#theImage").trigger("ON"); 122 //=================================== 123 jQuery("#theImage").live('ON', function (e) { 124 theImage_init("#theImage"); 125 }); 126 127 /*********************** 128 * 129 **********************/ 130 jQuery("#theMainImage").error(function (e) { 131 alert(this.src + ' Image does not exist !!'); 132 }); 133 134 jQuery("#theMainImage,.preload, .next1 , ").load(function (e) { 135 theImg = this; 136 name_src = theImg.src; 137 img_init.width = jQuery(this).width(); 138 img_init.height = jQuery(this).height(); 139 if (theImg.naturalWidth) 140 img_init.width = theImg.naturalWidth; 141 if (theImg.naturalHeight) 142 img_init.height = theImg.naturalHeight; 143 img_init.rapport = theImg.naturalWidth / theImg.naturalHeight; 144 nu_img = 0; 145 theMainImage_obj = "#theMainImage"; 146 Autosize_resize(true); 147 }); 148 149 //================================================================= 150 jQuery(document).live('gallyInterfaceReady', function (e) { 151 i = jQuery(this).text(); 152 jQuery(this).trigger('ON'); 153 } 90 }); 91 92 //================================================================= 93 jQuery(document).live('gallyInterfaceReady', function (e) { 94 i = jQuery(this).text(); 95 jQuery(this).trigger('ON'); 96 } 154 97 155 98 ); 156 157 158 159 160 161 162 163 164 165 166 167 168 99 // jQuery("#theImage").trigger("OK"); 100 jQuery("#theImage").live('Start_right', function (e) { 101 if (typeof Zone_image == "undefined") return 102 if (nu_img == "") nu_img = 7; 103 jQuery(jQuery('.debug').get(nu_img)).trigger('ON'); 104 test_w = window.myPamoorama.autoSlideFx.to; 105 test_w = window.myPamoorama.autoScrollFx.to; 106 nf = jQuery("#pamoorama_thumb").height(); 107 jQuery("#pamoorama_thumb img").width(200); 108 jQuery("#pamoorama_thumb img").height(nf); 109 // 200=window.myPamoorama.imageWidth 110 // frame = Zone_image.container.width 111 if (Zone_image.container) 169 112 nw = (200 * Zone_image.container.width) / window.myPamoorama.imageWidth; 170 jQuery("#pamoorama_frame").width(nw); 171 172 173 174 }); 175 176 jQuery("#theImage").live('Start_left', function (e) { 177 if (typeof Zone_image == "undefined") return 178 if (nu_img == "") nu_img = 7; 179 jQuery(jQuery('.debug').get(nu_img)).trigger('ON'); 180 test_w = window.myPamoorama.autoSlideFx.to; 181 test_w = window.myPamoorama.autoScrollFx.to; 182 nf = jQuery("#pamoorama_thumb").height(); 183 jQuery("#pamoorama_thumb img").width(200); 184 jQuery("#pamoorama_thumb img").height(nf); 185 186 nw = (200 * Zone_image.container.width) / window.myPamoorama.imageWidth; 187 jQuery("#pamoorama_frame").width(nw); 188 189 }); 190 191 // Custom Event, ON to turn on a debug. 192 jQuery('.debug').live('ON', function (e) { 193 194 nu_img = jQuery(this).text(); 195 jQuery('.debug').trigger('OFF'); 196 jQuery(this).addClass('debugOn'); 197 198 }); 199 200 // On Click = debugs On 201 jQuery('.debug').live('click', function (e) { 202 i = jQuery(this).text(); 203 jQuery(this).trigger('ON'); 204 }); 205 206 // Custom Event, Turn off a debug 207 jQuery('.debug').live('OFF', function (e) { 208 jQuery(this).removeClass('debugOn'); 209 }); 210 211 // on Double Click, remove the debug from the DOM 212 jQuery('.debug').live('dblclick', function () { 213 jQuery(this).fadeOut(function () { jQuery(this).remove() }); 214 }); 215 216 // Add another debug to the DOM 217 jQuery('#adddebugs').click(function () { 218 i = jQuery('.debug').length; 219 jQuery('<div>' + i + '</div>') 113 else 114 nw = (200 * infos_content.width) / window.myPamoorama.imageWidth; 115 jQuery("#pamoorama_frame").width(nw); 116 117 118 119 }); 120 121 jQuery("#theImage").live('Start_left', function (e) { 122 if (typeof Zone_image == "undefined") return 123 if (nu_img == "") nu_img = 7; 124 jQuery(jQuery('.debug').get(nu_img)).trigger('ON'); 125 test_w = window.myPamoorama.autoSlideFx.to; 126 test_w = window.myPamoorama.autoScrollFx.to; 127 nf = jQuery("#pamoorama_thumb").height(); 128 jQuery("#pamoorama_thumb img").width(200); 129 jQuery("#pamoorama_thumb img").height(nf); 130 131 nw = (200 * Zone_image.container.width) / window.myPamoorama.imageWidth; 132 jQuery("#pamoorama_frame").width(nw); 133 134 }); 135 136 // Custom Event, ON to turn on a debug. 137 jQuery('.debug').live('ON', function (e) { 138 139 nu_img = jQuery(this).text(); 140 jQuery('.debug').trigger('OFF'); 141 jQuery(this).addClass('debugOn'); 142 143 }); 144 145 // On Click = debugs On 146 jQuery('.debug').live('click', function (e) { 147 i = jQuery(this).text(); 148 jQuery(this).trigger('ON'); 149 }); 150 151 // Custom Event, Turn off a debug 152 jQuery('.debug').live('OFF', function (e) { 153 jQuery(this).removeClass('debugOn'); 154 }); 155 156 // on Double Click, remove the debug from the DOM 157 jQuery('.debug').live('dblclick', function () { 158 jQuery(this).fadeOut(function () { jQuery(this).remove() }); 159 }); 160 161 // Add another debug to the DOM 162 jQuery('#adddebugs').click(function () { 163 i = jQuery('.debug').length; 164 jQuery('<div>' + i + '</div>') 220 165 .addClass('debug') 221 166 .appendTo('#debugsContainer'); 222 }); 223 224 225 226 //=========================================== 227 // jQuery("#theImageAndInfos").trigger("ON"); 228 //=========================================== 229 jQuery("#theImageAndInfos").live('ON', function (e) { 230 infos_theImageAndInfos = jQuery("#theImageAndInfos").infos(); 231 232 233 }); // fin click #theImageAndInfos ON 234 235 //========================================== 236 // 237 //========================================== 238 jQuery("#infoSwitcher, #menuSwitcher").click(function () { 239 jQuery("#llgbo").trigger("ON"); 240 jQuery("#theImage").css({ textAlign: "center" }); 241 nu_img = 0; 242 theImage_init("#theImage"); 243 Autosize_resize(true); 244 }); // fin click infoSwitcher 245 //================================== 246 // 247 //=================================== 248 jQuery('#derivativeCheckedAutosize').click(function () { 167 }); 168 169 170 /********************************* 171 * 172 ********************************/ 173 jQuery("#menuSwitcher,#infoSwitcher").click(function (e) { 174 175 setTimeout(function () { Autosize_resize(true) }, 10); 176 nu_img = 0; 177 }); 178 179 180 //=========================================== 181 // jQuery("#theImageAndInfos").trigger("ON"); 182 //=========================================== 183 jQuery("#theImageAndInfos").live('ON', function (e) { 184 infos_theImageAndInfos = jQuery("#theImageAndInfos").infos(); 185 // setTimeout(function () { Autosize_resize(true) }, 100); 186 nu_img = 0; 187 }); // fin click #theImageAndInfos ON 188 jQuery("#theImageAndInfos").resize(function (e) { 189 190 nu_img = 0; 191 }); 192 193 //================================== 194 // 195 //=================================== 196 jQuery('#derivativeCheckedAutosize').click(function () { 197 pathnames = jQuery(this).attr("href").split(":"); 198 try { 199 eval(pathnames[1]); 200 } catch (e) { 201 n = false; 202 } 203 }); // fin click derivativeCheckedAutosize 204 //==================================================== 205 jQuery("#derivativeSwitchBox a").click(function () { 206 var theImg = document.getElementById(theMainImage_Id.replace("#", "")); 207 if (theImg) { 249 208 pathnames = jQuery(this).attr("href").split(":"); 209 250 210 try { 251 211 eval(pathnames[1]); 212 n = true; 252 213 } catch (e) { 253 214 n = false; 254 215 } 255 }); // fin click derivativeCheckedAutosize 256 //==================================================== 257 jQuery("#derivativeSwitchBox a").click(function () { 258 var theImg = document.getElementById("theMainImage"); 259 if (theImg) { 260 pathnames = jQuery(this).attr("href").split(":"); 261 262 try { 263 eval(pathnames[1]); 264 n = true; 265 } catch (e) { 266 n = false; 267 } 268 n = false; 269 infos_theMainImage = jQuery(theMainImage_obj).infos(); 270 infos_theImage = jQuery("#theImage").infos(); 271 theImg.removeAttribute("width"); 272 theImg.removeAttribute("height"); 273 rapport = parseInt(img_init.width) / parseInt(img_init.height); 274 if (n == true) { 275 Autosize_resize(true); 276 } else { 277 var nw = "100% x 100%".split("x"); 278 if (jQuery(this).text().match(RegExp("x", "gi"))) { 279 nw = jQuery(this).text().split("(")[1].split(")")[0]; 280 nw = nw.split("x"); 281 jQuery("#theImage").css({ marginRight: "auto", marginLeft: "auto", textAlign: "center" }); 282 283 if (theImg.naturalWidth) 284 img_init.width = theImg.naturalWidth; 285 if (theImg.naturalHeight) 286 img_init.height = theImg.naturalHeight; 287 288 wx = parseInt(nw[0]); 289 wh = parseInt(wx / rapport); 290 //jQuery("#theImage").css("height", wh + "px"); 291 jQuery(theImg).width(wx); 292 jQuery(theImg).height(wh); 293 } 294 } 295 } 296 297 }); // fin click #derivativeSwitchBox a 298 299 //========================================================================= 300 Autosize_init = function (name, value) { 301 // default configuration properties 302 var defaults = { 303 id_map: 'autosize' 304 }; 305 options = jQuery.extend(defaults, options); 306 infos_theImageAndInfos = jQuery("#theImageAndInfos").infos(); // Cadre general 216 217 infos_theMainImage = jQuery(theMainImage_Id).infos(); 307 218 infos_theImage = jQuery("#theImage").infos(); 308 309 infos_theMainImage = jQuery(theMainImage_obj).infos(); // Cadre general 310 if (infos_theMainImage.nodeName) { 311 312 } 313 if (infos_theMainImage.width == 0) { 314 infos_theMainImage = jQuery("#theImage img").infos(); 315 if (infos_theMainImage.id == "") 316 jQuery("#theImage img").attr("id", "theMainImage"); 317 infos_theMainImage = jQuery(theMainImage_obj).infos(); 318 } 319 infos_imageInfos = jQuery("#imageInfos").infos(); // Cadre general 320 infos_the_page = jQuery("#the_page").infos(); 321 infos_content = jQuery("#content").infos(); 322 infos_titrePage = jQuery("#titrePage").infos(); 323 infos_imageInfoBar = jQuery("#imageInfoBar").infos(); 324 infos_theHeader = jQuery("#theHeader").infos(); 325 infos_imageToolBar = jQuery("#imageToolBar").infos(); 326 infos_imageHeaderBar = jQuery("#imageHeaderBar").infos(); 327 Zone_Affichage = jQuery("#theImage").infos(); 328 329 jQuery.cookie('path', cookie_path, { path: cookie_path }); 330 typeMap = jQuery.cookie('picture_map'); 331 typeSave = jQuery.cookie('picture_deriv'); 332 old_img = jQuery.cookie('img'); 333 old_img_h = jQuery.cookie('img_h'); 334 old_img_w = jQuery.cookie('img_w'); 335 old_window_height = jQuery.cookie('window_height'); 336 old_window_width = jQuery.cookie('window_width'); 337 //============================================================ 338 img_init = { height: img_height, width: img_width }; // taille initiale 339 img_defaut = { height: scaled_height, width: scaled_width }; 340 img_reelle = { height: img_height, width: img_width }; 341 img_finale = { height: 0, width: 0 }; 342 img_top = "0"; 343 rapport = -1; 344 marges_llgbo = 0; 345 //============================================================= 346 Type_Img = ""; 347 nopano = false; 348 rapport = parseInt(img_init.width) / parseInt(img_init.height); 349 old_window = { width: 0, height: 0 }; 350 } // Autosize_init 351 //=========================================================================== 352 Autosize_resize = function (force, parametres) { 353 if (typeof rapport == "undefined") return; 354 if (force && force == true) old_window.width = 0; 355 id_map = jQuery(theMainImage_obj).attr("usemap"); 356 if (typeof id_map == "undefined") id_map = jQuery("#theImage").attr("usemap"); 357 if (typeof id_map == "undefined") id_map = "Autosize"; 358 if (options.id_map) { 359 // id_map = options.id_map; 360 } 361 if (id_map) { 362 if (id_map.match(RegExp("#map", "gi")) || id_map.match(RegExp("original", "gi"))) { 363 return true; 364 } 365 } 366 367 if (options.imageAutosize) { 368 // Wait_Affichage(); 369 return true; //stripped 370 } 371 372 if (typeof cl_visible == "undefined") return true; 373 if (!cl_visible == true) { return true; } 374 var chk = eval(user_status + "_enabled"); 375 if (chk == "") { return true; } 376 //================================================================= 377 var winwidth = infos_body.width; 378 var winheight = infos_body.height; 379 if (Type_Img == "pamoorama") { 380 theMainImage_obj = "#pamoorama"; 381 Zone_image = Calcul_Image(infos_imageInfos.visible == false); 382 } else { 383 Zone_image = Calcul_Image(infos_imageInfos.visible == false); 384 } 385 //================================================================= 386 old_window = jQuery(window).infos(); 387 //========= Récupération des informations ============= 388 var Licence = jQuery(".licencetag"); 389 infos_Licence = jQuery(".licencetag").infos(); 390 //================================================================= 391 switch (Type_Img) { 392 case "map": 393 Set_Map(true); 394 break 395 case "panorama": 396 if (!theMainImage_obj) { 397 theMainImage_obj = "#theMainImage"; 398 if (theMainImage_obj.length > 0) 399 return; 400 theMainImage_obj = jQuery().Get_Img_Maxi("#Panorama img[alt]"); 401 402 if (theMainImage_obj.length > 0) 403 theMainImage_obj = theMainImage_obj[0]; 404 else 405 theMainImage_obj = jQuery().Get_Img_Maxi("#Panorama img[alt]"); 406 } 407 infos_theImage = jQuery(theMainImage_obj).infos(); 408 infos_the_page = jQuery("#the_page").infos(); 409 jQuery("#theImage").height(infos_theImage.height); 410 img_finale.height = infos_theImage.height; 411 break 412 case "img": 413 414 if (!theMainImage_obj) return true; 415 if (theme.match(RegExp("luciano", "g"))) { 416 theMainImage_obj = "#the_page #The_MainImage"; 417 } 418 419 infos_the_page = jQuery("#the_page").infos(); 420 421 422 break 423 case "img_autre": 424 if (!theMainImage_obj) { 425 if (DEBUG_autosize == "true") alert("The_MainImage=null"); 426 return true; 427 428 } 429 infos_theImage = jQuery(theMainImage_obj).infos(); 430 infos_the_page = jQuery("#the_page").infos(); 431 432 433 break 434 case "embed": 435 // 436 if (infos_img.width == 0) 437 infos_img = jQuery("#thePicturePage").infos(); 438 if (infos_img.width == 0) 439 infos_img = jQuery("#the_page").infos(); 440 infos_theImage = infos_img; 441 infos_the_page = jQuery("#the_page").infos(); 442 Bandeau_bas.height = Bandeau_bas.top; 443 444 iph1 = jQuery("#theImage div").infos(); 445 if ((winheight - iph1.bottom) > 0) 446 Bandeau_bas.height = (winheight - iph1.bottom) + 50; 447 else 448 Bandeau_bas.height = 50; 449 450 451 if (rapport < 0) { 452 img_height = infos_img.height; 453 img_width = infos_img.width; 454 img_reelle.height = img_height; 455 img_reelle.width = img_width; 456 } 457 458 break 459 case "charlie": 460 img_reelle = { height: img_height, width: img_width }; 461 infos_img = jQuery(theMainImage_obj).infos(); ; 462 infos_the_page = jQuery("#the_page").infos(); 463 if (rapport < 0) { 464 img_height = parseInt(infos_img.height); 465 img_width = parseInt(infos_img.width); 466 img_reelle.height = parseInt(infos_img.height); 467 img_reelle.width = parseInt(infos_img.width); 468 } 469 break 470 471 472 case "pamoorama": 473 img_reelle = { height: img_height, width: img_width }; 474 //========================================================= 475 img_reelle.height = img_height; 476 img_reelle.width = Zone_Affichage.width; 477 if (typeof myPamoorama != "undefined") theMainImage_obj = myPamoorama.image; 478 infos_theImage = jQuery("#pamoorama").infos(); 479 infos_theImage.height = infos_theImage.height; 480 infos_the_page = jQuery("#the_page").infos(); 481 break 482 } 483 //================= Vérification Taille image minimun autorisée ======== 484 MinWidth = jQuery(theMainImage_obj).css("minWidth"); 485 if (MinWidth == "0px") 486 MinWidth = mini_width; 487 MinHeight = jQuery(theMainImage_obj).css("minHeight"); 488 if (MinHeight == "0px") 489 MinHeight = mini_height; 490 491 MaxWidth = jQuery(theMainImage_obj).css("maxWidth"); 492 if (MaxWidth == "0px") 493 MaxWidth = winwidth; 494 MaxHeight = jQuery(theMainImage_obj).css("maxHeight"); 495 if (MaxHeight == "0px") 496 MaxHeight = mwinheight; 497 498 //=============== Vérification taille minimale autorizée ====================== 499 var miniWidth = jQuery(theMainImage_obj).Get_Val_int(MinWidth, mini_width); 500 var miniHeight = jQuery(theMainImage_obj).Get_Val_int(MinHeight, mini_height); 501 if (winwidth < mini_width2) mini_width2 = winwidth; 502 503 var miniWidth2 = jQuery(theMainImage_obj).Get_Val_int(MinWidth, mini_width2); 504 var miniHeight2 = jQuery(theMainImage_obj).Get_Val_int(MinHeight, mini_height2); 505 506 507 var maxWidth = jQuery(theMainImage_obj).Get_Val_int(MaxWidth, winwidth, "0"); 508 maxHeight = jQuery(theMainImage_obj).Get_Val_int(MaxHeight, winheight, "0"); 509 510 mini_width = parseInt(miniWidth); 511 mini_height = parseInt(miniHeight); 512 img_reelle.width = parseInt(img_reelle.width); 513 if (img_reelle.width < mini_width) 514 return true; 515 img_reelle.height = parseInt(img_reelle.height); 516 if (img_reelle.height < parseInt(mini_height)) 517 return true; 518 519 //=============== Zone d'affichage ============================ 520 Zone_Affichage.width = Zone_image.container.width; 521 Zone_Affichage.height = Zone_image.container.height; 522 523 var Licence = jQuery(".licencetag"); 524 infos_Licence = jQuery(".licencetag").infos(); 525 526 //==================================================== 527 if (options.imageAutosizeMargin > 0) Marge_Basse = options.imageAutosizeMargin; 528 else Marge_Basse = parseInt(marge_basse || 0); // hors bandeau 529 //========================================================================== 530 531 532 533 //================================================= 534 if (Zone_Affichage.height < mini_height2) 535 Zone_Affichage.height = mini_height2; 536 if (Zone_Affichage.width < mini_width2) 537 Zone_Affichage.width = mini_width2; 538 //================================================= 539 var height_user = eval(user_status + "_height"); 540 var width_user = eval(user_status + "_width"); 541 var reg1 = new RegExp("%", "g"); 542 //============================================================= 543 if (height_user.match(reg1)) 544 Image_height = img_reelle.height * parseInt(height_user) / 100; 219 theImg.removeAttribute("width"); 220 theImg.removeAttribute("height"); 221 222 var nw = "100% x 100%".split("x"); 223 if (jQuery(this).text().match(RegExp("x", "gi"))) { 224 nw = jQuery(this).text().split("(")[1].split(")")[0]; 225 nw = nw.split("x"); 226 init_img(theImg); 227 wx = parseInt(nw[0]); 228 wh = parseInt(wx / rapport); 229 //jQuery("#theImage").css("height", wh + "px"); 230 jQuery(theImg).width(wx); 231 jQuery(theImg).height(wh); 232 set_cl(useMap == "#Autosize"); 233 Set_llbgo(); 234 } 235 236 } 237 238 }); // fin click #derivativeSwitchBox a 239 240 jQuery("input").click(function () { 241 if (this.name.match(RegExp("_enabled", "gi"))) { 242 sel = "[name*=" + this.name + "]"; 243 obj = jQuery("tr" + sel); 244 245 if (this.checked) 246 obj.css({ backgroundColor: "green", color: "white" }); 545 247 else 546 Image_height = parseInt(height_user); 547 echelle_max = parseFloat(echelle_max, '3'); 548 var echelle = parseFloat(Image_height / img_reelle.height, 3); 549 550 if (echelle > echelle_max) { echelle = echelle_max; } 551 552 Image_height = parseInt(img_reelle.height * echelle); 553 Image_width = parseInt(img_reelle.width * echelle); 554 555 if (check_auto_w == 'checked="checked"') { 556 //==== largeur à atteindre === 557 var width_user = eval(user_status + "_width"); 558 // Largeur maximale en fonction du statut 559 if (width_user.match(reg1)) 560 // pourcentage 561 Image_width = Zone_image.container.width * parseInt(width_user) / 100; 562 else 563 Image_width = parseInt(width_user); 564 565 Image_height = parseInt(Image_width / rapport); 566 } else { 567 Image_width = parseInt(Image_height * rapport); 568 } 569 //==================================================== 570 // Zone_image.image.height = Image_height; 571 // Zone_image.image.width = Image_width; 572 //====================================================================== 573 set_cl(); 248 obj.css({ backgroundColor: "red", color: "white" }); 249 250 return; 251 } 252 253 254 255 return; 256 257 258 259 260 }); 261 262 //==================================== 263 Autosize_init = function (name, value) { 264 img_defaut = { height: options.scaled_height, width: options.scaled_width }; 265 img_reelle = { height: options.img_height, width: options.img_width }; 266 img_init = { height: options.img_height, width: options.img_width }; // taille initiale 267 268 img_finale = img_init; 269 rapport = parseInt(img_init.width) / parseInt(img_init.height); 270 useMap = infos_theMainImage.useMap; // #mapmedium 271 Type_Img = ""; 272 nopano = false; 273 274 useMap = cookies.pictureMap; // #mapxxx 275 typeSave = cookies.typeSave; //picturederiv xxx 276 277 278 old_img = cookies.imgSrc; 279 old_window_height = cookies.windowHeight || jQuery(window).height(); 280 old_window_width = cookies.windowWidth || jQuery(window).width(); 281 old_img_h = cookies.imgHeight; 282 old_img_w = cookies.imgWidth; 283 284 var theImg = document.getElementById(theMainImage_Id.replace("#", "")); 285 theImg.useMap = useMap; 286 287 288 } // Autosize_init 289 //=========================================================================== 290 Autosize_resize = function (force, parametres) { 291 theImage_init(); 292 293 if (Get_dimensions(force, parametres)) { 294 295 jQuery(theMainImage_Id).height(Zone_image.image.height); 296 jQuery(theMainImage_Id).width(Zone_image.image.width); 297 jQuery("#theImageAndInfos").css({ height: "auto" }); 298 jQuery("#theImage").css({ height: "auto" }); 299 // jQuery("#theImage").width(Zone_image.container.width); 300 // jQuery("#theImage").width("auto"); 574 301 Set_Pamoorama(); 575 jQuery("#theImage").width(Zone_image.container.width); 576 jQuery("#theImage").height(Zone_image.container.height); 577 jQuery(theMainImage_obj).height(Zone_image.image.height); 578 jQuery(theMainImage_obj).width(Zone_image.image.width); 579 580 return true; 581 582 //=============================================================== 583 jQuery("#theImage").width(Zone_Affichage.width); 584 jQuery("#theImage").height(Zone_Affichage.height); 585 jQuery(theMainImage_obj).removeAttr("width"); 586 jQuery(theMainImage_obj).css({ height: Image_height }); //image 587 588 //================================================================ 589 590 align_auto = "center"; 591 if (jQuery("#theImg").css("textAlign")) 592 align_auto = jQuery("#theImg").css("textAlign"); 593 594 595 var marges = 0; 596 597 if (typeof (infos_img) != "undefined") { 598 widthmin -= infos_img.borderwidth.left || 0; 599 widthmin -= infos_img.borderwidth.right || 0; 600 } 601 widthmin -= marges; 602 if (typeof Bandeau_t != "undefined") { 603 widthmin -= (Bandeau_t.borderwidth.left + Bandeau_t.borderwidth.left); 604 Image_width -= (Bandeau_t.borderwidth.left + Bandeau_t.borderwidth.left); 605 } else { 606 607 jQuery.autosize.resize(); 608 } 609 if (Image_width > widthmin) { 610 // Image_width largeur à atteindre 611 // Calcul du rapport d'agrandissement 612 var echelle_w = parseFloat((widthmin) / img_reelle.width, 3); 613 if (echelle_w > echelle_max) { echelle_w = echelle_max; } 614 Image_width = parseInt(img_reelle.width * echelle_w); 615 if (rapport > 0) 616 Image_height = parseInt(Image_width / rapport); 617 } 618 619 620 621 622 //=================================================== 623 624 img_finale.height = Image_height; 625 img_finale.width = Image_width; 626 if (theme.match(RegExp("stripped", "gi"))) { 627 img_finale.width -= (llgboframe.top * 2); 628 if (rapport > 0) img_finale.height = (img_finale.width / rapport); 629 else img_finale.height -= (llgboframe.top * 2); 630 631 } 632 zoom = echelle; 633 if (typeof (llgboframe) != "undefined" && llgboframe.height > 0) { 634 //=============LLGBO2 =========================== 635 t1 = llgboframe; 636 if (!theMainImage_obj.src) { 637 theMainImage_obj = jQuery("#llgbo").find("img").get(0) 638 if (!theMainImage_obj.src) { 639 theMainImage_obj = jQuery("#theImage").find("div").get(0) 640 } 641 } 642 if (theMainImage_obj.src) { 643 wingbo = img_finale.width; 644 heightgbo = img_finale.height; 645 if (Type_Img == "panorama") { 646 heightgbo = infos_theImage.height; 647 img_finale.height = infos_theImage.height; 648 } 649 650 img_finale.width -= marges_llgbo; 651 if (jQuery("#slideshow").infos().width > 0) { 652 img_finale.height -= (marges_llgbo * 1.5); 653 } else { 654 img_finale.height -= marges_llgbo 655 } 656 657 658 if (wingbo > winwidth) { 659 jQuery("#llgbo").width(winwidth); 660 jQuery("#llgbo").height(winheight); 661 jQuery("#llgbo").css("width", winwidth + "px"); 662 jQuery("#llgbo").css("height", winheight + "px"); 663 } 664 else { 665 jQuery("#llgbo").width(wingbo); 666 jQuery("#llgbo").height(heightgbo); 667 jQuery("#llgbo").css("width", wingbo + "px"); 668 jQuery("#llgbo").css("height", heightgbo + "px"); 669 } 670 671 a0 = jQuery("area[rel!=up][rel!=prev][rel!=next]"); 672 a1 = jQuery("area[rel=prev]"); 673 a2 = jQuery("area[rel=next]"); 674 a3 = jQuery("area[rel=up]"); 675 nb_zone = 3; 676 if (a1.length == 0) { 677 nb_zone -= 1; 678 } 679 if (a2.length == 0) { 680 nb_zone -= 1; 681 } 682 683 684 var Largeur_zone = (img_finale.width / nb_zone); 685 var Hauteur_zone = (img_finale.height); 686 var init_zone = 0; 687 688 if (a1.length > 0) { 689 coord = { x0: init_zone, y0: 0, x1: Largeur_zone, y1: Hauteur_zone }; 690 691 jQuery("area[rel=prev]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + coord.y1 + "'" }); 692 init_zone += Largeur_zone; 693 } 694 695 coord = { x0: init_zone, y0: 0, x1: init_zone + Largeur_zone, y1: img_finale.height }; 696 697 if (a0.length > 0) { 698 jQuery("area[rel=up]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + (coord.y1 / 2) + "'" }); 699 jQuery(a0).attr({ coords: "'" + coord.x0 + "," + (coord.y1 / 2) + "," + coord.x1 + "," + (coord.y1) + "'" }); 700 } else { 701 jQuery("area[rel=up]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + (coord.y1) + "'" }); 702 } 703 init_zone += Largeur_zone; 704 705 if (a2.length > 0) { 706 coord = { x0: init_zone, y0: 0, x1: init_zone + Largeur_zone, y1: img_finale.height }; 707 jQuery("area[rel=next]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + coord.y1 + "'" }); 708 } 709 // jQuery("#theImage").height(heightgbo + marges_llgbo / 2); 710 } 711 } 712 713 //================ Zone affichage ========================= 714 715 // jQuery("#theImage").css("top", "0px"); 716 jQuery("#standard").css("top", 0 + "px"); 717 jQuery("#comments").css("top", 0 + "px"); 718 //========== Image Remise à l'échelle ======================= 719 720 img_finale.height = parseInt(img_finale.height); 721 img_finale.width = parseInt(img_finale.width); 722 //========================================================================= 723 //=== cadre = theImage 724 if (theme.match(RegExp("simple", "gi"))) { 725 jQuery("#theImage").width(Zone_Affichage.width); //centrer simple black 726 jQuery("#theImage").css({ width: Zone_Affichage.width + "px", 727 marginLeft: "auto" 728 }); 729 730 } else if (theme.match(RegExp("sobre", "gi")) || theme.match(RegExp("hr_", "gi")) || theme.match(RegExp("Mont", "gi"))) { 731 jQuery("#theImage").css({ width: "auto", marginLeft: "auto" }); 732 } else if (theme.match(RegExp("saruka", "gi"))) { 733 734 jQuery("#theImage").css({ width: Zone_Affichage.width + "px" }); 735 } else if (theme.match(RegExp("elegant", "gi"))) { 736 737 // jQuery("#theImage").css("width", "auto"); 738 jQuery("#theImage").css({ height: Zone_Affichage.height + "px", width: "auto" }); //conteneur 739 740 } else { 741 jQuery("#theImage").css("width", "auto"); 742 743 } 744 // ; 745 746 if (Type_Img == "panorama" || Type_Img == "pamoorama") { 747 img_finale.height = infos_theImage.height; 748 Zone_Affichage.height = img_finale.height; 749 750 } 751 752 if (typeof (gmaps) != "undefined") { 753 Gmap_ = gmaps.maps[0]; 754 if (Gmap_.sizeMode == 'A') { 755 jQuery("#iGMapsIcon").css({ width: old_window.width * 0.8 + "px", height: old_window.height * 0.8 + "px" }); 756 757 } 758 } 759 //============= flv,mov,mpg ok 760 /* wmv nok 761 * avi nok 762 //=========================================== 763 */ 764 if (Type_Img == "charlie") { 765 t1 = jQuery("#charlie").infos(); 766 767 /**/ 768 769 pdf = 0; 770 jQuery("#charlie div").each(function (i) { 771 772 773 p1 = jQuery(this).infos(); 774 pdf += p1.padding.right + p1.padding.left; 775 }); 776 img_finale.width -= pdf; 777 778 jQuery("#charlie").css({ 779 width: img_finale.width + pdf + "px", 780 height: img_finale.height + "px", 781 marginLeft: "auto" 782 }); 783 784 785 if (MainImage.length > 0) { 786 img_finale.height = parseInt(img_finale.width / rapport); 787 img_finale.height -= 30; 788 img_finale.width = rapport * img_finale.height; 789 790 791 MainImage.width(img_finale.width); 792 MainImage.height(img_finale.height); 793 jQuery("#embedplayer").width(300); 794 jQuery("#embedplayer").height(15); 795 } else { 796 jQuery("#player").css("width", img_finale.width + "px"); 797 jQuery("#player").css("height", img_finale.height + "px"); 798 799 jQuery("#embedplayer").css("width", img_finale.width + "px"); 800 jQuery("#embedplayer").css("height", img_finale.height + "px"); 801 802 jQuery("embed").css({ width: img_finale.width + "px", 803 height: img_finale.height + "px" 804 }); 805 jQuery("object").css({ width: img_finale.width + "px", 806 height: img_finale.height + "px" 807 }); 808 jQuery("video").css({ width: img_finale.width + "px", 809 height: img_finale.height + "px" 810 }); 811 812 813 814 jQuery("video").height(img_finale.height); 815 jQuery("video").width(img_finale.width); 816 817 jQuery("object").width(img_finale.width); 818 jQuery("object").height(img_finale.height); 819 //jQuery("#theImage").height(img_finale.height + Bandeau_bas.height); //?? 820 821 jQuery(theMainImage_obj).height(img_finale.height); 822 jQuery("#theImage").css("height", "auto"); 823 } 824 825 826 } else if (Type_Img == "embed") { 827 828 if (MainImage.length > 0) { 829 img_finale.height = parseInt(img_finale.width / rapport); 830 img_finale.height -= 30; 831 img_finale.width = rapport * img_finale.height; 832 833 834 MainImage.width(img_finale.width); 835 MainImage.height(img_finale.height); 836 jQuery("#embedplayer").width(300); 837 jQuery("#embedplayer").height(15); 838 } else { 839 jQuery("#theImage").css("height", "auto"); 840 jQuery("embed").css("height", img_finale.height); 841 jQuery("object").css({ height: img_finale.height + "px" }); 842 843 jQuery("object").width(img_finale.width); 844 jQuery("object").height(img_finale.height); 845 } 846 847 } else if (Type_Img == "panorama") { 848 if (typeof asp_options != "undefined") 849 n = asp_options; 850 n1 = jQuery("#Panorama div").width(); 851 jQuery(".panorama-viewport").css("margin", "auto"); 852 n = infos_imageToolBar; 853 854 855 } else if (Type_Img == "pamoorama") { 856 Set_Pamoorama(); 857 858 859 860 861 } else if (theMainImage_obj != null && theMainImage_obj.src) { 862 //--- background ?? --- 863 jQuery(theMainImage_obj).height(img_finale.height); 864 jQuery(theMainImage_obj).width(img_finale.width); 865 jQuery(theMainImage_obj).css({ height: img_finale.height + "px ", 866 width: img_finale.width + "px " 867 }); 868 869 870 } else { 871 //===map ? luciano === 872 // jQuery(theMainImage_obj).css({ height: img_finale.height + "px ", width: img_finale.width + "px }); 873 // jQuery(theMainImage_obj).height(img_finale.height ); 874 // jQuery(theMainImage_obj).width(img_finale.width ); 875 // jQuery(theMainImage_obj).attr({ width: img_finale.width }); 876 h = img_finale.height; 877 h = Zone_Affichage.height - Zone_Affichage.borderwidth.top - Zone_Affichage.borderwidth.bottom; 878 h -= (infos_theImage.borderwidth.bottom + infos_theImage.borderwidth.top); 879 880 jQuery(theMainImage_obj).attr({ height: h - 3 }); //image 881 if (theme.match(RegExp("elegant", "gi"))) { 882 return true; 883 884 } 885 if (theme.match(RegExp("luciano", "g"))) { 886 imgl = 180; 887 l = Zone_Affichage.left; 888 889 jQuery(".imageNumber").css({ left: l + "px" 890 891 }); 892 jQuery("#theImage" + " #theImg IMG").css({ height: img_finale.height + "px ", 893 width: (img_finale.width - imgl) + "px ", marginTop: "0px" 894 }) 895 } 896 897 } 898 899 var theImg = document.getElementById("theMainImage"); 900 if (theImg) { 901 theImg.removeAttribute("width"); 902 theImg.removeAttribute("height"); 903 jQuery(theMainImage_obj).css("width", img_finale.width + "px"); 904 } 905 906 jQuery("#navThumbPrev").css({ overflow: "hidden" }); 907 jQuery("#navThumbNext").css({ overflow: "hidden" }); 908 n = typeof inittoolbar; 909 if (Type_Img == "map") { 910 jQuery("#navThumbNext").css({ display: 'none' }); 911 jQuery("#navThumbPrev").css({ display: 'none' }); 912 jQuery("#theImage").css({ marginTop: infos_imageToolBar.height + "px", marginLeft: "0px", 913 width: winwidth + "px", 914 height: winheight + "px" 915 }); 916 //mapPicture 917 } 918 try { 919 if (theme.match(RegExp("gally", "gi"))) { 920 if (typeof inittoolbar == "function") { 921 if (typeof (currentTab) == "undefined") inittoolbar(); 922 else initializeImageMode("resize"); 923 } else { 924 tp = gallyPP.getImageProp(); 925 if (typeof (GallyPP) == "function") 926 gallyPP = new GallyPP(); 927 928 iph = jQuery("#imageHeaderBar").infos(); 929 jQuery("#imageToolBar").css({ top: iph.bottom + "px", position: "absolute" }); 930 jQuery("#theImage").width(winwidth); 931 } 932 //=========================================================================== 933 if (jQuery("#navThumbPrev").length > 0) { 934 jQuery("#navThumbPrevContainer").css({ left: "0px" 935 }); 936 } 937 if (jQuery("#navThumbNext").length > 0) { 938 jQuery("#navThumbNextContainer").css({ left: "0px" 939 }); 940 } 941 //============================================================================= 942 if (!theme.match(RegExp("lapis", "gi"))) { 943 if (typeof initializeImageMode == "function") { 944 initializeImageMode("resize"); 945 } 946 947 } 948 949 } else if (theme.match(RegExp("simple", "g"))) { 950 951 jQuery("#imageToolBar").css({ position: "static" }); 952 953 infos_imageInfoBar = jQuery("#imageInfoBar").infos(); 954 if (infos_imageInfoBar.bottom < infos_img.bottom) { 955 // jQuery("#imageInfoBar").height(infos_img.bottom); 956 } 957 958 } else { 959 960 // jQuery("#imageToolBar").css("position", "static"); 961 } 962 } catch (e) { 963 964 } 965 zoom = img_finale.height / img_height; 966 h0 = jQuery("#content").height(); 967 if (h0 == null) { 968 h0 = winheight - Zone_Affichage.top; 969 } 970 h1 = (h0 - img_finale.height) / 2; 971 // jQuery("#theImage").css({ marginTop: h1 + "px" }); 972 973 zoom = parseInt(zoom * 100); 974 jQuery('#zoom ').val(zoom); 975 set_cl(); 976 977 978 // --- réglage de la hauteur de page en fonction du copyright----------- 979 if (typeof (pos_copyright) == "undefined") pos_copyright = jQuery("#copyright").infos(); 980 981 if (theme.match(RegExp("stripped", "gi"))) { 982 var TitleBox = jQuery("#imageTitleContainer"); 983 if (TitleBox.length != 0) TitleBox.css("width", img_finale.width + "px"); 984 } else { 985 986 } 987 988 989 /* 990 if (!theme.match(RegExp("luciano", "gi"))) { 991 jQuery("#linkNext").css({ height: "80px", width: "200px", overflow: "hidden" }); 992 jQuery("#linkPrev").css({ height: "80px", width: "200px", overflow: "hidden" }); 993 jQuery(".navThumb img").css({ height: "80px", width: "", overflow: "hidden" }); 994 } 995 */ 996 infos_frame = jQuery("#theImage").infos(); 997 if (theme.match(RegExp("stripped", "gi"))) { 998 /* 999 infos_theImageBox = jQuery("#theImageAndTitle").infos(); 1000 p1 = jQuery(".randomButtons").infos(); 1001 p2 = jQuery("#imageHeaderBar").infos(); 1002 p3 = infos_content.top; 1003 p1 = options.imageAutosizeTitle; 1004 1005 jQuery("#theImage").width("width", infos_theImageBox.width + "px"); 1006 //jQuery("#theImageAndTitle").css("position", "relative"); 1007 jQuery("#content").css({ position: "relative", top: "10px", marginTop: "0px", 1008 paddingTop: "0px", textAalign: "center", marginLeft: "auto" 1009 }); 1010 1011 jQuery("#theImageAndTitle").css({ position: "relative", top: "0px", marginTop: "0px", 1012 paddingTop: "0px", marginLeft: "auto" 1013 }); */ 1014 t1 = infos_theImageBox.top; 1015 l1 = infos_theImageBox.left; 1016 // infos_theImageBox = jQuery("#theImage").infos(); 1017 1018 } else { 1019 1020 t1 = infos_frame.top; 1021 l1 = infos_frame.left; 1022 infos_theImageBox = jQuery("#theImage").infos(); //theImage 1023 } 1024 infos_theImageBox.margin.margin = infos_frame.margin.margin; 1025 infos_theImageBox.top = t1; 1026 infos_theImageBox.left = l1; 1027 // infos_theImageBox.position = "absolute"; 1028 1029 Window_Affichage = infos_theImageBox; 1030 if (DEBUG_autosize == "_true") { 1031 // jQuery("#theImage").css("border", "solid green"); 1032 1033 jQuery("#Debug5").css({ background: "red", 1034 position: "absolute", 1035 border: "green solid 2px", 1036 textAlign: align_auto, 1037 margin: "auto", 1038 top: Window_Affichage.top + "px", 1039 left: Window_Affichage.left + "px", 1040 width: Window_Affichage.width + "px", 1041 height: Window_Affichage.height + "px" 1042 }); //red 1043 jQuery("#Debug4").css({ top: infos_frame.bottom - infos_description.height + "px" }); //green 1044 } 1045 1046 //Wait_Affichage(); 1047 1048 return true; 1049 //_____________________________________________________ 1050 }; // Autosize 1051 1052 1053 1054 /******************************************** 1055 * window unLOAD 1056 ********************************************/ 1057 jQuery(window).unload(function () { 1058 try { 1059 if (typeof theMainImage_obj != "undefined") { 1060 var theImg = document.getElementById("theMainImage"); 1061 jQuery.cookie('img', theImg.src, cookie_path); // créer un cookie avec une valeur 1062 theImg.useMap = theImg.useMap || "autosize"; 1063 1064 jQuery.cookie('picture_map', theImg.useMap, { path: cookie_path }); 1065 jQuery.cookie('img_h', jQuery(theMainImage_obj).height(), { path: cookie_path }); 1066 jQuery.cookie('img_w', jQuery(theMainImage_obj).width(), { path: cookie_path }); 1067 1068 if (typeof Window_Affichage != "undefined") { 1069 jQuery.cookie('window_height', Window_Affichage.height, { path: cookie_path }); 1070 jQuery.cookie('window_width', Window_Affichage.width, { path: cookie_path }); 1071 } 1072 } 1073 } catch (r) { 1074 1075 } 1076 1077 }); //unload 1078 1079 /******************************************** 1080 * window LOAD 1081 ********************************************/ 1082 jQuery(window).load(function () { 1083 href = location.href; 1084 var aff_ok = false; 1085 1086 DEBUG_autosize = (typeof DEBUG_autosize != "undefined") ? DEBUG_autosize : "false"; 1087 if (DEBUG_autosize == "true") { 1088 for (var i = 0; i < 10; i++) { 1089 jQuery('#adddebugs').click(); 1090 } 1091 jQuery(jQuery('.debug').get(i - 1)).click(); 1092 } 1093 1094 /* 1095 jQuery.post(href, function (data) { 1096 nu_img--; 1097 if (nu_img < 0) nu_img = 9; 1098 jQuery(jQuery('.debug').get(nu_img)).trigger('ON'); 1099 //alert("Data Loaded: " + data); 1100 Wait_Affichage(); 302 303 set_cl(true); 304 } else { 305 Set_Pamoorama(); 306 set_cl(false); 307 } 308 Set_llbgo(true); 309 return true; 310 311 //_____________________________________________________ 312 }; // Autosize 313 314 Save_cookies = function (parametres) { 315 if (parametres.typeSave) document.cookie = 'picture_deriv=' + parametres.typeSave + ';path="' + "/" + '" '; 316 if (parametres.typeSave) jQuery.cookie('picture_deriv', parametres.typeSave, { path: "/" }); 317 if (parametres.pictureMap) jQuery.cookie('picture_map', parametres.pictureMap, { path: "/" }); 318 if (parametres.imgSrc) jQuery.cookie('img', parametres.imgSrc, { path: "/" }); 319 320 if (parametres.imgHeight) jQuery.cookie('img_h', infos_theMainImage.height, { path: "/" }); 321 if (parametres.imgWidth) jQuery.cookie('img_w', infos_theMainImage.width, { path: "/" }); 322 if (parametres.windowHeight) jQuery.cookie('window_height', Window_Affichage.height, { path: "/" }); 323 if (parametres.windowWidth) jQuery.cookie('window_width', Window_Affichage.width, { path: "/" }); 324 } 325 326 Get_cookies = function () { 327 parametres = { 328 typeSave: jQuery.cookie('picture_deriv'), 329 pictureMap: jQuery.cookie('picture_map'), 330 imgSrc: jQuery.cookie('img'), 331 332 imgHeight: jQuery.cookie('img_h'), 333 imgWidth: jQuery.cookie('img_w'), 334 windowHeight: jQuery.cookie('window_height'), 335 windowWidth: jQuery.cookie('window_width') 336 } 337 return parametres; 338 } 339 340 /******************************************** 341 * window unLOAD 342 ********************************************/ 343 jQuery(window).unload(function () { 344 try { 345 if (typeof theMainImage_Id != "undefined") { 346 347 useMap = options.useMap; 348 pictureMap = jQuery.cookie('picture_map'); 349 typeSave = jQuery.cookie('picture_deriv'); 350 351 old_img = jQuery.cookie('img'); 352 old_window_height = jQuery.cookie('window_height'); 353 old_window_width = jQuery.cookie('window_width'); 354 old_img_h = jQuery.cookie('img_h'); 355 old_img_w = jQuery.cookie('img_w'); 356 set_cookies({ 357 1101 358 }); 1102 */ 1103 //========================================================= 1104 if (typeof img_width == "undefined") { 1105 if (List_autosize.length == 0) return; 1106 wait_resize = false; 1107 if (List_autosize_resize()) Wait_Affichage(); 1108 return true; 1109 } 1110 //============================================================ 1111 Autosize_init(); 1112 Bandeau_bas = infos_Description_f("#theImage"); 1113 if (typeof Bandeau_bas != "undefined") Bandeau = Bandeau_bas.top; 1114 else Bandeau = 0; 1115 Wait_Affichage(); 1116 Autosize_resize(true, { id_map: "autosize" }); 1117 }); // window.onload 1118 /*********************************************************** 1119 * RESIZE 1120 ***********************************************************/ 1121 jQuery(window).resize( 359 360 if (typeof Window_Affichage != "undefined") { 361 jQuery.cookie('window_height', Window_Affichage.height, { path: "/" }); 362 jQuery.cookie('window_width', Window_Affichage.width, { path: "/" }); 363 } 364 } 365 } catch (r) { 366 367 } 368 369 }); //unload 370 371 372 373 374 /******************************************** 375 * window LOAD 376 ********************************************/ 377 jQuery(window).load(function () { 378 href = location.href; 379 var aff_ok = false; 380 if (DEBUG_autosize == "true") { 381 for (var i = 0; i < 10; i++) { 382 jQuery('#adddebugs').click(); 383 } 384 jQuery(jQuery('.debug').get(i - 1)).click(); 385 } 386 387 Autosize_init(); 388 //========================================================= 389 390 Bandeau_bas = infos_Description_f("#theImage"); 391 if (typeof Bandeau_bas != "undefined") Bandeau = Bandeau_bas.top; 392 else Bandeau = 0; 393 394 395 if (!theImage_init("#theMainImage")) { 396 Autosize_resize(true, options); 397 Set_llbgo(true); 398 Wait_Affichage(); 399 } else { 400 set_cl(options.useMap.match(RegExp("Autosize", "gi"))); 401 Set_llbgo(); 402 } 403 404 405 406 407 //================================================================================= 408 }); // window.onload 409 /*********************************************************** 410 * RESIZE 411 ***********************************************************/ 412 jQuery(window).resize( 1122 413 function (event, ui) { 1123 414 List_autosize_resize(event, ui); 1124 if (Autosize_resize(true)) 1125 if (Autosize_resize(true)); 415 Autosize_resize(true, options); 1126 416 Wait_Affichage(); 1127 417 }); 1128 418 1129 /************************************ 1130 * Extend 1131 ************************************/ 1132 jQuery.fn.extend({ 1133 //========================================================== 1134 infos_description: function (e) { 1135 return infos_Description_f(e); 1136 }, 1137 //============================================================= 1138 on: function (e) { 1139 return; 1140 }, 1141 /* 1142 * recherche la plus grande image (hauteur ou largeur) 1143 */ 1144 Get_Img_Maxi: function (myobj) { 1145 return Get_Img_Maxi(myobj); 1146 }, 1147 //============================================================ 1148 affiche_debug: function (aff_infos) { 1149 affiche_debug(aff_infos); 1150 } 1151 1152 1153 }); // fin extend 1154 //================================================================================= 1155 1156 /***************** 1157 * changeImgSrc1 1158 ******************/ 1159 changeImgSrc = function (url, typeSave, typeMap) { 1160 var theImg = document.getElementById("theMainImage"); 1161 if (theImg) { 1162 theImg.removeAttribute("width"); 1163 theImg.removeAttribute("height"); 1164 // theImg.useMap = "#map" + typeMap; 1165 if (typeMap == "Autosize") { 1166 theImg.useMap = "#" + typeMap; 1167 } else { 1168 theImg.useMap = "#map" + typeSave; 1169 } 1170 jQuery('#derivativeSwitchBox .switchCheck').css('visibility', 'hidden'); 1171 jQuery('#derivativeChecked' + typeMap).css('visibility', 'visible'); 1172 1173 document.cookie = 'picture_deriv=' + typeSave + ';path="' + cookie_path + '" '; 1174 jQuery.cookie('picture_deriv', typeSave, { path: cookie_path }); 1175 jQuery.cookie('picture_map', typeMap, { path: cookie_path }); 1176 theImg.src = url; // charge Image 1177 1178 } 1179 } //changeImgSrc1 1180 1181 Wait_pamoorama = function () { 1182 if (jQuery("#pamoorama").length) { 1183 mypanorama = window.myPamoorama; 1184 if (!mypanorama) { 1185 tempo = tempo + 1; 1186 if (tempo > 10) 1187 return true; 1188 setTimeout("Wait_pamoorama()", 500); 1189 return false; 1190 } 1191 if (mypanorama.skipInit == false) { 1192 setTimeout("Wait_pamoorama()", 500); 1193 return false; 1194 } 1195 //============================================================= 1196 infos_pamoorama = jQuery("#pamoorama").infos(); 1197 if (Math.abs(infos_pamoorama.height) < 50) { 1198 setTimeout("Wait_pamoorama()", 500); 1199 return false; 1200 } 1201 nopano = true; 1202 theMainImage_obj = "#pamoorama"; 1203 1204 } 1205 } // Wait_pamoorama 1206 //==================================================================================== 1207 Wait_Affichage = function () { 1208 if (typeof fade_in == "undefined") fade_in = 1000; 1209 fade_in = parseInt(fade_in); 1210 /* 1211 if (!Autosize_resize()) { 1212 setTimeout("Wait_Affichage()", 500); 1213 return 1214 } 1215 nu_img++; 1216 */ 1217 if (typeof fade_in == "undefined") fade_in = 0; 1218 if (fade_in == 0) { 1219 jQuery("#theImage").css({ opacity: "1" }); 1220 jQuery("#theImg").css({ opacity: "1" }); 1221 jQuery("#imageTitleContainer").css({ opacity: "1" }); 1222 jQuery("#theImageAndTitle").css({ opacity: "1" }); 1223 } else { 1224 jQuery("#theImage").animate({ opacity: "1" }, 419 /***************** 420 * changeImgSrc1 421 ******************/ 422 changeImgSrc = function (url, typeSave, useMap) { 423 var theImg = document.getElementById(theMainImage_Id.replace("#", "")); 424 if (theImg) { 425 theImg.removeAttribute("width"); 426 theImg.removeAttribute("height"); 427 // theImg.useMap = "#map" + useMap; 428 429 jQuery('#derivativeSwitchBox .switchCheck').css('visibility', 'hidden'); 430 jQuery('#derivativeChecked' + useMap.replace("#", "")).css('visibility', 'visible'); 431 options.useMap = useMap; 432 if (useMap.match("Autosize")) { 433 pictureMap = "#" + "Autosize"; 434 } else { 435 pictureMap = "#map" + typeSave; 436 } 437 theImg.src = url; // charge Image 438 theImg.useMap = pictureMap; 439 infos_theMainImage = jQuery(theMainImage_Id).infos(); 440 infos_theMainImage.useMap = theImg.useMap; 441 Save_cookies({ 442 typeSave: typeSave, 443 pictureMap: pictureMap, 444 imgSrc: url 445 }); 446 cookies = Get_cookies(); 447 448 } 449 450 451 } //changeImgSrc1 452 /************************************ 453 * 454 ************************************/ 455 Wait_pamoorama = function () { 456 if (jQuery("#pamoorama").length) { 457 mypanorama = window.myPamoorama; 458 if (!mypanorama) { 459 tempo = tempo + 1; 460 if (tempo > 10) 461 return true; 462 setTimeout("Wait_pamoorama()", 500); 463 return false; 464 } 465 if (mypanorama.skipInit == false) { 466 setTimeout("Wait_pamoorama()", 500); 467 return false; 468 } 469 //============================================================= 470 infos_pamoorama = jQuery("#pamoorama").infos(); 471 if (Math.abs(infos_pamoorama.height) < 50) { 472 setTimeout("Wait_pamoorama()", 500); 473 return false; 474 } 475 nopano = true; 476 theMainImage_Id = "#pamoorama"; 477 478 } 479 } // Wait_pamoorama 480 //==================================================================================== 481 Wait_Affichage = function () { 482 483 if (typeof fade_in == "undefined") fade_in = 1000; 484 fade_in = parseInt(fade_in); 485 /* 486 if (!Autosize_resize()) { 487 setTimeout("Wait_Affichage()", 500); 488 return 489 } 490 nu_img++; 491 */ 492 if (typeof fade_in == "undefined") fade_in = 0; 493 if (fade_in == 0) { 494 jQuery("#theImage").css({ opacity: "1" }); 495 jQuery("#theImg").css({ opacity: "1" }); 496 jQuery("#imageTitleContainer").css({ opacity: "1" }); 497 jQuery("#theImageAndTitle").css({ opacity: "1" }); 498 } else { 499 jQuery("#theImage").animate({ opacity: "1" }, 1225 500 fade_in, "swing", 1226 501 function (i) { … … 1241 516 ); 1242 517 1243 } 1244 // if (nu_img > 1) return; 1245 if (typeof stb != "undefined") 1246 stb.stop().fadeTo(3500, 0); 1247 if (typeof theMainImage_obj == "undefined") return true; 1248 1249 if (theMainImage_obj.selector) { 1250 theMainImage_obj = theMainImage_obj.selector; 1251 } 1252 // jQuery("#theImage").trigger("ON"); 1253 theImage_init("#theImage"); 1254 1255 if (theMainImage_obj == null) return; 1256 if (jQuery(theMainImage_obj).length > 0) { 1257 if (typeof img_h == "undefined") { 1258 img_h = jQuery(theMainImage_obj).height(); 1259 img_w = jQuery(theMainImage_obj).width(); 518 } 519 // if (nu_img > 1) return; 520 if (typeof stb != "undefined") 521 stb.stop().fadeTo(3500, 0); 522 if (typeof theMainImage_Id == "undefined") return true; 523 524 if (theMainImage_Id.selector) { 525 theMainImage_Id = theMainImage_Id.selector; 526 } 527 if (theMainImage_Id == null) return; 528 529 if (jQuery(theMainImage_Id).length > 0) { 530 if (typeof img_h == "undefined") { 531 img_h = jQuery(theMainImage_Id).height(); 532 img_w = jQuery(theMainImage_Id).width(); 533 } 534 535 jQuery("#src_img_h").val(img_h); 536 jQuery("#src_img_w").val(img_w); 537 jQuery("#ret_autosize").val(infos_theMainImage.src); 538 if (typeof Window_Affichage == "undefined") return; 539 jQuery("#window_height").val(Window_Affichage.height); 540 jQuery("#window_width").val(Window_Affichage.width); 541 jQuery("#ret_autosize").trigger('ON', { 542 width: img_w, 543 height: img_h, 544 theImage: theMainImage_Id, 545 src_img: infos_theMainImage.src, 546 window_height: Window_Affichage.height, 547 window_width: Window_Affichage.width 548 }); 549 } 550 } // Wait_affichage 551 552 553 554 555 556 /*********************** 557 * 558 **********************/ 559 init_img = function (theImg) { 560 name_src = theImg.src; 561 img_init = { width: jQuery(theImg).width(), height: jQuery(theImg).height() } 562 563 if (theImg.naturalWidth) 564 img_init.width = theImg.naturalWidth; 565 if (theImg.naturalHeight) 566 img_init.height = theImg.naturalHeight; 567 568 img_init.rapport = img_init.width / img_init.height; 569 Zone_image.height_init = img_init.height; 570 Zone_image.width_init = img_init.width; 571 Zone_image.rapport = img_init.rapport; 572 573 nu_img = 0; 574 theMainImage_Id = "#" + theImg.id; 575 if (typeof Zone_image.src == "undefined") return; 576 return name_src.match(Zone_image.src); 577 } 578 579 580 /***************************************************** 581 * recherche la plus grande image (hauteur ou largeur) 582 *****************************************************/ 583 Get_Img_Maxi = function (myobj) { 584 var w00 = 0; 585 var myImg = null; 586 587 img = jQuery(theMainImage_Id); 588 if (img != null) { 589 return; 590 591 } 592 img = jQuery(myobj); 593 594 img = jQuery('img[alt]'); 595 596 jQuery(myobj).each(function (i) { 597 w0 = img_reelle.width; 598 h0 = img_reelle.height; 599 if (h0 > w0) w0 = h0; 600 if (w0 > w00) { 601 if (!this.src.match(RegExp(".png", "gi"))) 602 if (!this.src.match(RegExp(thumbnail, "g"))) { 603 myImg = this; 604 jQuery(myImg).addClass("Image"); 605 w00 = w0; 1260 606 } 1261 jQuery("#src_img_h").val(img_h); 1262 jQuery("#src_img_w").val(img_w); 1263 jQuery("#ret_autosize").val(src_img); 1264 if (typeof Window_Affichage == "undefined") { 1265 Window_Affichage = { height: Zone_Affichage.height, 1266 width: Zone_Affichage.width 1267 }; 1268 } 1269 jQuery("#window_height").val(Window_Affichage.height); 1270 jQuery("#window_width").val(Window_Affichage.width); 1271 1272 jQuery("#ret_autosize").trigger('ON', { 1273 width: img_w, 1274 height: img_h, 1275 theImage: theMainImage_obj, 1276 src_img: src_img, 1277 window_height: Window_Affichage.height, 1278 window_width: Window_Affichage.width 1279 }); 1280 } 1281 } // Wait_affichage 1282 1283 1284 1285 1286 1287 /***************************************************** 1288 * recherche la plus grande image (hauteur ou largeur) 1289 *****************************************************/ 1290 Get_Img_Maxi = function (myobj) { 1291 var w00 = 0; 1292 var myImg = null; 1293 1294 img = jQuery(theMainImage_obj); 1295 if (img != null) { 1296 return; 1297 1298 } 1299 img = jQuery(myobj); 1300 1301 img = jQuery('img[alt]'); 1302 1303 jQuery(myobj).each(function (i) { 1304 w0 = img_reelle.width; 1305 h0 = img_reelle.height; 1306 if (h0 > w0) w0 = h0; 1307 if (w0 > w00) { 1308 if (!this.src.match(RegExp(".png", "g"))) 1309 if (!this.src.match(RegExp(thumbnail, "g"))) { 1310 myImg = this; 1311 jQuery(myImg).addClass("Image"); 1312 w00 = w0; 1313 } 1314 1315 } 1316 }); 1317 return myImg; 1318 } // Get_Img_Maxi 1319 1320 1321 /************************************************************* 1322 * 1323 **************************************************************/ 1324 infos_entete = function () { 1325 infos_imageToolBar = jQuery("#imageToolBar").infos(); 1326 if (typeof (marge_top) != "undefined") return result; 1327 1328 if (infos_imageToolBar.position == "absolute") { 1329 jQuery("#imageToolBar").css("position", "relative"); 1330 jQuery("#imageToolBar").css("top", 0 + "px"); 1331 } 1332 optiontop = 0; 1333 infos_imageInfoBar = jQuery("#imageInfoBar").infos(); 1334 jQuery("#" + "theImgContainer").css("marginTop", "0px"); 1335 infos_thePicturePage = jQuery("#thePicturePage").infos(); 1336 infos_theImage = jQuery("#theImage").infos(); 1337 if (theme.match(RegExp("stripped", "gi"))) { 1338 infos_theImageAndTitle = jQuery("#theImageAndTitle").infos(); 1339 infos_theImageBox = jQuery("#theImageBox").infos(); 1340 optiontop = (marges_llgbo / 2) + infos_theImageAndTitle.margin.top; 1341 } 1342 1343 if (infos_theImage.position == "relative") { 1344 //--- passage relative ==> static ===/ 1345 jQuery("#theImage").css("position", "static"); 1346 infos_theImage = jQuery("#theImage").infos(); 1347 1348 } else { 1349 1350 } 1351 if (infos_theImage.position == "absolute") { 1352 //--- passage absolute ==> static ===/ 1353 jQuery("#theImage").css("position", "static"); 1354 infos_theImage = jQuery("#theImage").infos(); 1355 1356 } 1357 1358 marge_top = Math.ceil(infos_the_page.top + 607 608 } 609 }); 610 return myImg; 611 } // Get_Img_Maxi 612 613 614 /************************************************************* 615 * 616 **************************************************************/ 617 infos_entete = function () { 618 infos_imageToolBar = jQuery("#imageToolBar").infos(); 619 if (typeof (marge_top) != "undefined") return; 620 621 optiontop = 0; 622 infos_imageInfoBar = jQuery("#imageInfoBar").infos(); 623 624 infos_thePicturePage = jQuery("#thePicturePage").infos(); 625 infos_theImage = jQuery("#theImage").infos(); 626 if (theme.match(RegExp("stripped", "gi"))) { 627 infos_theImageAndTitle = jQuery("#theImageAndTitle").infos(); 628 infos_theImageBox = jQuery("#theImageBox").infos(); 629 optiontop = (marges_llgbo / 2) + infos_theImageAndTitle.margin.top; 630 } 631 632 633 634 marge_top = Math.ceil(infos_the_page.top + 1359 635 infos_the_page.borderwidth.top + 1360 636 infos_theImage.borderwidth.top + … … 1362 638 ); 1363 639 1364 640 img_top = Math.ceil(infos_theImage.top + 1365 641 infos_theImage.padding.top + 1366 642 infos_theImage.borderwidth.top + 1367 643 infos_thePicturePage.margin.top + optiontop); 1368 result = infos_imageToolBar; 1369 // result.width = "20%"; 1370 // result.left = "40%"; 1371 result.marge_top = marge_top; 1372 result.img_top = img_top; 1373 //=== Afficher le titre de l'image sur le cadre === 1374 1375 1376 if (infos_llgboh2.top > 0) { 1377 result.img_top = infos_llgboh2.top; 1378 1379 } 1380 else if (marges_llgbo > 0) { 1381 result.img_top -= (8); 1382 } 1383 return result; 1384 } // infos_entete 1385 /************************************************* 1386 * Récupère les informations sur la description. 1387 * 1388 *************************************************/ 1389 infos_Description_f = function () { 1390 // jQuery("#theImage").css({ display: "block" }); 1391 //====== détection du type d'images ====== 1392 if (jQuery("#charlie").length > 0) { 1393 Type_Img = "charlie"; 1394 } else if (jQuery("#Panorama").length) { 1395 Type_Img = "panorama"; 1396 } else if (jQuery("#pamoorama").length) { 1397 Type_Img = "pamoorama"; 1398 } else if (jQuery("#map").length) { 1399 Type_Img = "map"; 1400 } else if (jQuery("#Panorama").length) { 1401 Type_Img = "panorama"; 1402 } else if ((jQuery("#theImage" + " iframe").length + jQuery("#theImage" + " object").length + jQuery("#theImage" + " embed").length) > 0) { 1403 1404 if (jQuery("#theImage" + " object").length > 0) { 1405 1406 type_src = "object"; 1407 1408 } else if (jQuery("#theImage" + " embed").length > 0) { 1409 1410 type_src = "embed"; 1411 644 result = infos_imageToolBar; 645 // result.width = "20%"; 646 // result.left = "40%"; 647 result.marge_top = marge_top; 648 result.img_top = img_top; 649 //=== Afficher le titre de l'image sur le cadre === 650 651 652 if (infos_llgboh2.top > 0) { 653 result.img_top = infos_llgboh2.top; 654 655 } 656 else if (marges_llgbo > 0) { 657 result.img_top -= (8); 658 } 659 return result; 660 } // infos_entete 661 /************************************************* 662 * Récupère les informations sur la description. 663 * 664 *************************************************/ 665 infos_Description_f = function () { 666 // jQuery("#theImage").css({ display: "block" }); 667 //====== détection du type d'images ====== 668 if (jQuery("#charlie").length > 0) { 669 Type_Img = "charlie"; 670 } else if (jQuery("#Panorama").length) { 671 Type_Img = "panorama"; 672 } else if (jQuery("#pamoorama").length) { 673 Type_Img = "pamoorama"; 674 } else if (jQuery("#map").length) { 675 Type_Img = "map"; 676 } else if (jQuery("#Panorama").length) { 677 Type_Img = "panorama"; 678 } else if ((jQuery("#theImage" + " iframe").length + jQuery("#theImage" + " object").length + jQuery("#theImage" + " embed").length) > 0) { 679 680 if (jQuery("#theImage" + " object").length > 0) { 681 682 type_src = "object"; 683 684 } else if (jQuery("#theImage" + " embed").length > 0) { 685 686 type_src = "embed"; 687 688 } else { 689 690 type_src = "iframe"; 691 } 692 nbf = jQuery("#theImage" + " " + type_src).length; 693 frm1 = jQuery("#theImage" + " " + type_src).get(0); 694 Type_Img = "charlie"; 695 696 //'fb - xfbml - like - button 697 698 objs = jQuery("#theImage" + " div").get(0); 699 if (jQuery(objs).length > 0) { 700 id_0 = jQuery(objs).attr("id"); 701 if (id_0 == "") { 702 jQuery(objs).attr("id", "charlie"); 703 } else { 704 if (nbf > 1) { 705 jQuery(frm1).attr("id", "charlie"); 1412 706 } else { 1413 1414 type_src = "iframe"; 707 Type_Img = "img"; 1415 708 } 1416 nbf = jQuery("#theImage" + " " + type_src).length; 1417 frm1 = jQuery("#theImage" + " " + type_src).get(0); 1418 Type_Img = "charlie"; 1419 1420 //'fb - xfbml - like - button 1421 1422 objs = jQuery("#theImage" + " div").get(0); 1423 if (jQuery(objs).length > 0) { 1424 id_0 = jQuery(objs).attr("id"); 1425 if (id_0 == "") { 1426 jQuery(objs).attr("id", "charlie"); 1427 } else { 1428 if (nbf > 1) { 1429 jQuery(frm1).attr("id", "charlie"); 1430 } else { 1431 Type_Img = "img"; 1432 } 1433 } 1434 } else { 1435 jQuery(frm1).attr("id", "charlie"); 1436 } 1437 1438 1439 } else if (jQuery("#theImage").find("img").length > 0) { 1440 Type_Img = "img"; 1441 } else if (jQuery("#theImage" + "Box").find("img").length > 0) { 1442 Type_Img = "img"; 1443 Parent = Parent + "Box"; 1444 } else if (jQuery("img").length > 0) { 1445 Type_Img = "img_autre"; 1446 return; 1447 } else { 1448 return; 1449 } 1450 //=============== CHARLIE ============================== 1451 if (jQuery("#charlie").length > 0) { 1452 jQuery("#charlie").css({ 1453 paddingTop: "0px", 1454 marginTop: "0px", 1455 paddingBottom: "0px", 1456 marginBottom: "0px" 1457 }); 1458 1459 } 1460 //================ LLGBO ====================== 1461 marges_llgbo = 0; 1462 if (jQuery("#llgbo").length > 0) { 1463 jQuery("#llgbo").trigger("ON"); 1464 if (infos_llgbo.height > 0) { 1465 marges_llgbo = infos_llgbo.borderwidth.left * 2; 1466 } 1467 } 1468 1469 Bandeau_t = infos_entete(); 1470 Bandeau = Bandeau_t.img_top; 1471 infos_theImgContainer = jQuery("#" + "theImgContainer").infos(); 1472 infos_description = jQuery("#" + "description").infos(); 1473 //============================================================================= 1474 // jQuery("#theImage" + " p").css({ padding: "0px", margin: "0px " }); 1475 if (theme.match(RegExp("simple", "gi"))) { 1476 jQuery("#theImage").css({ padding: "0px", 1477 marginLeft: "0px", 1478 marginRight: "auto", 1479 marginTop: "0px", 1480 marginBottom: "0px" 1481 1482 }); 1483 } 1484 1485 1486 if (theme.match(RegExp("luciano", "g"))) { 1487 jQuery("#imageContainer").css({ height: "auto" }); 1488 theMainImage_obj = "#theImage" + " #theImg img"; 1489 infos_img = jQuery(theMainImage_obj).infos(); 1490 1491 1492 } else if (Type_Img == "map") { 1493 1494 infos_map = jQuery("#mapPicture").infos(); 1495 marge_left = infos_map.width; 1496 1497 jQuery("#map").css({ left: marge_left + "px", padding: "0px", 1498 marginLeft: "0px", 1499 marginRight: "4px", 1500 marginTop: "0px", 1501 marginBottom: "0px", 1502 position: "relative" 1503 }); 1504 1505 theMainImage_obj = "#map"; 1506 infos_img = jQuery(theMainImage_obj).infos(); 1507 1508 1509 } else if (jQuery("#charlie").length > 0) { 1510 infos_charlie = jQuery("#charlie").infos(); 1511 obj_charlie = jQuery("object"); 1512 try { 1513 tp = obj_charlie.attr(); 1514 } catch (e) { 1515 tp = obj_charlie.prop(); 1516 } 1517 1518 if (tp != undefined) { 1519 if (obj_charlie.length > 0) 1520 tp = jQuery("object").attr("type") || jQuery("object").prop("type"); 1521 else 1522 tp = jQuery("embed").attr("type") || jQuery("embed").prop("type"); 1523 } 1524 1525 if (tp == 'application/x-shockwave-flash') { 1526 jQuery("#charlie").css({ 1527 paddingTop: "0px", 1528 marginTop: "0px", 1529 paddingBottom: "30px", 1530 marginBottom: "0px" 1531 }); 1532 } else { 1533 1534 } 1535 1536 var MainImage = jQuery(theMainImage_obj); 1537 1538 if (MainImage.length == 0) { 1539 theMainImage_obj = "#charlie"; 1540 infos_img = jQuery(theMainImage_obj).infos(); 1541 } else { 1542 1543 infos_img = jQuery(theMainImage_obj).infos(); 1544 1545 } 1546 1547 1548 } else if (jQuery("#theImage" + " embed").length > 0) { 1549 if (jQuery(theMainImage_obj).lenght == 0) { 1550 theMainImage_obj = "#theImage" + " embed"; 1551 infos_img = jQuery(theMainImage_obj).infos(); 1552 jQuery("#theImage" + " embed").width({ width: infos_img.width + "px", height: infos_img.height + "px" }); 1553 } else { 1554 1555 infos_img = jQuery(theMainImage_obj).infos(); 1556 Type_Img == "charlie" 1557 if (infos_img.width == 0) { 1558 1559 infos_img = jQuery(theMainImage_obj).infos(); 1560 1561 } 1562 } 1563 1564 } else if (Type_Img == "pamoorama") { 1565 if (!nopano) { 1566 Wait_pamoorama(); 1567 1568 } 1569 infos_img = jQuery(theMainImage_obj).infos(); 1570 infos_footer = jQuery("#pamoorama_footer").infos(); 1571 infos_img.height += parseInt(infos_img.height) + parseInt(infos_footer.height); 1572 1573 } else { 1574 var MainImage = jQuery(theMainImage_obj); 1575 1576 if (MainImage.length == 0) { 1577 theMainImage_obj = "#theImage" + " img[alt]"; 1578 } else { 1579 1580 } 1581 1582 1583 if (!theMainImage_obj) 1584 theMainImage_obj = "#theImage"; // sans img ?? 1585 1586 infos_img = jQuery(theMainImage_obj).infos(); 1587 } 1588 //===================================================================================== 1589 1590 switch (infos_img.position) { 1591 case "relative": 1592 break; 1593 case "static": 1594 break; 1595 case "absolute": 1596 break; 1597 case "": 1598 break; 1599 default: 1600 break; 1601 } 1602 1603 infos_description.marge = { 1604 bottom: infos_img.padding.bottom + infos_img.margin.bottom + infos_img.borderwidth.bottom, 1605 top: infos_img.padding.top + infos_img.borderwidth.top + infos_img.margin.top 1606 } 1607 1608 if (infos_llgbo.height > 0) infos_img = infos_llgbo; // format de l'image+largeur du cadre 1609 1610 if (theme.match(RegExp("luciano", "g"))) { 1611 1612 infos_theImgContainer = jQuery("#imageContainer").infos(); 1613 infos_description.bottom = jQuery("#imageInfo").infos().top; 1614 infos_description.top = infos_theImgContainer.bottom; 1615 infos_slidshowToolBar = jQuery("#slidshowToolBar").infos(); 1616 1617 if (infos_slidshowToolBar.height > 0) { 1618 correction = (infos_slidshowToolBar.height); 1619 infos_description.top = infos_img.bottom; 1620 infos_description.bottom = jQuery("#copyright").infos().top; 1621 } 1622 1623 //========================================================= 1624 } else if (theme.match(RegExp("stripped", "gi"))) { 1625 //options.imageAutosize 1626 //options.imageMargin 1627 jQuery("#content").css({ paddingTop: "5px" }); 1628 infos_content = jQuery("#content").infos(); 1629 if (options.imageAutosizeTitle == false) { 1630 infos_description.top = infos_theImageBox.bottom; 1631 1632 infos_description.bottom = infos_HeaderBar.margin.top + infos_description.top + 709 } 710 } else { 711 jQuery(frm1).attr("id", "charlie"); 712 } 713 714 715 } else if (jQuery("#theImage").find("img").length > 0) { 716 Type_Img = "img"; 717 } else if (jQuery("#theImage" + "Box").find("img").length > 0) { 718 Type_Img = "img"; 719 Parent = Parent + "Box"; 720 } else if (jQuery("img").length > 0) { 721 Type_Img = "img_autre"; 722 return; 723 } else { 724 return; 725 } 726 //=============== CHARLIE ============================== 727 if (jQuery("#charlie").length > 0) { 728 jQuery("#charlie").css({ 729 paddingTop: "0px", 730 marginTop: "0px", 731 paddingBottom: "0px", 732 marginBottom: "0px" 733 }); 734 735 } 736 //================ LLGBO ====================== 737 marges_llgbo = 0; 738 options.marges_llgbo = 0; 739 if (jQuery(llgbo_id).length > 0) { 740 infos_llgbo = jQuery(llgbo_id).infos(); 741 if (infos_llgbo.visible == true) { 742 if (infos_llgbo.height > 0) { 743 infos_llgboframe1 = jQuery(llgbo_id + " div:last").infos(); 744 infos_llgboframe31 = jQuery(llgbo_id + " div:first").infos(); 745 //============================================= 746 ll2 = infos_llgboframe1.width; // llgboframe1 747 ll1 = infos_llgboframe31.general.width; // llgboframe31 748 options.marges_llgbo = (ll1 - ll2); 749 infos_llgboh2 = jQuery("#llgboh2").infos(); 750 } 751 } 752 jQuery(llgbo_id).trigger("ON"); 753 marges_llgbo = options.marges_llgbo; 754 } 755 756 // Bandeau_t = infos_entete(); 757 // Bandeau = Bandeau_t.img_top; 758 infos_theImgContainer = jQuery("#" + "theImgContainer").infos(); 759 infos_description = jQuery("#" + "description").infos(); 760 //============================================================================= 761 762 763 764 if (theme.match(RegExp("luciano", "g"))) { 765 766 767 768 769 } else if (Type_Img == "map") { 770 771 infos_map = jQuery("#mapPicture").infos(); 772 marge_left = infos_map.width; 773 774 jQuery("#map").css({ left: marge_left + "px", padding: "0px", 775 marginLeft: "0px", 776 marginRight: "4px", 777 marginTop: "0px", 778 marginBottom: "0px", 779 position: "relative" 780 }); 781 782 theMainImage_Id = "#map"; 783 infos_theMainImage = jQuery(theMainImage_Id).infos(); 784 785 786 } else if (jQuery("#charlie").length > 0) { 787 infos_charlie = jQuery("#charlie").infos(); 788 obj_charlie = jQuery("object"); 789 try { 790 tp = obj_charlie.attr(); 791 } catch (e) { 792 tp = obj_charlie.prop(); 793 } 794 795 if (tp != undefined) { 796 if (obj_charlie.length > 0) 797 tp = jQuery("object").attr("type") || jQuery("object").prop("type"); 798 else 799 tp = jQuery("embed").attr("type") || jQuery("embed").prop("type"); 800 } 801 802 if (tp == 'application/x-shockwave-flash') { 803 jQuery("#charlie").css({ 804 paddingTop: "0px", 805 marginTop: "0px", 806 paddingBottom: "30px", 807 marginBottom: "0px" 808 }); 809 } else { 810 811 } 812 813 var MainImage = jQuery(theMainImage_Id); 814 815 if (MainImage.length == 0) { 816 theMainImage_Id = "#charlie"; 817 infos_theMainImage = jQuery(theMainImage_Id).infos(); 818 } else { 819 820 infos_theMainImage = jQuery(theMainImage_Id).infos(); 821 822 } 823 824 825 } else if (jQuery("#theImage" + " embed").length > 0) { 826 if (jQuery(theMainImage_Id).lenght == 0) { 827 theMainImage_Id = "#theImage" + " embed"; 828 infos_theMainImage = jQuery(theMainImage_Id).infos(); 829 jQuery("#theImage" + " embed").width({ width: infos_theMainImage.width + "px", height: infos_theMainImage.height + "px" }); 830 } else { 831 832 infos_theMainImage = jQuery(theMainImage_Id).infos(); 833 Type_Img == "charlie" 834 if (infos_theMainImage.width == 0) { 835 836 infos_theMainImage = jQuery(theMainImage_Id).infos(); 837 838 } 839 } 840 841 } else if (Type_Img == "pamoorama") { 842 if (!nopano) { 843 Wait_pamoorama(); 844 845 } 846 infos_theMainImage = jQuery(theMainImage_Id).infos(); 847 infos_footer = jQuery("#pamoorama_footer").infos(); 848 infos_theMainImage.height += parseInt(infos_theMainImage.height) + parseInt(infos_footer.height); 849 850 } else { 851 if (jQuery(theMainImage_Id).length == 0) { 852 theMainImage_Id = "#theImage" + " img[alt]"; 853 } else { 854 855 } 856 857 858 if (!theMainImage_Id) 859 theMainImage_Id = "#theImage"; // sans img ?? 860 861 862 } 863 //===================================================================================== 864 infos_theMainImage = jQuery(theMainImage_Id).infos(); 865 866 switch (infos_theMainImage.position) { 867 case "relative": 868 break; 869 case "static": 870 break; 871 case "absolute": 872 break; 873 case "": 874 break; 875 default: 876 break; 877 } 878 879 infos_description.marge = { 880 bottom: infos_theMainImage.padding.bottom + infos_theMainImage.margin.bottom + infos_theMainImage.borderwidth.bottom, 881 top: infos_theMainImage.padding.top + infos_theMainImage.borderwidth.top + infos_theMainImage.margin.top 882 } 883 884 if (infos_llgbo.height > 0) infos_theMainImage = infos_llgbo; // format de l'image+largeur du cadre 885 886 if (theme.match(RegExp("luciano", "g"))) { 887 888 infos_theImgContainer = jQuery(theImageAndInfos_id).infos(); 889 infos_description.bottom = jQuery("#imageInfo").infos().top; 890 infos_description.top = infos_theImgContainer.bottom; 891 infos_slidshowToolBar = jQuery("#slidshowToolBar").infos(); 892 893 if (infos_slidshowToolBar.height > 0) { 894 correction = (infos_slidshowToolBar.height); 895 infos_description.top = infos_theMainImage.bottom; 896 infos_description.bottom = jQuery("#copyright").infos().top; 897 } 898 899 //========================================================= 900 } else if (theme.match(RegExp("stripped", "gi"))) { 901 //options.imageAutosize 902 //options.imageMargin 903 904 infos_content = jQuery("#content").infos(); 905 if (options.imageAutosizeTitle == false) { 906 infos_description.top = infos_theImageBox.bottom; 907 908 infos_description.bottom = infos_HeaderBar.margin.top + infos_description.top + 1633 909 infos_description.borderwidth.top + 1634 910 infos_description.borderwidth.bottom + … … 1636 912 (marges_llgbo / 2) + 4; 1637 913 1638 1639 1640 1641 914 } else { 915 916 917 infos_description.top = infos_theImageBox.bottom - 1642 918 infos_content.top + 1643 919 options.imageAutosizeMargin * 2 + 1644 920 (marges_llgbo / 2) 1645 921 ; 1646 922 infos_description.bottom = jQuery("#tabZone").infos().top + 1647 923 infos_theImageAndTitle.margin.top; 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 infos_description.top = infos_img.height + infos_theImage.top; //410+621658 // infos_description.bottom -= infos_img.top;1659 1660 1661 1662 1663 1664 if (check_desc_v == false) {1665 1666 1667 1668 1669 1670 //cl_visible=false ;1671 1672 1673 1674 1675 1676 1677 924 if (msie == true) infos_description.bottom -= 4; 925 }; 926 check_desc_v = true; 927 928 } else { 929 if (theme.match(RegExp("sobre", "gi"))) { 930 infos_description.marge.top = -2; 931 } 932 infos_description.bottom = infos_theImage.bottom; //482 933 infos_description.top = infos_theMainImage.height + infos_theImage.top; //410+62 934 // infos_description.bottom -= infos_theMainImage.top; 935 } 936 // 937 938 infos_description.height = infos_description.bottom - infos_description.top; 939 940 if (options.check_desc_v == false) { 941 infos_description.height = 0; 942 } 943 944 Debug_pos(); 945 946 //options.cl_visible=false ; 947 return infos_description; 948 } //infos_Description_f 949 950 //======================================================================================= 951 Debug_info = function (index, infos, nom) { 952 if (infos.height > 0) { 953 message = browser.browser + " -- > Info : " + nom + " " + infos.id + "\n" + 1678 954 "Info nodeName: " + infos.nodeName + "\n" + 1679 955 "Info width: " + infos.width + "\n" + … … 1682 958 "Info left: " + infos.left + "\n" + 1683 959 "Info position: " + infos.position + "\n"; 1684 myDebug = { id: "Debug" + index, texte: message, 1685 css: { 1686 color: "black", 1687 opacity: "0.5", 1688 position: "absolute", 1689 height: infos.height || 100 + "px", 1690 width: infos.width || 300 + "px", 1691 left: infos.left || 0 + "px", 1692 border: "solid 1px green", 1693 top: infos.top + "px" 1694 } 960 myDebug = { id: "Debug" + index, texte: message, 961 css: { 962 color: "black", 963 opacity: "0.5", 964 position: "absolute", 965 height: infos.height || 100 + "px", 966 width: infos.width || 300 + "px", 967 left: infos.left || 0 + "px", 968 border: "solid 1px green", 969 top: infos.top + "px" 970 } 971 } 972 return myDebug; 973 } else { 974 if (typeof old_messages == "undefined") { 975 old_messages = new Array(); 976 977 } 978 if (infos != "" && infos != "undefined") { 979 nc0 = old_messages[index]; 980 981 if (typeof nc0 != "undefined") { 982 nc0 = old_messages[index].toString().split("<br />"); 983 if (nc0.length > 3) nc0.shift(); 984 985 old_messages[index] = nc0.join("<br />"); 986 } 987 old_messages[index] += " : " + nom + " -- > " + infos + "<br />"; 988 989 message = browser.browser + old_messages[index]; 990 991 myDebug = { id: "Debug" + index, texte: message, 992 css: { 993 color: "black", 994 opacity: "1.0", 995 position: "absolute", 996 align: "left", 997 height: 100 + "px", 998 width: 800 + "px", 999 left: 300 + "px", 1000 border: "solid 1px green", 1001 top: 0 + "px" 1695 1002 } 1696 return myDebug; 1697 } else { 1698 if (typeof old_messages == "undefined") { 1699 old_messages = new Array(); 1700 1701 } 1702 if (infos != "" && infos != "undefined") { 1703 nc0 = old_messages[index]; 1704 1705 if (typeof nc0 != "undefined") { 1706 nc0 = old_messages[index].toString().split("<br />"); 1707 if (nc0.length > 3) nc0.shift(); 1708 1709 old_messages[index] = nc0.join("<br />"); 1710 } 1711 old_messages[index] += " : " + nom + " -- > " + infos + "<br />"; 1712 1713 message = browser.browser + old_messages[index]; 1714 1715 myDebug = { id: "Debug" + index, texte: message, 1716 css: { 1717 color: "black", 1718 opacity: "1.0", 1719 position: "absolute", 1720 align: "left", 1721 height: 100 + "px", 1722 width: 800 + "px", 1723 left: 300 + "px", 1724 border: "solid 1px green", 1725 top: 0 + "px" 1726 } 1727 } 1728 } 1729 1730 return myDebug; 1731 } 1732 1733 1734 } 1003 } 1004 } 1005 1006 return myDebug; 1007 } 1008 1009 1010 } 1011 //==================================================== 1012 function Debug_pos() { 1013 return; 1014 if (DEBUG_autosize == "true") { 1015 1016 jQuery("[id ^='Debug']").show(); 1017 /* 1018 Debug2 background-color:yellow 1019 Debug3 background-color:blue 1020 Debug4 background-color:green 1021 Debug5 background-color:red 1022 1023 */ 1024 1025 affiche_debug({ 1026 Debug1: Debug_info(1, Bandeau_t, "Bandeau_t"), 1027 Debug4: Debug_info(4, infos_description, "infos_description"), 1028 Debug5: Debug_info(5, infos_theMainImage, "infos_theMainImage") 1029 }); 1030 } 1031 } 1032 //========================================================== 1033 affiche_debug = function (aff_infos) { 1034 jQuery(jQuery("[id ^='Debug']")).each(function (i) { 1035 if (aff_infos[this.id]) { 1036 if (aff_infos[this.id].css) { 1037 jQuery("#" + this.id).css(aff_infos[this.id].css); 1038 jQuery("#" + this.id).html(aff_infos[this.id].texte); 1039 } 1040 } 1041 }); 1042 return; 1043 } 1044 //=========================================== 1045 // 1046 //=========================================== 1047 Set_Map = function (nds) { 1048 p0 = jQuery("#map").position(); 1049 if (!p0) return; 1050 1051 infos_map = jQuery("#map").infos(); 1052 // if (infos_map.width == (Zone_image.container.width - p0.left)) return ; 1053 nds = jQuery("#imageInfos").css("display"); 1054 if (nds != "none") { 1055 p2 = jQuery("#infoSwitcher").infos(); 1056 p0.left += 35; 1057 } 1058 jQuery("#map").width(Zone_image.container.width - p0.left); 1059 jQuery("#map").css({ position: "absolute", height: Zone_image.container.height + "px" }); 1060 } 1061 1062 jQuery("map [name='mapAutosize'] area").mouseover(function (e) { 1063 return; 1064 }); 1065 //===================================== 1066 // 1067 //===================================== 1068 theImage_init = function (Obj) { 1069 if (jQuery("#derivativeSwitchBox").length > 0) { 1070 id3 = jQuery("#derivativeCheckedAutosize"); 1071 var pi = jQuery("#derivativeSwitchBox > span "); 1072 var px = jQuery(".derivativeSizeDetails "); 1073 i = 0; 1074 n = 0; 1075 var pt = new Array(); 1076 jQuery("#derivativeSwitchBox a").each(function (i) { 1077 href_path = jQuery(this).attr("href"); 1078 if (href_path.match(RegExp("auto", "gi"))) return true; 1079 pt[i] = href_path.split("'"); 1080 }); 1081 Calcul_Image(); 1082 tw = Zone_image.container.width; 1083 th = Zone_image.container.height; 1084 n = 0; 1085 jQuery(".derivativeSizeDetails").each(function (i) { 1086 vn = jQuery(this).text().replace("(", "").replace(")", "").split("x"); 1087 h0 = parseInt(vn[1]); 1088 w0 = parseInt(vn[0]) 1089 if (h0 > th) { 1090 n = i; 1091 return false; 1092 } 1093 if (w0 > tw) { 1094 n = i; 1095 return false; 1096 } 1097 n++; 1098 }); 1099 if (n > pt.length - 1) n = pt.length - 1; // format le plus grand 1100 if (n < 0) n = 0; // format le plus grand 1101 imgSrc = pt[n][1]; 1102 last_map = pt[n][5]; 1103 var theImg = document.getElementById(theMainImage_Id.replace("#", "")); 1104 if (theImg.useMap.match(RegExp("map", "gi"))) return; 1105 if (theImg.src.match(RegExp(imgSrc, "gi"))) return; 1106 1107 href_path = "javascript:changeImgSrc('" + imgSrc + "', '" + last_map + "', '" + "#Autosize" + "')"; 1108 jQuery("#linkAutosize").attr("href", href_path); 1109 changeImgSrc(imgSrc, last_map, "#Autosize"); 1110 } 1111 return false; 1112 1113 }; 1114 1115 //=============================================================== 1116 // Fonctions générales 1117 //=============================================================== 1118 Set_llbgo = function (Force) { 1119 if (Force) 1120 if (typeof LlgboFr_Resize == "function") LlgboFr_Resize(); 1121 // if (typeof updateXY != "function") return; 1122 maps = jQuery("map[name^='map']"); 1123 maps = jQuery("map[name='Autosize']"); 1124 if (maps.length == 0) return; 1125 1126 nom_map = 'Autosize'; 1127 // nom_map = maps[0].name; 1128 maps = jQuery("map[name='" + nom_map + "'] area"); 1129 1130 1131 nb_zone = maps.length; 1132 infos_theMainImage = jQuery(theMainImage_Id).infos(); // Image 1133 var Largeur_zone = (infos_theMainImage.width / nb_zone); 1134 var Hauteur_zone = (infos_theMainImage.height); 1135 var init_zone = 0; 1136 j = 0; 1137 maps.each(function (e) { 1138 init_zone = Largeur_zone * j; 1139 rel = jQuery(this).attr("rel"); 1140 title = jQuery(this).attr("title"); 1141 alt = jQuery(this).attr("alt"); 1142 H = Hauteur_zone; 1143 if (rel == "up") { 1144 H = Hauteur_zone / 4; 1145 } 1146 coord = { x0: init_zone, y0: 0, x1: Math.ceil(init_zone + Largeur_zone), y1: Hauteur_zone }; 1147 jQuery(this).attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + coord.y1 + "'" }); 1148 j++; 1149 }); 1150 1151 return; 1152 } 1153 1154 /************************************************* 1155 * correction pamoorama 1156 *************************************************/ 1157 Set_Pamoorama = function () { 1158 if (Type_Img == "pamoorama") { 1159 if (typeof myPamoorama == "undefined") { 1160 return; 1161 } 1162 1163 Calcul_Image(); 1164 infos_pamoorama = jQuery("#pamoorama").infos(); 1165 infos_pamoorama_outter = jQuery("#pamoorama_outter").infos(); 1166 infos_pamoorama_inner = jQuery("#pamoorama_inner").infos(); 1167 infos_pamoorama_footer = jQuery("#pamoorama_footer").infos(); 1168 infos_pamoorama_frame = jQuery("#pamoorama_frame").infos(); 1169 infos_frame = jQuery(myPamoorama.frame).infos(); 1170 1171 1735 1172 //==================================================== 1736 function Debug_pos() { 1737 return; 1738 if (DEBUG_autosize == "true") { 1739 1740 jQuery("[id ^='Debug']").show(); 1741 /* 1742 Debug2 background-color:yellow 1743 Debug3 background-color:blue 1744 Debug4 background-color:green 1745 Debug5 background-color:red 1746 1747 */ 1748 1749 affiche_debug({ 1750 Debug1: Debug_info(1, Bandeau_t, "Bandeau_t"), 1751 Debug4: Debug_info(4, infos_description, "infos_description"), 1752 Debug5: Debug_info(5, infos_img, "infos_img") 1753 }); 1754 } 1755 } 1756 //========================================================== 1757 affiche_debug = function (aff_infos) { 1758 jQuery(jQuery("[id ^='Debug']")).each(function (i) { 1759 if (aff_infos[this.id]) { 1760 if (aff_infos[this.id].css) { 1761 jQuery("#" + this.id).css(aff_infos[this.id].css); 1762 jQuery("#" + this.id).html(aff_infos[this.id].texte); 1763 } 1764 } 1765 }); 1766 return; 1767 } 1768 //=========================================== 1769 // 1770 //=========================================== 1771 Set_Map = function (nds) { 1772 p0 = jQuery("#map").position(); 1773 if (!p0) return; 1774 1775 infos_map = jQuery("#map").infos(); 1776 // if (infos_map.width == (Zone_image.container.width - p0.left)) return ; 1777 nds = jQuery("#imageInfos").css("display"); 1778 if (nds != "none") { 1779 p2 = jQuery("#infoSwitcher").infos(); 1780 p0.left += 35; 1781 } 1782 jQuery("#map").width(Zone_image.container.width - p0.left); 1783 jQuery("#map").css({ position: "absolute", height: Zone_image.container.height + "px" }); 1784 } 1785 //===================================== 1786 // 1787 //===================================== 1788 theImage_init = function (Obj) { 1789 if (jQuery("#derivativeSwitchBox").length > 0) { 1790 id3 = jQuery("#derivativeCheckedAutosize"); 1791 1792 1793 var pi = jQuery("#derivativeSwitchBox > span "); 1794 var px = jQuery(".derivativeSizeDetails "); 1795 1796 i = 0; 1797 n = 0; 1798 var pt = new Array(); 1799 jQuery("#derivativeSwitchBox a").each(function (i) { 1800 href_path = jQuery(this).attr("href"); 1801 if (href_path.match(RegExp("auto", "gi"))) return true; 1802 pt[i] = href_path.split("'"); 1803 }); 1804 1805 th = jQuery(window).height(); 1806 tw = jQuery(window).width(); 1807 1808 th = infos_body.height; 1809 tw = infos_body.width; 1810 infos_imageInfos 1811 1812 Zone_image = Calcul_Image(infos_imageInfos.visible == false); 1813 n0 = 0; 1814 n1 = 0; 1815 t0 = 0; 1816 tw = Zone_image.container.width; 1817 th = Zone_image.container.height; 1818 n = 0; 1819 1820 jQuery(".derivativeSizeDetails").each(function (i) { 1821 vn = jQuery(this).text().replace("(", "").replace(")", "").split("x"); 1822 h0 = parseInt(vn[1]); 1823 w0 = parseInt(vn[0]) 1824 if (h0 > th) { 1825 n = i; 1826 return false; 1827 } 1828 if (w0 > tw) { 1829 n = i; 1830 return false; 1831 } 1832 n++; 1833 }); 1834 if (n > pt.length - 1) n = pt.length - 1; // format le plus grand 1835 if (n < 0) n = 0; // format le plus grand 1836 id_en_cours = pt[n][1]; 1837 last_map = pt[n][5]; 1838 var theImg = document.getElementById("theMainImage"); 1839 if (id3.length > 0) { 1840 if (theImg.useMap.match(RegExp("map", "gi"))) return true; 1841 changeImgSrc(id_en_cours, last_map, "Autosize"); 1842 } else { 1843 new_html = '<br /><span class="switchCheck" id="derivativeCheckedAutosize" style="visibility:hidden" >✔ </span>'; 1844 new_html += '<a href="javascript:changeImgSrc(\'' + id_en_cours + '\', \'' + last_map + '\', \'Autosize\') ">'; 1845 new_html += 'Autosize<span class="derivativeSizeDetails"> - Autosize</span> </a>'; 1846 jQuery("#derivativeSwitchBox br:last").before(new_html); 1847 1848 theImg.useMap = typeMap; 1849 if (theImg.useMap.match(RegExp("map", "gi"))) { 1850 return true 1851 }; 1852 jQuery('#derivativeSwitchBox .switchCheck').css('visibility', 'hidden'); 1853 jQuery('#derivativeCheckedAutosize').css('visibility', 'visible'); 1854 1855 if (theImg) { 1856 theImg.removeAttribute("width"); 1857 theImg.removeAttribute("height"); 1858 theImg.src = id_en_cours; 1859 theImg.useMap = "Autosize"; 1860 return true; 1861 } 1862 } 1863 1864 } 1865 return true; 1866 1867 }; 1868 1869 //=============================================================== 1870 // Fonctions générales 1871 //=============================================================== 1872 1873 1874 /************************************************* 1875 * correction pamoorama 1876 *************************************************/ 1877 Set_Pamoorama = function () { 1878 if (Type_Img == "pamoorama") { 1879 if (typeof myPamoorama == "undefined") { 1880 return; 1881 } 1882 1883 Zone_image = Calcul_Image(infos_imageInfos.visible == false); 1884 infos_pamoorama = jQuery("#pamoorama").infos(); 1885 infos_pamoorama_outter = jQuery("#pamoorama_outter").infos(); 1886 infos_pamoorama_inner = jQuery("#pamoorama_inner").infos(); 1887 infos_pamoorama_footer = jQuery("#pamoorama_footer").infos(); 1888 infos_pamoorama_frame = jQuery("#pamoorama_frame").infos(); 1889 infos_frame = jQuery(myPamoorama.frame).infos(); 1890 1891 1892 //==================================================== 1893 jQuery("#pamoorama").css({ 1894 marginLeft: "auto", 1895 marginRight: "auto" 1896 // height: Zone_Affichage.height + "px" , sinon déclenchement panorama sur la hauteur; 1897 }); 1898 1899 infos_pamoorama_inner = jQuery("#pamoorama_inner").infos(); 1900 infos_pamoorama = jQuery("#pamoorama").infos(); 1901 1902 1903 1904 1905 marges_w = infos_pamoorama.borderwidth.left + 1173 jQuery("#pamoorama").css({ 1174 marginLeft: "auto", 1175 marginRight: "auto" 1176 // height: Zone_Affichage.height + "px" , sinon déclenchement panorama sur la hauteur; 1177 }); 1178 1179 infos_pamoorama_inner = jQuery("#pamoorama_inner").infos(); 1180 infos_pamoorama = jQuery("#pamoorama").infos(); 1181 1182 1183 1184 1185 marges_w = infos_pamoorama.borderwidth.left + 1906 1186 infos_pamoorama.margin.left + 1907 1187 infos_pamoorama.borderwidth.right + 1908 1188 infos_pamoorama.margin.right; 1909 1189 1910 1190 marges_h = 10 + 1911 1191 infos_pamoorama.borderwidth.top + 1912 1192 infos_pamoorama.margin.top + 1913 1193 infos_pamoorama.borderwidth.bottom + 1914 1194 infos_pamoorama.margin.bottom; 1915 1195 marges_h += infos_pamoorama_footer.borderwidth.top + 1916 1196 infos_pamoorama_footer.margin.top + 1917 1197 infos_pamoorama_footer.borderwidth.bottom + 1918 1198 infos_pamoorama_footer.margin.bottom; 1919 1199 1920 jQuery("#pamoorama").css({ 1921 width: "" 1922 }); 1923 1924 outter_height = Zone_image.container.height - infos_pamoorama_footer.height - marges_h; 1925 Zoom_pano = outter_height / Zone_image.height_init; 1926 1927 new_image = { height: Math.ceil(Zone_image.height_init * Zoom_pano), 1928 width: Math.ceil(Zone_image.width_init * Zoom_pano) 1929 } 1930 1931 jQuery("#pamoorama_inner").css({ width: new_image.width, height: new_image.height, "background-size": "100%" 1932 }); 1933 1934 // jQuery("#pamoorama_inner").width(Zone_image.width_init * Zoom_pano); 1935 // jQuery("#pamoorama_inner").height(Zone_image.height_init * Zoom_pano); 1936 1937 1938 //---------- test largeur image 1939 new_width = Zone_image.container.width; 1940 if (new_width > new_image.width) { 1941 new_width = new_image.width; 1942 jQuery("#pamoorama_outter").css({ 1943 position: 'absolute', 1944 align: "center", 1945 margin: "auto" 1946 }); 1947 } 1948 outter_width = new_width; 1949 1950 1951 // jQuery("#pamoorama_thumb").width(200 / Zone_image.zoom); 1952 1953 jQuery("#pamoorama_outter").css({ 1954 1955 align: 'center', 1956 margin: 'auto', 1957 width: outter_width + "px", 1958 height: outter_height + "px" 1959 }); 1960 //============= Mise à l'echelle ================== 1961 jQuery("#pamoorama_footer").css({ 1962 width: Zone_image.container.width + "px" 1963 }); 1964 1965 window.myPamoorama.options.width = Math.ceil(Zone_image.container.width); 1966 //================================================================== 1967 new_max_left = new_image.width - outter_width; 1968 // jQuery(window.myPamoorama.inner).width(Zone_image.width_init* Zoom_pano); 1969 // jQuery(window.myPamoorama.inner).height(Zone_image.height_init * Zoom_pano); 1970 1971 1972 window.myPamoorama.outter.scrollTo(new_max_left, 0); 1973 1974 window.myPamoorama.autoScrollFx.to = new Array(new_max_left, 0); 1975 window.myPamoorama.ratio = Math.ceil(new_image.width / 200); 1976 window.myPamoorama.imageWidth = new_image.width; 1977 window.myPamoorama.imageHeight = new_image.height; 1978 nf = jQuery("#pamoorama_thumb").height(); 1979 jQuery("#pamoorama_thumb img").width(200); 1980 jQuery("#pamoorama_thumb img").height(nf); 1981 // 200=window.myPamoorama.width 1982 // frame = Zone_image.container.width 1983 1984 nw = (window.myPamoorama.image.width * Zone_image.container.width) / window.myPamoorama.imageWidth; 1985 jQuery("#pamoorama_frame").width(nw); 1986 jQuery("#pamoorama").css({ 1987 width:"auto",height:"auto" 1200 jQuery("#pamoorama").css({ 1201 width: "" 1202 }); 1203 1204 outter_height = Zone_image.container.height - infos_pamoorama_footer.height - marges_h; 1205 Zoom_pano = outter_height / Zone_image.height_init; 1206 1207 new_image = { height: Math.ceil(Zone_image.height_init * Zoom_pano), 1208 width: Math.ceil(Zone_image.width_init * Zoom_pano) 1209 } 1210 1211 jQuery("#pamoorama_inner").css({ width: new_image.width, height: new_image.height, "background-size": "100%" 1212 }); 1213 1214 // jQuery("#pamoorama_inner").width(Zone_image.width_init * Zoom_pano); 1215 // jQuery("#pamoorama_inner").height(Zone_image.height_init * Zoom_pano); 1216 1217 1218 //---------- test largeur image 1219 new_width = Zone_image.container.width; 1220 if (new_width > new_image.width) { 1221 new_width = new_image.width; 1222 jQuery("#pamoorama_outter").css({ 1223 position: 'absolute', 1224 align: "center", 1225 margin: "auto" 1988 1226 }); 1989 1990 } // test img 1991 } // Set_Pamoorama 1992 /*********************************************************/ 1993 1994 Toggle_bp = function () { 1995 cl_visible = !cl_visible; 1996 Autosize_resize(); 1997 Wait_Affichage(); 1998 set_cl(); 1999 } 2000 //==================================== 2001 // 2002 //==================================== 2003 set_cl = function () { 2004 if (typeof cl_visible == "undefined") return; 2005 if (typeof src1 == "undefined") return; 2006 2007 if (cl_visible) src = src1; 2008 else src = src2; 2009 2010 if (cl_visible) { 2011 src_info = src3; 2012 src_infos_1 = src3; 2013 } 2014 else { 2015 src_info = src4; 2016 src_infos_1 = src5; 2017 } 2018 1227 } 1228 outter_width = new_width; 1229 1230 1231 // jQuery("#pamoorama_thumb").width(200 / Zone_image.zoom); 1232 1233 jQuery("#pamoorama_outter").css({ 1234 1235 align: 'center', 1236 margin: 'auto', 1237 width: outter_width + "px", 1238 height: outter_height + "px" 1239 }); 1240 //============= Mise à l'echelle ================== 1241 jQuery("#pamoorama_footer").css({ 1242 width: Zone_image.container.width + "px" 1243 }); 1244 1245 window.myPamoorama.options.width = Math.ceil(Zone_image.container.width); 1246 //================================================================== 1247 new_max_left = new_image.width - outter_width; 1248 // jQuery(window.myPamoorama.inner).width(Zone_image.width_init* Zoom_pano); 1249 // jQuery(window.myPamoorama.inner).height(Zone_image.height_init * Zoom_pano); 1250 1251 1252 window.myPamoorama.outter.scrollTo(new_max_left, 0); 1253 1254 window.myPamoorama.autoScrollFx.to = new Array(new_max_left, 0); 1255 window.myPamoorama.ratio = Math.ceil(new_image.width / 200); 1256 window.myPamoorama.imageWidth = new_image.width; 1257 window.myPamoorama.imageHeight = new_image.height; 1258 nf = jQuery("#pamoorama_thumb").height(); 1259 jQuery("#pamoorama_thumb img").width(200); 1260 jQuery("#pamoorama_thumb img").height(nf); 1261 // 200=window.myPamoorama.width 1262 // frame = Zone_image.container.width 1263 1264 nw = (window.myPamoorama.image.width * Zone_image.container.width) / window.myPamoorama.imageWidth; 1265 jQuery("#pamoorama_frame").width(nw); 1266 jQuery("#pamoorama").css({ 1267 width: "auto", height: "auto" 1268 }); 1269 1270 } // test img 1271 } // Set_Pamoorama 1272 /*********************************************************/ 1273 1274 Toggle_bp = function () { 1275 options.cl_visible = !options.cl_visible; 1276 Autosize_resize(); 1277 Wait_Affichage(); 1278 1279 } 1280 //==================================== 1281 // 1282 //==================================== 1283 set_cl = function (Valid) { 1284 if (typeof Valid == "undefined") Valid = options.useMap.match(RegExp("Autosize", "gi")) || false; 1285 1286 if (typeof options.cl_visible == "undefined") return; 1287 if (typeof src1 == "undefined") return; 1288 1289 if (options.cl_visible) src = src1; 1290 else src = src2; 1291 1292 if (options.cl_visible) { 1293 src_info = src3; 1294 src_infos_1 = src3; 1295 } 1296 else { 1297 src_info = src4; 1298 src_infos_1 = src5; 1299 } 1300 if (Valid) { 1301 if (typeof Zone_image.image != "undefined") { 2019 1302 Zone_image.zoom = (Zone_image.image.height / Zone_image.height_init); 2020 1303 zoom_cl = parseInt(100 * Zone_image.zoom); … … 2022 1305 2023 1306 zoom_cl = jQuery('#zoom ').val(); 1307 2024 1308 jQuery('#bp_cla').attr('alt', src_info); 2025 1309 jQuery('#bp_cla').attr('title', src_info); 2026 1310 jQuery('#bp_cla').attr('Stitle', src_info); 2027 1311 jQuery('#bp_cla').attr('Stip', zoom_cl + "%"); 2028 2029 //jQuery('#bp_cla span').text(src_infos_1 +" "+ zoom + "%");2030 1312 jQuery('#bp_cla span').text(zoom_cl + "%"); 2031 bp_scr = jQuery('#bp_img_cla'); 2032 2033 if (bp_scr.length > 0) { 2034 src_enc = bp_scr.attr("src"); 2035 if (!src_enc.match(src)) { 2036 bp_scr.get(0).src = src; 2037 jQuery('#bp_img_cla').attr('alt', src_info); 2038 jQuery('#bp_img_cla').attr('title', src_info); 1313 color_back = jQuery('#imageToolBar').css("backgroundColor"); 1314 if (color_back.match(new RegExp("rgb", "gi"))) { 1315 color_back = color_back.split("(")[1].split(")")[0].split(","); 1316 color_back = "rgb(" + Math.abs(255 - color_back[0]) + "," 1317 + Math.abs(255 - color_back[1]) + "," 1318 + Math.abs(255 - color_back[2]) + ")"; 1319 1320 } 1321 else if (color_back.match(new RegExp("#", "gi"))) 1322 color_back = Math.abs("#65536" - color_back); 1323 else 1324 color_back = jQuery('body').css("color"); 1325 1326 1327 jQuery('#bp_cla span').css("color", color_back); 1328 } 1329 } else { 1330 src = src6; 1331 } 1332 if (Zone_image.image) 1333 jQuery('#auto_details').text(" (" + Zone_image.image.width + " x " + Zone_image.image.height + ")"); 1334 bp_scr = jQuery('#bp_img_cla'); 1335 1336 if (bp_scr.length > 0) { 1337 src_enc = bp_scr.attr("src"); 1338 if (!src_enc.match(src)) { 1339 bp_scr.get(0).src = src; 1340 jQuery('#bp_img_cla').attr('alt', src_info); 1341 jQuery('#bp_img_cla').attr('title', src_info); 1342 } 1343 } 1344 } 1345 //==================================== 1346 // 1347 //==================================== 1348 Calcul_Image = function () { 1349 // theImageAndInfos(jaune) -> theImage(vert) -> [llgbo] -> theMainImage 1350 // + infos_imageInfos(red) 1351 infos_window = jQuery(window).infos(); 1352 infos_body = jQuery("body").infos(); // thePicturePage 1353 infos_the_page = jQuery("#the_page").infos(); 1354 // theHeader 1355 // 1356 infos_menubar = jQuery("#menubar").infos(); 1357 infos_menubar_dl = jQuery("#menubar dl").infos(); 1358 infos_content = jQuery("#content").infos(); 1359 // imageHeaderBar 1360 // imageToolBar imageInfoBar 1361 infos_imageInfoBar = jQuery("#imageInfoBar").infos(); 1362 infos_imageToolBar = jQuery("#imageToolBar").infos(); 1363 //theImageAndTitle 1364 infos_theImageAndInfos = jQuery("#theImageAndInfos").infos(); 1365 if (infos_theImageAndInfos.width == 0) 1366 infos_theImageAndInfos = jQuery("#theImageAndTitle").infos(); 1367 infos_theImage = jQuery("#theImage").infos(); 1368 /**************************************** 1369 * marginl r 10 10,borderwidth 5 5, padding 10 10 1370 * infos_theImage width 849 , (+padding) out 869,(+border) ext 879 ,(+marge) general 899 1371 * general marges width 50 l25+r25, 1372 ****************************************/ 1373 1374 infos_imageInfos = jQuery("#imageInfos").infos(); 1375 infos_theMainImage = jQuery(theMainImage_Id).infos(); // Image 1376 infos_theMainImage.src = jQuery(theMainImage_Id).attr("src"); 1377 1378 // commentContent 1379 // copyright 1380 1381 pos_top = options.pos_top; 1382 pos_top = options.pos_top + infos_llgbo.top 1383 1384 container = { 1385 height: infos_window.height - pos_top, 1386 width: infos_content.width 1387 } 1388 marge_left = infos_theImage.general.marges.left; 1389 marge_right = infos_theImage.general.marges.right; 1390 marge_top = infos_theImage.general.marges.top + infos_content.general.marges.top + 2; 1391 marge_bottom = infos_theImage.general.marges.bottom + Math.ceil(options.marge_basse) + infos_content.general.marges.bottom; ; 1392 1393 //========================================================== 1394 if (theme.match(RegExp("stripped", "gi"))) { 1395 infos_the_page.margin.left = 20; //taille fleche 1396 infos_the_page.margin.right = 20; 1397 } 1398 1399 1400 if (theme.match(RegExp("elegant", "gi"))) { 1401 jQuery("#imageInfos").css({ position: "absolute", right: 0, margin: "auto" 1402 , top: 0 1403 }); 1404 1405 1406 // marge_right += infos_content.general.marges.right; 1407 if (infos_imageInfos.visible == true) { 1408 marge_right += infos_imageInfos.width + 2; 1409 1410 } else { 1411 marge_right += 15; 1412 1413 } 1414 marge_left += 5; 1415 marge_top += 20; 1416 1417 } else if (theme.match(RegExp("stripped", "gi"))) { 1418 1419 } else if (theme.match(RegExp("simple", "gi"))) { 1420 1421 1422 } else if (theme.match(RegExp("OS", "gi"))) { 1423 1424 } else if (theme.match(RegExp("pur", "gi"))) { 1425 1426 marge_right += 25; 1427 1428 } else { 1429 // jQuery("#menuSwitcher").hide(); 1430 1431 margeLeft = infos_content.margin.left; 1432 if (infos_menubar_dl.visible == true) { 1433 margeLeft += infos_body.general.marges.width + infos_menubar.general.width; 1434 } 1435 else 1436 1437 margeLeft += infos_thePicturePage.general.marges.width; 1438 // container.width -= margeLeft; 1439 1440 1441 } 1442 1443 1444 1445 //========== Format Image ============== 1446 retrait_img_h = Math.ceil(options.marges_llgbo || 0) 1447 + infos_theMainImage.general.marges.height 1448 ; 1449 //=============================================================== 1450 retrait_img = Math.ceil(infos_theMainImage.general.marges.width); 1451 retrait_img += Math.ceil(options.marges_llgbo || 0); 1452 retrait_img += 0; 1453 1454 //================== Limite Format Image ===================== 1455 image_max = { 1456 height: container.height - marge_top - marge_bottom - retrait_img_h, 1457 width: container.width - marge_left - marge_right - retrait_img 1458 } 1459 //================================================================ 1460 if (typeof Zone_image.height_init == "undefined") { 1461 init_img(theImg); 1462 Zone_image.width_init = img_init.width; 1463 Zone_image.height_init = img_init.height; 1464 Zone_image.height_init = Math.ceil(img_init.height); 1465 Zone_image.rapport_init = Math.ceil(img_init.width / Zone_image.height_init); 1466 rapport = Zone_image.rapport_init; 1467 } 1468 1469 theMainImage_str = theMainImage_Id.replace("#", ""); 1470 useMap_en_cours = jQuery(theMainImage_Id).attr("useMap"); 1471 1472 var theImg = document.getElementById(theMainImage_str); 1473 if (theImg) { 1474 if (useMap_en_cours.match(RegExp("map", "gi"))) { 1475 image_max.height = jQuery(theImg).height() - retrait_img_h; 1476 image_max.width = jQuery(theImg).width() - retrait_img; 1477 width_theMainImage = image_max.width; 1478 height_theMainImage = image_max.height; 1479 } else { 1480 //========================= 1481 // test débordement 1482 //========================= 1483 rapport = Zone_image.rapport_init; 1484 width_theMainImage = Math.ceil(image_max.width); 1485 height_theMainImage = Math.ceil(width_theMainImage / rapport); 1486 1487 container.height_interne = container.height - marge_top - marge_bottom; 1488 container.width_interne = container.width - marge_left - marge_right; 1489 1490 if (height_theMainImage > container.height_interne) { 1491 image_max.height = container.height_interne; 1492 image_max.width = image_max.height * rapport; 1493 width_theMainImage = Math.ceil(image_max.width); 1494 height_theMainImage = Math.ceil(image_max.height); 1495 } 1496 if (width_theMainImage > container.width_interne) { 1497 image_max.width = container.width_interne; 1498 image_max.height = image_max.height / rapport; 1499 width_theMainImage = Math.ceil(image_max.width); 1500 height_theMainImage = Math.ceil(image_max.height); 1501 1502 } else if (width_theMainImage > container.width) { 1503 1504 } else { 1505 1506 } 1507 } 1508 //=============================================================== 1509 } 1510 if (Type_Img != "pamoorama") { 1511 1512 } 1513 1514 //================================================= 1515 rapport = Zone_image.rapport_init; 1516 1517 height_theMainImage = Math.ceil(width_theMainImage / rapport); 1518 container.height = height_theMainImage + retrait_img_h + infos_theImage.general.marges.top + pos_top; 1519 1520 //================================================================ 1521 Zone_image.image = { 1522 width: width_theMainImage, 1523 height: height_theMainImage 1524 }; 1525 1526 Zone_image.container = { 1527 width: container.width, 1528 height: container.height 1529 1530 }; 1531 //================================================================= 1532 1533 Zone_image.src = jQuery(theMainImage_Id).attr("src"); 1534 1535 1536 Zone_image.zoom = Zone_image.image.height / Zone_image.height_init; 1537 1538 } 1539 1540 /********************************************* 1541 * Calcul l es dimensions. 1542 *********************************************/ 1543 Get_dimensions = function (force, parametres) { 1544 infos_theMainImage = jQuery(theMainImage_Id).infos(); 1545 Zone_image.src = infos_theMainImage.src; 1546 if (typeof rapport == "undefined") return; 1547 if (force && force == true) old_window.width = 0; 1548 1549 1550 if (infos_theMainImage.useMap.match(RegExp("Autosize", "gi"))) 1551 infos_theMainImage.useMap = "#Autosize"; 1552 1553 useMap = options.useMap; 1554 1555 if (theme.match("simple")) useMap = "#Autosize"; 1556 if (typeof useMap == "") useMap = "#Autosize"; 1557 if (options.useMap) { 1558 // useMap = options.useMap; 1559 } 1560 if (useMap) { 1561 if (!useMap.match(RegExp("Autosize", "gi"))) { 1562 return; 1563 } 1564 } 1565 1566 if (options.imageAutosize) { 1567 return; //stripped 1568 } 1569 1570 if (typeof options.cl_visible == "undefined") return; 1571 if (!options.cl_visible == true) { return; } 1572 //====================================================== 1573 1574 var chk = eval("options." + user_status + "_enabled"); 1575 if (chk == "") { return; } 1576 1577 if (!options.useMap.match(RegExp("Autosize", "gi"))) { 1578 1579 return; 1580 } 1581 1582 //================================================================= 1583 infos_widow = jQuery(window).infos(); 1584 var winwidth = infos_body.width; 1585 var winheight = infos_body.height; 1586 if (Type_Img == "pamoorama") { 1587 theMainImage_Id = "#pamoorama"; 1588 Calcul_Image(); 1589 } else { 1590 Calcul_Image(); 1591 } 1592 img_finale = { width: Zone_image.image.width, height: Zone_image.image.height }; 1593 //================================================================= 1594 old_window = jQuery(window).infos(); 1595 //========= Récupération des informations ============= 1596 var Licence = jQuery(".licencetag"); 1597 infos_Licence = jQuery(".licencetag").infos(); 1598 //================================================================= 1599 switch (Type_Img) { 1600 case "map": 1601 Set_Map(true); 1602 break 1603 case "panorama": 1604 if (!theMainImage_Id) { 1605 theMainImage_Id = "#theMainImage"; 1606 if (theMainImage_Id.length > 0) 1607 return; 1608 theMainImage_Id = jQuery().Get_Img_Maxi("#Panorama img[alt]"); 1609 1610 if (theMainImage_Id.length > 0) 1611 theMainImage_Id = theMainImage_Id[0]; 1612 else 1613 theMainImage_Id = jQuery().Get_Img_Maxi("#Panorama img[alt]"); 1614 } 1615 infos_theImage = jQuery(theMainImage_Id).infos(); 1616 infos_the_page = jQuery("#the_page").infos(); 1617 jQuery("#theImage").height(infos_theImage.height); 1618 img_finale.height = infos_theImage.height; 1619 break 1620 case "img": 1621 1622 if (!theMainImage_Id) return; 1623 if (theme.match(RegExp("luciano", "g"))) { 1624 1625 } 1626 1627 infos_the_page = jQuery("#the_page").infos(); 1628 1629 1630 break 1631 case "img_autre": 1632 if (!theMainImage_Id) { 1633 if (DEBUG_autosize == "true") alert("The_MainImage=null"); 1634 return; 1635 1636 } 1637 infos_theImage = jQuery(theMainImage_Id).infos(); 1638 infos_the_page = jQuery("#the_page").infos(); 1639 1640 1641 break 1642 case "embed": 1643 // 1644 if (infos_theMainImage.width == 0) 1645 infos_theMainImage = jQuery("#thePicturePage").infos(); 1646 if (infos_theMainImage.width == 0) 1647 infos_theMainImage = jQuery("#the_page").infos(); 1648 infos_theImage = infos_theMainImage; 1649 infos_the_page = jQuery("#the_page").infos(); 1650 Bandeau_bas.height = Bandeau_bas.top; 1651 1652 iph1 = jQuery("#theImage div").infos(); 1653 if ((winheight - iph1.bottom) > 0) 1654 Bandeau_bas.height = (winheight - iph1.bottom) + 50; 1655 else 1656 Bandeau_bas.height = 50; 1657 1658 1659 if (rapport < 0) { 1660 img_height = infos_theMainImage.height; 1661 img_width = infos_theMainImage.width; 1662 img_reelle.height = img_height; 1663 img_reelle.width = img_width; 1664 } 1665 1666 break 1667 case "charlie": 1668 img_reelle = { height: img_height, width: img_width }; 1669 infos_theMainImage = jQuery(theMainImage_Id).infos(); ; 1670 infos_the_page = jQuery("#the_page").infos(); 1671 if (rapport < 0) { 1672 img_height = parseInt(infos_theMainImage.height); 1673 img_width = parseInt(infos_theMainImage.width); 1674 img_reelle.height = parseInt(infos_theMainImage.height); 1675 img_reelle.width = parseInt(infos_theMainImage.width); 1676 } 1677 break 1678 1679 1680 case "pamoorama": 1681 img_reelle = { height: img_height, width: img_width }; 1682 //========================================================= 1683 img_reelle.height = img_height; 1684 img_reelle.width = Zone_Affichage.width; 1685 if (typeof myPamoorama != "undefined") theMainImage_Id = myPamoorama.image; 1686 infos_theImage = jQuery("#pamoorama").infos(); 1687 infos_theImage.height = infos_theImage.height; 1688 infos_the_page = jQuery("#the_page").infos(); 1689 break 1690 } 1691 1692 img_finale = { width: Zone_image.image.width, height: Zone_image.image.height }; 1693 return true; 1694 1695 //================= Vérification Taille image minimun autorisée ======== 1696 MinWidth = jQuery(theMainImage_Id).css("minWidth"); 1697 if (MinWidth == "0px") 1698 MinWidth = options.mini_width; 1699 MinHeight = jQuery(theMainImage_Id).css("minHeight"); 1700 if (MinHeight == "0px") 1701 MinHeight = options.mini_height; 1702 1703 MaxWidth = jQuery(theMainImage_Id).css("maxWidth"); 1704 if (MaxWidth == "0px") 1705 MaxWidth = winwidth; 1706 MaxHeight = jQuery(theMainImage_Id).css("maxHeight"); 1707 if (MaxHeight == "0px") 1708 MaxHeight = winheight; 1709 1710 //=============== Vérification taille minimale autorizée ====================== 1711 var miniWidth = jQuery(theMainImage_Id).Get_Val_int(MinWidth, options.mini_width); 1712 var miniHeight = jQuery(theMainImage_Id).Get_Val_int(MinHeight, options.mini_height); 1713 if (winwidth < options.mini_width2) mini_width2 = winwidth; 1714 1715 var miniWidth2 = jQuery(theMainImage_Id).Get_Val_int(MinWidth, options.mini_width2); 1716 var miniHeight2 = jQuery(theMainImage_Id).Get_Val_int(MinHeight, options.mini_height2); 1717 1718 1719 var maxWidth = jQuery(theMainImage_Id).Get_Val_int(MaxWidth, winwidth, "0"); 1720 maxHeight = jQuery(theMainImage_Id).Get_Val_int(MaxHeight, winheight, "0"); 1721 1722 mini_width = parseInt(miniWidth); 1723 mini_height = parseInt(miniHeight); 1724 img_reelle.width = parseInt(img_reelle.width); 1725 if (img_reelle.width < mini_width) 1726 return; 1727 img_reelle.height = parseInt(img_reelle.height); 1728 if (img_reelle.height < parseInt(mini_height)) 1729 return; 1730 1731 1732 1733 1734 //================================================= 1735 if (Zone_image.image.height < options.mini_height2) 1736 Zone_image.image.height = options.mini_height2; 1737 if (Zone_image.image.width < options.mini_width2) 1738 Zone_image.image.width = options.mini_width2; 1739 //================================================== 1740 // Image_width largeur à atteindre 1741 // Calcul du rapport d'agrandissement 1742 echelle_max = parseFloat(options.echelle_max, '3'); 1743 if (Zone_image.zoom > echelle_max) { 1744 Zone_image.zoom = echelle_max; 1745 Zone_image.image.width = parseInt(Zone_image.width_init * Zone_image.zoom); 1746 if (rapport > 0) 1747 Zone_image.image.height = parseInt(Zone_image.width_init / rapport); 1748 } 1749 //============================================================= 1750 var height_user = eval("options." + user_status + "_height"); 1751 var width_user = eval("options." + user_status + "_width"); 1752 var reg1 = new RegExp("%", "g"); 1753 //============================================================= 1754 if (height_user.match(reg1)) 1755 Image_height = Zone_image.height_init * parseInt(height_user) / 100; 1756 else 1757 Image_height = parseInt(height_user); 1758 //============================================================== 1759 1760 Image_width = parseInt(Image_height * rapport); 1761 1762 //====================================================================== 1763 img_finale = { width: Zone_image.image.width, height: Zone_image.image.height }; 1764 return true; 1765 1766 1767 1768 1769 1770 1771 1772 //=================================================== 1773 1774 img_finale.height = Image_height; 1775 img_finale.width = Image_width; 1776 if (theme.match(RegExp("stripped", "gi"))) { 1777 img_finale.width -= (llgboframe.top * 2); 1778 if (rapport > 0) img_finale.height = (img_finale.width / rapport); 1779 else img_finale.height -= (llgboframe.top * 2); 1780 1781 } 1782 zoom = echelle; 1783 if (typeof (llgboframe) != "undefined" && llgboframe.height > 0) { 1784 //=============LLGBO2 =========================== 1785 t1 = llgboframe; 1786 if (!theMainImage_Id.src) { 1787 theMainImage_Id = jQuery(llgbo_id).find("img").get(0) 1788 if (!theMainImage_Id.src) { 1789 theMainImage_Id = jQuery("#theImage").find("div").get(0) 1790 } 1791 } 1792 if (theMainImage_Id.src) { 1793 wingbo = img_finale.width; 1794 heightgbo = img_finale.height; 1795 if (Type_Img == "panorama") { 1796 heightgbo = infos_theImage.height; 1797 img_finale.height = infos_theImage.height; 1798 } 1799 1800 1801 1802 1803 // jQuery("#theImage").height(heightgbo + marges_llgbo / 2); 1804 } 1805 } 1806 1807 //================ Zone affichage ========================= 1808 1809 // jQuery("#theImage").css("top", "0px"); 1810 jQuery("#standard").css("top", 0 + "px"); 1811 jQuery("#comments").css("top", 0 + "px"); 1812 //========== Image Remise à l'échelle ======================= 1813 1814 img_finale.height = parseInt(img_finale.height); 1815 img_finale.width = parseInt(img_finale.width); 1816 //========================================================================= 1817 //=== cadre = theImage 1818 if (theme.match(RegExp("simple", "gi"))) { 1819 jQuery("#theImage").width(Zone_Affichage.width); //centrer simple black 1820 jQuery("#theImage").css({ width: Zone_Affichage.width + "px", 1821 marginLeft: "auto" 1822 }); 1823 1824 } else if (theme.match(RegExp("sobre", "gi")) || theme.match(RegExp("hr_", "gi")) || theme.match(RegExp("Mont", "gi"))) { 1825 jQuery("#theImage").css({ width: "auto", marginLeft: "auto" }); 1826 } else if (theme.match(RegExp("saruka", "gi"))) { 1827 1828 jQuery("#theImage").css({ width: Zone_Affichage.width + "px" }); 1829 } else if (theme.match(RegExp("elegant", "gi"))) { 1830 1831 // jQuery("#theImage").css("width", "auto"); 1832 jQuery("#theImage").css({ height: Zone_Affichage.height + "px", width: "auto" }); //conteneur 1833 1834 } else { 1835 jQuery("#theImage").css("width", "auto"); 1836 1837 } 1838 // ; 1839 1840 if (Type_Img == "panorama" || Type_Img == "pamoorama") { 1841 img_finale.height = infos_theImage.height; 1842 Zone_Affichage.height = img_finale.height; 1843 1844 } 1845 1846 if (typeof (gmaps) != "undefined") { 1847 Gmap_ = gmaps.maps[0]; 1848 if (Gmap_.sizeMode == 'A') { 1849 jQuery("#iGMapsIcon").css({ width: old_window.width * 0.8 + "px", height: old_window.height * 0.8 + "px" }); 1850 1851 } 1852 } 1853 //============= flv,mov,mpg ok 1854 /* wmv nok 1855 * avi nok 1856 //=========================================== 1857 */ 1858 if (Type_Img == "charlie") { 1859 t1 = jQuery("#charlie").infos(); 1860 1861 /**/ 1862 1863 pdf = 0; 1864 jQuery("#charlie div").each(function (i) { 1865 1866 1867 p1 = jQuery(this).infos(); 1868 pdf += p1.padding.right + p1.padding.left; 1869 }); 1870 img_finale.width -= pdf; 1871 1872 jQuery("#charlie").css({ 1873 width: img_finale.width + pdf + "px", 1874 height: img_finale.height + "px", 1875 marginLeft: "auto" 1876 }); 1877 1878 1879 if (MainImage.length > 0) { 1880 img_finale.height = parseInt(img_finale.width / rapport); 1881 img_finale.height -= 30; 1882 img_finale.width = rapport * img_finale.height; 1883 1884 1885 MainImage.width(img_finale.width); 1886 MainImage.height(img_finale.height); 1887 jQuery("#embedplayer").width(300); 1888 jQuery("#embedplayer").height(15); 1889 } else { 1890 jQuery("#player").css("width", img_finale.width + "px"); 1891 jQuery("#player").css("height", img_finale.height + "px"); 1892 1893 jQuery("#embedplayer").css("width", img_finale.width + "px"); 1894 jQuery("#embedplayer").css("height", img_finale.height + "px"); 1895 1896 jQuery("embed").css({ width: img_finale.width + "px", 1897 height: img_finale.height + "px" 1898 }); 1899 jQuery("object").css({ width: img_finale.width + "px", 1900 height: img_finale.height + "px" 1901 }); 1902 jQuery("video").css({ width: img_finale.width + "px", 1903 height: img_finale.height + "px" 1904 }); 1905 1906 1907 1908 jQuery("video").height(img_finale.height); 1909 jQuery("video").width(img_finale.width); 1910 1911 jQuery("object").width(img_finale.width); 1912 jQuery("object").height(img_finale.height); 1913 //jQuery("#theImage").height(img_finale.height + Bandeau_bas.height); //?? 1914 1915 jQuery(theMainImage_Id).height(img_finale.height); 1916 jQuery("#theImage").css("height", "auto"); 1917 } 1918 1919 1920 } else if (Type_Img == "embed") { 1921 1922 if (MainImage.length > 0) { 1923 img_finale.height = parseInt(img_finale.width / rapport); 1924 img_finale.height -= 30; 1925 img_finale.width = rapport * img_finale.height; 1926 1927 1928 MainImage.width(img_finale.width); 1929 MainImage.height(img_finale.height); 1930 jQuery("#embedplayer").width(300); 1931 jQuery("#embedplayer").height(15); 1932 } else { 1933 jQuery("#theImage").css("height", "auto"); 1934 jQuery("embed").css("height", img_finale.height); 1935 jQuery("object").css({ height: img_finale.height + "px" }); 1936 1937 jQuery("object").width(img_finale.width); 1938 jQuery("object").height(img_finale.height); 1939 } 1940 1941 } else if (Type_Img == "panorama") { 1942 if (typeof asp_options != "undefined") 1943 n = asp_options; 1944 n1 = jQuery("#Panorama div").width(); 1945 jQuery(".panorama-viewport").css("margin", "auto"); 1946 n = infos_imageToolBar; 1947 1948 1949 } else if (Type_Img == "pamoorama") { 1950 Set_Pamoorama(); 1951 1952 1953 1954 1955 } else if (theMainImage_Id != null && theMainImage_Id.src) { 1956 //--- background ?? --- 1957 jQuery(theMainImage_Id).height(img_finale.height); 1958 jQuery(theMainImage_Id).width(img_finale.width); 1959 jQuery(theMainImage_Id).css({ height: img_finale.height + "px ", 1960 width: img_finale.width + "px " 1961 }); 1962 1963 1964 } else { 1965 //===map ? luciano === 1966 // jQuery(theMainImage_Id).css({ height: img_finale.height + "px ", width: img_finale.width + "px }); 1967 // jQuery(theMainImage_Id).height(img_finale.height ); 1968 // jQuery(theMainImage_Id).width(img_finale.width ); 1969 // jQuery(theMainImage_Id).attr({ width: img_finale.width }); 1970 h = img_finale.height; 1971 h = Zone_Affichage.height - Zone_Affichage.borderwidth.top - Zone_Affichage.borderwidth.bottom; 1972 h -= (infos_theImage.borderwidth.bottom + infos_theImage.borderwidth.top); 1973 1974 jQuery(theMainImage_Id).attr({ height: h - 3 }); //image 1975 if (theme.match(RegExp("elegant", "gi"))) { 1976 return true; 1977 1978 } 1979 if (theme.match(RegExp("luciano", "g"))) { 1980 imgl = 180; 1981 l = Zone_Affichage.left; 1982 1983 jQuery(".imageNumber").css({ left: l + "px" 1984 1985 }); 1986 jQuery("#theImage" + " #theImg IMG").css({ height: img_finale.height + "px ", 1987 width: (img_finale.width - imgl) + "px ", marginTop: "0px" 1988 }) 1989 } 1990 1991 } 1992 1993 var theImg = document.getElementById(theMainImage_Id.replace("#", "")); 1994 if (theImg) { 1995 theImg.removeAttribute("width"); 1996 theImg.removeAttribute("height"); 1997 jQuery(theMainImage_Id).css("width", img_finale.width + "px"); 1998 } 1999 2000 jQuery("#navThumbPrev").css({ overflow: "hidden" }); 2001 jQuery("#navThumbNext").css({ overflow: "hidden" }); 2002 n = typeof inittoolbar; 2003 if (Type_Img == "map") { 2004 jQuery("#navThumbNext").css({ display: 'none' }); 2005 jQuery("#navThumbPrev").css({ display: 'none' }); 2006 jQuery("#theImage").css({ marginTop: infos_imageToolBar.height + "px", marginLeft: "0px", 2007 width: winwidth + "px", 2008 height: winheight + "px" 2009 }); 2010 //mapPicture 2011 } 2012 try { 2013 if (theme.match(RegExp("gally", "gi"))) { 2014 if (typeof inittoolbar == "function") { 2015 if (typeof (currentTab) == "undefined") inittoolbar(); 2016 else initializeImageMode("resize"); 2017 } else { 2018 tp = gallyPP.getImageProp(); 2019 if (typeof (GallyPP) == "function") 2020 gallyPP = new GallyPP(); 2021 2022 iph = jQuery("#imageHeaderBar").infos(); 2023 jQuery("#imageToolBar").css({ top: iph.bottom + "px", position: "absolute" }); 2024 jQuery("#theImage").width(winwidth); 2025 } 2026 //=========================================================================== 2027 if (jQuery("#navThumbPrev").length > 0) { 2028 jQuery("#navThumbPrevContainer").css({ left: "0px" 2029 }); 2030 } 2031 if (jQuery("#navThumbNext").length > 0) { 2032 jQuery("#navThumbNextContainer").css({ left: "0px" 2033 }); 2034 } 2035 //============================================================================= 2036 if (!theme.match(RegExp("lapis", "gi"))) { 2037 if (typeof initializeImageMode == "function") { 2038 initializeImageMode("resize"); 2039 2039 } 2040 } 2041 } 2042 //==================================== 2043 // 2044 //==================================== 2045 Calcul_Image = function (all_width) { 2046 // theImageAndInfos(jaune) -> theImage(vert) -> [llgbo] -> theMainImage 2047 // + infos_imageInfos(red) 2048 infos_body = jQuery("body").infos(); // thePicturePage 2049 infos_the_page = jQuery("#the_page").infos(); 2050 // theHeader 2051 // 2052 infos_menubar = jQuery("#menubar").infos(); 2053 infos_content = jQuery("#content").infos(); 2054 // imageHeaderBar 2055 // imageToolBar imageInfoBar 2040 2041 } 2042 2043 } else if (theme.match(RegExp("simple", "g"))) { 2044 2045 jQuery("#imageToolBar").css({ position: "static" }); 2046 2056 2047 infos_imageInfoBar = jQuery("#imageInfoBar").infos(); 2057 infos_imageToolBar = jQuery("#imageToolBar").infos(); 2058 //theImageAndTitle 2059 infos_theImageAndInfos = jQuery("#theImageAndInfos").infos(); 2060 if (infos_theImageAndInfos.width == 0) 2061 infos_theImageAndInfos = jQuery("#theImageAndTitle").infos(); 2062 infos_theImage = jQuery("#theImage").infos(); 2063 infos_imageInfos = jQuery("#imageInfos").infos(); 2064 infos_theMainImage = jQuery(theMainImage_obj).infos(); // Image 2065 infos_theMainImage.src = jQuery(theMainImage_obj).attr("src"); 2066 // infos_llgbo = jQuery("#llgbo").infos(); 2067 // commentContent 2068 // copyright 2069 pos_bottom = infos_content.bottom - infos_content.margin.bottom; 2070 pos_left = infos_theImage.left; 2071 x = infos_body.left; 2072 imageInfos_width = jQuery("#imageInfos").css("width"); 2073 2074 if (theme.match(RegExp("stripped", "gi"))) { 2075 infos_the_page.margin.left = 20; //taille fleche 2076 infos_the_page.margin.right = 20; 2077 } 2078 2079 retrait_w = Math.ceil(infos_theImage.general.marges.width 2080 2081 ); 2082 2083 2084 retrait_w += Math.ceil(infos_the_page.general.marges.width 2085 2086 ); 2087 2088 retrait_w += Math.ceil(infos_body.general.marges.width); 2089 2090 retrait_w += Math.ceil(infos_content.general.marges.width); 2091 2092 2093 pos_top = Math.ceil(infos_theImageAndInfos.top 2094 + infos_theImageAndInfos.general.marges.height 2095 ); 2096 2097 retrait_h = Math.ceil(pos_top 2098 + infos_theImage.margin.top 2099 + infos_theImage.general.marges.height 2100 ); 2101 2102 2103 2104 jQuery(theMainImage_obj).css({ margin: "auto" 2105 }); 2106 2107 retrait_img = Math.ceil( 2108 infos_theMainImage.general.marges.width 2109 ); 2110 retrait_img += Math.ceil( 2111 infos_llgbo.borderwidth.left 2112 + infos_llgbo.borderwidth.right 2113 ); 2114 2115 retrait_img += Math.ceil( 2116 infos_the_page.general.marges.width 2117 ); 2118 2119 2120 2121 // menuSwitcherwidth+padding 2122 2123 2124 if (theme.match(RegExp("elegant", "gi"))) { 2125 if (all_width != true) { 2126 marge_right = infos_imageInfos.general.width; 2127 } else { 2128 marge_right = 0; 2129 } 2130 2131 wx1 = infos_theImage.general.width; 2132 width_theImage = (infos_body.width - marge_right - 1) 2133 2134 2135 } else if (theme.match(RegExp("stripped", "gi"))) { 2136 width_theImage = (jQuery(window).width()); 2137 } else if (theme.match(RegExp("simple", "gi"))) { 2138 width_theImage = infos_imageInfoBar.left + infos_theImage.left - infos_imageInfoBar.margin.left - 5; 2139 2140 2141 } else { 2142 width_theImage = (infos_body.width); 2143 marginLeft = infos_menubar.margin.left + 1; 2144 marginLeft = infos_content.margin.left; 2145 infos_menubar_dl = jQuery("#menubar dl").infos(); 2146 marginLeft = infos_menubar_dl.margin.left 2147 + infos_menubar_dl.left 2148 + infos_menubar_dl.width; 2149 if (infos_menubar_dl.visible == "false") 2150 if (!theme.match(RegExp("sylvia", "gi"))) 2151 marginLeft = 0; 2152 jQuery("#content").css({ marginLeft: marginLeft+"px" }); 2153 } 2154 2155 2156 b = 0; 2157 2158 2159 if (infos_llgbo.top > 0) { 2160 if ((infos_llgbo.top - retrait_h) > 0) { 2161 b = infos_llgbo.top - retrait_h; 2162 } else { 2163 b = infos_llgbo.top; 2164 } 2165 } 2166 retrait_h += (b * 2) - 5; 2167 retrait_img += 5; 2168 2169 2170 height_theImage = jQuery(window).height() - retrait_h; 2171 width_theImage -= retrait_w; 2172 //=============================================================== 2173 width_theMainImage = (width_theImage - retrait_img); 2174 height_theMainImage = parseInt(width_theImage / rapport); 2175 2176 //=============================================================== 2177 // test débordement 2178 if ((height_theMainImage) > height_theImage - (retrait_img + (b * 2))) { 2179 height_theMainImage = height_theImage - (retrait_img); 2180 width_theMainImage = parseInt(height_theMainImage * rapport); 2181 } else { 2182 width_theMainImage = width_theImage - (retrait_img); 2183 height_theMainImage = parseInt(width_theMainImage / rapport); 2184 } 2185 //================================================================== 2186 var theImg = document.getElementById("theMainImage"); 2187 if (theImg) { 2188 2189 2190 if (theImg.useMap.match(RegExp("map", "gi"))) { 2191 height_theMainImage = jQuery(theImg).height() - (retrait_img); 2192 width_theMainImage = jQuery(theImg).width() - retrait_img; 2193 } 2194 } 2195 width_theMainImage = parseInt(height_theMainImage * rapport); 2196 height_theMainImage = parseInt(width_theMainImage / rapport); 2197 2198 height_theImage += (b * 2); 2199 if (height_theImage > height_theMainImage + retrait_h) { 2200 if (Type_Img != "pamoorama") { 2201 height_theImage = height_theMainImage + retrait_h; 2202 } 2203 } 2204 height_theMainImage = width_theMainImage / rapport; 2205 2206 Zone_image = { 2207 image: { width: width_theMainImage, 2208 height: height_theMainImage 2209 }, 2210 container: { 2211 width: width_theImage, 2212 height: height_theImage 2213 } 2214 }; 2215 Zone_image.top = retrait_h; 2216 Zone_image.marge = { width: retrait_w, height: retrait_h }; 2217 2218 Zone_image.src = jQuery(theMainImage_obj).attr("src"); 2219 2220 2221 Zone_image.width_init = img_init.width; 2222 Zone_image.height_init = img_init.height; 2223 2224 if (!Zone_image.height_init) { 2225 Zone_image.height_init = parseInt(img_init.height); 2226 Zone_image.rapport_init = parseInt(img_init.width) / Zone_image.height_init; 2227 } 2228 2229 Zone_image.rapport_init = Zone_image.width_init / Zone_image.height_init; 2230 Zone_image.zoom = Zone_image.image.height / Zone_image.height_init; 2231 2232 return Zone_image; 2233 } 2234 2235 2236 2237 Autosize_resize(true); 2238 2239 2240 }); // ready 2241 })(jQuery); 2242 2048 if (infos_imageInfoBar.bottom < infos_theMainImage.bottom) { 2049 // jQuery("#imageInfoBar").height(infos_theMainImage.bottom); 2050 } 2051 2052 } else { 2053 2054 // jQuery("#imageToolBar").css("position", "static"); 2055 } 2056 } catch (e) { 2057 2058 } 2059 zoom = img_finale.height / img_height; 2060 h0 = jQuery("#content").height(); 2061 if (h0 == null) { 2062 h0 = winheight - Zone_Affichage.top; 2063 } 2064 h1 = (h0 - img_finale.height) / 2; 2065 // jQuery("#theImage").css({ marginTop: h1 + "px" }); 2066 2067 zoom = parseInt(zoom * 100); 2068 jQuery('#zoom ').val(zoom); 2069 2070 2071 2072 // --- réglage de la hauteur de page en fonction du copyright----------- 2073 if (typeof (pos_copyright) == "undefined") pos_copyright = jQuery("#copyright").infos(); 2074 2075 if (theme.match(RegExp("stripped", "gi"))) { 2076 var TitleBox = jQuery("#imageTitleContainer"); 2077 if (TitleBox.length != 0) TitleBox.css("width", img_finale.width + "px"); 2078 } else { 2079 2080 } 2081 2082 2083 /* 2084 if (!theme.match(RegExp("luciano", "gi"))) { 2085 jQuery("#linkNext").css({ height: "80px", width: "200px", overflow: "hidden" }); 2086 jQuery("#linkPrev").css({ height: "80px", width: "200px", overflow: "hidden" }); 2087 jQuery(".navThumb img").css({ height: "80px", width: "", overflow: "hidden" }); 2088 } 2089 */ 2090 infos_frame = jQuery("#theImage").infos(); 2091 if (theme.match(RegExp("stripped", "gi"))) { 2092 /* 2093 infos_theImageBox = jQuery("#theImageAndTitle").infos(); 2094 p1 = jQuery(".randomButtons").infos(); 2095 p2 = jQuery("#imageHeaderBar").infos(); 2096 p3 = infos_content.top; 2097 p1 = options.imageAutosizeTitle; 2098 2099 jQuery("#theImage").width("width", infos_theImageBox.width + "px"); 2100 //jQuery("#theImageAndTitle").css("position", "relative"); 2101 jQuery("#content").css({ position: "relative", top: "10px", marginTop: "0px", 2102 paddingTop: "0px", textAalign: "center", marginLeft: "auto" 2103 }); 2104 2105 jQuery("#theImageAndTitle").css({ position: "relative", top: "0px", marginTop: "0px", 2106 paddingTop: "0px", marginLeft: "auto" 2107 }); */ 2108 t1 = infos_theImageBox.top; 2109 l1 = infos_theImageBox.left; 2110 // infos_theImageBox = jQuery("#theImage").infos(); 2111 2112 } else { 2113 2114 t1 = infos_frame.top; 2115 l1 = infos_frame.left; 2116 infos_theImageBox = jQuery("#theImage").infos(); //theImage 2117 } 2118 infos_theImageBox.margin.margin = infos_frame.margin.margin; 2119 infos_theImageBox.top = t1; 2120 infos_theImageBox.left = l1; 2121 // infos_theImageBox.position = "absolute"; 2122 2123 Window_Affichage = infos_theImageBox; 2124 if (DEBUG_autosize == "_true") { 2125 // jQuery("#theImage").css("border", "solid green"); 2126 2127 jQuery("#Debug5").css({ background: "red", 2128 position: "absolute", 2129 border: "green solid 2px", 2130 textAlign: align_auto, 2131 margin: "auto", 2132 top: Window_Affichage.top + "px", 2133 left: Window_Affichage.left + "px", 2134 width: Window_Affichage.width + "px", 2135 height: Window_Affichage.height + "px" 2136 }); //red 2137 jQuery("#Debug4").css({ top: infos_frame.bottom - infos_description.height + "px" }); //green 2138 } 2139 2140 //Wait_Affichage(); 2141 2142 return true; 2143 } // Get_dimensions 2144 2145 2146 //========================================================= 2147 theMainImage_Id = "#theMainImage"; 2148 if (typeof (options) == "undefined") { 2149 options = { imageAutosize: false } 2150 } 2151 options = jQuery.extend(Autosize_options, options); 2152 var defaults = { 2153 useMap: '#Autosize', 2154 imageAutosizeMargin: 0, 2155 imageAutosize: false, 2156 marge_basse: options.imageAutosizeMargin || 0, 2157 DEBUG_autosize: false 2158 }; 2159 2160 options = jQuery.extend(defaults, options); 2161 jQuery("#form_autosize_picture").addClass("Autosize_margin"); 2162 //===== marges suplémentaires en fonction theme === 2163 options.marge_haute = jQuery(".Autosize_margin").Get_Val_int(jQuery(".Autosize_margin").css("top")); 2164 options.marge_basse = jQuery(".Autosize_margin").Get_Val_int(jQuery(".Autosize_margin").css("bottom")); 2165 options.marge_gauche = jQuery(".Autosize_margin").Get_Val_int(jQuery(".Autosize_margin").css("left")); 2166 options.marge_droite = jQuery(".Autosize_margin").Get_Val_int(jQuery(".Autosize_margin").css("right")); 2167 2168 2169 DEBUG_autosize = options.DEBUG_autosize; 2170 cookies = Get_cookies(); 2171 2172 //============= Gestion Maps ================ 2173 nom_map = "Autosize"; 2174 a_up = jQuery("map[name='" + nom_map + "'] area[rel=up]"); 2175 a_prev = jQuery("map[name='" + nom_map + "'] area[rel=prev]"); 2176 a_next = jQuery("map[name='" + nom_map + "'] area[rel=next]"); 2177 2178 new_html = '<map name="Autosize" >'; 2179 2180 var theme = options.theme; 2181 nb_zone = jQuery("div .navigationButtons a").length; 2182 var infos_theMainImage = jQuery(theMainImage_Id).infos(); // Image 2183 var Largeur_zone = (infos_theMainImage.width / nb_zone); 2184 var Hauteur_zone = (infos_theMainImage.height); 2185 var init_zone = 0; 2186 j = 0; 2187 jQuery("div .navigationButtons a").each(function (e) { 2188 Hauteur_zone = (infos_theMainImage.height); 2189 title = jQuery(this).attr("title"); 2190 h_ref = jQuery(this).attr("href"); 2191 init_zone = Largeur_zone * j; 2192 if (title.match(":")) { 2193 if (j == 0) 2194 rel = "prev"; 2195 else 2196 rel = "next"; 2197 } else { 2198 rel = "up"; 2199 Hauteur_zone = Hauteur_zone / 4; 2200 } 2201 coord = init_zone + "," + 0 + "," + Math.ceil(init_zone + Largeur_zone) + "," + Hauteur_zone; 2202 new_html += '<area rel="' + rel + '" title="' + title + '" href="' + h_ref + '" shape="rect" coords="' + coord + '" alt="' + title + '" />'; 2203 2204 j++; 2205 }); 2206 new_html += '</map>'; 2207 jQuery("#theImage map:last").after(new_html); 2208 2209 //=================== Gestion liste photos size ============================ 2210 us = 0; 2211 var user_status = options.user_status; 2212 var type_size = eval("options." + user_status + "_type"); //limite taille 2213 var type_size_maxi = eval("options." + user_status + "_type"); //limite taille 2214 2215 n = 0; 2216 2217 var pt = new Array(); 2218 jQuery("#derivativeSwitchBox .switchCheck").css('visibility', 'hidden'); 2219 jQuery("#derivativeSwitchBox a").css('visibility', 'hidden'); 2220 2221 jQuery("#derivativeSwitchBox a").each(function (i) { 2222 href_path = jQuery(this).attr("href"); 2223 pt[i] = href_path.split("'"); 2224 tsz = pt[i][5]; 2225 jQuery(this).css('visibility', 'visible'); 2226 //--- recherche limite --- 2227 if (tsz.match(RegExp(type_size_maxi, "gi"))) { 2228 return false; 2229 } 2230 //--- type en cours --- 2231 if (tsz.match(RegExp("^" + options.type_size, "gi"))) { 2232 us = n; 2233 } 2234 2235 n++; 2236 }); 2237 2238 jQuery("derivativeChecked" + options.type_size).css('visibility', 'visible'); 2239 2240 2241 2242 //=================== 2243 // VARIABLES 2244 //=================== 2245 var theMainImage_Id = "#theMainImage"; 2246 type_src = "div"; 2247 old_window = { width: 0, height: 0 }; 2248 List_autosize = new Array(); 2249 nu_img = 0; 2250 tempo = 0; 2251 //==================================================== 2252 var infos_thePicturePage = jQuery("#thePicturePage").infos(); 2253 var infos_theImageAndInfos; 2254 2255 var theImageAndInfos_id = "#theImageAndInfos"; 2256 if (options.theme.match(RegExp("simple", "gi"))) { 2257 theImageAndInfos_id = "#content"; 2258 2259 jQuery(theMainImage_Id).attr("position", "static"); 2260 2261 2262 } else { 2263 infos_theImageAndInfos = jQuery(theImageAndInfos_id).infos(); // Cadre general 2264 if (infos_theImageAndInfos.visible == true) 2265 theImageAndInfos_id = "#theImageAndInfos"; 2266 else 2267 theImageAndInfos_id = "#imageContainer"; 2268 } 2269 2270 infos_theImageAndInfos = jQuery(theImageAndInfos_id).infos(); // Cadre general 2271 2272 var infos_theImage = jQuery("#theImage").infos(); // Container 2273 infos_theMainImage = jQuery(theMainImage_Id).infos(); // Image 2274 2275 if (infos_theMainImage.width == 0) { 2276 infos_theMainImage = jQuery("#theImage img").infos(); 2277 if (infos_theMainImage.id == "") 2278 jQuery("#theImage img").attr("id", "theMainImage"); 2279 infos_theMainImage = jQuery(theMainImage_Id).infos(); 2280 } 2281 2282 var infos_imageInfos = jQuery("#imageInfos").infos(); // Informations 2283 2284 2285 var infos_the_page = jQuery("#the_page").infos(); 2286 var infos_content = jQuery("#content").infos(); 2287 var infos_titrePage = jQuery("#titrePage").infos(); 2288 var infos_imageInfoBar = jQuery("#imageInfoBar").infos(); 2289 var infos_theHeader = jQuery("#theHeader").infos(); 2290 var infos_imageToolBar = jQuery("#imageToolBar").infos(); 2291 var infos_imageHeaderBar = jQuery("#imageHeaderBar").infos(); 2292 var infos_body = jQuery("body").infos(); 2293 var llgbo_id = "#llgbo0"; 2294 2295 var infos_llgbo = jQuery(llgbo_id).infos(); 2296 var infos_llgboh2 = jQuery("#llgboh2").infos(); 2297 2298 var marges_llgbo = 0; 2299 var Zone_image = { 2300 width_init: options.img_width, 2301 height_init: options.img_height, 2302 rapport_init: options.img_width / options.img_height 2303 }; 2304 2305 var Type_Img = ""; 2306 2307 2308 2309 pos_top = jQuery(theImageAndInfos_id).position(); 2310 pos_top = pos_top.top - infos_theImageAndInfos.general.marges.top; 2311 pos_top += infos_content.general.marges.top; 2312 pos_top += infos_theImage.general.marges.top; 2313 options.pos_top = pos_top; 2314 2315 2316 old_window = { width: 0, height: 0 }; 2317 2318 2319 //==== en cours ============ 2320 n = pt.length - 1; 2321 if (n >= 0) { 2322 imgSrc = pt[n][1]; 2323 last_map = pt[n][5]; 2324 2325 imgSrc = pt[us][1]; 2326 last_map = pt[us][5]; 2327 2328 new_html = '<br /><span class="switchCheck" id="derivativeCheckedAutosize" style="visibility:visible" >✔ </span>'; 2329 new_html += '<a id="linkAutosize" href="javascript:changeImgSrc(\'' + imgSrc + '\', \'' + last_map + '\', \'' + type_size + '\') ">'; 2330 new_html += 'Autosize<span class="derivativeSizeDetails" id="auto_details" > - Autosize</span> </a>'; 2331 if (type_size.match(RegExp("Autosize", "gi"))) { 2332 jQuery("#derivativeSwitchBox br:last").before(new_html); 2333 } 2334 2335 useMap = cookies.pictureMap; // #mapxxx 2336 if (useMap == "#Autosize" && type_size_maxi == "Autosize") { 2337 2338 } else { 2339 useMap = last_map; 2340 } 2341 2342 typeSave = cookies.typeSave; //picturederiv xxx 2343 options.type_size = useMap.replace("#", ""); 2344 2345 type_size = options.type_size; 2346 cookies.pictureMap = useMap; // #mapxxx 2347 cookies.typeSave = last_map; //picturederiv xxx 2348 cookies.imgSrc = imgSrc; 2349 2350 changeImgSrc(imgSrc, last_map, type_size); 2351 2352 2353 } 2354 2355 2356 }); // ready 2243 2357 2244 2358 //===================================================================== … … 2291 2405 h1_top = jQuery(img).absoluteTop() - h1_top; 2292 2406 h1_bottom = Obj_h - h1_top; 2293 infos_ img= { width: conf.width[i], height: conf.height[i] }; //origine2407 infos_theMainImage = { width: conf.width[i], height: conf.height[i] }; //origine 2294 2408 img_rap = conf.rap[i]; 2295 if (infos_ img.width > Obj_w) h1 = parseInt(Obj_w / img_rap);2409 if (infos_theMainImage.width > Obj_w) h1 = parseInt(Obj_w / img_rap); 2296 2410 h1 -= h1_top; 2297 2411 if (h1 > Obj_h - h1_top) { … … 2310 2424 h1_top = jQuery(this).absoluteTop() - h1_top; 2311 2425 h1_bottom = Obj_h - h1_top; 2312 infos_ img= { width: conf.width[i], height: conf.height[i] }; //origine2426 infos_theMainImage = { width: conf.width[i], height: conf.height[i] }; //origine 2313 2427 img_rap = conf.rap[i]; 2314 if (infos_ img.width > Obj_w) h1 = parseInt(Obj_w / img_rap);2428 if (infos_theMainImage.width > Obj_w) h1 = parseInt(Obj_w / img_rap); 2315 2429 h1 -= h1_top; 2316 2430 if (h1 > Obj_h - h1_top) { … … 2336 2450 2337 2451 } 2338 //=============================================== 2339 // Extend expression jQuery(":Autozise") ; 2340 //=============================================== 2341 jQuery.extend(jQuery.expr[':'], { 2342 // Nom du sélecteur personnalisé 2343 Autosize: function (a) { 2344 nd = a.nodeName; 2345 n1 = a.className; 2346 // personal_block 2347 if (n1.match(RegExp("autosize", "gi"))) { 2348 // autosize = "MargeBasse:30px; ResizePicture:false" 2349 infconf = jQuery(a).attr("autosize"); 2350 n1 = typeof infconf; 2351 conf = { MargeBasse: 0, NoPicture: false } 2352 if (n1 == "undefined") { 2353 2354 } else { 2355 tableau = infconf.split(";"); 2356 for (var i = 0; i < tableau.length; i++) { 2357 tableau2 = tableau[i].split(":"); 2358 conf[jQuery.trim(tableau2[0])] = jQuery.trim(tableau2[1]); 2359 } 2360 imgs = jQuery(a).find("img"); 2361 rap = new Array(); 2362 width = new Array(); 2363 height = new Array(); 2364 if (imgs.length > 0) 2365 jQuery(imgs).each(function (i) { 2366 img = jQuery(this); 2367 rap.push((img.width() / img.height())); 2368 width.push(img.width()); 2369 height.push(img.height()); 2370 }); 2371 else { 2372 imgs = jQuery(a).children(); 2373 jQuery(imgs).each(function (i) { 2374 if (this.height > 0) { 2375 rap.push(this.width / this.height); 2376 width.push(this.width); 2377 height.push(this.height); 2378 } 2379 name = this.name; 2380 2381 2382 }); 2383 } 2384 conf['rap'] = rap; 2385 conf['width'] = width; 2386 conf['height'] = height; 2387 List_autosize.push({ obj: a, conf: conf }); 2388 jQuery(a).css({ opacity: 0 }); 2389 } 2390 } 2391 // Css = jQuery(a).getStyles(a); 2392 return false; 2393 }, // jQuery.Autosize 2394 Set_Class: function (a) { 2395 nd = a.nodeName; 2396 if (nd == "DIV") { 2397 XBrowserAddHandler(a, 'onpropertychange', onPropertyChange); 2398 //jQuery(a).find("img:nth-child(1)").css("border","Solid 5px green"); 2399 img = jQuery(a).children("img"); 2400 if (img.length == 0) img = jQuery(a).find("a").children("img"); 2401 if (img.length > 0) 2402 if (img.length == 1) { 2403 if (img[0].src.match(RegExp(".png", "g"))) 2404 return; 2405 // img[0].attachEvent('onpropertychange', onPropertyChange); 2406 XBrowserAddHandler(img[0], 'onpropertychange', onPropertyChange); 2407 jQuery(img).addClass("Image"); 2408 //jQuery(img).attr("autosize", "MargeBasse:0px; ResizePicture:true"); 2409 } 2410 } 2411 } //jQuery().Set_Class 2412 2413 2414 }); // Extend expression 2415 2416 /************************************************** 2417 * TEST 2418 **************************************************/ 2419 2420 jQuery(document).ready(function () { 2421 /* 2422 var txtTestBox = document.getElementById('menubar'); 2423 XBrowserAddHandler(txtTestBox, 'propertychange', function () { 2424 onPropertyChange(txtTestBox); 2425 }); 2426 var txtTestBox2 = document.getElementById('imageInfos'); 2427 XBrowserAddHandler(txtTestBox2, 'propertychange', function () { 2428 onPropertyChange(txtTestBox2); 2429 }); 2430 */ 2431 2432 /**/ 2433 /************************************************** 2434 * XBrowserAddHandler 2435 **************************************************/ 2436 function XBrowserAddHandler(target, eventName, handlerName) { 2437 if (target.addEventListener) 2438 target.addEventListener(eventName, handlerName, false); 2439 else if (target.attachEvent) 2440 target.attachEvent("on" + eventName, handlerName); 2441 else 2442 target["on" + eventName] = handlerName; 2443 2444 } 2445 2446 /************************************************** 2447 * onProperty 2448 **************************************************/ 2449 function onPropertyChange(obj,e) { 2450 if (!e && window.event) 2451 e = window.event; 2452 if (e) 2453 keyCode = (window.Event) ? e.which : e.keyCode; 2454 var el = obj; 2455 attributs = el.attributes; 2456 type_action = e.type; 2457 style = ""; 2458 alt = ""; 2459 src = ""; 2460 if (attributs.id) id = attributs.id.value; 2461 if (attributs.style) style = attributs.style.value; 2462 if (attributs.alt) alt = attributs.alt.value; 2463 /* Image */ 2464 if (attributs.src) { 2465 src = attributs.src.value; 2466 if (attributs.width) width = attributs.width.value; 2467 if (attributs.height) height = attributs.height.value; 2468 } 2469 affiche_debug({ 2470 Debug1: Debug_info(1, type_action + " : " + src, id + " action ") 2471 2472 }); 2473 2474 2475 if (style) 2476 switch (style) { 2477 case "style.opacity": 2478 2479 break; 2480 case "style.transform": 2481 2482 break; 2483 case "style.display": 2484 2485 break; 2486 case "style.color": 2487 2488 break; 2489 case "style.width": 2490 width = el.style.width; 2491 break; 2492 case "style.height": 2493 height = el.style.height; 2494 break; 2495 2496 case 'width': 2497 2498 break; 2499 case 'height': 2500 2501 el.style.height = el.attributes.height.nodeValue + 'px'; 2502 el.firstChild.style.height = el.clientHeight + 'px'; 2503 break; 2504 } 2505 } 2506 2507 2508 /************************************************** 2509 * TEST 2510 **************************************************/ 2511 2512 }); 2513 2514 /******************************************************** 2515 * List_autosize_resize 2516 ********************************************************/ 2517 function List_autosize_resize(event, ui) { 2518 if (typeof wait_resize == "undefined") wait_resize = false; 2519 if (wait_resize == true) return; 2520 wait_resize = true; 2521 if (List_autosize.length == 0) return; 2522 for (i = 0; i < List_autosize.length; i++) { 2523 Autosize_resize(jQuery(List_autosize[i])); 2524 } 2525 wait_resize = false; 2526 return true; 2527 } 2452 2453 2454 /******************************************************** 2455 * List_autosize_resize 2456 ********************************************************/ 2457 function List_autosize_resize(event, ui) { 2458 if (typeof wait_resize == "undefined") wait_resize = false; 2459 if (wait_resize == true) return; 2460 wait_resize = true; 2461 if (List_autosize.length == 0) return; 2462 for (i = 0; i < List_autosize.length; i++) { 2463 Autosize_resize(jQuery(List_autosize[i])); 2464 } 2465 wait_resize = false; 2466 return true; 2467 } 2468 2469 2470 2471 2528 2472 2529 2473 /**/ -
extensions/Autosize/js/autosize.cookie.js
r16589 r16931 95 95 } 96 96 }; 97 98 if (jQuery.cookie('picture-menu') == 'visible') { 99 jQuery("head").append("<style type=\"text/css\">#content.contentWithMenu, #the_page > .content {margin-left:240px;}</style>"); 100 } else { 101 jQuery("head").append("<style type=\"text/css\">#the_page #menubar {display:none;} #content.contentWithMenu, #the_page > .content {margin-left:35px;}</style>"); 102 } 103 97 98 104 99 function hideMenu(delay) { 105 100 var menubar = jQuery("#menubar"); … … 160 155 161 156 // side-menu show/hide 157 162 158 163 159 var sidemenu = jQuery.cookie('picture-menu'); 164 160 var menubar = jQuery("#menubar"); 165 161 return; 166 162 if (menubar.length == 1) { 167 163 -
extensions/Autosize/js/autosize.dimensions.js
r16638 r16931 33 33 options = options || false; 34 34 options = jQuery.extend({ margin: options }); 35 35 Maxi_val = this.parent().width(); 36 36 var val = this.is(':visible') ? this[0]['offset' + name] : 37 37 num(this, … … 118 118 myposition = ""; 119 119 results = { 120 visible:false , 120 121 position: "", 121 122 top: 0, … … 127 128 borderwidth: borderwidth, 128 129 padding: padding, 129 margin: margin, id: "", nodeName: "" 130 margin: margin, 131 132 out: { 133 width: 0, 134 height: 0, 135 right: 0, 136 bottom: 0 137 }, 138 139 exterieur: { 140 width: 0, 141 height: 0, 142 right: 0, 143 bottom: 0 144 }, 145 146 general: { 147 width: 0, 148 height: 0, 149 right: 0, 150 bottom: 0, 151 marges: { height:0, 152 top: 0, 153 bottom: 0, 154 width: 0, 155 left: 0, 156 right: 0 157 } 158 }, 159 src:"", 160 useMap : "" , 161 id: "", 162 nodeName: "" 130 163 }; 131 164 ; … … 150 183 out_width = jQuery(elem).outerWidth(); 151 184 out_height = jQuery(elem).outerHeight(); 152 elem_parent = elem.parentElement;185 elem_parent = elem.parentElement; 153 186 if (typeof elem_parent == "undefined") { 154 187 elem_parent = window; … … 207 240 Top = Cl_Position.top; 208 241 209 visible= jQuery(elem).is(':visible'); 210 results = {src: elem.src || "none", 242 visible = jQuery(elem).is(':visible'); 243 results = { 244 useMap : elem.useMap || "none", 245 src: elem.src || "none", 211 246 visible: visible || false, 212 247 position: myposition, … … 239 274 right: Left + out_width + margin.left + margin.right, 240 275 bottom: Top + out_height + margin.top + margin.bottom, 241 marges: { height: margin.top + borderwidth.top + padding.top + 242 margin.bottom + borderwidth.bottom + padding.bottom, 243 top: margin.top + borderwidth.top + padding.top, 244 bottom: margin.bottom + borderwidth.bottom + padding.bottom, 245 width: margin.left + borderwidth.left + padding.left + 246 margin.right + borderwidth.right + padding.right, 247 left: margin.left + borderwidth.left + padding.left, 248 right: margin.right + borderwidth.right + padding.right 249 } 250 251 276 marges: { height: margin.top + 277 borderwidth.top + 278 padding.top + 279 margin.bottom + borderwidth.bottom + 280 padding.bottom, 281 top: margin.top + 282 borderwidth.top + 283 padding.top, 284 bottom: margin.bottom + 285 borderwidth.bottom + 286 padding.bottom, 287 width: margin.left + 288 borderwidth.left + 289 padding.left + 290 margin.right + 291 borderwidth.right + 292 padding.right, 293 left: margin.left + 294 borderwidth.left + 295 padding.left, 296 right: margin.right + 297 borderwidth.right + 298 padding.right 299 } 252 300 }, 253 301 id: id, … … 311 359 var element = jQuery(elt).get(0); 312 360 propriete = []; 313 try {314 if (jQuery(element).length > 0)315 if (window.getComputedStyle) // Mozilla Firefox & cie316 {317 var propriete = window.getComputedStyle(element, null);318 }319 else if (element.currentStyle) // Microsoft Internet Explorer320 {321 322 var propriete = element.currentStyle;323 }324 }catch(e){325 326 361 try { 362 if (jQuery(element).length > 0) 363 if (window.getComputedStyle) // Mozilla Firefox & cie 364 { 365 var propriete = window.getComputedStyle(element, null); 366 } 367 else if (element.currentStyle) // Microsoft Internet Explorer 368 { 369 370 var propriete = element.currentStyle; 371 } 372 } catch (e) { 373 374 } 327 375 return propriete; 328 376 }, … … 334 382 335 383 /************************** 336 337 338 384 * Get_val_int 385 * params: element,valeur maxi 386 * return: valeur entiere 339 387 ******************************/ 340 388 Get_Val_int = function (myObj, Maxi_val, Mini_val, prop) { 341 389 342 var val = 0; 343 Maxi_val = parseInt(Maxi_val || "0"); 344 345 /* 346 - numérique suivie de px ou % ou pt ou em, 347 - thin, bordure mince, 348 - medium, bordure moyenne (valeur par défaut), 349 - thick, bordure épaisse, 350 - inherit, hérite de son parent (css2). 351 */ 352 353 if (!myObj) { 390 var val = 0; 391 Maxi_val = parseInt(Maxi_val || "0"); 392 393 /* 394 - numérique suivie de px ou % ou pt ou em, 395 - thin, bordure mince, 396 - medium, bordure moyenne (valeur par défaut), 397 - thick, bordure épaisse, 398 - inherit, hérite de son parent (css2). 399 */ 400 401 if (!myObj) { 402 return Maxi_val; 403 } 404 405 if (typeof (myObj) == "string") { 406 switch (myObj) { 407 case 'thin': 408 return 1; 409 break; 410 case 'medium': 411 return 2; 412 break; 413 case 'thick': 414 return 4; 415 break; 416 case 'inherit': 417 break; 418 case 'none': 419 return Maxi_val; 420 break; 421 default: 422 break; 423 } 424 425 var reg1 = new RegExp("auto", "g"); 426 if (myObj.match(reg1)) { 354 427 return Maxi_val; 355 428 } 356 357 if (typeof (myObj) == "string") {358 switch (myObj) {359 case 'thin':360 return 1;361 break;362 case 'medium':363 return 2;364 break;365 case 'thick':366 return 4;367 break;368 case 'inherit':369 break;370 case 'none':371 return Maxi_val;372 break;373 default:374 break;375 }376 377 var reg1 = new RegExp("auto", "g");378 if (myObj.match(reg1)) {379 return Maxi_val;380 }381 429 382 430 if (prop) { … … 384 432 myObj = num(prop.elem, prop.prop); 385 433 } else { 386 reg1 = new RegExp("px", "g"); 434 reg1 = new RegExp("px", "g"); 435 if (myObj.match(reg1)) { 436 437 myObj = Parse_Int(myObj); 438 439 } else { 440 reg1 = new RegExp("%", "g"); 387 441 if (myObj.match(reg1)) { 388 389 myObj = Parse_Int(myObj); 390 391 } else { 392 reg1 = new RegExp("%", "g"); 393 if (myObj.match(reg1)) { 394 myObj = myObj.replace(reg1, ""); 395 val = Math.ceil(myObj * Maxi_val / 100); 396 return val; 397 } 442 myObj = myObj.replace(reg1, ""); 443 val = Math.ceil(myObj * Maxi_val / 100); 444 return val; 398 445 } 399 446 } 400 if (Mini_val) 401 if (myObj < Mini_val) return Maxi_val; 447 } 448 if (Mini_val) 449 if (myObj < Mini_val) return Maxi_val; 402 450 val = Parse_Int(myObj); 403 451 404 452 } else { 405 453 val = Parse_Int(myObj); 406 454 } 407 455 if (typeof (val) == "NaN") 408 456 return Maxi_val; 409 410 411 457 return val; 458 459 } 412 460 413 461 /* … … 415 463 */ 416 464 function Parse_Int(valeur_num) { 417 if (!jQuery.isNumeric(valeur_num)){418 valeur_num = valeur_num.toString();419 reg1 = new RegExp("px", "gi");420 if (valeur_num.match(reg1)) {465 if (!jQuery.isNumeric(valeur_num)) { 466 valeur_num = valeur_num.toString(); 467 reg1 = new RegExp("px", "gi"); 468 if (valeur_num.match(reg1)) { 421 469 valeur_num = valeur_num.replace(reg1, ""); 422 } else{470 } if (valeur_num.match(RegExp("%", "gi"))) { 423 471 valeur_num = valeur_num.replace(reg1, ""); 472 valeur_num = Math.ceil(valeur_num * Maxi_val / 100); 473 } else { 474 valeur_num = valeur_num.replace(reg1, ""); 475 } 424 476 } 425 }426 477 valeur_num = Math.ceil(valeur_num); 427 478 return valeur_num || 0; … … 434 485 }; 435 486 436 myjQuery = jQuery;437 my$ = $;487 // myjQuery = jQuery; 488 // my$ = $; 438 489 439 490 })(jQuery); -
extensions/Autosize/js/conflit.js
r12660 r16931 174 174 function (jQuery) { 175 175 jQuery(window).load(function () { 176 177 //============================================================178 if (jQuery("#check_auto_w").length > 0) {179 var cl_visible = jQuery("#check_auto_w").get(0).checked;180 if (!cl_visible) {181 jQuery("#table0 :text[name*='_width'] ").hide();182 } else {183 jQuery("#table0 :text[name*='_width'] ").show();184 }185 }186 176 //============================================================== 187 jQuery("input").click(function () { 188 if (this.name.match(RegExp("_enabled", "gi"))) { 189 sel = "[name*=" + this.name + "]"; 190 obj = jQuery("tr" + sel); 191 192 if (this.checked) 193 obj.css({ backgroundColor: "green", color: "white" }); 194 else 195 obj.css({ backgroundColor: "red", color: "white" }); 196 197 return; 198 } 199 200 if (this.name != "check_auto_w") return; 201 202 cl_visible = this.checked 203 if (!cl_visible) { 204 jQuery("#table0 :text[name*='_width'] ").hide(); 205 } else { 206 jQuery("#table0 :text[name*='_width'] ").show(); 207 } 208 209 return; 210 211 212 213 214 }); 177 215 178 jQuery("#icon_gmaps").bind('click', function () { 216 179 //jQuery("#iGMapsIconContent").dialog("open"); -
extensions/Autosize/main.inc.php
r16579 r16931 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+20 ); 36 // add_event_handler('loc_after_page_header', array(&$autosize_controler, 'cl_autosize_script_1'), EVENT_HANDLER_PRIORITY_NEUTRAL+20 ); 37 37 38 add_event_handler('loc_after_page_header', array(&$autosize_controler, 'cl_autosize_affiche'), EVENT_HANDLER_PRIORITY_NEUTRAL+21 ); 38 39 39 40 add_event_handler('loc_end_page_tail',array(&$autosize_controler, 'cl_autosize_script_2'), EVENT_HANDLER_PRIORITY_NEUTRAL ); 41 42 43 40 44 ?> -
extensions/Autosize/template/autosize.tpl
r12527 r16931 2 2 {html_head} <!-- autosize/template/autosize.tpl --> 3 3 <script type="text/javascript"> 4 var src_img = '{$SRC_IMG}'; 5 var fade_in = '{$fade_in}'; 6 var cl_visible = "{$cl_visible}" =="true"; 7 var thumbnail = '{$thumbnail}'; 8 var scaled_width = '{$SCALED_WIDTH}'; // valeur par defaut 9 var scaled_height = '{$SCALED_HEIGHT}'; // valeur par defaut 10 var img_width='{$IMG_WIDTH }'; 11 var img_height = '{ $IMG_HEIGHT }'; 4 5 var Autosize_options={ldelim} 6 7 cookies :{$cookies} , 8 deriv_type :'{$deriv_type}' , 9 type_size:'{$deriv_type}' , 10 DEBUG_autosize:'{$DEBUG_autosize}', 11 theme:'{$theme}', 12 src_img : '{$SRC_IMG}', 13 fade_in : '{$fade_in}', 14 cl_visible : "{$cl_visible}" =="true", 15 thumbnail : '{$thumbnail}', 12 16 13 var cookie_width='{$COOKIE_WIDTH }'; 14 var cookie_height = '{ $COOKIE_HEIGHT }'; 17 scaled_width : '{$SCALED_WIDTH}', // valeur par defaut 18 scaled_height : '{$SCALED_HEIGHT}', // valeur par defaut 19 ratio:'{$IMG_WIDTH/$IMG_HEIGHT }' , 20 img_width:'{$IMG_WIDTH }', 21 img_height : '{ $IMG_HEIGHT }', 15 22 23 cookie_width:'{$COOKIE_WIDTH }', 24 cookie_height : '{ $COOKIE_HEIGHT }', 16 25 17 var marge_basse='{ $MARGE_BASSE }';18 var echelle_max='{ $ECHELLE_MAX }';19 var mini_width='{ $MINI_WIDTH }';20 var mini_height = '{ $MINI_HEIGHT }';21 var mini_width2 = '{ $MINI_WIDTH2 }';22 var mini_height2 = '{ $MINI_HEIGHT2 }';26 marge_basse:'{ $MARGE_BASSE }', 27 echelle_max:'{ $ECHELLE_MAX }', 28 mini_width:'{ $MINI_WIDTH }', 29 mini_height : '{ $MINI_HEIGHT }', 30 mini_width2 : '{ $MINI_WIDTH2 }', 31 mini_height2 : '{ $MINI_HEIGHT2 }', 23 32 24 var webmaster_width='{$webmaster_width }'; 25 var webmaster_height = '{ $webmaster_height }'; 26 var webmaster_enabled = '{ $webmaster_enabled }'; 33 webmaster_type:'{$webmaster_type.SELECTED }', 34 webmaster_enabled : '{ $webmaster_enabled }', 27 35 28 var admin_width='{ $admin_width }'; 29 var admin_height = '{ $admin_height }'; 30 var admin_enabled = '{ $admin_enabled }'; 36 admin_type : '{ $admin_type.SELECTED }', 37 admin_enabled : '{ $admin_enabled }', 31 38 32 var generic_width='{ $generic_width }'; 33 var generic_height = '{ $generic_height }'; 34 var generic_enabled = '{ $generic_enabled }'; 39 generic_type:'{ $generic_type.SELECTED }', 40 generic_enabled : '{ $generic_enabled }', 35 41 36 var guest_width='{ $guest_width }'; 37 var guest_height = '{$guest_height}'; 38 var guest_enabled = '{ $guest_enabled }'; 42 guest_type:'{ $guest_type.SELECTED }', 43 guest_enabled : '{ $guest_enabled }', 39 44 40 var normal_width='{$normal_width}'; 41 var normal_height = '{$normal_height}'; 42 var normal_enabled = '{ $normal_enabled }'; 45 normal_type:'{$normal_type.SELECTED }', 46 normal_enabled : '{ $normal_enabled }', 43 47 44 var user_status='{$user_status}';45 46 var check_auto_w = '{$check_auto_w}';47 48 var check_desc_v = ('{$check_desc_v}' == 'checked="checked"') ? true : false; 48 user_status:'{$user_status}', 49 check_auto_w : '{$check_auto_w}', 50 check_desc_v : '{$check_desc_v}' 51 } ; 52 49 53 </script> 50 54 … … 54 58 <script type="text/javascript"> 55 59 var visible = '{$visible}'; 56 </script> 60 </script> 61 62 {/html_head} 57 63 {if $DEBUG_autosize == "true"} 58 64 {assign var="visible" value="block"} … … 101 107 {/if} 102 108 103 {/html_head} 109 104 110 <!-- << autosize/template/autosize.tpl body --> 105 111 -
extensions/Autosize/template/mes_scripts.tpl
r11961 r16931 33 33 {literal} 34 34 {/literal} 35 36 35 <!---Fin Mes SCRIPTS ---> -
extensions/Autosize/template/picture.tpl
r12527 r16931 17 17 </span> 18 18 </a> 19 20 19 21 20 22 <script language="JavaScript" type="text/javascript"> … … 53 55 var src4 = "{'cl_autosize_info'|@translate}"; 54 56 var src5 = "{'cl_autosize_info_1'|@translate}"; 55 </script> 57 var src6 = "{$cl_autosize_button.ICON1}"; 58 </script> 59
Note: See TracChangeset
for help on using the changeset viewer.