Changeset 10202 for extensions/Autosize
- Timestamp:
- Apr 9, 2011, 6:08:58 PM (14 years ago)
- Location:
- extensions/Autosize
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Autosize/admin/template/admin.tpl
r9283 r10202 53 53 jQuery('.cluetip').cluetip({ 54 54 width: 300, 55 splitTitle: '|' 55 splitTitle: '|' , 56 clickThrough: true 56 57 }); 57 58 }); -
extensions/Autosize/js/Affiche_script.js
r9948 r10202 253 253 jQuery(document).ready( 254 254 function (jQuery) { 255 jQuery(':Autosize'); 256 257 jQuery(window).unload(function () { 258 try { 259 if (TheImg) { 260 jQuery.cookie('img', TheImg.src); // créer un cookie avec une valeur 261 jQuery.cookie('img_h', jQuery(TheImg).height()); 262 jQuery.cookie('img_w', jQuery(TheImg).width()); 263 jQuery.cookie('window_height', Window_Affichage.height); 264 jQuery.cookie('window_width', Window_Affichage.width); 265 } 266 } catch (r) { 267 268 } 269 270 }); 271 255 jQuery(':Autosize'); 256 257 jQuery(window).unload(function () { 258 try { 259 if (TheImg) { 260 jQuery.cookie('img', TheImg.src); // créer un cookie avec une valeur 261 jQuery.cookie('img_h', jQuery(TheImg).height()); 262 jQuery.cookie('img_w', jQuery(TheImg).width()); 263 jQuery.cookie('window_height', Window_Affichage.height); 264 jQuery.cookie('window_width', Window_Affichage.width); 265 } 266 } catch (r) { 267 268 } 269 270 }); 271 272 jQuery(window).resize( 273 function (event, ui) { 274 List_autosize_resize(event, ui); 275 276 }); 277 278 jQuery(window).load(function () { 279 if (typeof img_width == "undefined") { 280 281 if (List_autosize.length == 0) return; 282 for (i = 0; i < List_autosize.length; i++) { 283 Autosize_resize(jQuery(List_autosize[i])); 284 } 285 286 return; 287 } 288 //========================================================= 289 if (typeof (options) == "undefined") { 290 options = { imageAutosizeMargin: 0, imageAutosize: false } 291 } 292 293 old_img = jQuery.cookie('img'); 294 old_img_h = jQuery.cookie('img_h'); 295 old_img_w = jQuery.cookie('img_w'); 296 old_window_height = jQuery.cookie('window_height'); 297 old_window_width = jQuery.cookie('window_width'); 298 299 //============================================================ 300 img_init = { height: img_height, width: img_width }; // taille initiale 301 img_defaut = { height: scaled_height, width: scaled_width }; 302 img_reelle = { height: img_height, width: img_width }; 303 img_finale = { height: 0, width: 0 }; 304 305 img_top = "0"; 306 rapport = -1; 307 marges_llgbo = 0; 308 pos = 0; 309 //============================================================= 310 Type_Img = ""; 311 TheImg = null; 312 nopano = false; 313 314 Zone_Affichage = { height: 0, width: 0 }; 315 //============================================================ 316 jQuery("#the_page").css({ top: "0px" }); 317 Info_the_page = jQuery("#the_page").infos(); 318 info_HeaderBar = jQuery("#imageHeaderBar").infos(); 319 320 Parent = "#theImage"; 321 322 Zone_Affichage = jQuery(Parent).infos(); 323 // 324 var old_window = { width: 0, height: 0 }; 325 Bandeau_bas = Info_Description_f(Parent); 326 if (typeof Bandeau_bas != "undefined") Bandeau = Bandeau_bas.top; 327 else Bandeau = 0; 328 if (typeof Bandeau_bas == "undefined") { } 329 old_window = { width: 0, height: 0 }; 330 jQuery("#theImage").trigger('ON'); 331 332 old_window = { width: 0, height: 0 }; 333 jQuery().newResize(); 334 335 //=================================================================== 336 /* 337 * window .resize 338 */ 272 339 jQuery(window).resize( 273 340 function (event, ui) { 274 List_autosize_resize(event, ui); 275 341 jQuery().newResize(); 276 342 }); 277 343 278 jQuery(window).load(function () { 279 if (typeof img_width == "undefined") { 280 281 if (List_autosize.length == 0) return; 282 for (i = 0; i < List_autosize.length; i++) { 283 Autosize_resize(jQuery(List_autosize[i])); 344 //============== initialisation =================== 345 346 var pos; 347 var set_p = false; 348 349 350 }); // window.onload 351 352 /* Extension 353 * affiche_debug 354 355 * resize 356 * : 357 */ 358 //========================================================= 359 old_window = { width: 0, height: 0 }; 360 361 jQuery.fn.extend({ 362 //========================================================== 363 Info_description: function (e) { 364 return Info_Description_f(e); 365 366 }, 367 //============================================================= 368 onPropertyChange: function (e) { 369 return; 370 371 372 }, 373 /* 374 * recherche la plus grande image (hauteur ou largeur) 375 */ 376 Get_Img_Maxi: function (myobj) { 377 return Get_Img_Maxi(myobj); 378 }, 379 //============================================================ 380 affiche_debug: function (aff_infos) { 381 affiche_debug(aff_infos); 382 }, 383 //==================================================== 384 newResize: function () { 385 // 386 //if (options.imageAutosize) return true ;stripped 387 if (DEBUG == "true") { 388 nu_img += 1; 389 390 bp1 = jQuery('.debug').get(nu_img); 391 if (!bp1) nu_img = 0; 392 bp1 = jQuery('.debug').get(nu_img); 393 394 jQuery(bp1).trigger('ON'); 395 } 396 if (typeof cl_visible == "undefined") return; 397 if (!cl_visible == true) { return true; } 398 var chk = eval(user_status + "_enabled"); 399 if (chk == "") { return true; } 400 //================================================================= 401 var winwidth = jQuery(window).width(); 402 var winheight = jQuery(window).height(); 403 n = winwidth - old_window.width; 404 if (Math.abs(n) < 1) { 405 n = winheight - old_window.height; 406 if (Math.abs(n) < 1) 407 return true; 408 } 409 if (Math.abs(n) > 30) nu_img = 0; 410 //if (nu_img > 10) return true; 411 old_window = jQuery(window).infos(); 412 //=========================================================================== 413 414 415 jQuery(Parent).width(winwidth); 416 jQuery(Parent).height(winheight); 417 418 var Cadre = jQuery(Parent).get(0); 419 var info_theImage = jQuery(Cadre).infos(); 420 //=============== Information cadre ====== 421 var info_the_page = jQuery("#the_page").infos(); 422 //============================================================================= 423 424 var info_content = jQuery("#content").infos(); 425 var info_titrePage = jQuery("#titrePage").infos(); 426 var info_imageInfoBar = jQuery("#imageInfoBar").infos(); 427 var info_theHeader = jQuery("#theHeader").infos(); 428 429 var Zone_Affichage = jQuery(Parent).infos(); 430 var info_ToolBar = jQuery("#imageToolBar").infos(); 431 var marge = 0; 432 var marge_right = 0; 433 var marge_left = 0; 434 if (theme.match(RegExp("simple", "g"))) { 435 if (info_ToolBar.width > 0) 436 marge = (Zone_Affichage.width - info_ToolBar.width) / 2; 437 else if (info_the_page.width > 0) 438 marge = (Zone_Affichage.width - info_the_page.width) / 2; 439 440 marge_right = marge; 441 marge_left = marge; 442 443 if (info_content.width > 100) { 444 445 marge_left = (info_imageInfoBar.margin.left) + 1; 446 marge_right = (marge_left + info_imageInfoBar.margin.right) + 1; 447 winwidth = info_content.width; 448 marge_right = info_imageInfoBar.width + marge_right; 449 450 } 451 } else { 452 if (theme.match(RegExp("stripped", "gi"))) { 453 454 marge = (info_the_page.width - info_HeaderBar.width) / 2; 455 marge_right = marge; 456 marge_left = marge; 457 } else if (info_ToolBar.width > 0) { 458 marge = (info_the_page.width - info_ToolBar.width) / 2; 459 460 marge_right = marge + info_the_page.left; 461 marge_left = marge; 462 463 } 464 winwidth = info_the_page.width; 465 } 466 467 468 469 marge_right += Zone_Affichage.borderwidth.right; 470 marge_left += Zone_Affichage.borderwidth.left; 471 winwidth -= (marge_right + marge_left); 472 //--------------------------------------------- 473 jQuery(Parent).width(winwidth); 474 jQuery(Parent).css({ height: "auto" }); 475 476 477 // jQuery(Parent).height(Zone_Affichage.height); 478 //--------------------------------------------- 479 480 if (Type_Img == "pamoorama") { 481 482 mypanorama = window.myPamoorama; 483 //============================================================ 484 if (typeof (mypanorama) == "undefined") return false; 485 var myPamoorama = mypanorama; 486 if (typeof (myPamoorama.skipInit) == "undefined") return false; 487 // 488 489 if (myPamoorama.skipInit == false) { 490 491 return false; 492 } 493 494 var info_pamoorama = jQuery("#pamoorama").infos(); 495 var info_pamoorama_outter = jQuery("#pamoorama_outter").infos(); 496 var info_pamoorama_inner = jQuery("#pamoorama_inner").infos(); 497 var info_pamoorama_footer = jQuery("#pamoorama_footer").infos(); 498 var info_pamoorama_frame = jQuery("#pamoorama_frame").infos(); 499 TheImg = jQuery("#pamoorama"); 500 obj = TheImg.get(0); 501 502 } else { 503 504 505 506 507 } 508 //================================================================= 509 510 511 switch (Type_Img) { 512 case "map": 513 img_reelle.height = info_img.height; 514 info_map = jQuery("#mapPicture").infos(); 515 jQuery("#map").css("left", info_map.width + "px"); 516 Bandeau_bas.height = 10; 517 518 if (theme.match(RegExp("simple", "g"))) { 519 img_reelle.width = winwidth; //- info_map.width -marge_right; 520 } else { 521 img_reelle.width = winwidth - info_map.width - marge_right; 522 } 523 524 525 info_the_page = jQuery("#the_page").infos(); 526 winwidth = img_reelle.width; 527 528 ; 529 530 break 531 532 533 case "panorama": 534 // return; 535 536 537 TheImg = jQuery().Get_Img_Maxi("#Panorama img"); 538 info_theImage = jQuery(TheImg).infos(); 539 info_the_page = jQuery("#the_page").infos(); 540 541 break 542 case "img": 543 544 if (!TheImg) return true; 545 if (theme.match(RegExp("luciano", "g"))) { 546 TheImg = jQuery("#the_page #theImg"); 547 } 548 info_theImage = jQuery(TheImg).infos(); 549 info_the_page = jQuery("#the_page").infos(); 550 551 552 break 553 case "img_autre": 554 if (!TheImg) { 555 if (DEBUG == "true") alert("TheImg=null"); 556 return true; 557 558 } 559 info_theImage = jQuery(TheImg).infos(); 560 info_the_page = jQuery("#the_page").infos(); 561 562 563 break 564 case "embed": 565 // 566 567 info_theImage = info_img; 568 info_the_page = jQuery("#the_page").infos(); 569 570 if (rapport < 0) { 571 img_height = info_img.height; 572 img_width = info_img.width; 573 574 img_reelle.height = img_height; 575 img_reelle.width = img_width; 576 577 } 578 579 break 580 case "charlie": 581 582 583 info_theImage = info_img; 584 info_the_page = jQuery("#the_page").infos(); 585 if (rapport < 0) { 586 img_height = parseInt(info_img.height); 587 img_width = parseInt(info_img.width); 588 589 img_reelle.height = parseInt(info_img.height); 590 img_reelle.width = parseInt(info_img.width); 591 } 592 593 break 594 case "pamoorama": 595 596 img_reelle = { height: img_height, width: img_width }; 597 598 //========================================================= 599 img_reelle.height = img_height; 600 img_reelle.width = Zone_Affichage.width; 601 602 603 TheImg = myPamoorama.image; 604 info_theImage = jQuery("#pamoorama").infos(); 605 info_theImage.height = img_reelle.height; 606 607 608 info_the_page = jQuery("#the_page").infos(); 609 610 break 611 612 613 } 614 MinWidth = jQuery(TheImg).css("minWidth"); 615 if (MinWidth == "0px") 616 MinWidth = mini_width; 617 MinHeight = jQuery(TheImg).css("minHeight"); 618 if (MinHeight == "0px") 619 MinHeight = mini_height; 620 621 MaxWidth = jQuery(TheImg).css("maxWidth"); 622 if (MaxWidth == "0px") 623 MaxWidth = winwidth; 624 MaxHeight = jQuery(TheImg).css("maxHeight"); 625 if (MaxHeight == "0px") 626 MaxHeight = mwinheight; 627 628 //=============== Vérification taille minimale autorizée ====================== 629 var miniWidth = jQuery(TheImg).Get_Val_int(MinWidth, mini_width); 630 var miniHeight = jQuery(TheImg).Get_Val_int(MinHeight, mini_height); 631 if (winwidth < mini_width2) mini_width2 = winwidth; 632 633 var miniWidth2 = jQuery(TheImg).Get_Val_int(MinWidth, mini_width2); 634 var miniHeight2 = jQuery(TheImg).Get_Val_int(MinHeight, mini_height2); 635 636 637 var maxWidth = jQuery(TheImg).Get_Val_int(MaxWidth, winwidth, "0"); 638 maxHeight = jQuery(TheImg).Get_Val_int(MaxHeight, winheight, "0"); 639 640 641 mini_width = parseInt(miniWidth); 642 mini_height = parseInt(miniHeight); 643 644 img_reelle.width = parseInt(img_reelle.width); 645 646 if (img_reelle.width < mini_width) return true; 647 648 img_reelle.height = parseInt(img_reelle.height); 649 if (img_reelle.height < parseInt(mini_height)) return true; 650 //================================================================================== 651 if (rapport < 0) { 652 653 img_init.height = parseInt(img_height); 654 img_init.width = parseInt(img_width); 655 656 rapport = img_width / img_height; 657 658 if (Type_Img != "map") 659 rapport = (img_init.width / img_init.height); 660 else 661 rapport = 0; 662 663 } 664 665 666 //=============== Zone d'affichage ============================ 667 668 borderW = Zone_Affichage.borderwidth.left; 669 borderW += Zone_Affichage.borderwidth.right; 670 671 672 Zone_Affichage.width = winwidth - borderW; 673 674 675 676 var Licence = jQuery(".licencetag"); 677 info_Licence = jQuery(".licencetag").infos(); 678 679 jQuery(Parent + " #theImg IMG").css("marginTop", "0px") 680 //========== Correction en fonction du thème ============================= 681 var correction = 0; 682 if (theme.match(RegExp("sobre", "g"))) { 683 684 // correction = -info_Licence.padding.top; 685 if (Type_Img == 'img') { 686 if (msie == true) correction = 0; 687 else correction = 0; 688 correction = 10; 689 } 690 691 } else if (theme.match(RegExp("Pure", "g"))) { 692 correction += 0; //?? 693 } else if (theme.match(RegExp("luciano", "g"))) { 694 correction = 0; //?? 695 696 } else if (theme.match(RegExp("simple", "g"))) { 697 correction += 0; //?? 698 } else if (theme.match(RegExp("gally", "g"))) { 699 correction += 0; //?? 700 701 } 702 703 //==================================================== 704 if (options.imageAutosizeMargin > 0) Marge_Basse = options.imageAutosizeMargin; 705 else Marge_Basse = parseInt(marge_basse || 0); // hors bandeau 706 //========================================================================== 707 h = 0; 708 709 h = (Zone_Affichage.padding.bottom + Zone_Affichage.padding.top + Zone_Affichage.margin.top + Zone_Affichage.margin.bottom); 710 Bandeau = Bandeau_t.img_top; 711 Zone_Affichage.height = winheight - Bandeau - Marge_Basse - correction - h; 712 //========================================================================= 713 if (Zone_Affichage.height < mini_height2) 714 Zone_Affichage.height = mini_height2; 715 if (Zone_Affichage.width < mini_width2) 716 Zone_Affichage.width = mini_width2; 717 //========================================================================= 718 if (typeof (Bandeau_bas) != "undefined") { 719 Zone_Affichage.height -= (Bandeau_bas.height + Bandeau_bas.marge.top + Bandeau_bas.marge.bottom); 720 721 722 } else { 723 724 } 725 726 var Image_height = Zone_Affichage.height; 727 728 //============================================================= 729 var height_user = eval(user_status + "_height"); 730 var reg1 = new RegExp("%", "g"); 731 if (height_user.match(reg1)) 732 Image_height = Image_height * parseInt(height_user) / 100; 733 else 734 Image_height = parseInt(height_user); 735 736 echelle_max = parseFloat(echelle_max, '3'); 737 var echelle = parseFloat(Image_height / img_reelle.height, 3); 738 739 if (echelle > echelle_max) { echelle = echelle_max; } 740 Image_height = parseInt(img_reelle.height * echelle); 741 //============================================================ 742 743 var Image_width; 744 if (rapport > 0) 745 Image_width = parseInt(Image_height * rapport); 746 else if (Type_Img == "map") { 747 Image_width = Zone_Affichage.width - marge_left - marge_right; 748 } else { 749 Image_width = Zone_Affichage.width; 750 } 751 752 //=============================================================== 753 align_auto = "center"; 754 if (jQuery("#theImg").css("textAlign")) 755 align_auto = jQuery("#theImg").css("textAlign"); 756 var widthmin = winwidth; 757 758 if (check_auto_w == 'checked="checked"') { 759 // if (Type_Img != "pamoorama" && Type_Img != "panorama" ) { 760 //==== largeur à atteindre === 761 var width_user = eval(user_status + "_width"); 762 // Largeur maximale en fonction du statut 763 if (width_user.match(reg1)) 764 // pourcentage 765 widthmin = widthmin * parseInt(width_user) / 100; 766 else 767 widthmin = parseInt(width_user); 768 769 var marges = 0; 770 771 if (typeof (info_img) != "undefined") { 772 widthmin -= info_img.borderwidth.left || 0; 773 widthmin -= info_img.borderwidth.right || 0; 774 } 775 widthmin -= marges; 776 widthmin -= (Bandeau_t.borderwidth.left + Bandeau_t.borderwidth.left); 777 Image_width -= (Bandeau_t.borderwidth.left + Bandeau_t.borderwidth.left); 778 if (Image_width > widthmin) { 779 // Image_width largeur à atteindre 780 // Calcul du rapport d'agrandissement 781 var echelle_w = parseFloat((widthmin) / img_reelle.width, 3); 782 if (echelle_w > echelle_max) { echelle_w = echelle_max; } 783 Image_width = parseInt(img_reelle.width * echelle_w); 784 if (rapport > 0) 785 Image_height = parseInt(Image_width / rapport); 786 } 787 788 789 790 } 791 792 793 // } 794 //=================================================== 795 796 img_finale.height = Image_height; 797 img_finale.width = Image_width; 798 if (theme.match(RegExp("stripped", "gi"))) { 799 img_finale.width -= (llgboframe.top * 2); 800 if (rapport > 0) img_finale.height = (img_finale.width / rapport); 801 else img_finale.height -= (llgboframe.top * 2); 802 } 803 zoom = echelle; 804 if (llgboframe.height > 0) { 805 //=============LLGBO2 =========================== 806 t1 = llgboframe; 807 if (!TheImg.src) { 808 TheImg = jQuery(TheImg).find("img").get(0) 809 if (!TheImg.src) { 810 TheImg = jQuery(Parent).find("div").get(0) 811 } 812 } 813 if (TheImg.src) { 814 815 816 wingbo = img_finale.width; 817 heightgbo = img_finale.height; 818 if (Type_Img == "panorama") { 819 heightgbo = info_theImage.height; 820 img_finale.height = info_theImage.height; 821 } 822 823 img_finale.width -= marges_llgbo; 824 if (jQuery("#slideshow").infos().width > 0) { 825 img_finale.height -= (marges_llgbo * 1.5); 826 } else { 827 img_finale.height -= marges_llgbo 828 } 829 830 831 if (wingbo > winwidth) { 832 jQuery("#gbo").width(winwidth); 833 jQuery("#gbo").height(winheight); 834 jQuery("#gbo").css("width", winwidth + "px"); 835 jQuery("#gbo").css("height", winheight + "px"); 836 } 837 else { 838 jQuery("#gbo").width(wingbo); 839 jQuery("#gbo").height(heightgbo); 840 jQuery("#gbo").css("width", wingbo + "px"); 841 jQuery("#gbo").css("height", heightgbo + "px"); 842 } 843 844 a0 = jQuery("area[rel!=up][rel!=prev][rel!=next]"); 845 a1 = jQuery("area[rel=prev]"); 846 a2 = jQuery("area[rel=next]"); 847 a3 = jQuery("area[rel=up]"); 848 nb_zone = 3; 849 if (a1.length == 0) { 850 nb_zone -= 1; 851 } 852 if (a2.length == 0) { 853 nb_zone -= 1; 854 } 855 856 857 var Largeur_zone = (img_finale.width / nb_zone); 858 var Hauteur_zone = (img_finale.height); 859 var init_zone = 0; 860 861 if (a1.length > 0) { 862 coord = { x0: init_zone, y0: 0, x1: Largeur_zone, y1: Hauteur_zone }; 863 864 jQuery("area[rel=prev]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + coord.y1 + "'" }); 865 init_zone += Largeur_zone; 866 } 867 868 coord = { x0: init_zone, y0: 0, x1: init_zone + Largeur_zone, y1: img_finale.height }; 869 870 if (a0.length > 0) { 871 jQuery("area[rel=up]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + (coord.y1 / 2) + "'" }); 872 jQuery(a0).attr({ coords: "'" + coord.x0 + "," + (coord.y1 / 2) + "," + coord.x1 + "," + (coord.y1) + "'" }); 873 } else { 874 jQuery("area[rel=up]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + (coord.y1) + "'" }); 875 } 876 init_zone += Largeur_zone; 877 878 if (a2.length > 0) { 879 coord = { x0: init_zone, y0: 0, x1: init_zone + Largeur_zone, y1: img_finale.height }; 880 jQuery("area[rel=next]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + coord.y1 + "'" }); 881 } 882 } 883 } 884 885 //================ Zone affichage ========================= 886 887 888 // jQuery(Cadre).css("top", "0px"); 889 jQuery("#standard").css("top", 0 + "px"); 890 jQuery("#comments").css("top", 0 + "px"); 891 //========== Image Remise à l'échelle ======================= 892 893 img_finale.height = parseInt(img_finale.height); 894 img_finale.width = parseInt(img_finale.width); 895 //========================================================================= 896 if (jQuery("#slideshow").infos().width > 0) { 897 898 jQuery(Cadre).css({ marginLeft: "auto" 899 }); 900 } 901 else 902 jQuery(Cadre).css({ marginLeft: marge_left + "px" 903 }); 904 jQuery(Cadre).width(Zone_Affichage.width); 905 // jQuery(Cadre).height(Zone_Affichage.height); 906 907 if (typeof (gmaps) != "undefined") { 908 Gmap_ = gmaps.maps[0]; 909 if (Gmap_.sizeMode == 'A') { 910 jQuery("#iGMapsIcon").css({ width: old_window.width * 0.8 + "px", height: old_window.height * 0.8 + "px" }); 911 912 } 913 } 914 //============= flv,mov,mpg ok 915 /* wmv nok 916 * avi nok 917 //=========================================== 918 */ 919 if (Type_Img == "charlie") { 920 t1 = jQuery("#charlie").infos(); 921 922 /**/ 923 924 pdf = 0; 925 jQuery("#charlie div").each(function (i) { 926 927 928 p1 = jQuery(this).infos(); 929 pdf += p1.padding.right + p1.padding.left; 930 }); 931 img_finale.width -= pdf; 932 933 jQuery("#charlie").css({ 934 width: img_finale.width + pdf, 935 height: img_finale.height, 936 margin: "auto" 937 }); 938 939 940 941 jQuery("#player").css("width", img_finale.width + "px"); 942 jQuery("#player").css("height", img_finale.height); 943 944 jQuery("#embedplayer").css("width", img_finale.width); 945 jQuery("#embedplayer").css("height", img_finale.height); 946 947 948 jQuery("object").width(img_finale.width); 949 jQuery("object").height(img_finale.height); 950 951 952 } else if (Type_Img == "panorama") { 953 954 // ----- jQuery(TheImg).panorama2(img_finale.height, img_finale.width); 955 // jQuery(TheImg).height(img_finale.height); 956 // jQuery(TheImg).width(img_finale.width); 957 jQuery("#Panorama div").height(img_finale.height); 958 // class=simple_panorama 959 960 jQuery(".panorama-viewport").css("left", "2px"); 961 jQuery(".panorama-viewport").css("width", "auto"); 962 963 964 } else if (Type_Img == "pamoorama") { 965 info_theImage.height = Zone_Affichage.height; 966 img_height = myPamoorama.imageHeight 967 if (theme.match(RegExp("simple", "g"))) { 968 // marge_right = 2; 969 } 970 new_width = Zone_Affichage.width - marge_right - marge_left; 971 new_width = Zone_Affichage.width - (info_theImage.borderwidth.right + info_theImage.borderwidth.left); 972 973 974 975 Zone_Affichage.height += info_pamoorama_footer.height; 976 zoom = info_theImage.height / img_height; 977 myPamoorama.options.width = new_width * zoom; 978 // if(msie || safari) jQuery("#pamoorama_inner ").css({ zoom: zoom }); 979 //==================================================== 980 jQuery("#pamoorama").css({ 981 marginLeft: "auto", 982 marginRight: "auto", 983 //height: Zone_Affichage.height + "px", sinon déclenchement panorama sur la hauteur; 984 width: new_width + "px" 985 }); 986 jQuery("#pamoorama").width(new_width); 987 988 //==================================================== 989 info_pamoorama = jQuery("#pamoorama").infos(); 990 img_finale.height = info_pamoorama.height - info_pamoorama_footer.height; 991 img_finale.width = new_width; 992 993 jQuery("#pamoorama_outter").width(new_width); 994 995 996 // commenter sinon outter augmente à chaque resize 997 // jQuery("#pamoorama_outter").height(info_pamoorama.height - info_pamoorama_footer.height); 998 999 1000 1001 jQuery("#pamoorama_outter").css({ width: new_width + "px" }); 1002 jQuery("#pamoorama_footer").css({ width: new_width + "px" }); 1003 // 1004 //==================================================== 1005 info_pamoorama = jQuery("#pamoorama").infos(); 1006 info_pamoorama_outter = jQuery("#pamoorama_outter").infos(); 1007 info_pamoorama_inner = jQuery("#pamoorama_inner").infos(); 1008 info_pamoorama_footer = jQuery("#pamoorama_footer").infos(); 1009 info_pamoorama_frame = jQuery("#pamoorama_frame").infos(); 1010 1011 info_frame = jQuery(myPamoorama.frame).infos(); 1012 1013 zoom = img_finale.height / img_height; 1014 1015 1016 } else if (TheImg.src) { 1017 //--- background ?? --- 1018 jQuery(TheImg).height(img_finale.height); 1019 jQuery(TheImg).width(img_finale.width); 1020 jQuery(TheImg).css({ height: img_finale.height + "px ", 1021 width: img_finale.width + "px " 1022 }); 1023 1024 1025 } else { 1026 //===map ? luciano === 1027 jQuery(TheImg).height(img_finale.height); 1028 jQuery(TheImg).width(img_finale.width); 1029 jQuery(TheImg).css({ height: img_finale.height + "px ", 1030 width: img_finale.width + "px " 1031 }); 1032 if (theme.match(RegExp("luciano", "g"))) { 1033 jQuery(Parent + " #theImg IMG").css({ height: img_finale.height + "px ", 1034 width: img_finale.width + "px " 1035 }) 1036 } 1037 1038 } 1039 1040 jQuery("#navThumbPrev").css({ overflow: "hidden" }); 1041 jQuery("#navThumbNext").css({ overflow: "hidden" }); 1042 n = typeof inittoolbar; 1043 if (Type_Img == "map") { 1044 jQuery("#navThumbNext").css({ display: 'none' }); 1045 jQuery("#navThumbPrev").css({ display: 'none' }); 1046 } 1047 try { 1048 if (theme.match(RegExp("gally", "gi"))) { 1049 if (typeof inittoolbar == "function") { 1050 if (typeof (currentTab) == "undefined") inittoolbar(); 1051 else initializeImageMode("resize"); 1052 } 1053 //=========================================================================== 1054 1055 if (jQuery("#navThumbPrev").length > 0) { 1056 jQuery("#navThumbPrev").css({ height: info_img.height + "px", 1057 overflow: "hidden" 1058 }); 1059 1060 } 1061 if (jQuery("#navThumbNext").length > 0) { 1062 jQuery("#navThumbNext").css({ height: info_img.height + "px", 1063 overflow: "hidden" 1064 }); 1065 1066 } 1067 1068 1069 if (!theme.match(RegExp("lapis", "gi"))) { 1070 if (typeof initializeImageMode == "function") { 1071 initializeImageMode("resize"); 284 1072 } 285 1073 286 return; 1074 } 1075 1076 } else if (theme.match(RegExp("simple", "g"))) { 1077 1078 jQuery("#imageToolBar").css({ position: "static" }); 1079 1080 info_imageInfoBar = jQuery("#imageInfoBar").infos(); 1081 if (info_imageInfoBar.bottom < info_img.bottom) { 1082 // jQuery("#imageInfoBar").height(info_img.bottom); 1083 } 1084 1085 } else { 1086 1087 // jQuery("#imageToolBar").css("position", "static"); 287 1088 } 288 //========================================================= 289 if (typeof (options) == "undefined") { 290 options = { imageAutosizeMargin: 0, imageAutosize: false } 291 } 292 293 old_img = jQuery.cookie('img'); 294 old_img_h = jQuery.cookie('img_h'); 295 old_img_w = jQuery.cookie('img_w'); 296 old_window_height = jQuery.cookie('window_height'); 297 old_window_width = jQuery.cookie('window_width'); 298 299 //============================================================ 300 img_init = { height: img_height, width: img_width }; // taille initiale 301 img_defaut = { height: scaled_height, width: scaled_width }; 302 img_reelle = { height: img_height, width: img_width }; 303 img_finale = { height: 0, width: 0 }; 304 305 img_top = "0"; 306 rapport = -1; 307 marges_llgbo = 0; 308 pos = 0; 309 //============================================================= 310 Type_Img = ""; 311 TheImg = null; 312 nopano = false; 313 314 Zone_Affichage = { height: 0, width: 0 }; 315 //============================================================ 316 jQuery("#the_page").css({ top: "0px" }); 317 Info_the_page = jQuery("#the_page").infos(); 318 info_HeaderBar = jQuery("#imageHeaderBar").infos(); 319 320 Parent = "#theImage"; 321 322 Zone_Affichage = jQuery(Parent).infos(); 323 // 324 var old_window = { width: 0, height: 0 }; 325 Bandeau_bas = Info_Description_f(Parent); 326 if (typeof Bandeau_bas != "undefined") Bandeau = Bandeau_bas.top; 327 else Bandeau = 0; 328 if (typeof Bandeau_bas == "undefined") { } 329 old_window = { width: 0, height: 0 }; 330 jQuery("#theImage").trigger('ON'); 331 332 old_window = { width: 0, height: 0 }; 333 jQuery().newResize(); 334 335 //=================================================================== 336 /* 337 * window .resize 338 */ 339 jQuery(window).resize( 340 function (event, ui) { 341 jQuery().newResize(); 342 }); 343 344 //============== initialisation =================== 345 346 var pos; 347 var set_p = false; 348 349 350 }); // window.onload 351 352 /* Extension 353 * affiche_debug 354 355 * resize 356 * : 357 */ 358 //========================================================= 359 old_window = { width: 0, height: 0 }; 360 361 jQuery.fn.extend({ 362 //========================================================== 363 Info_description: function (e) { 364 return Info_Description_f(e); 365 366 }, 367 //============================================================= 368 onPropertyChange: function (e) { 369 return; 370 371 372 }, 373 /* 374 * recherche la plus grande image (hauteur ou largeur) 375 */ 376 Get_Img_Maxi: function (myobj) { 377 return Get_Img_Maxi(myobj); 378 }, 379 //============================================================ 380 affiche_debug: function (aff_infos) { 381 affiche_debug(aff_infos); 382 }, 383 //==================================================== 384 newResize: function () { 385 // 386 //if (options.imageAutosize) return true ;stripped 387 if (DEBUG == "true") { 388 nu_img += 1; 389 390 bp1 = jQuery('.debug').get(nu_img); 391 if (!bp1) nu_img = 0; 392 bp1 = jQuery('.debug').get(nu_img); 393 394 jQuery(bp1).trigger('ON'); 395 } 396 if (typeof cl_visible == "undefined") return; 397 if (!cl_visible == true) { return true; } 398 var chk = eval(user_status + "_enabled"); 399 if (chk == "") { return true; } 400 //================================================================= 401 var winwidth = jQuery(window).width(); 402 var winheight = jQuery(window).height(); 403 n = winwidth - old_window.width; 404 if (Math.abs(n) < 1) { 405 n = winheight - old_window.height; 406 if (Math.abs(n) < 1) 407 return true; 408 } 409 if (Math.abs(n) > 30) nu_img = 0; 410 //if (nu_img > 10) return true; 411 old_window = jQuery(window).infos(); 412 //=========================================================================== 413 414 415 jQuery(Parent).width(winwidth); 416 jQuery(Parent).height(winheight); 417 418 var Cadre = jQuery(Parent).get(0); 419 var info_theImage = jQuery(Cadre).infos(); 420 //=============== Information cadre ====== 421 var info_the_page = jQuery("#the_page").infos(); 422 //============================================================================= 423 424 var info_content = jQuery("#content").infos(); 425 var info_titrePage = jQuery("#titrePage").infos(); 426 var info_imageInfoBar = jQuery("#imageInfoBar").infos(); 427 var info_theHeader = jQuery("#theHeader").infos(); 428 429 var Zone_Affichage = jQuery(Parent).infos(); 430 var info_ToolBar = jQuery("#imageToolBar").infos(); 431 var marge = 0; 432 var marge_right = 0; 433 var marge_left = 0; 434 if (theme.match(RegExp("simple", "g"))) { 435 if (info_ToolBar.width > 0) 436 marge = (Zone_Affichage.width - info_ToolBar.width) / 2; 437 else if (info_the_page.width > 0) 438 marge = (Zone_Affichage.width - info_the_page.width) / 2; 439 440 marge_right = marge; 441 marge_left = marge; 442 443 if (info_content.width > 100) { 444 445 marge_left = (info_imageInfoBar.margin.left); 446 marge_right = (info_imageInfoBar.margin.left + info_imageInfoBar.margin.right); 447 winwidth = info_content.width; 448 marge_right = info_imageInfoBar.width + marge_right; 449 450 } 451 } else { 452 if (theme.match(RegExp("stripped", "gi"))) { 453 454 marge = (info_the_page.width - info_HeaderBar.width) / 2; 455 } else if (info_ToolBar.width > 0) 456 marge = (info_the_page.width - info_ToolBar.width) / 2; 457 458 marge_right = marge; 459 marge_left = marge; 460 winwidth = info_the_page.width; 461 } 462 463 464 465 marge_right += Zone_Affichage.borderwidth.right; 466 marge_left += Zone_Affichage.borderwidth.left; 467 winwidth -= (marge_right + marge_left); 468 //--------------------------------------------- 469 jQuery(Parent).width(winwidth); 470 jQuery(Parent).css({ height: "auto" }); 471 472 473 // jQuery(Parent).height(Zone_Affichage.height); 474 //--------------------------------------------- 475 476 if (Type_Img == "pamoorama") { 477 478 mypanorama = window.myPamoorama; 479 //============================================================ 480 if (typeof (mypanorama) == "undefined") return false; 481 var myPamoorama = mypanorama; 482 if (typeof (myPamoorama.skipInit) == "undefined") return false; 483 // 484 485 if (myPamoorama.skipInit == false) { 486 487 return false; 488 } 489 490 var info_pamoorama = jQuery("#pamoorama").infos(); 491 var info_pamoorama_outter = jQuery("#pamoorama_outter").infos(); 492 var info_pamoorama_inner = jQuery("#pamoorama_inner").infos(); 493 var info_pamoorama_footer = jQuery("#pamoorama_footer").infos(); 494 var info_pamoorama_frame = jQuery("#pamoorama_frame").infos(); 495 TheImg = jQuery("#pamoorama"); 496 obj = TheImg.get(0); 497 498 } else { 499 500 501 502 503 } 504 //================================================================= 505 506 507 switch (Type_Img) { 508 case "map": 509 img_reelle.height = info_img.height; 510 info_map = jQuery("#mapPicture").infos(); 511 jQuery("#map").css("left", info_map.width + "px"); 512 Bandeau_bas.height = 10; 513 514 if (theme.match(RegExp("simple", "g"))) { 515 img_reelle.width = winwidth; //- info_map.width -marge_right; 516 } else { 517 img_reelle.width = winwidth - info_map.width - marge_right; 518 } 519 520 521 info_the_page = jQuery("#the_page").infos(); 522 winwidth = img_reelle.width; 523 524 ; 525 526 break 527 528 529 case "panorama": 530 // return; 531 532 533 TheImg = jQuery().Get_Img_Maxi("#Panorama img"); 534 info_theImage = jQuery(TheImg).infos(); 535 info_the_page = jQuery("#the_page").infos(); 536 537 break 538 case "img": 539 540 if (!TheImg) return true; 541 if (theme.match(RegExp("luciano", "g"))) { 542 TheImg = jQuery("#the_page #theImg"); 543 } 544 info_theImage = jQuery(TheImg).infos(); 545 info_the_page = jQuery("#the_page").infos(); 546 547 548 break 549 case "img_autre": 550 if (!TheImg) { 551 if (DEBUG == "true") alert("TheImg=null"); 552 return true; 553 554 } 555 info_theImage = jQuery(TheImg).infos(); 556 info_the_page = jQuery("#the_page").infos(); 557 558 559 break 560 case "embed": 561 // 562 563 info_theImage = info_img; 564 info_the_page = jQuery("#the_page").infos(); 565 566 if (rapport < 0) { 567 img_height = info_img.height; 568 img_width = info_img.width; 569 570 img_reelle.height = img_height; 571 img_reelle.width = img_width; 572 573 } 574 575 break 576 case "charlie": 577 578 579 info_theImage = info_img; 580 info_the_page = jQuery("#the_page").infos(); 581 if (rapport < 0) { 582 img_height = parseInt(info_img.height); 583 img_width = parseInt(info_img.width); 584 585 img_reelle.height = parseInt(info_img.height); 586 img_reelle.width = parseInt(info_img.width); 587 } 588 589 break 590 case "pamoorama": 591 592 img_reelle = { height: img_height, width: img_width }; 593 594 //========================================================= 595 img_reelle.height = img_height; 596 img_reelle.width = Zone_Affichage.width; 597 598 599 TheImg = myPamoorama.image; 600 info_theImage = jQuery("#pamoorama").infos(); 601 info_theImage.height = img_reelle.height; 602 603 604 info_the_page = jQuery("#the_page").infos(); 605 606 break 607 608 609 } 610 MinWidth=jQuery(TheImg).css("minWidth"); 611 if (MinWidth == "0px") 612 MinWidth =mini_width; 613 MinHeight = jQuery(TheImg).css("minHeight"); 614 if (MinHeight == "0px") 615 MinHeight = mini_height; 616 617 MaxWidth = jQuery(TheImg).css("maxWidth"); 618 if (MaxWidth == "0px") 619 MaxWidth = winwidth; 620 MaxHeight = jQuery(TheImg).css("maxHeight"); 621 if (MaxHeight == "0px") 622 MaxHeight = mwinheight; 623 624 //=============== Vérification taille minimale autorizée ====================== 625 var miniWidth = jQuery(TheImg).Get_Val_int(MinWidth, mini_width); 626 var miniHeight = jQuery(TheImg).Get_Val_int(MinHeight, mini_height); 627 628 var miniWidth2 = jQuery(TheImg).Get_Val_int( MinWidth, mini_width2); 629 var miniHeight2 = jQuery(TheImg).Get_Val_int( MinHeight, mini_height2); 630 631 var maxWidth = jQuery(TheImg).Get_Val_int(MaxWidth, winwidth, "0"); 632 maxHeight = jQuery(TheImg).Get_Val_int(MaxHeight, winheight, "0"); 633 634 635 mini_width = parseInt(miniWidth); 636 mini_height = parseInt(miniHeight); 637 638 img_reelle.width = parseInt(img_reelle.width); 639 640 if (img_reelle.width < mini_width) return true; 641 642 img_reelle.height = parseInt(img_reelle.height); 643 if (img_reelle.height < parseInt(mini_height)) return true; 644 //================================================================================== 645 if (rapport < 0) { 646 647 img_init.height = parseInt(img_height); 648 img_init.width = parseInt(img_width); 649 650 rapport = img_width / img_height; 651 652 if (Type_Img != "map") 653 rapport = (img_init.width / img_init.height); 654 else 655 rapport = 0; 656 657 } 658 659 660 //=============== Zone d'affichage ============================ 661 662 borderW = Zone_Affichage.borderwidth.left; 663 borderW += Zone_Affichage.borderwidth.right; 664 665 666 Zone_Affichage.width = winwidth - borderW; 667 668 669 670 var Licence = jQuery(".licencetag"); 671 info_Licence = jQuery(".licencetag").infos(); 672 673 jQuery(Parent + " #theImg IMG").css("marginTop", "0px") 674 //========== Correction en fonction du thème ============================= 675 var correction = 0; 676 if (theme.match(RegExp("sobre", "g"))) { 677 678 // correction = -info_Licence.padding.top; 679 if (Type_Img == 'img') { 680 if (msie == true) correction = 0; 681 else correction = 0; 682 correction = 10; 683 } 684 685 } else if (theme.match(RegExp("Pure", "g"))) { 686 correction += 0; //?? 687 } else if (theme.match(RegExp("luciano", "g"))) { 688 correction = 0; //?? 689 690 } else if (theme.match(RegExp("simple", "g"))) { 691 correction += 0; //?? 692 } else if (theme.match(RegExp("gally", "g"))) { 693 correction += 0; //?? 694 695 } 696 697 //==================================================== 698 if (options.imageAutosizeMargin > 0) Marge_Basse = options.imageAutosizeMargin; 699 else Marge_Basse = parseInt(marge_basse || 0); // hors bandeau 700 //========================================================================== 701 h = 0; 702 703 h = (Zone_Affichage.padding.bottom + Zone_Affichage.padding.top + Zone_Affichage.margin.top + Zone_Affichage.margin.bottom); 704 Bandeau = Bandeau_t.img_top; 705 Zone_Affichage.height = winheight - Bandeau - Marge_Basse - correction - h; 706 //========================================================================= 707 if (Zone_Affichage.height < mini_height2) 708 Zone_Affichage.height = mini_height2; 709 if (Zone_Affichage.width < mini_width2) 710 Zone_Affichage.width = mini_width2; 711 //========================================================================= 712 if (typeof (Bandeau_bas) != "undefined") { 713 Zone_Affichage.height -= (Bandeau_bas.height + Bandeau_bas.marge.top + Bandeau_bas.marge.bottom); 714 715 716 } else { 717 718 } 719 720 var Image_height = Zone_Affichage.height; 721 722 //============================================================= 723 var height_user = eval(user_status + "_height"); 724 var reg1 = new RegExp("%", "g"); 725 if (height_user.match(reg1)) 726 Image_height = Image_height * parseInt(height_user) / 100; 727 else 728 Image_height = parseInt(height_user); 729 730 echelle_max = parseFloat(echelle_max, '3'); 731 var echelle = parseFloat(Image_height / img_reelle.height, 3); 732 733 if (echelle > echelle_max) { echelle = echelle_max; } 734 Image_height = parseInt(img_reelle.height * echelle); 735 //============================================================ 736 737 var Image_width; 738 if (rapport > 0) 739 Image_width = parseInt(Image_height * rapport); 740 else if (Type_Img == "map") { 741 Image_width = Zone_Affichage.width - marge_left - marge_right; 742 } else { 743 Image_width = Zone_Affichage.width; 744 } 745 746 //=============================================================== 747 align_auto = "center"; 748 if (jQuery("#theImg").css("textAlign")) 749 align_auto = jQuery("#theImg").css("textAlign"); 750 var widthmin = winwidth; 751 752 if (check_auto_w == 'checked="checked"') { 753 // if (Type_Img != "pamoorama" && Type_Img != "panorama" ) { 754 //==== largeur à atteindre === 755 var width_user = eval(user_status + "_width"); 756 // Largeur maximale en fonction du statut 757 if (width_user.match(reg1)) 758 // pourcentage 759 widthmin = widthmin * parseInt(width_user) / 100; 760 else 761 widthmin = parseInt(width_user); 762 763 var marges = 0; 764 765 if (typeof (info_img) != "undefined") { 766 widthmin -= info_img.borderwidth.left || 0; 767 widthmin -= info_img.borderwidth.right || 0; 768 } 769 widthmin -= marges; 770 widthmin -= (Bandeau_t.borderwidth.left + Bandeau_t.borderwidth.left); 771 Image_width -= (Bandeau_t.borderwidth.left + Bandeau_t.borderwidth.left); 772 if (Image_width > widthmin) { 773 // Image_width largeur à atteindre 774 // Calcul du rapport d'agrandissement 775 var echelle_w = parseFloat((widthmin) / img_reelle.width, 3); 776 if (echelle_w > echelle_max) { echelle_w = echelle_max; } 777 Image_width = parseInt(img_reelle.width * echelle_w); 778 if (rapport > 0) 779 Image_height = parseInt(Image_width / rapport); 780 } 781 782 783 784 } 785 786 787 // } 788 //=================================================== 789 790 img_finale.height = Image_height; 791 img_finale.width = Image_width; 792 if (theme.match(RegExp("stripped", "gi"))) { 793 img_finale.width -= (llgboframe.top * 2); 794 if (rapport > 0) img_finale.height = (img_finale.width / rapport); 795 else img_finale.height -= (llgboframe.top * 2); 796 } 797 zoom = echelle; 798 if (llgboframe.height > 0) { 799 //=============LLGBO2 =========================== 800 t1 = llgboframe; 801 if (!TheImg.src) { 802 TheImg = jQuery(TheImg).find("img").get(0) 803 if (!TheImg.src) { 804 TheImg = jQuery(Parent).find("div").get(0) 805 } 806 } 807 if (TheImg.src) { 808 809 810 wingbo = img_finale.width; 811 heightgbo = img_finale.height; 812 if (Type_Img == "panorama") { 813 heightgbo = info_theImage.height; 814 img_finale.height = info_theImage.height; 815 } 816 817 img_finale.width -= marges_llgbo; 818 if (jQuery("#slideshow").infos().width > 0) { 819 img_finale.height -= (marges_llgbo * 1.5); 820 } else { 821 img_finale.height -= marges_llgbo 822 } 823 824 825 if (wingbo > winwidth) { 826 jQuery("#gbo").width(winwidth); 827 jQuery("#gbo").height(winheight); 828 jQuery("#gbo").css("width", winwidth + "px"); 829 jQuery("#gbo").css("height", winheight + "px"); 830 } 831 else { 832 jQuery("#gbo").width(wingbo); 833 jQuery("#gbo").height(heightgbo); 834 jQuery("#gbo").css("width", wingbo + "px"); 835 jQuery("#gbo").css("height", heightgbo + "px"); 836 } 837 838 a0 = jQuery("area[rel!=up][rel!=prev][rel!=next]"); 839 a1 = jQuery("area[rel=prev]"); 840 a2 = jQuery("area[rel=next]"); 841 a3 = jQuery("area[rel=up]"); 842 nb_zone = 3; 843 if (a1.length == 0) { 844 nb_zone -= 1; 845 } 846 if (a2.length == 0) { 847 nb_zone -= 1; 848 } 849 850 851 var Largeur_zone = (img_finale.width / nb_zone); 852 var Hauteur_zone = (img_finale.height); 853 var init_zone = 0; 854 855 if (a1.length > 0) { 856 coord = { x0: init_zone, y0: 0, x1: Largeur_zone, y1: Hauteur_zone }; 857 858 jQuery("area[rel=prev]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + coord.y1 + "'" }); 859 init_zone += Largeur_zone; 860 } 861 862 coord = { x0: init_zone, y0: 0, x1: init_zone + Largeur_zone, y1: img_finale.height }; 863 864 if (a0.length > 0) { 865 jQuery("area[rel=up]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + (coord.y1 / 2) + "'" }); 866 jQuery(a0).attr({ coords: "'" + coord.x0 + "," + (coord.y1 / 2) + "," + coord.x1 + "," + (coord.y1) + "'" }); 867 } else { 868 jQuery("area[rel=up]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + (coord.y1) + "'" }); 869 } 870 init_zone += Largeur_zone; 871 872 if (a2.length > 0) { 873 coord = { x0: init_zone, y0: 0, x1: init_zone + Largeur_zone, y1: img_finale.height }; 874 jQuery("area[rel=next]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + coord.y1 + "'" }); 875 } 876 } 877 } 878 879 //================ Zone affichage ========================= 880 881 882 // jQuery(Cadre).css("top", "0px"); 883 jQuery("#standard").css("top", 0 + "px"); 884 jQuery("#comments").css("top", 0 + "px"); 885 //========== Image Remise à l'échelle ======================= 886 887 img_finale.height = parseInt(img_finale.height); 888 img_finale.width = parseInt(img_finale.width); 889 //========================================================================= 890 if (jQuery("#slideshow").infos().width > 0) { 891 892 jQuery(Cadre).css({ marginLeft: "auto" 893 }); 894 } 895 else 896 jQuery(Cadre).css({ marginLeft: marge_left + "px" 897 }); 898 jQuery(Cadre).width(Zone_Affichage.width); 899 // jQuery(Cadre).height(Zone_Affichage.height); 900 901 if (typeof (gmaps) != "undefined") { 902 Gmap_ = gmaps.maps[0]; 903 if (Gmap_.sizeMode == 'A') { 904 jQuery("#iGMapsIcon").css({ width: old_window.width * 0.8 + "px", height: old_window.height * 0.8 + "px" }); 905 906 } 907 } 908 //============= flv,mov,mpg ok 909 /* wmv nok 910 * avi nok 911 //=========================================== 912 */ 913 if (Type_Img == "charlie") { 914 t1 = jQuery("#charlie").infos(); 915 916 /**/ 917 918 pdf = 0; 919 jQuery("#charlie div").each(function (i) { 920 921 922 p1 = jQuery(this).infos(); 923 pdf += p1.padding.right + p1.padding.left; 924 }); 925 img_finale.width -= pdf; 926 927 jQuery("#charlie").css({ 928 width: img_finale.width + pdf, 929 height: img_finale.height, 930 margin: "auto" 931 }); 932 933 934 935 jQuery("#player").css("width", img_finale.width + "px"); 936 jQuery("#player").css("height", img_finale.height); 937 938 jQuery("#embedplayer").css("width", img_finale.width); 939 jQuery("#embedplayer").css("height", img_finale.height); 940 941 942 jQuery("object").width(img_finale.width); 943 jQuery("object").height(img_finale.height); 944 945 946 } else if (Type_Img == "panorama") { 947 948 // ----- jQuery(TheImg).panorama2(img_finale.height, img_finale.width); 949 // jQuery(TheImg).height(img_finale.height); 950 // jQuery(TheImg).width(img_finale.width); 951 jQuery("#Panorama div").height(img_finale.height); 952 // class=simple_panorama 953 954 jQuery(".panorama-viewport").css("left", "2px"); 955 jQuery(".panorama-viewport").css("width", "auto"); 956 957 958 } else if (Type_Img == "pamoorama") { 959 info_theImage.height = Zone_Affichage.height; 960 img_height = myPamoorama.imageHeight 961 if (theme.match(RegExp("simple", "g"))) { 962 // marge_right = 2; 963 } 964 new_width = Zone_Affichage.width - marge_right - marge_left; 965 new_width = Zone_Affichage.width - (info_theImage.borderwidth.right + info_theImage.borderwidth.left); 966 967 968 969 Zone_Affichage.height += info_pamoorama_footer.height; 970 zoom = info_theImage.height / img_height; 971 myPamoorama.options.width = new_width * zoom; 972 // if(msie || safari) jQuery("#pamoorama_inner ").css({ zoom: zoom }); 973 //==================================================== 974 jQuery("#pamoorama").css({ 975 marginLeft: "auto", 976 marginRight: "auto", 977 //height: Zone_Affichage.height + "px", sinon déclenchement panorama sur la hauteur; 978 width: new_width + "px" 979 }); 980 jQuery("#pamoorama").width(new_width); 981 982 //==================================================== 983 info_pamoorama = jQuery("#pamoorama").infos(); 984 img_finale.height = info_pamoorama.height - info_pamoorama_footer.height; 985 img_finale.width = new_width; 986 987 jQuery("#pamoorama_outter").width(new_width); 988 989 990 // commenter sinon outter augmente à chaque resize 991 // jQuery("#pamoorama_outter").height(info_pamoorama.height - info_pamoorama_footer.height); 992 993 994 995 jQuery("#pamoorama_outter").css({ width: new_width + "px" }); 996 jQuery("#pamoorama_footer").css({ width: new_width + "px" }); 997 // 998 //==================================================== 999 info_pamoorama = jQuery("#pamoorama").infos(); 1000 info_pamoorama_outter = jQuery("#pamoorama_outter").infos(); 1001 info_pamoorama_inner = jQuery("#pamoorama_inner").infos(); 1002 info_pamoorama_footer = jQuery("#pamoorama_footer").infos(); 1003 info_pamoorama_frame = jQuery("#pamoorama_frame").infos(); 1004 1005 info_frame = jQuery(myPamoorama.frame).infos(); 1006 1007 zoom = img_finale.height / img_height; 1008 1009 1010 } else if (TheImg.src) { 1011 //--- background ?? --- 1012 jQuery(TheImg).height(img_finale.height); 1013 jQuery(TheImg).width(img_finale.width); 1014 jQuery(TheImg).css({ height: img_finale.height + "px ", 1015 width: img_finale.width + "px " 1016 }); 1017 1018 1019 } else { 1020 //===map ? luciano === 1021 jQuery(TheImg).height(img_finale.height); 1022 jQuery(TheImg).width(img_finale.width); 1023 jQuery(TheImg).css({ height: img_finale.height + "px ", 1024 width: img_finale.width + "px " 1025 }); 1026 if (theme.match(RegExp("luciano", "g"))) { 1027 jQuery(Parent + " #theImg IMG").css({ height: img_finale.height + "px ", 1028 width: img_finale.width + "px " 1029 }) 1030 } 1031 1032 } 1033 1034 jQuery("#navThumbPrev").css({ overflow: "hidden" }); 1035 jQuery("#navThumbNext").css({ overflow: "hidden" }); 1036 n = typeof inittoolbar; 1037 if (Type_Img == "map") { 1038 jQuery("#navThumbNext").css({ display: 'none' }); 1039 jQuery("#navThumbPrev").css({ display: 'none' }); 1040 } 1041 try { 1042 if (theme.match(RegExp("gally", "gi"))) { 1043 if (typeof inittoolbar == "function") { 1044 if (typeof (currentTab) == "undefined") inittoolbar(); 1045 else initializeImageMode("resize"); 1046 } 1047 //=========================================================================== 1048 1049 if (jQuery("#navThumbPrev").length > 0) { 1050 jQuery("#navThumbPrev").css({ height: info_img.height + "px", 1051 overflow: "hidden" 1052 }); 1053 1054 } 1055 if (jQuery("#navThumbNext").length > 0) { 1056 jQuery("#navThumbNext").css({ height: info_img.height + "px", 1057 overflow: "hidden" 1058 }); 1059 1060 } 1061 1062 1063 if (!theme.match(RegExp("lapis", "gi"))) { 1064 if (typeof initializeImageMode == "function") { 1065 initializeImageMode("resize"); 1066 } 1067 1068 } 1069 1070 } else if (theme.match(RegExp("simple", "g"))) { 1071 1072 jQuery("#imageToolBar").css({ position: "static" }); 1073 1074 info_imageInfoBar = jQuery("#imageInfoBar").infos(); 1075 if (info_imageInfoBar.bottom < info_img.bottom) { 1076 // jQuery("#imageInfoBar").height(info_img.bottom); 1077 } 1078 1079 } else { 1080 1081 // jQuery("#imageToolBar").css("position", "static"); 1082 } 1083 } catch (e) { 1084 1085 } 1086 // --- rglage de la hauteur de page en fonction du copyright----------- 1087 if (typeof (pos) == "undefined") pos = jQuery("#copyright").infos(); 1088 if (pos != jQuery("#copyright").infos()) 1089 pos = jQuery("#copyright").infos(); 1090 if (theme.match(RegExp("stripped", "gi"))) { 1091 var TitleBox = jQuery("#imageTitleContainer"); 1092 if (TitleBox.length != 0) TitleBox.css("width", img_finale.width + "px"); 1093 } else { 1094 if (pos.top > 100) 1095 jQuery("#the_page").height(pos.top); 1096 1097 } 1098 1099 if (!theme.match(RegExp("luciano", "gi"))) { 1100 jQuery("#linkNext").css({ height: "80px", width: "200px", overflow: "hidden" }); 1101 jQuery("#linkPrev").css({ height: "80px", width: "200px", overflow: "hidden" }); 1102 jQuery(".navThumb img").css({ height: "80px", width: "", overflow: "hidden" }); 1103 } 1104 info_frame = jQuery(Cadre).infos(); 1105 if (theme.match(RegExp("stripped", "gi"))) { 1106 pos = "absolute"; 1107 info_theImageBox = jQuery("#theImageAndTitle").infos(); 1108 t1 = info_theImageBox.top; 1109 l1 = info_theImageBox.left; 1110 // info_theImageBox = jQuery(Parent).infos(); 1111 1112 } else { 1113 pos = "absolute"; 1114 t1 = info_frame.top; 1115 l1 = info_frame.left; 1116 info_theImageBox = jQuery(Parent).infos(); 1117 } 1118 1119 info_theImageBox.margin.margin = info_frame.margin.margin; 1120 info_theImageBox.top = t1; 1121 info_theImageBox.left = l1; 1122 info_theImageBox.pos = "absolute"; 1123 Window_Affichage = info_theImageBox; 1124 if (DEBUG == "true") { 1125 // jQuery(Cadre).css("border", "solid green"); 1126 1127 jQuery("#Debug5").css({ background: "transparent", 1128 position: pos, 1129 border: "green solid 2px", 1130 textAlign: align_auto, 1131 margin: Window_Affichage.margin.margin, 1132 top: Window_Affichage.top + "px", 1133 left: Window_Affichage.left + "px", 1134 width: Window_Affichage.width + "px", 1135 height: Window_Affichage.height + "px" 1136 }); //red 1137 jQuery("#Debug4").css({ top: info_frame.bottom - info_description.height + "px" }); //green 1138 } 1139 1140 Wait_Affichage(); 1141 1142 return true; 1143 1144 1145 1146 1147 1148 //_____________________________________________________ 1149 } // Resize(); 1150 1151 1152 //====================================================================== 1153 1154 1155 }); // fin extend 1089 } catch (e) { 1090 1091 } 1092 // --- rglage de la hauteur de page en fonction du copyright----------- 1093 if (typeof (pos) == "undefined") pos = jQuery("#copyright").infos(); 1094 if (pos != jQuery("#copyright").infos()) 1095 pos = jQuery("#copyright").infos(); 1096 if (theme.match(RegExp("stripped", "gi"))) { 1097 var TitleBox = jQuery("#imageTitleContainer"); 1098 if (TitleBox.length != 0) TitleBox.css("width", img_finale.width + "px"); 1099 } else { 1100 if (pos.top > 100) 1101 jQuery("#the_page").height(pos.top); 1102 1103 } 1104 1105 if (!theme.match(RegExp("luciano", "gi"))) { 1106 jQuery("#linkNext").css({ height: "80px", width: "200px", overflow: "hidden" }); 1107 jQuery("#linkPrev").css({ height: "80px", width: "200px", overflow: "hidden" }); 1108 jQuery(".navThumb img").css({ height: "80px", width: "", overflow: "hidden" }); 1109 } 1110 info_frame = jQuery(Cadre).infos(); 1111 if (theme.match(RegExp("stripped", "gi"))) { 1112 pos = "absolute"; 1113 info_theImageBox = jQuery("#theImageAndTitle").infos(); 1114 t1 = info_theImageBox.top; 1115 l1 = info_theImageBox.left; 1116 // info_theImageBox = jQuery(Parent).infos(); 1117 1118 } else { 1119 pos = "absolute"; 1120 t1 = info_frame.top; 1121 l1 = info_frame.left; 1122 info_theImageBox = jQuery(Parent).infos(); 1123 } 1124 1125 info_theImageBox.margin.margin = info_frame.margin.margin; 1126 info_theImageBox.top = t1; 1127 info_theImageBox.left = l1; 1128 info_theImageBox.pos = "absolute"; 1129 Window_Affichage = info_theImageBox; 1130 if (DEBUG == "true") { 1131 // jQuery(Cadre).css("border", "solid green"); 1132 1133 jQuery("#Debug5").css({ background: "transparent", 1134 position: pos, 1135 border: "green solid 2px", 1136 textAlign: align_auto, 1137 margin: Window_Affichage.margin.margin, 1138 top: Window_Affichage.top + "px", 1139 left: Window_Affichage.left + "px", 1140 width: Window_Affichage.width + "px", 1141 height: Window_Affichage.height + "px" 1142 }); //red 1143 jQuery("#Debug4").css({ top: info_frame.bottom - info_description.height + "px" }); //green 1144 } 1145 1146 Wait_Affichage(); 1147 1148 return true; 1149 1150 1151 1152 1153 1154 //_____________________________________________________ 1155 } // Resize(); 1156 1157 1158 //====================================================================== 1159 1160 1161 }); // fin extend 1156 1162 1157 1163
Note: See TracChangeset
for help on using the changeset viewer.