| 29 | | init_tb = 0; |
| 30 | | tp1 = typeof(MooTools); |
| 31 | | if (tp1 != "undefined") { |
| 32 | | //==== mootools prototype ==== |
| 33 | | if (MooTools.version == "1.2.4") { |
| 34 | | return jQuery(element).get(0); |
| 35 | | |
| 36 | | }else if( MooTools.version == "1.11") { |
| 37 | | B = element; |
| 38 | | if (!B) { |
| 39 | | if (typeof (B) == "boolean") return null; |
| 40 | | return jQuery(); |
| 41 | | } |
| 42 | | if (B.htmlElement) { |
| 43 | | return Garbage.collect(B); |
| 44 | | |
| | 91 | |
| | 92 | /* |
| | 93 | * Marge_haute |
| | 94 | * params: element,boolean ajoute_h(ajoute la hauteur de l'element) |
| | 95 | * return: valeur margin+padding+[hauteur] |
| | 96 | */ |
| | 97 | function Marge_haute(myObj, ajoute_h) { |
| | 98 | Mon_obj = jQuery(myObj); |
| | 99 | if (Mon_obj.length == 0) return 0; |
| | 100 | |
| | 101 | if (ajoute_h) h_p = parseInt(jQuery(myObj).height()); |
| | 102 | else h_p = 0; |
| | 103 | |
| | 104 | if (jQuery(myObj).css("marginTop")) |
| | 105 | if (jQuery(myObj).css("marginTop") != "auto") h_p += parseInt(jQuery(myObj).css("marginTop")); |
| | 106 | if (jQuery(myObj).css("marginBottom")) |
| | 107 | if (jQuery(myObj).css("marginBottom") != "auto") h_p += parseInt(jQuery(myObj).css("marginBottom")); |
| | 108 | if (jQuery(myObj).css("paddingTop")) |
| | 109 | if (jQuery(myObj).css("paddingTop") != "auto") h_p += parseInt(jQuery(myObj).css("paddingTop")); |
| | 110 | if (parseInt(jQuery(myObj).css("paddingBottom"))) |
| | 111 | if (jQuery(myObj).css("paddingBottom") != "auto") h_p += parseInt(jQuery(myObj).css("paddingBottom")); |
| | 112 | return h_p; |
| | 113 | } |
| | 114 | //=================================================================== |
| | 115 | var old_w = 0; |
| | 116 | var old_h = 0; |
| | 117 | var rapport = -1; |
| | 118 | var init_taille_thumblink = { height: 0, width: 0 }; |
| | 119 | /* |
| | 120 | * window .resize |
| | 121 | */ |
| | 122 | jQuery(window).resize(function (event, ui) { |
| | 123 | if (typeof (event) == 'undefined') return; |
| | 124 | |
| | 125 | w1 = jQuery(window).width(); |
| | 126 | h1 = jQuery(window).height(); |
| | 127 | |
| | 128 | |
| | 129 | if (!visible) return; |
| | 130 | if (old_w == w1 && old_h == h1) return; |
| | 131 | |
| | 132 | if (old_w != w1) { |
| | 133 | old_w = w1; |
| | 134 | } else { |
| | 135 | if (old_h != h1) old_h = h1; |
| | 136 | } |
| | 137 | var Type_Img = ""; |
| | 138 | //====== d�tection du type d'images ====== |
| | 139 | if (jQuery("#charlie").length > 0) { |
| | 140 | Type_Img = "charlie"; |
| | 141 | } else if (jQuery("#pamoorama").length) { |
| | 142 | Type_Img = "pamoorama"; |
| | 143 | } else if (jQuery("#theImage embed").length > 0) { |
| | 144 | Type_Img = "embed"; |
| | 145 | } else if (jQuery("#map").length) { |
| | 146 | Type_Img = "map"; |
| | 147 | } else if (jQuery("#Panorama").length) { |
| | 148 | Type_Img = "panorama"; |
| | 149 | } else if (jQuery("#theImage").find("img").length > 0) { |
| | 150 | Type_Img = "img"; |
| | 151 | } else if (jQuery("img").length > 0) { |
| | 152 | Type_Img = "img_autre"; |
| | 153 | return; |
| | 154 | } else { |
| | 155 | return; |
| | 156 | } |
| | 157 | |
| | 158 | var winwidth = old_w; |
| | 159 | var twidth = jQuery("#imageHeaderBar").width(); |
| | 160 | var twidth1 = jQuery("#imageToolBar").width(); |
| | 161 | |
| | 162 | var winheight = old_h; |
| | 163 | //==== r�cup�re Img la plus grande ===== |
| | 164 | if (jQuery("#theImg")) IMG = "#theImg"; |
| | 165 | else IMG = "#theImage"; |
| | 166 | |
| | 167 | TheImg2 = Get_Img_Maxi(IMG + " img"); |
| | 168 | //================================================================= |
| | 169 | if (TheImg2 == null) { |
| | 170 | if (jQuery("#theImage").find("img").length > 0) { |
| | 171 | IMG = "#theImage"; |
| | 172 | TheImg = Get_Img_Maxi("#theImage img"); |
| 46 | | if ([window, document].contains(B)) { return B; } |
| 47 | | var A = $type(B); |
| 48 | | if (A == "string") { B = document.getElementById(B); A = (B) ? "element" : false; } |
| 49 | | if (A != "element") { |
| 50 | | return null; |
| | 174 | } else { |
| | 175 | TheImg = TheImg2 |
| | 176 | |
| | 177 | } |
| | 178 | |
| | 179 | //================================================================= |
| | 180 | switch (Type_Img) { |
| | 181 | case "map": |
| | 182 | |
| | 183 | jQuery("#content").height(winheight); |
| | 184 | |
| | 185 | var TheImg = jQuery("#map").get(0); |
| | 186 | pos_image = jQuery("#map").position(); |
| | 187 | pos_page = jQuery("#the_page").position(); |
| | 188 | |
| | 189 | |
| | 190 | break |
| | 191 | |
| | 192 | |
| | 193 | case "panorama": |
| | 194 | |
| | 195 | var w00 = 0; |
| | 196 | jQuery("#Panorama img").each(function (i) { |
| | 197 | w0 = this.width; |
| | 198 | if (w0 > w00) { |
| | 199 | TheImg = this; |
| | 200 | n = TheImg.nameProp; |
| | 201 | w00 = w0; |
| | 202 | } |
| | 203 | }); |
| | 204 | |
| | 205 | pos_image = jQuery(TheImg).position(); |
| | 206 | pos_page = jQuery("#the_page").position(); |
| | 207 | |
| | 208 | break |
| | 209 | case "img": |
| | 210 | |
| | 211 | if (!TheImg) return; |
| | 212 | pos_image = jQuery(TheImg).position(); |
| | 213 | pos_page = jQuery("#the_page").position(); |
| | 214 | |
| | 215 | |
| | 216 | break |
| | 217 | case "img_autre": |
| | 218 | if (!TheImg) return; |
| | 219 | pos_image = jQuery(TheImg).position(); |
| | 220 | pos_page = jQuery("#the_page").position(); |
| | 221 | |
| | 222 | |
| | 223 | break |
| | 224 | case "embed": |
| | 225 | // |
| | 226 | |
| | 227 | var TheImg = jQuery("#theImage").find("embed"); |
| | 228 | |
| | 229 | pos_image = jQuery("#theImage").position(); |
| | 230 | pos_page = jQuery("#the_page").position(); |
| | 231 | if (rapport < 0) { |
| | 232 | img_height = parseInt(TheImg.height); |
| | 233 | img_width = parseInt(TheImg.width); |
| | 234 | |
| | 235 | img_reelle.height = parseInt(TheImg.height); |
| | 236 | img_reelle.width = parseInt(TheImg.width); |
| | 237 | } |
| | 238 | |
| | 239 | break |
| | 240 | case "charlie": |
| | 241 | |
| | 242 | var TheImg = jQuery('#charlie object').get(0); |
| | 243 | pos_image = jQuery("#theImage").position(); |
| | 244 | pos_page = jQuery("#the_page").position(); |
| | 245 | if (rapport < 0) { |
| | 246 | img_height = parseInt(TheImg.height); |
| | 247 | img_width = parseInt(TheImg.width); |
| | 248 | |
| | 249 | img_reelle.height = parseInt(TheImg.height); |
| | 250 | img_reelle.width = parseInt(TheImg.width); |
| | 251 | } |
| | 252 | |
| | 253 | break |
| | 254 | case "pamoorama": |
| | 255 | //========================================================= |
| | 256 | var Images = jQuery("#pamoorama img"); |
| | 257 | var Image = jQuery("#pamoorama").find("img"); |
| | 258 | |
| | 259 | pos_image = jQuery("#pamoorama").position(); |
| | 260 | pos_page = jQuery("#the_page").position(); |
| | 261 | break |
| | 262 | return; |
| | 263 | |
| | 264 | } |
| | 265 | //=============== V�rification taille minimale autoriz�e ====================== |
| | 266 | miniWidth = Get_Val_int(jQuery(TheImg).css("min-width"), mini_width); |
| | 267 | miniHeight = Get_Val_int(jQuery(TheImg).css("min-height"), mini_height); |
| | 268 | maxWidth = Get_Val_int(jQuery(TheImg).css("max-width"), winwidth); |
| | 269 | maxHeight = Get_Val_int(jQuery(TheImg).css("max-height"), winheight); |
| | 270 | |
| | 271 | mini_width = parseInt(miniWidth); |
| | 272 | mini_height = parseInt(miniHeight); |
| | 273 | |
| | 274 | img_reelle.width = parseInt(img_reelle.width); |
| | 275 | if (img_reelle.width < mini_width) return; |
| | 276 | |
| | 277 | img_reelle.height = parseInt(img_reelle.height); |
| | 278 | if (img_reelle.height < parseInt(mini_height)) return; |
| | 279 | //================================================================================== |
| | 280 | if (rapport < 0) { |
| | 281 | img_init.height = parseInt(img_height || TheImg.height); |
| | 282 | img_init.width = parseInt(img_width || TheImg.width); |
| | 283 | rapport = img_width / img_height; |
| | 284 | if (Type_Img != "map") |
| | 285 | rapport = (img_init.width / img_init.height); |
| | 286 | else |
| | 287 | rapport = -1; |
| | 288 | |
| | 289 | } |
| | 290 | |
| | 291 | |
| | 292 | //=============== Zone d'affichage ============================ |
| | 293 | zone_affichage.width = winwidth - 0 - (pos_page.left * 2) - 5; |
| | 294 | zone_affichage.height = winheight - 0 - pos_page.top; |
| | 295 | |
| | 296 | |
| | 297 | //=========================================================================== |
| | 298 | var sel0 = { top: 0 }; |
| | 299 | sel0.top += Marge_haute("#theHeader", true); |
| | 300 | |
| | 301 | sel0.top += Marge_haute("#imageHeaderBar", true); |
| | 302 | if (!theme.match(RegExp("gally", "g"))) { |
| | 303 | sel0.top += Marge_haute("#imageToolBar", true); |
| | 304 | } else { |
| | 305 | sel0.top += Marge_haute(TheImg, false); |
| | 306 | } |
| | 307 | if (jQuery("#theImage").css("marginTop")) |
| | 308 | if (jQuery("#theImage").css("marginTop") != "auto") |
| | 309 | sel0.top += parseInt(jQuery("#theImage").css("marginTop")); |
| | 310 | if (jQuery("#theImage").css("paddingTop")) |
| | 311 | if (jQuery("#theImage").css("paddingTop") != "auto") |
| | 312 | sel0.top += parseInt(jQuery("#theImage").css("paddingTop")); |
| | 313 | |
| | 314 | img_top = 0; |
| | 315 | if (jQuery("#theImage").css("position") != "absolute") |
| | 316 | zone_affichage.height -= sel0.top; |
| | 317 | |
| | 318 | if (theme.match(RegExp("gally", "g"))) { img_top = sel0.top } |
| | 319 | jQuery("#theImage").css("top", img_top + "px") |
| | 320 | |
| | 321 | jQuery("#theImage #theImg IMG").css("marginTop", "0px") |
| | 322 | |
| | 323 | |
| | 324 | |
| | 325 | var lmt = 0; |
| | 326 | h = 0; |
| | 327 | //================ Licence ======================== |
| | 328 | var Licence = jQuery("#theImage span"); |
| | 329 | if (Licence.length > 0) { |
| | 330 | jQuery("#theImage span").css("background", "blue"); |
| | 331 | t1 = jQuery("#theImage span").position(); |
| | 332 | h = jQuery("#theImage span").height(); |
| | 333 | } |
| | 334 | //==== paragraphe suppl�mentaire === |
| | 335 | if (jQuery("#theImage table")) { |
| | 336 | jQuery("#theImage table").css("background", "yellow"); |
| | 337 | t1 = jQuery("#theImage table").position(); |
| | 338 | } |
| | 339 | |
| | 340 | if (jQuery("#theImage p")) { |
| | 341 | jQuery("#theImage p").css("background", "red"); |
| | 342 | t1 = jQuery("#theImage p").position(); |
| | 343 | h += jQuery("#theImage p").height(); |
| | 344 | } |
| | 345 | if (jQuery("#theImage br")) { |
| | 346 | |
| | 347 | |
| | 348 | } |
| | 349 | |
| | 350 | |
| | 351 | |
| | 352 | lmt = jQuery("#theImage span").height() - jQuery("#theImage p").height(); |
| | 353 | |
| | 354 | //========================================================================== |
| | 355 | Marge_Basse = parseInt(marge_basse || 0); |
| | 356 | zone_affichage.height = zone_affichage.height - Marge_Basse; |
| | 357 | |
| | 358 | var Image_height = zone_affichage.height - h; |
| | 359 | |
| | 360 | var height_user = eval(user_status + "_height"); |
| | 361 | |
| | 362 | //============================================================= |
| | 363 | var reg1 = new RegExp("%", "g"); |
| | 364 | if (height_user.match(reg1)) |
| | 365 | Image_height = Image_height * parseInt(height_user) / 100; |
| | 366 | else |
| | 367 | Image_height = parseInt(height_user); |
| | 368 | |
| | 369 | //============================================================ |
| | 370 | echelle_max = parseFloat(echelle_max, '3'); |
| | 371 | var echelle = parseFloat(Image_height / img_reelle.height, 3); |
| | 372 | |
| | 373 | if (echelle > echelle_max) { echelle = echelle_max; } |
| | 374 | |
| | 375 | Image_height = parseInt(img_reelle.height * echelle); |
| | 376 | |
| | 377 | if (rapport > 0) var Image_Width = parseInt(Image_height * rapport); |
| | 378 | else var Image_Width = parseInt(img_reelle.width * echelle); |
| | 379 | //=============================================================== |
| | 380 | |
| | 381 | align_auto = "center"; |
| | 382 | if (jQuery("#theImg").css("textAlign")) |
| | 383 | align_auto = jQuery("#theImg").css("textAlign"); |
| | 384 | |
| | 385 | if (check_auto_w == 'checked="checked"') { |
| | 386 | // if (Type_Img != "pamoorama" && Type_Img != "panorama" ) { |
| | 387 | //==== largeur � atteindre === |
| | 388 | var width_user = eval(user_status + "_width"); |
| | 389 | // Largeur maximale en fonction du statut |
| | 390 | if (width_user.match(reg1)) |
| | 391 | // pourcentage |
| | 392 | widthmin = twidth * parseInt(width_user) / 100; |
| | 393 | else |
| | 394 | widthmin = parseInt(width_user); |
| | 395 | |
| | 396 | if (Image_Width > widthmin) { |
| | 397 | // Image_Width largeur � atteindre |
| | 398 | // Calcul du rapport d'agrandissement |
| | 399 | var echelle_w = parseFloat(widthmin / img_reelle.width, 3); |
| | 400 | if (echelle_w > echelle_max) { echelle_w = echelle_max; } |
| | 401 | Image_Width = parseInt(img_reelle.width * echelle_w); |
| 52 | | if (B.htmlElement) { return Garbage.collect(B); } |
| 53 | | if (["object", "embed"].contains(B.tagName.toLowerCase())) { return B; } |
| 54 | | $extend(B, Element.prototype); |
| 55 | | B.htmlElement = function () { }; |
| 56 | | return Garbage.collect(B); |
| 57 | | } |
| 58 | | // |
| 59 | | } |
| 60 | | tp1 = typeof(Prototype); |
| 61 | | if (tp1 == "undefined") { return jQuery(element); } |
| 62 | | if (Prototype.Version != '1.6.0.2') { |
| 63 | | return jQuery(element); |
| 64 | | } |
| 65 | | |
| 66 | | //======== prototype.js ===================== |
| 67 | | if (arguments.length > 1) { |
| 68 | | for (var i = 0, elements = [], length = arguments.length; i < length; i++) |
| 69 | | elements.push($(arguments[i])); |
| 70 | | new_element= elements; |
| 71 | | } |
| 72 | | if (typeof(element)=="string") |
| 73 | | element = jQuery("#" + element).get(0); |
| 74 | | try { |
| 75 | | new_element = Element.extend(element); |
| 76 | | } catch (e) { |
| 77 | | return new_element; |
| 78 | | } |
| 79 | | //================================================== |
| 80 | | if (typeof (new_element) == "undefined") { |
| 81 | | jQuery(document).data("initialized", 1); |
| 82 | | return jQuery(); |
| 83 | | } |
| 84 | | return new_element; |
| 85 | | |
| 86 | | } |
| 87 | | |
| 88 | | jQuery(document).ready( |
| 89 | | function (jQuery) { |
| 90 | | |
| 91 | | function Marge_haute(myObj, ajoute_h) { |
| 92 | | Mon_obj = jQuery(myObj); |
| 93 | | if (Mon_obj.length == 0) return 0; |
| 94 | | |
| 95 | | if (ajoute_h) h_p = parseInt(jQuery(myObj).height()); |
| 96 | | else h_p = 0; |
| 97 | | |
| 98 | | if (jQuery(myObj).css("marginTop")) |
| 99 | | if (jQuery(myObj).css("marginTop") != "auto") h_p += parseInt(jQuery(myObj).css("marginTop")); |
| 100 | | if (jQuery(myObj).css("marginBottom")) |
| 101 | | if (jQuery(myObj).css("marginBottom") != "auto") h_p += parseInt(jQuery(myObj).css("marginBottom")); |
| 102 | | if (jQuery(myObj).css("paddingTop")) |
| 103 | | if (jQuery(myObj).css("paddingTop") != "auto") h_p += parseInt(jQuery(myObj).css("paddingTop")); |
| 104 | | if (parseInt(jQuery(myObj).css("paddingBottom"))) |
| 105 | | if (jQuery(myObj).css("paddingBottom") != "auto") h_p += parseInt(jQuery(myObj).css("paddingBottom")); |
| 106 | | return h_p; |
| 107 | | } |
| 108 | | //=================================================================== |
| 109 | | |
| 110 | | jQuery(window).resize(function (event, ui) { |
| 111 | | if (typeof (event) == 'undefined') return; |
| 112 | | t = event.type; |
| 113 | | var Type_Img = ""; |
| 114 | | //====== d�tection du type d'images ====== |
| 115 | | var Image = jQuery("#theImage").find("embed"); |
| 116 | | if (Image.length > 0) { |
| 117 | | Type_Img = "embed"; |
| 118 | | } else if (jQuery("#map").length) { |
| 119 | | |
| 120 | | Type_Img = "map"; |
| 121 | | |
| 122 | | |
| 123 | | } else if (jQuery("#pamoorama").length) { |
| 124 | | |
| 125 | | Type_Img = "pamoorama"; |
| 126 | | } else if (jQuery("#Panorama").length) { |
| 127 | | |
| 128 | | Type_Img = "panorama"; |
| | 403 | |
| | 404 | if (rapport > 0) Image_height = parseInt(Image_Width / rapport); |
| | 405 | |
| | 406 | } |
| | 407 | |
| | 408 | |
| | 409 | // } |
| | 410 | |
| | 411 | zoom = echelle; |
| | 412 | |
| | 413 | if (TheImg.src) { |
| | 414 | w_init = TheImg.width; |
| | 415 | h_init = TheImg.height; |
| | 416 | } |
| | 417 | // zone_affichage.height *= zoom; |
| | 418 | // zone_affichage.width *= zoom; |
| | 419 | //=============LLGBO2 =========================== |
| | 420 | marges = 0; |
| | 421 | |
| | 422 | if (jQuery("#gbo") && jQuery("#gbo div:first").length > 0) { |
| | 423 | llgboframe = jQuery("#gbo div:first"); |
| | 424 | marges = jQuery(llgboframe).width() - jQuery("#gbo div:last").width(); |
| | 425 | cadre = {}; |
| | 426 | m1 = jQuery(llgboframe).height(); |
| | 427 | t1 = jQuery(llgboframe).position(); |
| | 428 | |
| | 429 | |
| | 430 | if (TheImg.src) { |
| | 431 | Image_height = Image_height - marges; |
| | 432 | Image_Width = Image_Width - marges; |
| | 433 | |
| | 434 | jQuery("#gbo").width(Image_Width + marges); |
| | 435 | jQuery("#gbo").height(Image_height + marges); |
| | 436 | jQuery("#gbo").css("width", Image_Width + marges + "px"); |
| | 437 | jQuery("#gbo").css("height", Image_height + marges + "px"); |
| | 438 | } else { |
| | 439 | |
| | 440 | jQuery("#gbo").width(zone_affichage.width - marges); |
| | 441 | jQuery("#gbo").height(Image_height + marges) |
| | 442 | jQuery("#gbo").css("width", zone_affichage.width - marges + "px"); |
| | 443 | jQuery("#gbo").css("height", Image_height - marges + "px") |
| | 444 | |
| | 445 | } |
| | 446 | |
| | 447 | |
| | 448 | |
| | 449 | if (jQuery("#prevnext")) { |
| | 450 | areas = jQuery("area"); |
| | 451 | |
| | 452 | } |
| | 453 | |
| | 454 | |
| | 455 | } |
| | 456 | |
| | 457 | //========================================================= |
| | 458 | zone_affichage.height = (Image_height + marges) |
| | 459 | jQuery("#linkNext").height(Image_height); |
| | 460 | jQuery("#linkPrev").height(Image_height); |
| | 461 | //================ Zone affichage ========================= |
| | 462 | // Image_height, Image_Width = valeur a atteindre. |
| | 463 | jQuery("#theImage").css("backgroundColor", "green"); |
| | 464 | jQuery("#theImage").height(zone_affichage.height); |
| | 465 | jQuery("#theImage").width(zone_affichage.width); |
| | 466 | //============================================================== |
| | 467 | img_finale.height = Image_height; |
| | 468 | img_finale.width = Image_Width; |
| | 469 | //============================================================== |
| | 470 | |
| | 471 | if (Type_Img == "charlie") { |
| | 472 | t1 = jQuery("#charlie").position(); |
| | 473 | /**/ |
| | 474 | pdf = 2 * parseInt(jQuery(".none_2").css("paddingRight")); |
| | 475 | jQuery("#charlie").css("width", Image_Width + pdf); |
| | 476 | jQuery("#charlie").css("height", Image_height); |
| | 477 | jQuery("#charlie").css("margin", "auto"); |
| | 478 | |
| | 479 | |
| | 480 | jQuery("#player").css("width", Image_Width + 100 + "px"); |
| | 481 | jQuery("#player").css("height", Image_height); |
| | 482 | |
| | 483 | jQuery("#embedplayer").css("width", Image_Width); |
| | 484 | jQuery("#embedplayer").css("height", Image_height); |
| | 485 | |
| | 486 | |
| | 487 | jQuery("object").width(Image_Width); |
| | 488 | jQuery("object").height(Image_height); |
| | 489 | } else if (Type_Img == "panorama") { |
| | 490 | jQuery(TheImg).height(img_finale.height); |
| | 491 | jQuery(TheImg).width(img_finale.width); |
| | 492 | jQuery("#Panorama div").height(Image_height); |
| | 493 | // class=simple_panorama |
| | 494 | jQuery(TheImg).attr("id", "Img1"); |
| | 495 | var settings = { |
| | 496 | viewport_width: 600, |
| | 497 | speed: 20000, |
| | 498 | direction: 'left', |
| | 499 | control_display: 'auto', |
| | 500 | start_position: 0, |
| | 501 | auto_start: true, |
| | 502 | mode_360: true, |
| | 503 | loop_180: true |
| | 504 | }; |
| | 505 | element = TheImg; //panorama_animate(element, elemWidth, settings); |
| | 506 | n = $.fn; |
| | 507 | pc = jQuery(TheImg) |
| | 508 | options = pc.extend(); |
| | 509 | |
| | 510 | if (options) jQuery.extend(settings, options); |
| | 511 | |
| | 512 | |
| | 513 | n = 1; |
| | 514 | ; |
| | 515 | |
| | 516 | |
| | 517 | /* |
| | 518 | jQuery("DIV .panoramaContainer").css("background", "red"); |
| | 519 | jQuery("DIV .panoramaContainer").css("background", "red"); |
| | 520 | jQuery("DIV .panoramaViewport").css("background", "red"); |
| | 521 | jQuery("DIV .panoramaControl").css("background", "red"); |
| | 522 | */ |
| | 523 | |
| | 524 | } else if (Type_Img == "pamoorama") { |
| | 525 | |
| | 526 | |
| | 527 | jQuery("#pamoorama").css("height", Image_height + "px"); |
| | 528 | jQuery("#pamoorama").css("width", twidth + "px"); |
| | 529 | |
| | 530 | jQuery("#pamoorama").height(Image_height); |
| | 531 | jQuery("#pamoorama").width(twidth); |
| | 532 | |
| | 533 | |
| | 534 | |
| | 535 | jQuery("#pamoorama_outter").height(Image_height); |
| | 536 | jQuery("#pamoorama_outter").width(twidth); |
| | 537 | |
| | 538 | jQuery("#pamoorama_outter").css("height", Image_height + "px"); |
| | 539 | jQuery("#pamoorama_outter").css("width", twidth + "px"); |
| | 540 | jQuery("#pamoorama_footer").width(twidth); |
| | 541 | jQuery("#pamoorama_footer").css('width', twidth + "px"); |
| | 542 | zoom = Image_height / img_height; |
| | 543 | |
| | 544 | h_frame = jQuery("#pamoorama_frame").height(); |
| | 545 | h_width = jQuery("#pamoorama_frame").width(); |
| | 546 | jQuery(TheImg).css("zoom", zoom); |
| | 547 | |
| | 548 | |
| | 549 | |
| | 550 | } else if (TheImg.src) { |
| | 551 | //--- background ?? --- |
| | 552 | jQuery(TheImg).height(img_finale.height); |
| | 553 | jQuery(TheImg).width(img_finale.width); |
| | 554 | jQuery(TheImg).css("height", img_finale.height + "px"); |
| | 555 | jQuery(TheImg).css("width", img_finale.width + "px"); |
| | 556 | |
| | 557 | } else { |
| | 558 | |
| | 559 | jQuery(TheImg).height(img_finale.height); |
| | 560 | jQuery(TheImg).width(img_finale.width); |
| | 561 | } |
| | 562 | |
| | 563 | |
| | 564 | try { |
| | 565 | if (theme.match(RegExp("gally", "g"))) { |
| | 566 | if (init_taille_thumblink.height == 0) |
| | 567 | init_taille_thumblink = { height: jQuery(".thumbLink").height(), width: jQuery(".thumbLink").height() }; |
| | 568 | |
| | 569 | jQuery(".thumbLink").css("height", init_taille_thumblink.height + "px"); |
| | 570 | jQuery(".thumbLink").css("width", init_taille_thumblink.width + "px"); |
| | 571 | } |
| | 572 | } catch (e) { |
| | 573 | |
| | 574 | } |
| | 575 | // |
| | 576 | jQuery(window).resize(); |
| 130 | | } else if (jQuery("#theImage").find("img").length > 0) { |
| 131 | | Type_Img = "img"; |
| 132 | | } else if (jQuery("img").length > 0) { |
| 133 | | Type_Img = "img_autre"; |
| 134 | | } else { |
| 135 | | return; |
| 136 | | } |
| 137 | | var winheight = jQuery(window).height(); |
| 138 | | var winwidth = jQuery(window).width(); |
| 139 | | //================================================================= |
| 140 | | switch (Type_Img) { |
| 141 | | case "map": |
| 142 | | |
| 143 | | |
| 144 | | jQuery("#content").height(winheight); |
| 145 | | var Image = jQuery("#map"); |
| 146 | | var TheImg = jQuery("#map").get(0); |
| 147 | | position = jQuery("#map").position(); |
| 148 | | l2 = jQuery("#the_page").position(); |
| 149 | | img_height = winheight - position.top - l2.top; |
| 150 | | img_width = winwidth - position.left - (l2.left * 2) - 5; |
| 151 | | |
| 152 | | |
| 153 | | break |
| 154 | | case "img": |
| 155 | | var Image = jQuery("#theImage").find("img"); |
| 156 | | var TheImg = jQuery("#theImg").find("img").get(0); |
| 157 | | if (!TheImg) |
| 158 | | TheImg = jQuery(Image).get(0); |
| 159 | | break |
| 160 | | case "img_autre": |
| 161 | | var Image = jQuery("img"); |
| 162 | | var TheImg = jQuery(Image).get(0); |
| 163 | | break |
| 164 | | case "embed": |
| 165 | | var Image = jQuery("#theImage").find("embed"); |
| 166 | | var TheImg = jQuery(Image).get(0); |
| 167 | | img_height = TheImg.clientHeight; |
| 168 | | img_width = TheImg.clientWidth; |
| 169 | | break |
| 170 | | case "pamoorama": |
| 171 | | //========================================================= |
| 172 | | var Images = jQuery("#pamoorama"); |
| 173 | | var Image = jQuery(Images).get(0); |
| 174 | | |
| 175 | | var TheImg = jQuery("#pamoorama").get(0); |
| 176 | | if (!TheImg) return; |
| 177 | | TheImg = jQuery("#pamoorama_inner"); |
| 178 | | if (TheImg.length < 1) return; |
| 179 | | |
| 180 | | break |
| 181 | | } |
| 182 | | |
| 183 | | //================================================================================== |
| 184 | | |
| 185 | | var sel0 = jQuery(TheImg).position(); |
| 186 | | jQuery("#theImage").css("top", sel0.top + "px") |
| 187 | | jQuery().relativize("#theImage"); |
| 188 | | if (!sel0) return; |
| 189 | | type_pos = jQuery(TheImg).css("position"); //static |
| 190 | | |
| 191 | | sel0.top = 0; |
| 192 | | sel0.top += Marge_haute("#theHeader", true); |
| 193 | | |
| 194 | | sel0.top += Marge_haute("#imageHeaderBar", true); |
| 195 | | if (!theme.match(RegExp("gally", "g"))) { |
| 196 | | sel0.top += Marge_haute("#imageToolBar", true); |
| 197 | | } else { |
| 198 | | sel0.top += Marge_haute(TheImg, false); |
| 199 | | } |
| 200 | | if (jQuery("#theImage").css("marginTop")) |
| 201 | | if (jQuery("#theImage").css("marginTop") != "auto") |
| 202 | | sel0.top += parseInt(jQuery("#theImage").css("marginTop")); |
| 203 | | if (jQuery("#theImage").css("paddingTop")) |
| 204 | | if (jQuery("#theImage").css("paddingTop") != "auto") |
| 205 | | sel0.top += parseInt(jQuery("#theImage").css("paddingTop")); |
| 206 | | |
| 207 | | img_top = 0; |
| 208 | | |
| 209 | | if (theme.match(RegExp("gally", "g"))) { img_top = sel0.top } |
| 210 | | jQuery("#theImage").css("top", img_top + "px") |
| 211 | | |
| 212 | | |
| 213 | | mini_width = parseInt(mini_width); |
| 214 | | mini_height = parseInt(mini_height); |
| 215 | | |
| 216 | | W0 = parseInt(img_width); |
| 217 | | if (W0 < mini_width) return; |
| 218 | | |
| 219 | | H0 = parseInt(img_height); |
| 220 | | if (H0 < parseInt(mini_height)) return; |
| 221 | | if (Type_Img != "map") |
| 222 | | var rapport = (W0 / H0); |
| 223 | | else |
| 224 | | var rapport = -1; |
| 225 | | |
| 226 | | //========================================================================== |
| 227 | | var Licence = jQuery("#theImage").find(".licencetag"); |
| 228 | | if (Licence.length > 0) { |
| 229 | | var lmt = jQuery(Licence.get(0)).height(); |
| 230 | | h_p = jQuery(Licence.get(0)).height(); |
| 231 | | jQuery(Licence.get(0)).css("position", "relative"); |
| 232 | | |
| 233 | | jQuery(Licence.get(0)).css("top", "0px"); |
| 234 | | |
| 235 | | } else { |
| 236 | | var lmt = 0; |
| 237 | | |
| 238 | | } |
| 239 | | //==== paragraphe suppl�mentaire === |
| 240 | | if (jQuery("#theImage").find("p")) { |
| 241 | | h_p = 0; |
| 242 | | Pars = jQuery("#theImage").find("p"); |
| 243 | | |
| 244 | | for (var i = 0; i < Pars.length; i++) { |
| 245 | | P0 = Pars.get(i); |
| 246 | | h_p += Marge_haute(P0, true); |
| 247 | | } |
| 248 | | |
| 249 | | // n_t = (p_p.top - Image_height) + h_p; |
| 250 | | |
| 251 | | lmt += h_p; |
| 252 | | jQuery("#theImage").css("paddingBottom", 0 + "px"); |
| 253 | | } |
| 254 | | |
| 255 | | //========================================================================== |
| 256 | | |
| 257 | | var Image_height = (winheight - sel0.top) - parseInt(marge_basse) - lmt; |
| 258 | | var height_user = eval(user_status + "_height"); |
| 259 | | |
| 260 | | //============================================================= |
| 261 | | var reg1 = new RegExp("%", "g"); |
| 262 | | if (height_user.match(reg1)) |
| 263 | | Image_height = Image_height * parseInt(height_user) / 100; |
| 264 | | else |
| 265 | | Image_height = parseInt(height_user); |
| 266 | | |
| 267 | | //============================================================ |
| 268 | | echelle_max = parseFloat(echelle_max, '3'); |
| 269 | | var echelle = parseFloat(Image_height / H0, 3); |
| 270 | | |
| 271 | | if (echelle > echelle_max) { |
| 272 | | echelle = echelle_max; |
| 273 | | Image_height = parseInt(H0 * echelle); |
| 274 | | } |
| 275 | | |
| 276 | | if (rapport > 0) |
| 277 | | var Image_Width = parseInt(Image_height * rapport); |
| 278 | | else |
| 279 | | var Image_Width = parseInt(W0); |
| 280 | | //=============================================================== |
| 281 | | twidth = jQuery("#imageHeaderBar").width(); |
| 282 | | img_la = jQuery(TheImg).width(); //initiale |
| 283 | | offset = jQuery(TheImg).position(); |
| 284 | | |
| 285 | | var width_user = eval(user_status + "_width"); |
| 286 | | align_auto = "center"; |
| 287 | | if (check_auto_w == 'checked="checked"') { |
| 288 | | if (Type_Img != "pamoorama") { |
| 289 | | widthmin = (winwidth - offset.left); |
| 290 | | |
| 291 | | if (Image_Width > widthmin) { |
| 292 | | //============================================================= |
| 293 | | if (width_user.match(reg1)) |
| 294 | | Image_Width = Image_Width * parseInt(width_user) / 100; |
| 295 | | else |
| 296 | | Image_Width = parseInt(width_user); |
| 297 | | |
| 298 | | var echelle_w = parseFloat(winwidth / W0, 3); |
| 299 | | if (echelle_w > echelle_max) { |
| 300 | | echelle_w = echelle_max; |
| 301 | | Image_Width = parseInt(W0 * echelle_w); |
| 302 | | } |
| 303 | | Image_Width = parseInt(W0 * echelle_w); |
| 304 | | |
| 305 | | align_auto = "left"; |
| 306 | | } else { |
| 307 | | |
| 308 | | align_auto = "center"; |
| 309 | | } |
| 310 | | Image_height = parseInt(Image_Width / rapport); |
| 311 | | |
| 312 | | } |
| 313 | | |
| 314 | | |
| 315 | | } |
| 316 | | //============================================================= |
| 317 | | |
| 318 | | if (Type_Img == "pamoorama") { |
| 319 | | |
| 320 | | |
| 321 | | jQuery("#pamoorama").css("height", Image_height + "px"); |
| 322 | | jQuery("#pamoorama").css("width", twidth + "px"); |
| 323 | | |
| 324 | | jQuery("#pamoorama").height(Image_height + "px"); |
| 325 | | jQuery("#pamoorama").width(twidth + "px"); |
| 326 | | |
| 327 | | |
| 328 | | |
| 329 | | jQuery("#pamoorama_outter").height(Image_height + "px"); |
| 330 | | jQuery("#pamoorama_outter").width(twidth + "px"); |
| 331 | | |
| 332 | | jQuery("#pamoorama_outter").css("height", Image_height + "px"); |
| 333 | | jQuery("#pamoorama_outter").css("width", twidth + "px"); |
| 334 | | |
| 335 | | zoom = Image_height / img_height; |
| 336 | | |
| 337 | | h_frame = jQuery("#pamoorama_frame").height(); |
| 338 | | h_width = jQuery("#pamoorama_frame").width(); |
| 339 | | jQuery(TheImg).css("zoom", zoom); |
| 340 | | |
| 341 | | |
| 342 | | |
| 343 | | } else { |
| 344 | | |
| 345 | | |
| 346 | | if (jQuery("#theImg").css("textAlign")) |
| 347 | | jQuery("#theImg").css("textAlign", align_auto); |
| 348 | | |
| 349 | | jQuery(TheImg).height(Image_height + "px"); |
| 350 | | jQuery(TheImg).width(Image_Width + "px"); |
| 351 | | jQuery(TheImg).css("height", Image_height + "px"); |
| 352 | | jQuery(TheImg).css("width", Image_Width + "px"); |
| 353 | | |
| 354 | | } |
| 355 | | try { |
| 356 | | if (theme.match(RegExp("gally", "g"))) { |
| 357 | | |
| 358 | | m = jQuery("#theImg"); |
| 359 | | if (m.length > 0) initializeImageMode('resize'); |
| 360 | | |
| 361 | | |
| 362 | | } else if (theme.match(RegExp("luciano", "g"))) { |
| 363 | | jQuery("#theImage").height(Image_height); |
| 364 | | } |
| 365 | | } catch (e) { |
| 366 | | |
| 367 | | } |
| 368 | | // |
| 369 | | |
| 370 | | return; |
| 371 | | }); |
| 372 | | |
| 373 | | //=================================================================== |
| 374 | | |
| 375 | | |
| 376 | | jQuery(window).resize(); |
| 377 | | jQuery(window).resize(); |
| 378 | | |
| 379 | | |
| 380 | | /* */ |
| 381 | | |
| 382 | | |
| 383 | | }); |
| | 578 | }); |
| | 579 | |
| | 580 | //=================================================================== |
| | 581 | |
| | 582 | |
| | 583 | jQuery(window).resize(); |
| | 584 | jQuery(window).resize(); |
| | 585 | |
| | 586 | } // function |
| | 587 | ); // ready |
| | 588 | |
| | 589 | /* Extension |
| | 590 | * absolutize: |
| | 591 | * relativize: |
| | 592 | */ |
| 386 | | //----------------------------------------------------------------- |
| 387 | | absolutize: function(element) { |
| 388 | | element = jQuery(element).get(0); |
| 389 | | if (element.getStyle('position') == 'absolute') return; |
| 390 | | // Position.prepare(); // To be done manually by Scripty when it needs it. |
| 391 | | |
| 392 | | var offsets = element.positionedOffset(); |
| 393 | | var top = offsets[1]; |
| 394 | | var left = offsets[0]; |
| 395 | | var width = element.clientWidth; |
| 396 | | var height = element.clientHeight; |
| 397 | | |
| 398 | | element._originalLeft = left - parseFloat(element.style.left || 0); |
| 399 | | element._originalTop = top - parseFloat(element.style.top || 0); |
| 400 | | element._originalWidth = element.style.width; |
| 401 | | element._originalHeight = element.style.height; |
| 402 | | |
| 403 | | element.style.position = 'absolute'; |
| 404 | | element.style.top = top + 'px'; |
| 405 | | element.style.left = left + 'px'; |
| 406 | | element.style.width = width + 'px'; |
| 407 | | element.style.height = height + 'px'; |
| 408 | | return element; |
| 409 | | }, |
| 410 | | |
| 411 | | relativize: function(element) { |
| 412 | | element = jQuery(element).get(0);; |
| 413 | | if (jQuery(element).css('position') == 'relative') return; |
| 414 | | // Position.prepare(); // To be done manually by Scripty when it needs it. |
| 415 | | element._originalLeft = parseFloat(element.style.left || 0); |
| 416 | | element._originalTop = parseFloat(element.style.top || 0); |
| 417 | | element._originalWidth = element.style.width; |
| 418 | | element._originalHeight = element.style.height; |
| 419 | | |
| 420 | | element.style.position = 'relative'; |
| 421 | | var top = parseFloat(element.style.top || 0) - (element._originalTop || 0); |
| 422 | | var left = parseFloat(element.style.left || 0) - (element._originalLeft || 0); |
| 423 | | |
| 424 | | element.style.top = top + 'px'; |
| 425 | | element.style.left = left + 'px'; |
| 426 | | // element.style.height = element._originalHeight; |
| 427 | | // element.style.width = element._originalWidth; |
| 428 | | return element; |
| 429 | | } |
| 430 | | //========================================================= |
| 431 | | }); // fin extend |
| | 595 | //------------------------------------------------------- |
| | 596 | absolutize: function (element) { |
| | 597 | element = jQuery(element).get(0); |
| | 598 | if (element.getStyle('position') == 'absolute') return; |
| | 599 | // Position.prepare(); // To be done manually by Scripty when it needs it. |
| | 600 | |
| | 601 | var offsets = element.positionedOffset(); |
| | 602 | var top = offsets[1]; |
| | 603 | var left = offsets[0]; |
| | 604 | var width = element.clientWidth; |
| | 605 | var height = element.clientHeight; |
| | 606 | |
| | 607 | element._originalLeft = left - parseFloat(element.style.left || 0); |
| | 608 | element._originalTop = top - parseFloat(element.style.top || 0); |
| | 609 | element._originalWidth = element.style.width; |
| | 610 | element._originalHeight = element.style.height; |
| | 611 | |
| | 612 | element.style.position = 'absolute'; |
| | 613 | element.style.top = top + 'px'; |
| | 614 | element.style.left = left + 'px'; |
| | 615 | element.style.width = width + 'px'; |
| | 616 | element.style.height = height + 'px'; |
| | 617 | return element; |
| | 618 | }, |
| | 619 | |
| | 620 | relativize: function (element) { |
| | 621 | element = jQuery(element).get(0); ; |
| | 622 | if (jQuery(element).css('position') == 'relative') return; |
| | 623 | // Position.prepare(); // To be done manually by Scripty when it needs it. |
| | 624 | element._originalLeft = parseFloat(element.style.left || 0); |
| | 625 | element._originalTop = parseFloat(element.style.top || 0); |
| | 626 | element._originalWidth = element.style.width; |
| | 627 | element._originalHeight = element.style.height; |
| | 628 | |
| | 629 | element.style.position = 'relative'; |
| | 630 | var top = parseFloat(element.style.top || 0) - (element._originalTop || 0); |
| | 631 | var left = parseFloat(element.style.left || 0) - (element._originalLeft || 0); |
| | 632 | |
| | 633 | element.style.top = top + 'px'; |
| | 634 | element.style.left = left + 'px'; |
| | 635 | // element.style.height = element._originalHeight; |
| | 636 | // element.style.width = element._originalWidth; |
| | 637 | return element; |
| | 638 | } |
| | 639 | //========================================================= |
| | 640 | }); // fin extend |