Changeset 8536


Ignore:
Timestamp:
Jan 8, 2011, 6:17:44 PM (13 years ago)
Author:
cljosse
Message:

[Autosize][beta] compatibility with theme simple


Location:
extensions/Autosize
Files:
4 edited

Legend:

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

    r8186 r8536  
    4242               }
    4343        info_pamoorama = jQuery("#pamoorama").infos();
    44          new_width= info_pamoorama.width ;
     44        new_width = info_pamoorama.width -( info_pamoorama.borderwidth.left + info_pamoorama.borderwidth.right);
    4545         if (  Math.abs(new_width - myPamoorama.options.width)>10  ) {
    4646                 setTimeout("Wait_pamoorama()", 500);
     
    9393             if (fade_in != 0) {
    9494                 if (msie)
    95                      jQuery("#theImage").css({ opacity: "0"  });
     95                     jQuery("#theImage").css({ opacity: "0" });
    9696                 else
    9797                     jQuery("#theImage").css({ opacity: "0" });
     
    235235                 if (n == 0) {
    236236                     n = winheight - old_window.height;
    237                      if (n == 0) return true;
     237                     if (n == 0)
     238                         return true;
    238239                 }
    239240                 old_window = jQuery(window).infos();
     
    264265                     if (info_ToolBar.width > 0)
    265266                         marge = (Zone_Affichage.width - info_ToolBar.width) / 2;
    266                      else if (info_the_page.width>0)
     267                     else if (info_the_page.width > 0)
    267268                         marge = (Zone_Affichage.width - info_the_page.width) / 2;
    268269
     
    272273                     if (info_content.width > 100) {
    273274
    274                          marge_left = 0;
     275                         marge_left = (info_imageInfoBar.margin.left);
    275276                         marge_right = (info_imageInfoBar.margin.left + info_imageInfoBar.margin.right);
    276277                         winwidth = info_content.width;
     
    676677                 jQuery("#standard").css("top", 0 + "px");
    677678                 jQuery("#comments").css("top", 0 + "px");
    678 
    679 
    680 
    681 
    682679                 //========== Image Remise à l'échelle =======================
    683680
    684681                 Image_height = img_finale.height;
    685682                 Image_width = img_finale.width;
    686 
    687 
    688 
    689683                 //=========================================================================
     684                 jQuery(Cadre).css({ marginLeft: marge_left + "px"
     685                 });
    690686                 jQuery(Cadre).width(Zone_Affichage.width);
    691687                 //   jQuery(Cadre).height(Zone_Affichage.height);
     
    749745
    750746                 } else if (Type_Img == "pamoorama") {
    751 
     747                     info_theImage.height = Zone_Affichage.height;
    752748                     img_height = myPamoorama.imageHeight
    753                      marge_left += 2;
    754 
    755749                     if (theme.match(RegExp("simple", "g"))) {
    756                          marge_right = 2;
     750                         //  marge_right = 2;
    757751                     }
    758752                     new_width = Zone_Affichage.width - marge_right - marge_left;
    759                      info_theImage.height = Zone_Affichage.height;
     753                     new_width = Zone_Affichage.width - (info_theImage.borderwidth.right + info_theImage.borderwidth.left);
     754
     755
    760756
    761757                     Zone_Affichage.height += info_pamoorama_footer.height;
    762 
    763 
    764758                     zoom = info_theImage.height / img_height;
    765759                     myPamoorama.options.width = new_width * zoom;
    766 
    767 
    768760                     //  if(msie || safari) jQuery("#pamoorama_inner ").css({ zoom: zoom });
    769761                     //====================================================
     
    771763                         marginLeft: "auto",
    772764                         marginRight: "auto",
    773                   //       height: Zone_Affichage.height + "px", sinon déclenchement panorama sur la hauteur;
     765                         //height: Zone_Affichage.height + "px", sinon déclenchement panorama sur la hauteur;
    774766                         width: new_width + "px"
    775767                     });
     
    782774
    783775                     jQuery("#pamoorama_outter").width(new_width);
     776
     777
    784778                     // commenter sinon outter augmente à chaque resize
    785                    //  jQuery("#pamoorama_outter").height(info_pamoorama.height - info_pamoorama_footer.height);
     779                     //  jQuery("#pamoorama_outter").height(info_pamoorama.height - info_pamoorama_footer.height);
    786780
    787781
    788782
    789783                     jQuery("#pamoorama_outter").css({ width: new_width + "px" });
     784                     jQuery("#pamoorama_footer").css({ width: new_width + "px" });
    790785                     //     
    791786                     //====================================================
     
    851846                     } else if (theme.match(RegExp("simple", "g"))) {
    852847
    853                          jQuery("#imageToolBar").css("position", "static");
     848                         jQuery("#imageToolBar").css({ position: "static" });
     849                         
    854850                         info_imageInfoBar = jQuery("#imageInfoBar").infos();
    855851                         if (info_imageInfoBar.bottom < info_img.bottom) {
    856                              jQuery("#imageInfoBar").height(info_img.bottom);
     852                          //   jQuery("#imageInfoBar").height(info_img.bottom);
    857853                         }
    858854
     
    892888                     }
    893889                     //   jQuery(Cadre).css("border", "solid green");
    894                      margins = jQuery(Cadre).css("margin");
     890                     margins = info_frame.margin.margin;
    895891                     jQuery("#Debug5").css({ background: "transparent",
    896892                         position: pos,
    897893                         border: "green solid 2px",
    898894                         textAlign: align_auto,
    899                          margin: "4px",
     895                         margin: margins,
    900896                         top: t1 + "px",
    901897                         left: l1 + "px",
  • extensions/Autosize/js/jquery.dimensions.js

    r8093 r8536  
    106106                if (elem.nodeName) nodeName = elem.nodeName;
    107107
    108 
     108               
    109109                if (elem == window) {
    110110
    111                     myposition = jQuery(this).attr("position") || "";
     111                    myposition = "";
    112112                    width = jQuery(elem).width();
    113113                    height = jQuery(elem).height();
    114114                } else {
    115                     myposition = jQuery(this).css("position") || "";
     115                    Css = jQuery(elem).getStyles(elem);
     116                    myposition = Css.position || "";
    116117                    width = jQuery(elem).outerWidth();
    117118                    height = jQuery(elem).outerHeight();
    118119
    119120
    120                     borderwidth.left = jQuery(elem).Get_Val_int(jQuery(elem).css("borderLeftWidth"));
    121                     borderwidth.right = jQuery(elem).Get_Val_int(jQuery(elem).css("borderRightWidth"));
    122                     borderwidth.top = jQuery(elem).Get_Val_int(jQuery(elem).css("borderTopWidth"));
    123                     borderwidth.bottom = jQuery(elem).Get_Val_int(jQuery(elem).css("borderBottomWidth"));
     121                    borderwidth.left = jQuery(elem).Get_Val_int(Css.borderLeftWidth);
     122                    borderwidth.right = jQuery(elem).Get_Val_int(Css.borderRightWidth);
     123                    borderwidth.top = jQuery(elem).Get_Val_int(Css.borderTopWidth);
     124                    borderwidth.bottom = jQuery(elem).Get_Val_int(Css.borderBottomWidth);
    124125                    try {
    125                         borderwidth.width = jQuery(elem).Get_Val_int(jQuery(elem).css("borderWidth"));
     126                        borderwidth.width = Css.borderWidth;
    126127                    } catch (e) {
    127128                        borderwidth.width = '"' + borderwidth.left + ' ' + borderwidth.top + ' ' + borderwidth.right + ' ' + borderwidth.bottom + '"';
     
    129130
    130131
    131                     margin.left = jQuery(elem).Get_Val_int(jQuery(elem).css("marginLeft"));
    132                     margin.right = jQuery(elem).Get_Val_int(jQuery(elem).css("marginRight"));
    133                     margin.top = jQuery(elem).Get_Val_int(jQuery(elem).css("marginTop"));
    134                     margin.bottom = jQuery(elem).Get_Val_int(jQuery(elem).css("marginBottom"));
     132
     133                    margin.left = jQuery(elem).Get_Val_int(Css.marginLeft);
     134                    margin.right = jQuery(elem).Get_Val_int(Css.marginRight);
     135                    margin.top = jQuery(elem).Get_Val_int(Css.marginTop);
     136                    margin.bottom = jQuery(elem).Get_Val_int(Css.marginBottom);
     137
    135138                    try {
    136                         margin.margin = jQuery(elem).Get_Val_int(jQuery(elem).css("margin"));
     139                        margin.margin = Css.margin;
     140
    137141                    } catch (e) {
    138142                        margin.margin = '"' + margin.left + ' ' + margin.top + ' ' + margin.right + ' ' + margin.bottom + '"';
    139143                    }
    140144
    141                     padding.left = jQuery(elem).Get_Val_int(jQuery(elem).css("paddingLeft"));
    142                     padding.right = jQuery(elem).Get_Val_int(jQuery(elem).css("paddingRight"));
    143                     padding.top = jQuery(elem).Get_Val_int(jQuery(elem).css("paddingTop"));
    144                     padding.bottom = jQuery(elem).Get_Val_int(jQuery(elem).css("paddingBottom"));
    145                     try { padding.padding = jQuery(elem).Get_Val_int(jQuery(elem).css("padding")); } catch (e) {
     145                    padding.left = jQuery(elem).Get_Val_int(Css.paddingLeft);
     146                    padding.right = jQuery(elem).Get_Val_int(Css.paddingRight);
     147                    padding.top = jQuery(elem).Get_Val_int(Css.paddingTop);
     148                    padding.bottom = jQuery(elem).Get_Val_int(Css.paddingBottom);
     149                    try {
     150                        padding.padding = Css.padding;
     151                    } catch (e) {
    146152                        padding.padding = '"' + padding.left + ' ' + padding.top + ' ' + padding.right + ' ' + padding.bottom + '"';
    147153                    }
     
    222228            return jQuery(offsetParent);
    223229        },
     230        // getStyles(Obj) Récupérer la valeur CSS
     231        getStyles: function (elt) {
     232            var element = elt;
     233            if (window.getComputedStyle) // Mozilla Firefox & cie
     234            {
     235                var propriete = window.getComputedStyle(element, null);
     236            }
     237            else if (element.currentStyle) // Microsoft Internet Explorer
     238            {
     239
     240                var propriete = element.currentStyle;
     241            }
     242            return propriete;
     243        },
    224244        /*
    225245        * Get_val_int
     
    230250        Get_Val_int: function (myObj, Maxi_val, Mini_val) {
    231251            var val = 0;
    232 
    233252            Maxi_val = parseInt(Maxi_val || "0");
    234253
     
    246265
    247266            if (typeof (myObj) == "string") {
     267
    248268                if (myObj == "none") return Maxi_val;
    249                 if (myObj == "auto") return Maxi_val;
    250                 var reg1 = new RegExp("px", "g")
     269                var reg1 = new RegExp("auto", "g")
     270                if (myObj.match(reg1)) {
     271                    return Maxi_val;
     272                }
     273                reg1 = new RegExp("px", "g")
    251274                if (myObj.match(reg1)) {
    252275
  • extensions/Autosize/main.inc.php

    r8093 r8536  
    22/*
    33Plugin Name: AutoSize
    4 Version: 1.4.2.3
     4Version: 1.4.2.5
    55Description: Ajuste l'affichage des photos en fonction de la hauteur de la fenetre de navigation
    66Plugin URI: http://piwigo.org/ext/extension_view.php?eid=448
  • extensions/Autosize/template/autosize.tpl

    r8070 r8536  
    9292<div id="Debug4"  align=center style="color:black;z-index:2000;position:absolute; background-color:green; top:0px;left:0px;width:800px;margin:auto;"></div>
    9393<div id="Debug5"  align=center style="color:black;z-index:2000;position:absolute; background-color:red; top:100px;left:0px;width:300px;margin:auto;"></div>
    94 
     94 
    9595<p><button id="adddebugs">Add a debug</button></p>
    9696
Note: See TracChangeset for help on using the changeset viewer.