Changeset 7602


Ignore:
Timestamp:
Nov 3, 2010, 4:41:12 PM (13 years ago)
Author:
cljosse
Message:

[Autosize][beta] adjust width and height with pamooramic and theme simple.

Location:
extensions/Autosize
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/Autosize/autosize.inc.php

    r7574 r7602  
    4646                                $autosize_parametres = cl_autosize_Get_Options();
    4747                                include (AUTOSIZE_PATH."include/affiche.php"); 
    48                                 $debug = isset($conf['debug']) ? $conf['debug'] : false ;
     48                                $debug = isset($conf['debug']) ? $conf['debug'] : 'false' ;
    4949                                $cl_visible=isset($conf['cl_auto']) ? $conf['cl_auto'] : 'true' ;
    5050                               
  • extensions/Autosize/js/Affiche_script.js

    r7575 r7602  
    1919    jQuery(window).resize();
    2020}
     21//=========================================================
     22
     23function wait_Timer() {
     24    old_w = 0
     25    if (DEBUG == "true") {
     26        info_pamoorama_outter = jQuery("#pamoorama_outter").info();
     27        jQuery("#Debug1").css({
     28            filter: 'alpha(opacity:50)',
     29            position: "absolute",
     30            border: "solid 1px green",
     31            top: 100 + "px",
     32            width: (200) + "px",
     33            height: 200 + "px"
     34        });
     35        jQuery("#Debug1").text("Debug1:info : " + info_pamoorama_outter.width +
     36    " : " + info_pamoorama_outter.height
     37    );
     38    }
     39    jQuery(window).resize();
     40 
     41
     42}
     43
     44/*
     45*
     46*/
     47jQuery("#pamoorama").bind('resize', function () {
     48    wait_Timer();
     49})
     50
     51jQuery("#pamoorama_iner").bind('resize', function () {
     52    wait_Timer();
     53})
     54//============================================================//==
     55jQuery("#pamoorama_outter").bind('resize', function () {
     56    wait_Timer();
     57})
     58
    2159
    2260jQuery(document).ready(
     
    4583
    4684
    47           //=========================================================
    48 
    49           function wait_Timer() {
    50               old_w = 0
    51               jQuery(window).resize();
    52               info_pamoorama_outter = jQuery("#pamoorama_outter").info();
    53               if (info_pamoorama_outter.width == 0)
    54                   setTimeout("wait_Timer()", 100);
    55 
    56           }
     85
    5786
    5887
     
    258287                  Bandeau_bas = info_description;
    259288
    260                   jQuery("#Debug").css({
     289                  jQuery("#Debug").css({ opacity: "0.50",
    261290                      filter: 'alpha(opacity:50)',
    262291                      position: "absolute",
     
    267296                  jQuery("#Debug").text("Debug:Bandeau : " + Bandeau);
    268297
    269                   jQuery("#Debug1").css({
     298                  jQuery("#Debug1").css({ opacity: "0.50",
    270299                      filter: 'alpha(opacity:50)',
    271300                      position: "absolute",
     
    277306                  jQuery("#Debug1").text("Debug1:Bandeau_bas top : " + Bandeau_bas.top + " height:" + Bandeau_bas.height);
    278307
    279                   jQuery("#Debug2").css({
     308                  jQuery("#Debug2").css({ opacity: "0.50",
    280309                      filter: 'alpha(opacity:50)',
    281310                      position: "absolute",
     
    296325          }
    297326
    298           /*
    299           *
    300           */
    301           jQuery("#pamoorama_iner").bind('resize', function () {
    302               wait_Timer();
    303           })
    304           //============================================================//==
    305           jQuery("#pamoorama_outter").bind('resize', function () {
    306               wait_Timer();
    307           })
    308327
    309328
     
    343362          * window .resize
    344363          */
     364          jQuery(window).resize();
     365          setTimeout('jQuery(window).resize()', 200);
     366
    345367          jQuery(window).resize(function (event, ui) {
    346368              if (typeof (event) == 'undefined') return;
     
    352374
    353375              //==========================================================================
    354               var winwidth = jQuery(window).width();
    355               var winheight = jQuery(window).height();
     376              var Window_width = jQuery(window).width();
     377              var Window_height = jQuery(window).height();
     378              var winwidth = Window_width;
     379              var winheight = Window_height;
    356380              if (old_w == winwidth && old_h == winheight) return;
    357381
     
    429453              winwidth -= (marge_right + marge_left);
    430454
    431 
    432 
    433 
    434455              if (Type_Img == "pamoorama") {
    435                   var info_pamoorama = jQuery("#pamoorama").info();
    436                   var info_pamoorama_outter = jQuery("#pamoorama_outter").info();
    437                   var info_pamoorama_inner = jQuery("#pamoorama_inner").info();
    438                   var info_pamoorama_footer = jQuery("#pamoorama_footer").info();
    439                   TheImg = jQuery("#pamoorama");
     456                  var myPamoorama = this.myPamoorama;
     457
    440458                  if (typeof (myPamoorama) == "undefined") {
    441459
     460
    442461                      return
    443 
    444                   }
    445                  
    446 
    447          
    448                   po = myPamoorama;
     462                  }
     463
     464
     465                  if (typeof (myPamoorama.imageHeight) == "undefined") {
     466                      old_w = 0;
     467                      old_h = 0;
     468
     469
     470                      return;
     471                  }
    449472
    450473                  /*
     
    574597                      //=========================================================
    575598
    576 
    577                       if (typeof (myPamoorama.imageHeight) == "undefined") {
    578                            old_w = 0;
    579                           return;
    580                       }
     599                      var info_pamoorama = jQuery("#pamoorama").info();
     600                      var info_pamoorama_outter = jQuery("#pamoorama_outter").info();
     601                      var info_pamoorama_inner = jQuery("#pamoorama_inner").info();
     602                      var info_pamoorama_footer = jQuery("#pamoorama_footer").info();
     603                      TheImg = jQuery("#pamoorama");
    581604
    582605                      img_reelle.height = myPamoorama.imageHeight;
     
    705728              var widthmin = winwidth;
    706729
    707               if (check_auto_w == 'checked="checked"') {
     730              if (check_auto_w == 'checked="checked"' || Type_Img == "pamoorama") {
    708731                  // if (Type_Img != "pamoorama" && Type_Img != "panorama" ) {
    709732                  //==== largeur à atteindre ===
     
    726749                      if (echelle_w > echelle_max) { echelle_w = echelle_max; }
    727750                      Image_width = parseInt(img_reelle.width * echelle_w);
    728                       if (rapport > 0)
    729                           Image_height = parseInt(Image_width / rapport);
     751                      if (Type_Img != "pamoorama") {
     752                          if (rapport > 0)
     753                              Image_height = parseInt(Image_width / rapport);
     754                      }
    730755                  }
    731756
     
    871896                  Gmap_ = gmaps.maps[0];
    872897                  if (Gmap_.sizeMode == 'A') {
    873                       jQuery("#iGMapsIcon").css({ width: old_w * 0.8 + "px", height: old_h * 0.8 + "px" });
    874 
     898                      jQuery("#iGMapsIcon").css({ width: Window_width * gmaps.popupAutomaticSize + "px", height: Window_height * gmaps.popupAutomaticSize + "px" });
    875899                  }
    876900              }
     
    912936                  img_height = myPamoorama.imageHeight
    913937
    914                   marge_left += 0;
    915                   new_width = Zone_Affichage.width - marge_right - marge_left;
     938
     939                  new_width = Zone_Affichage.width;
    916940                  new_width -= 4;
    917941                  jQuery("#pamoorama").css({ marginLeft: "auto",
     
    943967                  jQuery("#linkPrev").css({ width: "200px", overflow: "hidden" });
    944968                  zoom = Image_height / img_height;
    945                  
     969
    946970
    947971
     
    10091033                      jQuery("#imageToolBar").css("position", "static");
    10101034                      info_imageInfoBar = jQuery("#imageInfoBar").info();
    1011                       if (info_imageInfoBar.bottom < info_img.bottom) {
    1012                           jQuery("#imageInfoBar").height(info_img.bottom);
     1035                      info_theImage = jQuery("#theImage").info();
     1036                      Maxi_b = info_theImage.bottom - info_imageInfoBar.top
     1037                      if (info_imageInfoBar.bottom < info_theImage.bottom) {
     1038                          jQuery("#imageInfoBar").height(info_theImage.height);
     1039                          jQuery("#imageInfoBar").css("height", info_theImage.height + "px");
    10131040                      }
    10141041
     
    10261053              if (pos.top > 100) jQuery("#the_page").height(pos.top);
    10271054              if (old_w == jQuery(window).width() && old_h == jQuery(window).height()) return;
    1028               jQuery(window).resize();
     1055              //jQuery(window).resize();
    10291056              return;
    10301057          });
    10311058          var pos;
    10321059          //===================================================================   
    1033           jQuery(window).resize();
     1060          //jQuery(window).resize();
    10341061          /*
    10351062          * recherche la plus grande image (hauteur ou largeur)
     
    10581085
    10591086      } // function
    1060 );                                                                                                                                                                                                                                                                                                                                                                                                                                                          // ready
     1087);                                                                                                                                                                                                                                                                                                                                                                                                                                                                 // ready
    10611088    /*
    10621089*
     
    10801107            jQuery('html,body').stop().scrollTop(0);
    10811108            jQuery('html,body').stop().scrollLeft(0);
    1082             jQuery(".ui-widget-overlay").css("opacity", "0.75");
     1109            jQuery(".ui-widget-overlay").css({opacity:"0.75",filter: 'alpha(opacity:65)'});
    10831110
    10841111            l1 = (jQuery(window).width() - (jQuery(".gmapsPopup").width()))/2;
     
    10881115            jQuery(".gmapsPopup").css("top", h1 + "px");
    10891116
    1090         },
    1091         //-------------------------------------------------------
    1092         absolutize: function (element) {
    1093             element = jQuery(element).get(0);
    1094             if (element.getStyle('position') == 'absolute') return;
    1095             // Position.prepare(); // To be done manually by Scripty when it needs it.
    1096 
    1097             var offsets = element.positionedOffset();
    1098             var top = offsets[1];
    1099             var left = offsets[0];
    1100             var width = element.clientWidth;
    1101             var height = element.clientHeight;
    1102 
    1103             element._originalLeft = left - parseFloat(element.style.left || 0);
    1104             element._originalTop = top - parseFloat(element.style.top || 0);
    1105             element._originalWidth = element.style.width;
    1106             element._originalHeight = element.style.height;
    1107 
    1108             element.style.position = 'absolute';
    1109             element.style.top = top + 'px';
    1110             element.style.left = left + 'px';
    1111             element.style.width = width + 'px';
    1112             element.style.height = height + 'px';
    1113             return element;
    1114         },
    1115 
    1116         relativize: function (element) {
    1117             element = jQuery(element).get(0); ;
    1118             if (jQuery(element).css('position') == 'relative') return;
    1119             // Position.prepare(); // To be done manually by Scripty when it needs it.
    1120             element._originalLeft = parseFloat(element.style.left || 0);
    1121             element._originalTop = parseFloat(element.style.top || 0);
    1122             element._originalWidth = element.style.width;
    1123             element._originalHeight = element.style.height;
    1124 
    1125             element.style.position = 'relative';
    1126             var top = parseFloat(element.style.top || 0) - (element._originalTop || 0);
    1127             var left = parseFloat(element.style.left || 0) - (element._originalLeft || 0);
    1128 
    1129             element.style.top = top + 'px';
    1130             element.style.left = left + 'px';
    1131             //  element.style.height = element._originalHeight;
    1132             // element.style.width  = element._originalWidth;
    1133             return element;
    11341117        }
    11351118        //=========================================================
  • extensions/Autosize/main.inc.php

    r7574 r7602  
    22/*
    33Plugin Name: AutoSize
    4 Version: 1.3.2
     4Version: 1.3.3
    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
Note: See TracChangeset for help on using the changeset viewer.