Ignore:
Timestamp:
Jan 20, 2011, 11:26:53 AM (13 years ago)
Author:
cljosse
Message:

[Autosize][beta] Opportunity to test the class "autosize" to resize objects


File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/Autosize/js/Affiche_script.js

    r8735 r8792  
    11
     2
     3Parent = "#theImage";
    24
    35function Toggle_bp() {
     
    1517    jQuery('#bp_img_cla').attr('title', src_info);
    1618    jQuery('#bp_cla').attr('Stitle', src_info);
    17     jQuery('#bp_cla').attr('Stip', " ");       
    18      jQuery().newResize();
    19    
     19    jQuery('#bp_cla').attr('Stip', " ");
     20    jQuery().newResize();
     21
    2022}
    21                    
     23
    2224function Wait_pamoorama() {
    23      if (jQuery("#pamoorama").length) {
     25    if (jQuery("#pamoorama").length) {
    2426        mypanorama = window.myPamoorama;
    25         if (!mypanorama){
    26                          setTimeout("Wait_pamoorama()", 500);
    27                          return false ;
    28                         }
    29         if ( mypanorama.skipInit==false) {
    30                     setTimeout("Wait_pamoorama()", 500);
    31                     return false ;
    32                }
     27        if (!mypanorama) {
     28            setTimeout("Wait_pamoorama()", 500);
     29            return false;
     30        }
     31        if (mypanorama.skipInit == false) {
     32            setTimeout("Wait_pamoorama()", 500);
     33            return false;
     34        }
    3335        info_pamoorama = jQuery("#pamoorama").infos();
    34         new_width = info_pamoorama.width -( info_pamoorama.borderwidth.left + info_pamoorama.borderwidth.right);
    35          if (  Math.abs(new_width - myPamoorama.options.width)>10  ) {
    36                  setTimeout("Wait_pamoorama()", 500);
    37                  return false ;
    38                  }
    39 
    40              nopano = true;
    41              old_window = { width: 0, height: 0 };
    42              jQuery('#pamoorama').trigger('ON');
    43            
    44       }
    45   }
     36        new_width = info_pamoorama.width - (info_pamoorama.borderwidth.left + info_pamoorama.borderwidth.right);
     37        if (Math.abs(new_width - myPamoorama.options.width) > 10) {
     38            setTimeout("Wait_pamoorama()", 500);
     39            return false;
     40        }
     41
     42        nopano = true;
     43        old_window = { width: 0, height: 0 };
     44        jQuery('#pamoorama').trigger('ON');
     45
     46    }
     47}
    4648nu_img = 0;
    4749
    4850//==========================================================================
    4951function Wait_Affichage() {
    50    
    51             fade_in = parseInt(fade_in);
    52     if(!jQuery().newResize()) {
    53                  setTimeout("Wait_Affichage()", 500);
    54                  return
    55              }
    56  
    57              if (fade_in == 0) {               
    58                      jQuery(Parent).css({opacity:"1" });
    59          } else {
    60 
    61                 jQuery(Parent).animate(
     52
     53    fade_in = parseInt(fade_in);
     54    if (!jQuery().newResize()) {
     55        setTimeout("Wait_Affichage()", 500);
     56        return
     57    }
     58
     59    if (fade_in == 0) {
     60        jQuery(Parent).css({ opacity: "1" });
     61    } else {
     62
     63        jQuery(Parent).animate(
    6264                         { opacity: "1" }, fade_in, "swing"
    6365                       , function (i) {
     
    7173                       }
    7274              );
    73              }
    74 
    75 }
     75    }
     76
     77}
     78
     79//=====================================================================
     80
     81List_autosize = new Array();
     82function Autosize_resize(Obj) {
     83    if (typeof cl_visible != "undefined") return;
     84    var winwidth = jQuery(window).width();
     85    var winheight = jQuery(window).height();
     86    h1 = jQuery(Obj).infos();
     87        h1 = (winheight - h1.top - 5);
     88        rap = jQuery(Obj).find("img").height() / jQuery(Obj).find("img").width();
     89        Obj.height(h1);   w1=(h1 / rap);
     90        Obj.css({ height: h1 + "px",width:w1+"px", margin: "auto" });
     91        img = jQuery(Obj).find("img") ;
     92           img.height(h1);       
     93           img.width(w1);             
     94
     95
     96   
     97}
     98jQuery.extend(jQuery.expr[':'], {
     99    // Nom du sélecteur personnalisé
     100    Autosize: function (a) {
     101        n1 = a.className;
     102        // personal_block
     103        if (n1 == "autosize") {
     104            List_autosize.push(a);
     105            Autosize_resize(jQuery(a));
     106            jQuery(a).css({ opacity: 1 });
     107
     108        }
     109        //  Css = jQuery(a).getStyles(a);
     110
     111        return false;
     112
     113    }
     114});
    76115 
     116
    77117 
    78 //=========================================================
    79 
     118//==============================================================
    80119jQuery(document).ready(
    81120     function (jQuery) {
     121         jQuery(':Autosize');
     122
    82123         jQuery(window).unload(function () {
    83 
    84 
    85 
    86124         });
     125
     126         jQuery(window).resize(
     127               function (event, ui) {
     128                   if (List_autosize.length == 0) return;
     129                   for (i = 0; i < List_autosize.length; i++) {
     130                       Autosize_resize(jQuery(List_autosize[i]));
     131                   }
     132
     133               });
     134
    87135         jQuery(window).load(function () {
    88 
    89              //  jQuery("#theImage").css({ opacity: "0" });
    90 
    91              jQuery("#the_page").css({ top: "0px" });
    92 
    93              //======= cl_conflit ======
     136             if (typeof img_width == "undefined") {
     137
     138                 if (List_autosize.length == 0) return;
     139                 for (i = 0; i < List_autosize.length; i++) {
     140                     Autosize_resize(jQuery(List_autosize[i]));
     141                 }
     142
     143                 return;
     144             }
     145             //============================================================
     146             img_init = { height: img_height, width: img_width };  // taille initiale
     147             img_defaut = { height: scaled_height, width: scaled_width };
     148             img_reelle = { height: img_height, width: img_width };
     149             img_finale = { height: 0, width: 0 };
     150
    94151             img_top = "0";
    95152             rapport = -1;
     
    97154             pos = 0;
    98155             //=============================================================
    99              function cl_Timer() {
    100                  //   if (!jQuery.browser.msie) { jQuery(function () { alert(jQuery.browser.version); }); }
    101                  if (jQuery.browser.msie && parseInt(jQuery.browser.version) < 8)
    102                      alert(jQuery.browser.version);
    103                  panoramaContainer = jQuery(".panorama-container");
    104                  n = document.scripts[6]; //12--14affiche_script ;
    105                  t = n.src;
    106                  currentPosition = 0 - parseInt(jQuery(panoramaContainer).css('margin-left'));
    107                  if (currentPosition == NaN) return;
    108                  if (currentPosition > 1000)
    109                      jQuery(panoramaContainer).css('margin-left', "0px")
    110                  setTimeout("cl_Timer()", 500);
    111              }
    112 
    113 
    114 
    115156             Type_Img = "";
    116157             TheImg = null;
    117158             nopano = false;
    118159
    119              /*
    120              *
    121              */
    122 
    123              //============================================================
    124 
    125              /* jQuery */
    126              img_init = { height: img_height, width: img_width };  // taille initiale
    127              img_defaut = { height: scaled_height, width: scaled_width };
    128              img_reelle = { height: img_height, width: img_width };
    129              img_finale = { height: 0, width: 0 };
    130160             Zone_Affichage = { height: 0, width: 0 };
    131161             //============================================================       
    132 
     162             jQuery("#the_page").css({ top: "0px" });
    133163             Info_the_page = jQuery("#the_page").infos();
    134164
    135165             Parent = "#theImage";
     166
    136167             Zone_Affichage = jQuery(Parent).infos();
    137168             //   
    138169             var old_window = { width: 0, height: 0 };
    139 
    140              if (Info_description(Parent)) {
    141                  Bandeau_bas = Info_description(Parent);
    142                  Bandeau = Bandeau_bas.top;
    143              } else {
    144 
    145              }
     170             Bandeau_bas = Info_Description_f(Parent);
     171             if (typeof Bandeau_bas != "undefined") Bandeau = Bandeau_bas.top;
     172             else Bandeau = 0;
     173             if (typeof Bandeau_bas == "undefined") { }
    146174             old_window = { width: 0, height: 0 };
    147175             jQuery("#theImage").trigger('ON');
     
    154182             * window .resize
    155183             */
    156 
    157 
    158184             jQuery(window).resize(
    159185               function (event, ui) {
     
    168194
    169195         }); // window.onload
     196
    170197         /* Extension
    171198         * affiche_debug
     
    180207             //==========================================================
    181208             Info_description: function (e) {
    182                  return Info_description(e);
     209                 return Info_Description_f(e);
    183210
    184211             },
     
    193220             */
    194221             Get_Img_Maxi: function (myobj) {
    195 
    196222                 return Get_Img_Maxi(myobj);
    197223             },
     
    199225             affiche_debug: function (aff_infos) {
    200226                 affiche_debug(aff_infos);
    201 
    202 
    203227             },
    204228             //====================================================
     
    233257
    234258
    235                  Parent = "#theImage";
    236259                 jQuery(Parent).width(winwidth);
    237260                 jQuery(Parent).height(winheight);
     
    599622                 if (theme.match(RegExp("stripped", "gi"))) {
    600623                     img_finale.width -= (llgboframe.top * 2);
    601                      img_finale.height = img_finale.width / rapport;
     624                     img_finale.height = (img_finale.width / rapport);
    602625                 }
    603626                 zoom = echelle;
     
    607630                     if (!TheImg.src) {
    608631                         TheImg = jQuery(TheImg).find("img").get(0)
     632                         if (!TheImg.src) {
     633                             TheImg = jQuery(Parent).find("div").get(0)
     634                         }
    609635                     }
    610636                     if (TheImg.src) {
     
    752778                     jQuery(".panorama-viewport").css("left", "2px");
    753779                     jQuery(".panorama-viewport").css("width", "auto");
    754                      //   setTimeout("cl_Timer()", 500);
     780
    755781
    756782                 } else if (Type_Img == "pamoorama") {
     
    825851                 }
    826852
    827                  jQuery("#imageContainer").css({ height: "auto" });
    828 
    829853                 jQuery("#navThumbPrev").css({ overflow: "hidden" });
    830854                 jQuery("#navThumbNext").css({ overflow: "hidden" });
     
    844868                         if (jQuery("#navThumbPrev").length > 0) {
    845869                             jQuery("#navThumbPrev").css({ height: info_img.height + "px",
    846                                  top: info_img.top + 20 + "px", overflow: "hidden"
     870                                 overflow: "hidden"
    847871                             });
    848872
     
    850874                         if (jQuery("#navThumbNext").length > 0) {
    851875                             jQuery("#navThumbNext").css({ height: info_img.height + "px",
    852                                  top: info_img.top + 20 + "px", overflow: "hidden"
     876                                 overflow: "hidden"
    853877                             });
    854878
     
    941965
    942966     } // function
    943 );   
     967);
    944968
    945969
     
    947971* recherche la plus grande image (hauteur ou largeur)
    948972*/
    949 function     Get_Img_Maxi(myobj) {
    950                      var w00 = 0;
    951                      var myImg = null;
    952                      jQuery(myobj).each(function (i) {
    953                          w0 = img_reelle.width;
    954                          h0 = img_reelle.height;
    955                          if (h0 > w0) w0 = h0;
    956                          if (w0 > w00) {
    957                              if (!this.src.match(RegExp(".png", "g")))
    958                                  if (!this.src.match(RegExp(thumbnail, "g"))) {
    959                                      myImg = this;
    960                                      w00 = w0;
    961                                  }
    962 
    963                          }
    964                      });
    965                      return myImg;
    966                  }
    967 
    968                  //============================================================
    969                  /*
    970                  *
    971                  */
    972 
    973                  function Info_entete(Parent) {
    974                      if (typeof (marge_top) != "undefined") return result;
    975                      info_imageToolBar = jQuery("#imageToolBar").infos();
    976                      if (info_imageToolBar.position == "absolute") {
    977                          jQuery("#imageToolBar").css("position", "relative");
    978                          jQuery("#imageToolBar").css("top", 0 + "px");
    979                      }
    980                      optiontop = 0;
    981                      
    982                      info_imageInfoBar = jQuery("#imageInfoBar").infos();
    983 
    984 
    985                     info_theImgContainer = jQuery("#"+ "theImgContainer").infos();
    986                      info_theImage = jQuery(Parent).infos();
    987                  info_thePicturePage =   jQuery("#thePicturePage").infos();
    988                    if ( theme.match(RegExp("stripped", "gi"))) 
    989                      {
    990                          optiontop = info_imageInfoBar.bottom + llgboframe.top;
    991                     }
    992 
    993                  if (info_theImage.position == "relative") {
    994                      //--- passage relative ==> static ===/
    995                      jQuery(Parent).css("position", "static");
    996                      info_theImage = jQuery(Parent).infos();
    997 
    998                  } else {
    999 
    1000                  }
    1001                      if (info_theImage.position == "absolute") {
    1002                          //--- passage absolute ==> static ===/
    1003                          jQuery(Parent).css("position", "static");
    1004                          info_theImage = jQuery(Parent).infos();
    1005 
    1006                      }
    1007 
    1008                      marge_top = Math.ceil(Info_the_page.top +
     973function Get_Img_Maxi(myobj) {
     974    var w00 = 0;
     975    var myImg = null;
     976    jQuery(myobj).each(function (i) {
     977        w0 = img_reelle.width;
     978        h0 = img_reelle.height;
     979        if (h0 > w0) w0 = h0;
     980        if (w0 > w00) {
     981            if (!this.src.match(RegExp(".png", "g")))
     982                if (!this.src.match(RegExp(thumbnail, "g"))) {
     983                    myImg = this;
     984                    w00 = w0;
     985                }
     986
     987        }
     988    });
     989    return myImg;
     990}
     991
     992//============================================================
     993/*
     994*
     995*/
     996
     997function Info_entete(Parent) {
     998    if (typeof (marge_top) != "undefined") return result;
     999    info_imageToolBar = jQuery("#imageToolBar").infos();
     1000    if (info_imageToolBar.position == "absolute") {
     1001        jQuery("#imageToolBar").css("position", "relative");
     1002        jQuery("#imageToolBar").css("top", 0 + "px");
     1003    }
     1004    optiontop = 0;
     1005
     1006    info_imageInfoBar = jQuery("#imageInfoBar").infos();
     1007
     1008    jQuery("#" + "theImgContainer").css("marginTop", "0px");
     1009    info_theImage = jQuery(Parent).infos();
     1010    info_thePicturePage = jQuery("#thePicturePage").infos();
     1011    if (theme.match(RegExp("stripped", "gi"))) {
     1012        optiontop = info_imageInfoBar.bottom + llgboframe.top;
     1013    }
     1014
     1015    if (info_theImage.position == "relative") {
     1016        //--- passage relative ==> static ===/
     1017        jQuery(Parent).css("position", "static");
     1018        info_theImage = jQuery(Parent).infos();
     1019
     1020    } else {
     1021
     1022    }
     1023    if (info_theImage.position == "absolute") {
     1024        //--- passage absolute ==> static ===/
     1025        jQuery(Parent).css("position", "static");
     1026        info_theImage = jQuery(Parent).infos();
     1027
     1028    }
     1029
     1030    marge_top = Math.ceil(Info_the_page.top +
    10091031                                     Info_the_page.borderwidth.top +
    1010                                      info_theImage.borderwidth.top + 
     1032                                     info_theImage.borderwidth.top +
    10111033                                     info_thePicturePage.margin.top
    10121034                                     );
    10131035
    1014                         img_top = Math.ceil(info_theImage.top +
     1036    img_top = Math.ceil(info_theImage.top +
    10151037                        info_theImage.borderwidth.top +
    10161038                        info_thePicturePage.margin.top + optiontop);
    1017                         result = info_imageToolBar;
    1018                         result.width = "20%";
    1019                         result.left = "40%";
    1020                         result.marge_top = marge_top;
    1021                         result.img_top = img_top;
    1022                         //=== Afficher le titre de l'image sur le cadre ===
    1023                         llgboh2 = jQuery("#gboh2").infos();
    1024                       result.img_top += llgboh2.height   ;
    1025                      return result;
    1026 
    1027                  }
    1028 
    1029                  /* Récupère les informations sur la description.
    1030                  *
    1031                  */
     1039    result = info_imageToolBar;
     1040    result.width = "20%";
     1041    result.left = "40%";
     1042    result.marge_top = marge_top;
     1043    result.img_top = img_top;
     1044    //=== Afficher le titre de l'image sur le cadre ===
     1045    llgboh2 = jQuery("#gboh2").infos();
     1046    result.img_top += llgboh2.height;
     1047    return result;
     1048
     1049}
     1050
     1051/* Récupère les informations sur la description.
     1052*
     1053*/
    10321054
    10331055//====================================================
    1034 function Info_description(Parent) {
    1035 
    1036                      //  jQuery(Parent + " p:not(:contains(' ')) ").remove();
    1037                      //=============================================================================
    1038                      info_description = { top: 0, bottom: 0, height: 0 };
    1039 
    1040                      jQuery(Parent).css({ display: "block" });
    1041                      //====== détection du type d'images ======
    1042                      if (jQuery("#charlie").length > 0) {
    1043                          Type_Img = "charlie";
    1044                      } else if (jQuery("#pamoorama").length) {
    1045                          Type_Img = "pamoorama";
    1046                      } else if (jQuery(Parent +" embed").length > 0) {
    1047                          Type_Img = "embed";
    1048                      } else if (jQuery("#map").length) {
    1049                          Type_Img = "map";
    1050 
    1051                      } else if (jQuery("#Panorama").length) {
    1052                          Type_Img = "panorama";
    1053                      } else if (jQuery(Parent).find("img").length > 0) {
    1054                          Type_Img = "img";
    1055                        } else if (jQuery(Parent+"Box").find("img").length > 0) {
    1056                          Type_Img = "img";
    1057                          Parent = Parent + "Box";
    1058                      } else if (jQuery("img").length > 0) {
    1059                          Type_Img = "img_autre";
    1060                          return;
    1061                      } else {
    1062                          return;
    1063                      }
    1064 
    1065 
    1066 
    1067                      llgboframe = jQuery("#gbo").infos();
    1068                      marges_llgbo = 0;
    1069                      //=========================================================
    1070 
    1071                      if (llgboframe.height > 0) {
    1072                          
    1073                          ll1 = jQuery("#gbo div:first").infos();
    1074                          ll2 = jQuery("#gbo div:last").infos(); ;
    1075                          ll1 = ll1.width;
    1076                          ll2 = ll2.width - ll2.borderwidth.left - ll2.borderwidth.right;
    1077                          marges_llgbo = (ll1 - ll2)  ;
    1078                          
    1079                      }
    1080                      
    1081 
    1082                      Bandeau_t = Info_entete(Parent)
    1083                      Bandeau = Bandeau_t.img_top;
    1084 
    1085                      if (theme.match(RegExp("simple", "gi"))) {
    1086                          jQuery(Parent).css({ padding: "0px",
    1087                              marginLeft: "0px",
    1088                              marginRight: "auto",
    1089                              marginTop: "0px",
    1090                              marginBottom: "0px"
    1091 
    1092                          });
    1093                      } else {
    1094 
    1095 
    1096 
    1097                      }
    1098 
    1099                      //   jQuery(Parent + " p").css({ padding: "0px", margin: "0px "    });
    1100                      if (theme.match(RegExp("luciano", "g"))) {
    1101                          TheImg = jQuery(Parent + " #theImg img");
    1102 
    1103                          info_img = jQuery(TheImg).infos();
    1104 
    1105 
    1106                      } else if (Type_Img == "map") {
    1107 
    1108                          info_map = jQuery("#mapPicture").infos();
    1109                          marge_left = info_map.width;
    1110 
    1111                          jQuery("#map").css({ left: marge_left + "px", padding: "0px",
    1112                              marginLeft: "0px",
    1113                              marginRight: "4px",
    1114                              marginTop: "0px",
    1115                              marginBottom: "0px", position: "relative"
    1116                          });
    1117 
    1118                          TheImg = jQuery("#map");
    1119                          info_img = jQuery(TheImg).infos();
    1120 
    1121 
    1122                      } else if (jQuery("#charlie").length > 0) {
    1123 
    1124                          jQuery("#charlie").css({ padding: "0px"
    1125 
    1126                          });
    1127                          TheImg = jQuery("#charlie")
    1128                          info_img = jQuery(TheImg).infos();
    1129 
    1130 
    1131 
    1132                      } else if (jQuery(Parent +" embed").length > 0) {
    1133  
    1134                          TheImg = jQuery(Parent +" embed");
    1135                          info_img = jQuery(TheImg).infos();
    1136                      
    1137 
    1138 
    1139                      } else if (Type_Img == "pamoorama") {
    1140 
    1141 
    1142 
    1143                          if (!nopano) {
    1144                              Wait_pamoorama();
    1145                              return
    1146                          }
    1147                          TheImg = jQuery("#pamoorama");
    1148                          info_img = jQuery(TheImg).infos();
    1149                          info_footer = jQuery("#pamoorama_footer").infos();
    1150                          info_img.height = parseInt(img_reelle.height) + parseInt(info_footer.height);
    1151 
    1152                      } else {
    1153                          TheImg = jQuery(Parent + " img");
    1154                          TheImg = Get_Img_Maxi(TheImg);
    1155                          info_img = jQuery(TheImg).infos();
    1156                      }
    1157                      //=====================================================================================
    1158 
    1159                      switch (info_img.position) {
    1160                          case "relative":
    1161                              break;
    1162                          case "static":
    1163                              break;
    1164                          case "absolute":
    1165                              break;
    1166                          case "":
    1167                              break;
    1168                          default:
    1169                              break;
    1170                      }
    1171                      info_description.marge = { bottom: info_img.padding.bottom + info_img.margin.bottom + info_img.borderwidth.bottom,
    1172                          top: info_img.padding.top + info_img.borderwidth.top + info_img.margin.top
    1173                      }
    1174                      marges_ = info_img.margin.bottom + info_img.borderwidth.bottom;
    1175 
    1176                      info_img.bottom += marges_ * 2;
    1177                      info_img.bottom += marges_llgbo / 2;
    1178                      info_img.bottom += info_description.marge.top + info_description.marge.bottom;
    1179 
    1180                      info_img.right += marges_ * 2;
    1181                      info_img.width += marges_ * 2;
    1182                      info_img.height = info_img.bottom - info_img.top;
    1183                      //======================================================================================
    1184                      info_description.top = info_img.bottom;
    1185                      info_description.bottom = info_description.top; //init
    1186 
    1187                      //===================== Recherche Description Bas ==================================
    1188 
    1189                      info_para = info_description;
    1190 
    1191 
    1192                      jQuery(Parent + " p").each(function (i) {
    1193                          para = jQuery(this).infos();
    1194                          if (para.height > 0) {
    1195                              if (para.top >= info_description.top) {
    1196                                  para.height = para.bottom - info_description.top;
    1197                                  info_para = para;
    1198                                  info_para.top = info_description.top;
    1199 
    1200                              }
    1201                          }
    1202                      });
    1203                      //===================== Recherche lmt Bas =====(bleu debug3)====================
    1204                      info_licencetag = jQuery(Parent + ".licencetag").infos();
    1205                      jQuery(".licencetag").css("position", "static");
    1206 
    1207                      jQuery(".licencetag table").each(function (i) {
    1208                          info_licencetag = jQuery(this).infos();
    1209                          info_licencetag.bottom += info_licencetag.margin.top + info_licencetag.margin.bottom;
    1210 
    1211                          if (jQuery.browser.msie == true)
    1212                              jQuery(this).css("padding", "0px");
    1213                          jQuery(this).css("border", "solid 5px transparent");
    1214 
    1215                      });
    1216 
    1217                      if (info_licencetag.top == 0 && info_licencetag.height > 10) {
    1218                          info_licencetag.top = info_para.bottom;
    1219                          info_licencetag.bottom = info_para.bottom + info_licencetag.height;
    1220                          info_licencetag.bottom += info_licencetag.margin.top + info_licencetag.margin.bottom;
    1221 
    1222                      }
    1223 
    1224                      //========================================================
    1225                      info_table = jQuery(Parent + " Table").infos();
    1226                      if (info_table.height > 0) {
    1227                          info_table.bottom += info_table.margin.top + info_table.margin.bottom;
    1228                          info_licencetag.bottom = Math.max(info_table.bottom, info_licencetag.bottom)
    1229                          info_licencetag.top = info_table.top;
    1230                          info_licencetag.bottom = info_table.bottom;
    1231                          info_licencetag.height = info_table.height;
    1232                      }
    1233                      info_description.top = info_img.bottom;
    1234 
    1235                      info_description.height = Math.max(info_para.bottom, info_licencetag.bottom) - info_description.top;
    1236 
    1237 
    1238                      info_description.bottom = info_description.bottom + info_description.height;
    1239                      //=============================================================================
    1240                      if (theme.match(RegExp("gally", "gi"))) {
    1241                          if (!theme.match(RegExp("lapis", "gi"))) {
    1242                              info_description.bottom = info_description.bottom
    1243                          }
    1244                      }
    1245 
    1246 
    1247 
    1248                      info_description.height = info_description.bottom - info_description.top;
    1249 
    1250 
    1251 
    1252                      if (theme.match(RegExp("gally", "g"))) {
    1253                          if (!theme.match(RegExp("lapis", "gi"))) {
    1254                              info_copyright = jQuery("#copyright").infos();
    1255                              info_description.bottom += info_copyright.height;
    1256                          }
    1257                      }
    1258 
    1259                      if (theme.match(RegExp("luciano", "g"))) {
    1260                          info_description.bottom -= 0;
    1261 
    1262                        
    1263                              correction = -30;
    1264                              Info_slidshowToolBar = jQuery("#slidshowToolBar").infos();
    1265 
    1266                              if (Info_slidshowToolBar.height > 0) {
    1267                                  correction -= (Info_slidshowToolBar.height);
    1268                                  info_description.top -= 90;
    1269 
    1270                              }
    1271                              
    1272                        
    1273 
    1274                          //=========================================================
    1275                      }
    1276 
    1277 
    1278                      if (jQuery.browser.msie != true)
    1279                          info_description.bottom += 4;
    1280 
    1281                    
    1282 
    1283                      info_description.height = info_description.bottom - info_description.top;
    1284                      if (check_desc_v != 'checked="checked"') {
    1285                          info_description.height = 0;
    1286                      }
    1287                      Debug_pos();
    1288                      return info_description;
    1289                  }
    1290 
    1291                  //====================================================
    1292      function Debug_info(index,infos,nom) {
    1293      if (DEBUG != "true") return ;
    1294      if(infos.height>0){
    1295 
    1296      message = browser.browser + " -- > Info : "+ nom +" " + infos.id +"\n"+
    1297                  "Info nodeName: " + infos.nodeName +"\n"+
    1298                  "Info width: " + infos.width +"\n"+
    1299                  "Info height: " + infos.height +"\n"+
    1300                  "Info top: " + infos.top +"\n"+
    1301                  "Info left: " + infos.left +"\n"+
    1302                  "Info position: " + infos.position +"\n";
    1303                
    1304            myDebug   = { id: "Debug" + index, texte: message,
    1305                      css: {
    1306                      color:"black",
    1307                         opacity: "0.5",                     
    1308                         position: "absolute",
    1309                         height: infos.height||100 +"px",
    1310                         width: infos.width||300 +"px",
    1311                         left: infos.left||0 +"px",
    1312                         border: "solid 1px green",
    1313                         top: infos.top  + "px"
    1314 
    1315                      }
    1316                  }
    1317                  return myDebug;
    1318                  }else{
    1319                   return null ;
    1320                  }
    1321 
    1322 
    1323      }
    1324      //====================================================
    1325      function Debug_pos() {
    1326          if (DEBUG == "true") {
    1327          
    1328              jQuery("[id ^='Debug']").show();         
    1329                 /*
    1330                  Debug2  background-color:yellow
    1331                  Debug3 background-color:blue
    1332                  Debug4 background-color:green
    1333                  Debug5 background-color:red
    1334 
    1335                 */
    1336 
    1337              affiche_debug({                               
    1338                     Debug1: Debug_info(1, Bandeau_t,"Bandeau_t"),
    1339                     Debug3: Debug_info(3, info_licencetag, "info_licencetag"),
    1340                     Debug4: Debug_info(4, info_description, "info_description"),
    1341                     Debug5: Debug_info(5, info_img, "info_img")
    1342              });
    1343          }
    1344      }
    1345 
    1346    function    affiche_debug(aff_infos) {
    1347          jQuery(jQuery("[id ^='Debug']")).each(function (i) {
    1348              if (aff_infos[this.id]) {
    1349                  if (aff_infos[this.id].css) {
    1350                      jQuery("#" + this.id).css(aff_infos[this.id].css);
    1351                      jQuery("#" + this.id).text(aff_infos[this.id].texte);
    1352                  }
    1353              }
    1354          });
    1355          return;
    1356 
    1357      }
    1358 
    1359 
    1360      jQuery(function () {
    1361          jQuery('#pamoorama').live('ON', function (e) {
    1362              jQuery(jQuery('.debug').get(1)).trigger('ON');
    1363              Bandeau_bas = Info_description(Parent);
    1364              Bandeau = Bandeau_bas.top;
    1365              old_window = { width: 0, height: 0 };
    1366              Wait_Affichage();
    1367          });
    1368          jQuery(Parent).live('ON', function (e) {
    1369              jQuery(jQuery('.debug').get(1)).trigger('ON');
    1370              Wait_Affichage();
    1371          });
    1372 
    1373          // Custom Event, ON to turn on a debug.
    1374          jQuery('.debug').live('ON', function (e) {
    1375 
    1376              jQuery('.debug').trigger('OFF');
    1377              jQuery(this).addClass('debugOn');
    1378          });
    1379 
    1380          // On Click = debugs On
    1381          jQuery('.debug').live('click', function (e) {
    1382 
    1383              jQuery(this).trigger('ON');
    1384          });
    1385 
    1386          // Custom Event, Turn off a debug
    1387          jQuery('.debug').live('OFF', function (e) {
    1388 
    1389              jQuery(this).removeClass('debugOn');
    1390          });
    1391 
    1392          // on Double Click, remove the debug from the DOM
    1393          jQuery('.debug').live('dblclick', function () {
    1394 
    1395              jQuery(this).fadeOut(function () { $(this).remove() });
    1396          });
    1397 
    1398          // Add another debug to the DOM
    1399          jQuery('#adddebugs').click(function () {
    1400              jQuery('<div></div>')
     1056function Info_Description_f(Parent) {
     1057
     1058
     1059    jQuery(Parent).css({ display: "block" });
     1060    //====== détection du type d'images ======
     1061    if (jQuery("#charlie").length > 0) {
     1062        Type_Img = "charlie";
     1063    } else if (jQuery("#pamoorama").length) {
     1064        Type_Img = "pamoorama";
     1065    } else if (jQuery(Parent + " embed").length > 0) {
     1066        Type_Img = "embed";
     1067    } else if (jQuery("#map").length) {
     1068        Type_Img = "map";
     1069
     1070    } else if (jQuery("#Panorama").length) {
     1071        Type_Img = "panorama";
     1072    } else if (jQuery(Parent).find("img").length > 0) {
     1073        Type_Img = "img";
     1074    } else if (jQuery(Parent + "Box").find("img").length > 0) {
     1075        Type_Img = "img";
     1076        Parent = Parent + "Box";
     1077    } else if (jQuery("img").length > 0) {
     1078        Type_Img = "img_autre";
     1079        return;
     1080    } else {
     1081        return;
     1082    }
     1083    // jQuery(Parent + " p:not(:contains(' ')) ").remove();
     1084    // jQuery(Parent + " p:(:contains('')) ").remove();
     1085    llgboframe = jQuery("#gbo").infos();
     1086    marges_llgbo = 0;
     1087    //=========================================================
     1088
     1089    if (llgboframe.height > 0) {
     1090
     1091        ll1 = jQuery("#gbo div:first").infos();
     1092        ll2 = jQuery("#gbo div:last").infos(); ;
     1093        ll1 = ll1.width;
     1094        ll2 = ll2.width - ll2.borderwidth.left - ll2.borderwidth.right;
     1095        marges_llgbo = (ll1 - ll2);
     1096
     1097    }
     1098
     1099    Bandeau_t = Info_entete(Parent)
     1100    Bandeau = Bandeau_t.img_top;
     1101
     1102    info_theImgContainer = jQuery("#" + "theImgContainer").infos();
     1103    info_description = jQuery("#" + "description").infos();
     1104    //=============================================================================         
     1105    //   jQuery(Parent + " p").css({ padding: "0px", margin: "0px "    });
     1106    if (theme.match(RegExp("simple", "gi"))) {
     1107        jQuery(Parent).css({ padding: "0px",
     1108            marginLeft: "0px",
     1109            marginRight: "auto",
     1110            marginTop: "0px",
     1111            marginBottom: "0px"
     1112
     1113        });
     1114    }
     1115
     1116
     1117    if (theme.match(RegExp("luciano", "g"))) {
     1118        jQuery("#imageContainer").css({ height: "auto" });
     1119        TheImg = jQuery(Parent + " #theImg img");
     1120        info_img = jQuery(TheImg).infos();
     1121
     1122
     1123    } else if (Type_Img == "map") {
     1124
     1125        info_map = jQuery("#mapPicture").infos();
     1126        marge_left = info_map.width;
     1127
     1128        jQuery("#map").css({ left: marge_left + "px", padding: "0px",
     1129            marginLeft: "0px",
     1130            marginRight: "4px",
     1131            marginTop: "0px",
     1132            marginBottom: "0px", position: "relative"
     1133        });
     1134
     1135        TheImg = jQuery("#map");
     1136        info_img = jQuery(TheImg).infos();
     1137
     1138
     1139    } else if (jQuery("#charlie").length > 0) {
     1140
     1141        jQuery("#charlie").css({ padding: "0px"
     1142
     1143        });
     1144        TheImg = jQuery("#charlie")
     1145        info_img = jQuery(TheImg).infos();
     1146
     1147
     1148
     1149    } else if (jQuery(Parent + " embed").length > 0) {
     1150
     1151        TheImg = jQuery(Parent + " embed");
     1152        info_img = jQuery(TheImg).infos();
     1153
     1154
     1155
     1156    } else if (Type_Img == "pamoorama") {
     1157        if (!nopano) {
     1158            Wait_pamoorama();
     1159            return
     1160        }
     1161        TheImg = jQuery("#pamoorama");
     1162        info_img = jQuery(TheImg).infos();
     1163        info_footer = jQuery("#pamoorama_footer").infos();
     1164        info_img.height = parseInt(img_reelle.height) + parseInt(info_footer.height);
     1165
     1166    } else {
     1167        TheImg = jQuery(Parent + " img");
     1168
     1169        TheImg = Get_Img_Maxi(TheImg);
     1170        if (!TheImg) TheImg = jQuery(Parent);   // sans img ??
     1171        info_img = jQuery(TheImg).infos();
     1172    }
     1173    //=====================================================================================
     1174
     1175    switch (info_img.position) {
     1176        case "relative":
     1177            break;
     1178        case "static":
     1179            break;
     1180        case "absolute":
     1181            break;
     1182        case "":
     1183            break;
     1184        default:
     1185            break;
     1186    }
     1187
     1188    info_description.marge = {
     1189        bottom: info_img.padding.bottom + info_img.margin.bottom + info_img.borderwidth.bottom,
     1190        top: info_img.padding.top + info_img.borderwidth.top + info_img.margin.top
     1191    }
     1192
     1193
     1194    if (llgboframe.height > 0) info_img = llgboframe;
     1195
     1196    if (theme.match(RegExp("luciano", "g"))) {
     1197
     1198        info_theImgContainer = jQuery("#imageContainer").infos();
     1199        info_description.bottom = jQuery("#imageInfo").infos().top;
     1200        info_description.top = info_theImgContainer.bottom;
     1201        Info_slidshowToolBar = jQuery("#slidshowToolBar").infos();
     1202
     1203        if (Info_slidshowToolBar.height > 0) {
     1204            correction = (Info_slidshowToolBar.height);
     1205            info_description.top = info_img.bottom;
     1206            info_description.bottom = jQuery("#copyright").infos().top;
     1207        }
     1208
     1209        //=========================================================
     1210    } else if (theme.match(RegExp("stripped", "gi"))) {
     1211
     1212        info_theImageAndTitle = jQuery("#theImageAndTitle").infos();
     1213        info_description.top = info_img.bottom;
     1214        info_description.bottom = info_theImageAndTitle.bottom +
     1215                    info_theImageAndTitle.margin.bottom +
     1216                    info_theImageAndTitle.margin.top +
     1217                    info_description.borderwidth.top +
     1218                    info_description.borderwidth.bottom;
     1219
     1220    } else {
     1221        info_description.bottom = info_theImage.bottom;
     1222        info_description.top = info_img.height + info_theImage.top;
     1223        info_description.bottom -= info_img.top;
     1224    }
     1225    if (msie == true) info_description.bottom -= 4;
     1226
     1227    info_description.height = info_description.bottom - info_description.top;
     1228
     1229    if (check_desc_v != 'checked="checked"') {
     1230        info_description.height = 0;
     1231    }
     1232
     1233    Debug_pos();
     1234
     1235
     1236    return info_description;
     1237}
     1238
     1239//====================================================
     1240function Debug_info(index, infos, nom) {
     1241    if (DEBUG != "true") return;
     1242    if (infos.height > 0) {
     1243
     1244        message = browser.browser + " -- > Info : " + nom + " " + infos.id + "\n" +
     1245                 "Info nodeName: " + infos.nodeName + "\n" +
     1246                 "Info width: " + infos.width + "\n" +
     1247                 "Info height: " + infos.height + "\n" +
     1248                 "Info top: " + infos.top + "\n" +
     1249                 "Info left: " + infos.left + "\n" +
     1250                 "Info position: " + infos.position + "\n";
     1251
     1252        myDebug = { id: "Debug" + index, texte: message,
     1253            css: {
     1254                color: "black",
     1255                opacity: "0.5",
     1256                position: "absolute",
     1257                height: infos.height || 100 + "px",
     1258                width: infos.width || 300 + "px",
     1259                left: infos.left || 0 + "px",
     1260                border: "solid 1px green",
     1261                top: infos.top + "px"
     1262
     1263            }
     1264        }
     1265        return myDebug;
     1266    } else {
     1267        return null;
     1268    }
     1269
     1270
     1271}
     1272//====================================================
     1273function Debug_pos() {
     1274    if (DEBUG == "true") {
     1275
     1276        jQuery("[id ^='Debug']").show();
     1277        /*
     1278        Debug2  background-color:yellow
     1279        Debug3 background-color:blue
     1280        Debug4 background-color:green
     1281        Debug5 background-color:red
     1282
     1283        */
     1284
     1285        affiche_debug({
     1286            Debug1: Debug_info(1, Bandeau_t, "Bandeau_t"),
     1287            Debug4: Debug_info(4, info_description, "info_description"),
     1288            Debug5: Debug_info(5, info_img, "info_img")
     1289        });
     1290    }
     1291}
     1292
     1293function affiche_debug(aff_infos) {
     1294    jQuery(jQuery("[id ^='Debug']")).each(function (i) {
     1295        if (aff_infos[this.id]) {
     1296            if (aff_infos[this.id].css) {
     1297                jQuery("#" + this.id).css(aff_infos[this.id].css);
     1298                jQuery("#" + this.id).text(aff_infos[this.id].texte);
     1299            }
     1300        }
     1301    });
     1302    return;
     1303
     1304}
     1305
     1306
     1307jQuery(function () {
     1308    jQuery('#pamoorama').live('ON', function (e) {
     1309        jQuery(jQuery('.debug').get(1)).trigger('ON');
     1310        Bandeau_bas = Info_Description_f(Parent);
     1311        Bandeau = Bandeau_bas.top;
     1312        old_window = { width: 0, height: 0 };
     1313        Wait_Affichage();
     1314    });
     1315
     1316    jQuery(Parent).live('ON', function (e) {
     1317        jQuery(jQuery('.debug').get(1)).trigger('ON');
     1318        Wait_Affichage();
     1319    });
     1320
     1321    // Custom Event, ON to turn on a debug.
     1322    jQuery('.debug').live('ON', function (e) {
     1323
     1324        jQuery('.debug').trigger('OFF');
     1325        jQuery(this).addClass('debugOn');
     1326    });
     1327
     1328    // On Click = debugs On
     1329    jQuery('.debug').live('click', function (e) {
     1330
     1331        jQuery(this).trigger('ON');
     1332    });
     1333
     1334    // Custom Event, Turn off a debug
     1335    jQuery('.debug').live('OFF', function (e) {
     1336
     1337        jQuery(this).removeClass('debugOn');
     1338    });
     1339
     1340    // on Double Click, remove the debug from the DOM
     1341    jQuery('.debug').live('dblclick', function () {
     1342
     1343        jQuery(this).fadeOut(function () { $(this).remove() });
     1344    });
     1345
     1346    // Add another debug to the DOM
     1347    jQuery('#adddebugs').click(function () {
     1348        jQuery('<div></div>')
    14011349            .addClass('debug')
    14021350            .appendTo('#debugsContainer');
    1403          });
    1404 
    1405          // Add 10 testing debugs to start with
    1406          jQuery(window).load(function () {
    1407              if (DEBUG == "true") {
    1408                  for (var i = 0; i < 10; i++) {
    1409                      jQuery('#adddebugs').click();
    1410                  }
    1411                  jQuery(jQuery('.debug').get(8)).click();
    1412 
    1413              }
    1414          }); //on load
    1415      });
     1351    });
     1352
     1353    // Add 10 testing debugs to start with
     1354    jQuery(window).load(function () {
     1355        if (DEBUG == "true") {
     1356            for (var i = 0; i < 10; i++) {
     1357                jQuery('#adddebugs').click();
     1358            }
     1359            jQuery(jQuery('.debug').get(8)).click();
     1360
     1361        }
     1362    }); //on load
     1363});
Note: See TracChangeset for help on using the changeset viewer.