Ignore:
Timestamp:
Dec 2, 2011, 1:51:19 PM (12 years ago)
Author:
cljosse
Message:

[extensions] Autosize fix compatibility with iframe

File:
1 edited

Legend:

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

    r12660 r12683  
    498498
    499499         Bandeau_bas = Info_Description_f(Parent);
    500          if (typeof Bandeau_bas == "undefined") {
    501 
    502          }
    503500         if (typeof Bandeau_bas != "undefined") Bandeau = Bandeau_bas.top;
    504501         else Bandeau = 0;
     
    564561             }
    565562
     563             if (typeof Bandeau_bas == "undefined")
     564               return;
    566565
    567566           if (typeof cl_visible == "undefined") return true;
     
    940939           //=========================================================================
    941940           if (typeof (Bandeau_bas) != "undefined") {
    942              if (Bandeau_bas.height < Zone_Affichage.height) Zone_Affichage.height -= (Bandeau_bas.height + Bandeau_bas.marge.top + Bandeau_bas.marge.bottom);
     941             if (Bandeau_bas.height < Zone_Affichage.height)
     942                 Zone_Affichage.height -= (Bandeau_bas.height + Bandeau_bas.marge.top + Bandeau_bas.marge.bottom);
    943943           } else {
    944944           }
     
    11211121           //=== cadre = theImage
    11221122           jQuery(Cadre).css({ marginLeft: "auto" });
    1123            if (theme.match(RegExp("sobre", "gi")) || theme.match(RegExp("hr_", "gi")) || theme.match(RegExp("Mont", "gi"))) {
     1123           if (theme.match(RegExp("simple", "gi"))) {
     1124             jQuery(Cadre).width(Zone_Affichage.width); //centrer simple black
     1125           } else if (theme.match(RegExp("sobre", "gi")) || theme.match(RegExp("hr_", "gi")) || theme.match(RegExp("Mont", "gi"))) {
    11241126             jQuery(Cadre).css("width", "auto");
    11251127           } else {
    1126            jQuery(Cadre).width(Zone_Affichage.width); //centrer simple black
     1128             jQuery(Cadre).css("width", "auto");
    11271129
    11281130           }
     
    11621164
    11631165             jQuery("#charlie").css({
    1164                width: img_finale.width + pdf,
    1165                height: img_finale.height,
     1166               width: img_finale.width + pdf + "px",
     1167               height: img_finale.height + "px",
    11661168               marginLeft: "auto"
    11671169             });
     
    11801182             } else {
    11811183               jQuery("#player").css("width", img_finale.width + "px");
    1182                jQuery("#player").css("height", img_finale.height);
    1183                jQuery("#embedplayer").css("width", img_finale.width);
    1184                jQuery("#embedplayer").css("height", img_finale.height);
    1185                jQuery("embed").css("height", img_finale.height);
     1184               jQuery("#player").css("height", img_finale.height + "px");
     1185
     1186               jQuery("#embedplayer").css("width", img_finale.width + "px");
     1187               jQuery("#embedplayer").css("height", img_finale.height + "px");
     1188
     1189               jQuery("embed").css({ width: img_finale.width + "px",
     1190                                    height: img_finale.height + "px" });
     1191               jQuery("object").css({ width: img_finale.width + "px",
     1192                                    height: img_finale.height + "px"
     1193                                  });
     1194              jQuery("video").css({ width: img_finale.width + "px",
     1195                                    height: img_finale.height + "px"
     1196                                  });
     1197
     1198
     1199
    11861200               jQuery("video").height(img_finale.height);
    11871201               jQuery("video").width(img_finale.width);
    1188                jQuery("video").css({ height: img_finale.height + "px" });
    1189                jQuery("object").css({ height: img_finale.height + "px" });
     1202
    11901203               jQuery("object").width(img_finale.width);
    11911204               jQuery("object").height(img_finale.height);
    1192                jQuery(Cadre).height(img_finale.height + Bandeau_bas.height); //??
     1205               //jQuery(Cadre).height(img_finale.height + Bandeau_bas.height); //??             
     1206
    11931207               jQuery(The_MainImage).height(img_finale.height);
    11941208               jQuery(Cadre).css("height", "auto");
     
    15771591*
    15781592*/
    1579 
     1593type_src = "div";
    15801594//====================================================
    15811595function Info_Description_f(Parent) {
    15821596    jQuery(Parent).css({ display: "block" });
    15831597    //====== détection du type d'images ======
    1584     if (jQuery("#charlie").length > 0) {
    1585         Type_Img = "charlie";
    1586       jQuery("#charlie").css({
    1587         paddingTop: "0px",
    1588         marginTop: "0px",
    1589         paddingBottom: "10px",
    1590         marginBottom: "0px"
    1591       });
    1592 
    1593       } else if (jQuery("#Panorama").length) {
     1598   if (jQuery("#Panorama").length) {
    15941599        Type_Img = "panorama";
    15951600    } else if (jQuery("#pamoorama").length) {
    15961601        Type_Img = "pamoorama";
     1602
     1603    } else if (jQuery(Parent + " object").length > 0) {
     1604        Type_Img = "charlie";
     1605        if (jQuery(Parent + " div").length > 0)
     1606          jQuery(Parent + " div").attr("id", "charlie");
     1607        else
     1608          jQuery(Parent + " object").attr("id", "charlie");
     1609        type_src = "object";
     1610
    15971611    } else if (jQuery(Parent + " embed").length > 0) {
    1598         Type_Img = "embed";
     1612        Type_Img = "charlie";
     1613        if (jQuery(Parent + " div").length > 0)
     1614          jQuery(Parent + " div").attr("id", "charlie");
     1615        else
     1616        jQuery(Parent + "embed").attr("id", "charlie");
     1617        type_src = "embed";
     1618
     1619      } else if (jQuery(Parent + " iframe").length > 0) {
     1620        Type_Img = "charlie";
     1621        if (jQuery(Parent + " div").length > 0)
     1622          jQuery(Parent + " div").attr("id", "charlie");
     1623        else
     1624          jQuery(Parent + " iframe").attr("id", "charlie");
     1625        type_src = "iframe";
     1626
    15991627    } else if (jQuery("#map").length) {
    16001628        Type_Img = "map";
     
    16131641        return;
    16141642    }
     1643      //=========================================================
     1644      if (jQuery("#charlie").length > 0) {
     1645        jQuery("#charlie").css({
     1646          paddingTop: "0px",
     1647          marginTop: "0px",
     1648          paddingBottom: "0px",
     1649          marginBottom: "0px"
     1650        });
     1651
     1652      }
    16151653    // jQuery(Parent + " p:not(:contains(' ')) ").remove();
    16161654    // jQuery(Parent + " p:(:contains('')) ").remove();
     
    16991737          });
    17001738        } else {
    1701           jQuery("#charlie").css({
    1702             paddingTop: "0px",
    1703             marginTop: "0px",
    1704             paddingBottom: "10px",
    1705             marginBottom: "0px"
    1706           });
     1739       
    17071740        }
    17081741
     
    17281761      info_img = jQuery(The_MainImage).infos();
    17291762      Type_Img == "charlie"
     1763      if (info_img.width == 0) {
     1764        The_MainImage = jQuery("#theMainImage");
     1765        info_img = jQuery(The_MainImage).infos();
     1766
     1767      }
    17301768    }
    17311769
Note: See TracChangeset for help on using the changeset viewer.