Changeset 7536 for extensions/Autosize/js/Affiche_script.js
- Timestamp:
- Nov 1, 2010, 10:25:51 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Autosize/js/Affiche_script.js
r7458 r7536 1 var cl_visible = true; 1 2 2 function Toggle_bp() { 3 3 cl_visible = !cl_visible; … … 20 20 21 21 jQuery(document).ready( 22 22 23 function (jQuery) { 24 25 26 if (DEBUG == "false") { 27 jQuery("#Debug").hide(); 28 jQuery("#Debug1").hide(); 29 jQuery("#Debug2").hide(); 30 } 23 31 var img_top = "0"; 24 32 … … 30 38 var marges_llgbo = 0; 31 39 if (llgboframe.length > 0) { 32 33 marges_llgbo = jQuery(llgboframe).outerWidth() - jQuery("#gbo div:last").innerWidth(); 40 ll1 = jQuery(llgboframe).info(); 41 ll2 = jQuery("#gbo div:last").info(); 42 marges_llgbo = (ll1.width - ll2.width) + ll2.borderwidth.left + ll2.borderwidth.right; 34 43 } 35 44 … … 47 56 48 57 49 58 //============================================================= 50 59 function cl_Timer() { 51 60 // if (!jQuery.browser.msie) { jQuery(function () { alert(jQuery.browser.version); }); } … … 64 73 setTimeout("cl_Timer()", 500); 65 74 } 75 //============================================================= 66 76 function onPropertyChange(e) { 67 77 var el = e.srcElement; … … 89 99 */ 90 100 function Info_entete(Parent) { 101 91 102 var info_imageToolBar = jQuery("#imageToolBar").info(); 92 103 if (info_imageToolBar.position == "absolute") { … … 97 108 98 109 if (info_theImage.position == "relative") { 99 //--- passage absolute ==> static ===/110 //--- passage relative ==> static ===/ 100 111 jQuery("#theImage").css("position", "static"); 101 112 info_theImage = jQuery("#theImage").info(); … … 108 119 109 120 } 110 121 111 122 marge_top = Info_the_page.top + 112 123 Info_the_page.borderwidth.top + … … 122 133 */ 123 134 function Info_description(Parent) { 124 jQuery("#" + Parent + " p").css({ padding: "0px", margin: "0px " 125 }); 135 136 126 137 // jQuery("#" + Parent + " p:not(:contains(' ')) ").remove(); 127 138 … … 136 147 marginRight: "auto", 137 148 marginTop: "0px", 138 marginBottom: "0px" 149 marginBottom: "0px", position: "absolute", top: Bandeau + "px" 139 150 }); 140 151 } else { 141 jQuery("#" + Parent).css({ padding: "0px", 142 marginLeft: "auto", 143 marginRight: "auto", 144 marginTop: "0px", 145 marginBottom: "0px" 152 153 /* jQuery("#" + Parent).css({ padding: "0px", 154 marginLeft: "auto", 155 marginRight: "auto", 156 marginTop: "0px", 157 marginBottom: "0px" 146 158 }); 147 } 159 */ 160 161 } 162 163 164 // jQuery("#" + Parent + " p").css({ padding: "0px", margin: "0px " }); 165 148 166 149 167 if (theme.match(RegExp("luciano", "g"))) { 150 info_img = jQuery("#" + Parent + " #theImg").info(); 168 info_img = jQuery("#" + Parent + " #theImg img").info(); 169 151 170 } else { 152 171 … … 165 184 //============================================================================= 166 185 info_desc = jQuery("#" + Parent + " p:first").info(); 186 if (info_desc.bottom < info_img.bottom) 187 info_desc.bottom = info_img.bottom; 188 167 189 // if (info_desc.top > info_img.bottom) 168 190 // info_description.top = info_desc.top; 169 191 170 192 if (jQuery("#Panorama").length) { 193 Type_Img = "panorama"; 194 // cl_visible = false; 195 196 } 171 197 info_table = jQuery(".infoTable").info(); 172 198 … … 180 206 if (info_licencetag.bottom > 0) { 181 207 jQuery(".licencetag").css("border", "solid 5px transparent"); 182 if (info_licencetag.bottom > info_licencetag.height) 183 info_description.bottom = info_licencetag.bottom - 3; 208 if (info_licencetag.bottom > info_description.bottom) { 209 info_description.bottom = info_licencetag.bottom; 210 } 184 211 else 185 info_description.bottom -= info_licencetag.padding.top + info_table.margin.top;212 info_description.bottom += info_table.margin.top + info_table.padding.top; 186 213 187 214 } … … 217 244 } 218 245 } 246 247 if (theme.match(RegExp("luciano", "g"))) { info_description.bottom -= 30 } 248 219 249 info_description.height = info_description.bottom - info_description.top; 220 250 221 if (0) { 251 252 if (DEBUG == "true") { 253 222 254 /* jQuery("#Debug").text(jQuery("#Debug").text() + user_status); 223 255 224 jQuery("#Debug").hide(); 225 jQuery("#Debug1").hide(); 226 jQuery("#Debug2").hide(); 256 227 257 info_description.width = "800"; 228 258 */ 229 259 jQuery("#Debug").css('display', 'block'); 260 jQuery("#Debug1").show(); 261 jQuery("#Debug2").show(); 230 262 Bandeau_bas = info_description; 231 263 … … 257 289 }); 258 290 jQuery("#Debug2").text("Debug2:Bandeau_bas bottom :" + Bandeau_bas.bottom); 259 // cl_visible = false; 291 260 292 } 261 293 … … 285 317 jQuery().recentrage_widget(); 286 318 }) 287 319 jQuery("#icon_gmaps").bind('click', function () { 320 jQuery().recentrage_widget(); 321 }) 288 322 289 323 … … 315 349 jQuery(window).resize(function (event, ui) { 316 350 if (typeof (event) == 'undefined') return; 317 if (!cl_visible ) return;351 if (!cl_visible == true) return; 318 352 if (eval(user_status + "_enabled") == "") return; 319 353 var chk = eval(user_status + "_enabled"); … … 334 368 //=========================================================================== 335 369 336 337 var Cadre = jQuery("#theImage").get(0);338 370 339 371 var Type_Img = ""; … … 349 381 } else if (jQuery("#Panorama").length) { 350 382 Type_Img = "panorama"; 351 } else if (jQuery( Cadre).find("img").length > 0) {383 } else if (jQuery("#theImage").find("img").length > 0) { 352 384 Type_Img = "img"; 353 385 } else if (jQuery("img").length > 0) { … … 360 392 361 393 394 var Cadre = jQuery("#theImage").get(0); 362 395 var info_Cadre = jQuery(Cadre).info(); 363 396 //=============== Information cadre ====== … … 379 412 var info_theHeader = jQuery("#theHeader").info(); 380 413 381 var marge = (Zone_Affichage.width - info_ToolBar.width) / 2; 414 415 var marge = 0; 416 if (info_ToolBar.width > 0) 417 marge = (Zone_Affichage.width - info_ToolBar.width) / 2; 382 418 383 419 var marge_right = marge; … … 394 430 395 431 winwidth -= (marge_right + marge_left); 432 396 433 397 434 … … 454 491 455 492 case "panorama": 456 457 var w00 = 0; 458 jQuery("#Panorama img").each(function (i) { 459 w0 = this.width; 460 if (w0 > w00) { 461 TheImg = this; 462 n = TheImg.nameProp; 463 w00 = w0; 464 } 465 }); 466 493 // return; 494 495 496 TheImg = Get_Img_Maxi("#Panorama img"); 467 497 info_theImage = jQuery(TheImg).info(); 468 498 info_the_page = jQuery("#the_page").info(); … … 472 502 473 503 if (!TheImg) return; 504 if (theme.match(RegExp("luciano", "g"))) { 505 TheImg = jQuery("#the_page #theImg"); 506 } 474 507 info_theImage = jQuery(TheImg).info(); 475 508 info_the_page = jQuery("#the_page").info(); … … 573 606 var Licence = jQuery(".licencetag"); 574 607 info_Licence = jQuery(".licencetag").info(); 575 //================================================================================== 608 576 609 jQuery("#theImage #theImg IMG").css("marginTop", "0px") 577 610 //========== Correction en fonction du thème ============================= 578 611 var correction = 0; 579 612 if (theme.match(RegExp("sobre", "g"))) { … … 584 617 correction += 0; //?? 585 618 } else if (theme.match(RegExp("luciano", "g"))) { 586 correction += 0; //?? 619 correction = 0; //?? 620 587 621 } else if (theme.match(RegExp("simple", "g"))) { 588 622 correction += 0; //?? … … 682 716 683 717 t1 = jQuery(llgboframe).info(); 684 685 718 if (!TheImg.src) { 719 TheImg = jQuery(TheImg).find("img").get(0) 720 } 686 721 if (TheImg.src) { 687 722 … … 689 724 Image_height -= marges_llgbo; // réduction frame 690 725 if (rapport > 1) { 691 jQuery("#gbo").outerWidth(Image_width); 692 jQuery("#gbo").css("width", Image_width + "px"); 693 726 if (Image_width > winwidth) { 727 jQuery("#gbo").outerWidth(winwidth); 728 jQuery("#gbo").css("width", winwidth + "px"); 729 } 730 else { 731 jQuery("#gbo").outerWidth(Image_width); 732 jQuery("#gbo").css("width", Image_width + "px"); 733 } 694 734 695 735 t1 = jQuery("#gbo div:last").info(); 696 736 697 Image_width = jQuery("#gbo div:last").innerWidth();737 Image_width = t1.width - (t1.borderwidth.left + t1.borderwidth.right); 698 738 Image_height = parseInt(Image_width / rapport); 699 739 700 740 jQuery("#gbo").outerHeight(Image_height + marges_llgbo); 701 741 jQuery("#gbo").css("height", (Image_height + marges_llgbo) + "px"); 702 if ( 703 jQuery("#gbo").css("paddingBottom", 1 8+ "px");742 if (jQuery.browser.msie) { 743 jQuery("#gbo").css("paddingBottom", 17 + "px"); 704 744 } 705 745 … … 707 747 Image_height -= 4; 708 748 Image_width -= 4; 749 if (Image_width > winwidth) { 750 jQuery("#gbo").outerWidth(winwidth); 751 jQuery("#gbo").css("width", winwidth + "px"); 752 } 753 else { 754 jQuery("#gbo").outerWidth(Image_width); 755 jQuery("#gbo").css("width", Image_width + "px"); 756 } 757 709 758 jQuery("#gbo").css("height", (Image_height + marges_llgbo) + "px"); 759 jQuery("#gbo").height(Image_height + marges_llgbo); 760 710 761 jQuery("#gbo").css("width", Image_width + marges_llgbo + "px"); 711 712 Image_width = jQuery("#gbo div:last").innerWidth(); 713 Image_height = parseInt(Image_width / rapport); 762 jQuery("#gbo").width(Image_width + marges_llgbo); 763 764 765 766 if (jQuery.browser.msie) { 767 jQuery("#gbo").css("paddingBottom", 17 + "px"); 768 } 714 769 715 770 } 716 771 // jQuery("#" + Parent + " p:not(:contains(' ')) ").remove(); 772 a0 = jQuery("area[rel!=up][rel!=prev][rel!=next]"); 717 773 a1 = jQuery("area[rel=prev]"); 718 774 a2 = jQuery("area[rel=next]"); 719 775 a3 = jQuery("area[rel=up]"); 776 nb_zone = 3; 720 777 if (a1.length == 0) { 721 jQuery("area[rel=prev]").attr({ coords: "'" + 0 + ",0," + 0 + "," + 0 + "'" }); 722 jQuery("area[rel=up]").attr({ coords: "'" + 0 + ",0," + Image_width / 2 + "," + Image_height + "'" }); 723 jQuery("area[rel=next]").attr({ coords: "'" + Image_width / 2 + ",0," + (Image_width) + "," + Image_height + "'" }); 724 725 } else if (a2.length == 0) { 726 jQuery("area[rel=prev]").attr({ coords: "'" + 0 + ",0," + (Image_width) / 2 + "," + Image_height + "'" }); 727 jQuery("area[rel=up]").attr({ coords: "'" + Image_width / 2 + ",0," + (Image_width * 2) / 2 + "," + Image_height + "'" }); 728 jQuery("area[rel=next]").attr({ coords: "'" + 0 + ",0," + 0 + "," + 0 + "'" }); 729 778 nb_zone -= 1; 779 } 780 if (a2.length == 0) { 781 nb_zone -= 1; 782 } 783 784 785 var Largeur_zone = (Image_width / nb_zone); 786 var Hauteur_zone = (Image_height); 787 var init_zone = 0; 788 789 if (a1.length > 0) { 790 coord = { x0: init_zone, y0: 0, x1: Largeur_zone, y1: Hauteur_zone }; 791 792 jQuery("area[rel=prev]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + coord.y1 + "'" }); 793 init_zone += Largeur_zone; 794 } 795 796 coord = { x0: init_zone, y0: 0, x1: init_zone + Largeur_zone, y1: Image_height }; 797 798 if (a0.length > 0) { 799 jQuery("area[rel=up]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + (coord.y1 / 2) + "'" }); 800 jQuery(a0).attr({ coords: "'" + coord.x0 + "," + (coord.y1 / 2) + "," + coord.x1 + "," + (coord.y1) + "'" }); 730 801 } else { 731 732 jQuery("area[rel=prev]").attr({ coords: "'" + 0 + ",0," + (Image_width) / 3 + "," + Image_height + "'" }); 733 jQuery("area[rel=up]").attr({ coords: "'" + Image_width / 3 + ",0," + (Image_width * 2) / 3 + "," + Image_height + "'" }); 734 jQuery("area[rel=next]").attr({ coords: "'" + (Image_width * 2) / 3 + ",0," + (Image_width) + "," + Image_height + "'" }); 802 jQuery("area[rel=up]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + (coord.y1) + "'" }); 735 803 } 736 804 init_zone += Largeur_zone; 805 806 if (a2.length > 0) { 807 coord = { x0: init_zone, y0: 0, x1: init_zone + Largeur_zone, y1: Image_height }; 808 jQuery("area[rel=next]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + coord.y1 + "'" }); 809 } 810 811 812 813 814 815 /* 816 jQuery("area[rel=prev]").attr({ coords: "'" + 0 + ",0," + (Image_width) / nb_zone + "," + Image_height + "'" }); 817 jQuery("area[rel=up]").attr({ coords: "'" + Image_width * (nb_zone - 1) / (nb_zone + 1) + ",0," + (Image_width * (nb_zone - 1)) / (nb_zone + 1) + "," + Image_height + "'" }); 818 jQuery("area[rel=next]").attr({ coords: "'" + (Image_width * (nb_zone - 1)) / (nb_zone + 1) + ",0," + (Image_width * (nb_zone + 1)) / (nb_zone + 1) + "," + Image_height + "'" }); 819 */ 737 820 738 821 } … … 742 825 // Image_height, Image_width = valeur a atteindre. 743 826 if (theme.match(RegExp("luciano", "g"))) { 827 //---- information en dehors du cadre 744 828 Zone_Affichage.height -= Bandeau_bas.height; 745 829 jQuery(Cadre).height(Zone_Affichage.height); … … 749 833 //========================================================= 750 834 751 jQuery(Cadre).css("top", "0px");835 // jQuery(Cadre).css("top", "0px"); 752 836 jQuery("#standard").css("top", 0 + "px"); 753 837 jQuery("#comments").css("top", 0 + "px"); … … 794 878 } else if (Type_Img == "panorama") { 795 879 796 // jQuery(TheImg).panorama2(img_finale.height, img_finale.width);797 jQuery(TheImg).height(img_finale.height);798 jQuery(TheImg).width(img_finale.width);880 // ----- jQuery(TheImg).panorama2(img_finale.height, img_finale.width); 881 // jQuery(TheImg).height(img_finale.height); 882 // jQuery(TheImg).width(img_finale.width); 799 883 jQuery("#Panorama div").height(Image_height); 800 884 // class=simple_panorama … … 854 938 jQuery(TheImg).css("height", img_finale.height + "px"); 855 939 jQuery(TheImg).css("width", img_finale.width + "px"); 940 856 941 } 857 942 … … 889 974 if (jQuery("#navThumbPrev").length > 0) { 890 975 jQuery("#navThumbPrev").css({ height: info_img.height + "px", 891 top: info_img.top 976 top: info_img.top 892 977 }); 893 978 } 894 979 if (jQuery("#navThumbNext").length > 0) { 895 980 jQuery("#navThumbNext").css({ height: info_img.height + "px", 896 top: info_img.top 981 top: info_img.top 897 982 }); 898 983 } … … 902 987 } else { 903 988 904 jQuery("#imageToolBar").css("position", "static");989 // jQuery("#imageToolBar").css("position", "static"); 905 990 } 906 991 } catch (e) { … … 946 1031 947 1032 } // function 948 ); // ready1033 ); // ready 949 1034 /* 950 1035 *
Note: See TracChangeset
for help on using the changeset viewer.