Changeset 11277


Ignore:
Timestamp:
Jun 9, 2011, 4:13:50 PM (13 years ago)
Author:
cljosse
Message:

[extensions] Autosize fix bugs whith panorama

Location:
extensions/Autosize
Files:
7 edited

Legend:

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

    r11066 r11277  
    11Parent = "#theImage";
     2 
     3
    24function Toggle_bp() {
    35    cl_visible = !cl_visible;
     
    8183
    8284
    83     img_h = jQuery(TheImg).height();
    84     img_w = jQuery(TheImg).width();
     85    img_h = jQuery(theImg).height();
     86    img_w = jQuery(theImg).width();
    8587
    8688    jQuery("#src_img_h").val(img_h);
     
    9698    jQuery("#ret_autosize").trigger('ON', { width: img_w,
    9799        height: img_h,
    98         theImage: TheImg,
     100        theImage: theImg,
    99101        src_img: src_img,
    100102        window_height: Window_Affichage.height,
     
    243245       jQuery(window).unload(function () {
    244246         try {
    245            if (TheImg) {
    246              jQuery.cookie('img', TheImg.src); // créer un cookie avec une valeur
    247              jQuery.cookie('img_h', jQuery(TheImg).height());
    248              jQuery.cookie('img_w', jQuery(TheImg).width());
     247           if (theImg) {
     248             jQuery.cookie('img', theImg.src); // créer un cookie avec une valeur
     249             jQuery.cookie('img_h', jQuery(theImg).height());
     250             jQuery.cookie('img_w', jQuery(theImg).width());
    249251             jQuery.cookie('window_height', Window_Affichage.height);
    250252             jQuery.cookie('window_width', Window_Affichage.width);
     
    272274           return;
    273275         }
     276
     277
    274278         //=========================================================
    275279         if (typeof (options) == "undefined") {
     
    295299         //=============================================================
    296300         Type_Img = "";
    297          TheImg = null;
     301         theImg = null;
    298302         nopano = false;
     303
    299304
    300305         Zone_Affichage = { height: 0, width: 0 };
     
    372377         newResize: function () {
    373378           //
     379
    374380           if (typeof options != undefined)
    375381             if (options.imageAutosize)
     
    459465           marge_left += Zone_Affichage.borderwidth.left;
    460466           winwidth -= (marge_right + marge_left);
    461            //---------------------------------------------
    462            jQuery(Parent).width(winwidth);
    463            jQuery(Parent).css({ height: "auto" });
    464 
    465            //  jQuery(Parent).height(Zone_Affichage.height);
    466            //---------------------------------------------
     467
    467468
    468469           if (Type_Img == "pamoorama") {
     
    485486             var info_pamoorama_footer = jQuery("#pamoorama_footer").infos();
    486487             var info_pamoorama_frame = jQuery("#pamoorama_frame").infos();
    487              TheImg = jQuery("#pamoorama");
    488              obj = TheImg.get(0);
     488             theImg = jQuery("#pamoorama");
     489             obj = theImg.get(0);
    489490
    490491           } else {
     
    520521
    521522             case "panorama":
    522                // return;
    523 
    524 
    525                TheImg = jQuery().Get_Img_Maxi("#Panorama img");
    526                info_theImage = jQuery(TheImg).infos();
     523               //  return;
     524
     525               //the theMainImage ??
     526               theImg = jQuery("#theMainImage");
     527               if (theImg.length > 0)
     528                 theImg = theImg[0];
     529               else
     530                 theImg = jQuery().Get_Img_Maxi("#Panorama img[alt]");
     531               info_theImage = jQuery(theImg).infos();
    527532               info_the_page = jQuery("#the_page").infos();
    528533
     
    530535             case "img":
    531536
    532                if (!TheImg) return true;
     537               if (!theImg) return true;
    533538               if (theme.match(RegExp("luciano", "g"))) {
    534                  TheImg = jQuery("#the_page #theImg");
    535                }
    536                info_theImage = jQuery(TheImg).infos();
     539                 theImg = jQuery("#the_page #theImg");
     540               }
     541               info_theImage = jQuery(theImg).infos();
    537542               info_the_page = jQuery("#the_page").infos();
    538543
     
    540545               break
    541546             case "img_autre":
    542                if (!TheImg) {
    543                  if (DEBUG_autosize == "true") alert("TheImg=null");
     547               if (!theImg) {
     548                 if (DEBUG_autosize == "true") alert("theImg=null");
    544549                 return true;
    545550
    546551               }
    547                info_theImage = jQuery(TheImg).infos();
     552               info_theImage = jQuery(theImg).infos();
    548553               info_the_page = jQuery("#the_page").infos();
    549554
     
    589594
    590595
    591                TheImg = myPamoorama.image;
     596               theImg = myPamoorama.image;
    592597               info_theImage = jQuery("#pamoorama").infos();
    593598               info_theImage.height = img_reelle.height;
     
    600605
    601606           }
    602            MinWidth = jQuery(TheImg).css("minWidth");
     607           //================= Vérification taille image ==================
     608           MinWidth = jQuery(theImg).css("minWidth");
    603609           if (MinWidth == "0px")
    604610             MinWidth = mini_width;
    605            MinHeight = jQuery(TheImg).css("minHeight");
     611           MinHeight = jQuery(theImg).css("minHeight");
    606612           if (MinHeight == "0px")
    607613             MinHeight = mini_height;
    608614
    609            MaxWidth = jQuery(TheImg).css("maxWidth");
     615           MaxWidth = jQuery(theImg).css("maxWidth");
    610616           if (MaxWidth == "0px")
    611617             MaxWidth = winwidth;
    612            MaxHeight = jQuery(TheImg).css("maxHeight");
     618           MaxHeight = jQuery(theImg).css("maxHeight");
    613619           if (MaxHeight == "0px")
    614620             MaxHeight = mwinheight;
    615621
    616622           //=============== Vérification taille minimale  autorizée ======================
    617            var miniWidth = jQuery(TheImg).Get_Val_int(MinWidth, mini_width);
    618            var miniHeight = jQuery(TheImg).Get_Val_int(MinHeight, mini_height);
     623           var miniWidth = jQuery(theImg).Get_Val_int(MinWidth, mini_width);
     624           var miniHeight = jQuery(theImg).Get_Val_int(MinHeight, mini_height);
    619625           if (winwidth < mini_width2) mini_width2 = winwidth;
    620626
    621            var miniWidth2 = jQuery(TheImg).Get_Val_int(MinWidth, mini_width2);
    622            var miniHeight2 = jQuery(TheImg).Get_Val_int(MinHeight, mini_height2);
    623 
    624 
    625            var maxWidth = jQuery(TheImg).Get_Val_int(MaxWidth, winwidth, "0");
    626            maxHeight = jQuery(TheImg).Get_Val_int(MaxHeight, winheight, "0");
     627           var miniWidth2 = jQuery(theImg).Get_Val_int(MinWidth, mini_width2);
     628           var miniHeight2 = jQuery(theImg).Get_Val_int(MinHeight, mini_height2);
     629
     630
     631           var maxWidth = jQuery(theImg).Get_Val_int(MaxWidth, winwidth, "0");
     632           maxHeight = jQuery(theImg).Get_Val_int(MaxHeight, winheight, "0");
     633
    627634
    628635
     
    631638
    632639           img_reelle.width = parseInt(img_reelle.width);
    633            jQuery(Cadre).width(mini_width);
     640           // jQuery(Cadre).width(mini_width);
     641
     642
    634643           if (img_reelle.width < mini_width) {
    635              jQuery(Cadre).width(mini_width);
     644             //jQuery(Cadre).width(mini_width);
    636645             return true;
    637646
     
    639648
    640649           img_reelle.height = parseInt(img_reelle.height);
    641            if (img_reelle.height < parseInt(mini_height)) return true;
     650           if (img_reelle.height < parseInt(mini_height))
     651             return true;
    642652           //==================================================================================
     653           //---------------------------------------------
     654           //  jQuery(Parent).width(winwidth);
     655           //  jQuery(Parent).css({ height: "auto" });
     656           //  jQuery(Parent).height(Zone_Affichage.height);
     657           //---------------------------------------------
     658
    643659           if (rapport < 0) {
    644660
     
    798814             //=============LLGBO2 ===========================
    799815             t1 = llgboframe;
    800              if (!TheImg.src) {
    801                TheImg = jQuery(TheImg).find("img").get(0)
    802                if (!TheImg.src) {
    803                  TheImg = jQuery(Parent).find("div").get(0)
     816             if (!theImg.src) {
     817               theImg = jQuery(theImg).find("img").get(0)
     818               if (!theImg.src) {
     819                 theImg = jQuery(Parent).find("div").get(0)
    804820               }
    805821             }
    806              if (TheImg.src) {
     822             if (theImg.src) {
    807823
    808824
     
    945961
    946962           } else if (Type_Img == "panorama") {
    947 
    948              // -----     jQuery(TheImg).panorama2(img_finale.height, img_finale.width);
    949              // jQuery(TheImg).height(img_finale.height);
    950              // jQuery(TheImg).width(img_finale.width);
    951              jQuery("#Panorama div").height(img_finale.height);
     963             // -----     jQuery(theImg).panorama2(img_finale.height, img_finale.width);
     964             //  jQuery(theImg).height(img_finale.height);
     965             //   jQuery(theImg).width(img_finale.width);
     966             //  n = jQuery.fn.panorama();
     967             // jQuery("#Panorama div").height(img_finale.height);
    952968             //  class=simple_panorama
    953 
    954              jQuery(".panorama-viewport").css("left", "2px");
    955              jQuery(".panorama-viewport").css("width", "auto");
     969             // jQuery("#Panorama div").height(img_finale.height);
     970             if (typeof asp_options != "undefined")
     971               n = asp_options;
     972             n1 = jQuery("#Panorama div").width();
     973             // asp_options.viewport_width = winwidth;
     974             //n =n.panorama_animate();
     975             //jQuery("#panoramaContainer").stop(); ;
     976             // n = jQuery(theImg).panorama(asp_options);
     977
     978             //jQuery("#Panorama div").width(asp_options.viewport_width);
     979
     980             jQuery(".panorama-viewport").css("margin", "auto");
     981
     982             n = info_imageToolBar;
    956983
    957984
    958985           } else if (Type_Img == "pamoorama") {
     986
     987
     988
    959989             info_theImage.height = Zone_Affichage.height;
    960990             img_height = myPamoorama.imageHeight
     
    964994             new_width = Zone_Affichage.width - marge_right - marge_left;
    965995             new_width = Zone_Affichage.width - (info_theImage.borderwidth.right + info_theImage.borderwidth.left);
     996             if (new_width > myPamoorama.imageWidth)
     997               new_width = myPamoorama.imageWidth;
    966998
    967999
     
    9871019             jQuery("#pamoorama_outter").width(new_width);
    9881020
    989 
     1021             jQuery("#pamoorama_thumb").width(200 / zoom);
    9901022             // commenter sinon outter augmente à chaque resize
    9911023             //  jQuery("#pamoorama_outter").height(info_pamoorama.height - info_pamoorama_footer.height);
    992 
     1024             // pamoorama_frame
    9931025
    9941026
     
    10081040
    10091041
    1010            } else if (TheImg.src) {
     1042           } else if (theImg.src) {
    10111043             //--- background ?? ---
    1012              jQuery(TheImg).height(img_finale.height);
    1013              jQuery(TheImg).width(img_finale.width);
    1014              jQuery(TheImg).css({ height: img_finale.height + "px ",
     1044             jQuery(theImg).height(img_finale.height);
     1045             jQuery(theImg).width(img_finale.width);
     1046             jQuery(theImg).css({ height: img_finale.height + "px ",
    10151047               width: img_finale.width + "px "
    10161048             });
     
    10191051           } else {
    10201052             //===map ? luciano ===
    1021              jQuery(TheImg).height(img_finale.height);
    1022              jQuery(TheImg).width(img_finale.width);
    1023              jQuery(TheImg).css({ height: img_finale.height + "px ",
     1053             jQuery(theImg).height(img_finale.height);
     1054             jQuery(theImg).width(img_finale.width);
     1055             jQuery(theImg).css({ height: img_finale.height + "px ",
    10241056               width: img_finale.width + "px "
    10251057             });
     
    11161148             info_theImageBox = jQuery("#theImageAndTitle").infos();
    11171149             p1 = jQuery(".randomButtons").infos();
    1118              p2=jQuery("#imageHeaderBar").infos();
     1150             p2 = jQuery("#imageHeaderBar").infos();
    11191151             jQuery("#theImage").width("width", info_theImageBox.width + "px");
    11201152             jQuery("#theImageAndTitle").css("position", "relative");
    1121              jQuery("#theImageAndTitle").css({marginTop: "0px",
     1153             jQuery("#theImageAndTitle").css({ marginTop: "0px",
    11221154               paddingTop: (p1.top) + "px"
    11231155             });
     
    11841216    var w00 = 0;
    11851217    var myImg = null;
     1218    img = jQuery(myobj);
     1219
     1220    img = jQuery('img[alt]');
     1221
    11861222    jQuery(myobj).each(function (i) {
    11871223        w0 = img_reelle.width;
     
    12081244    if (typeof (marge_top) != "undefined") return result;
    12091245    info_imageToolBar = jQuery("#imageToolBar").infos();
     1246
     1247
    12101248    if (info_imageToolBar.position == "absolute") {
    12111249        jQuery("#imageToolBar").css("position", "relative");
     
    12131251    }
    12141252    optiontop = 0;
     1253
    12151254
    12161255    info_imageInfoBar = jQuery("#imageInfoBar").infos();
     
    12551294                        info_thePicturePage.margin.top + optiontop);
    12561295    result = info_imageToolBar;
    1257     result.width = "20%";
    1258     result.left = "40%";
     1296   // result.width = "20%";
     1297   // result.left = "40%";
    12591298    result.marge_top = marge_top;
    12601299    result.img_top = img_top;
     
    13391378    if (theme.match(RegExp("luciano", "g"))) {
    13401379        jQuery("#imageContainer").css({ height: "auto" });
    1341         TheImg = jQuery(Parent + " #theImg img");
    1342         info_img = jQuery(TheImg).infos();
     1380        theImg = jQuery(Parent + " #theImg img");
     1381        info_img = jQuery(theImg).infos();
    13431382
    13441383
     
    13561395        });
    13571396
    1358         TheImg = jQuery("#map");
    1359         info_img = jQuery(TheImg).infos();
     1397        theImg = jQuery("#map");
     1398        info_img = jQuery(theImg).infos();
    13601399
    13611400
     
    13651404
    13661405        });
    1367         TheImg = jQuery("#charlie")
    1368         info_img = jQuery(TheImg).infos();
     1406        theImg = jQuery("#charlie")
     1407        info_img = jQuery(theImg).infos();
    13691408
    13701409
     
    13721411    } else if (jQuery(Parent + " embed").length > 0) {
    13731412
    1374         TheImg = jQuery(Parent + " embed");
    1375         info_img = jQuery(TheImg).infos();
     1413        theImg = jQuery(Parent + " embed");
     1414        info_img = jQuery(theImg).infos();
    13761415
    13771416
     
    13821421            return
    13831422        }
    1384         TheImg = jQuery("#pamoorama");
    1385         info_img = jQuery(TheImg).infos();
     1423        theImg = jQuery("#pamoorama");
     1424        info_img = jQuery(theImg).infos();
    13861425        info_footer = jQuery("#pamoorama_footer").infos();
    13871426        info_img.height = parseInt(img_reelle.height) + parseInt(info_footer.height);
    13881427
    13891428    } else {
    1390         TheImg = jQuery(Parent + " img");
    1391 
    1392         TheImg = Get_Img_Maxi(TheImg);
    1393         if (!TheImg) TheImg = jQuery(Parent);   // sans img ??
    1394         info_img = jQuery(TheImg).infos();
     1429        theImg = jQuery(Parent + " img[alt]");
     1430
     1431        //theImg = Get_Img_Maxi(theImg);
     1432        //theMainImage
     1433     
     1434        if (!theImg)
     1435            theImg = jQuery(Parent);   // sans img ??
     1436        if (theImg.length > 1)
     1437          {theImg = theImg[0];
     1438
     1439          }
     1440
     1441        info_img = jQuery(theImg).infos();
    13951442    }
    13961443    //=====================================================================================
  • extensions/Autosize/js/autosize.dimensions.js

    r10845 r11277  
    145145          Css = jQuery(elem).getStyles(elem);
    146146          myposition = Css.position.toString() || "";
    147          
     147
    148148
    149149          width = jQuery(elem).outerWidth();
     
    188188        }
    189189        if (elem == window) {
    190           Cl_Position = { Top: 0, Left: 0 };
     190          Cl_Position = { top: 0, left: 0 };
    191191        } else {
    192192          Cl_Position = jQuery(elem).d_position();
     
    218218    d_position: function () {
    219219      var left = 0, top = 0, elem = this[0], offset, parentOffset, offsetParent, results;
    220 
     220      l1 = jQuery(elem).css("left");
    221221      if (elem) {
    222222        offsetParent = this.offsetParent();
  • extensions/Autosize/js/conflit.js

    r10913 r11277  
    6464nbpa = 0;
    6565var Fn;
    66 if (typeof MooTools == "undefined" && typeof Prototype == "undefined") {
    67 
    68 } else {
    69   $mootools = $;
    70 }
    71 //====================================================
    7266function conflit(element, nc) {
    73      //--- cl_conflit
     67  if(typeof DEBUG != "boolean") DEBUG = false ;
     68    //--- cl_conflit
    7469    if (typeof MooTools == "undefined" && typeof Prototype == "undefined") {
    7570        ret_element = jQuery(element);
     
    210205        jQuery("#icon_gmaps").bind('click', function () {
    211206          //jQuery("#iGMapsIconContent").dialog("open");
    212           if (Version_pwg > '2.2.0')
    213             return;
     207          if (Version_pwg > '2.2.0' )
     208          return;
    214209          jQuery('html,body').stop().scrollTop(0);
    215210          jQuery('html,body').stop().scrollLeft(0);
  • extensions/Autosize/js/conflit_2.js

    r10913 r11277  
    1 
    2 //=== ajout des fonctions jQuery ===
    3 if (typeof MooTools == "undefined" && typeof Prototype == "undefined") {
    4   $mootools = window.$;
    5 } else {
    6   if (typeof jQuery != 'undefined') {
    7     if (typeof $mootools != 'undefined') {
    8       if (typeof (gmaps) != "undefined") {
     1if (typeof Type_Img ) {
     2  //=== ajout des fonctions jQuery ===
     3  if (typeof MooTools == "undefined" && typeof Prototype == "undefined") {
     4    $mootools = window.$;
     5  } else {
     6    if (typeof jQuery != 'undefined') {
     7      if (typeof $mootools != 'undefined') {
     8        if (typeof (gmaps) != "undefined") {
     9        }
     10        $ = jQuery.fn.$;
     11        jQuery.extend($, $mootools);
     12        jQuery.extend($, jQuery.fn);
     13      } else {
     14        $ = jQuery.fn.$;
     15        jQuery.extend($, jQuery.fn);
    916      }
    10       $ = jQuery.fn.$;
    11       jQuery.extend($, $mootools);
    12       jQuery.extend($, jQuery.fn);
    13     } else {
    14       $ = jQuery.fn.$;
    15       jQuery.extend($, jQuery.fn);
    1617    }
    1718  }
  • extensions/Autosize/main.inc.php

    r10913 r11277  
    22/*
    33Plugin Name: AutoSize
    4 Version: auto
     4Version: 1.6.3a
    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/header_2_2.tpl

    r11066 r11277  
    11{if not empty($pamoorama)}
    2 
    3  <script  id="pamoorama0.3" src="plugins/paMOOramics/js/pamoorama0.3.js" type="text/jscript"></script>
    4 <script id="mootools" src="plugins/paMOOramics/js/mootools.js" type="text/jscript"></script>
     2  <script  id="pamoorama0.3" src="plugins/paMOOramics/js/pamoorama0.3.js" type="text/jscript"></script>
     3  <script id="mootools" src="plugins/paMOOramics/js/mootools.js" type="text/jscript"></script>
    54{else}
    65{/if}
    7 {* au ou jquery non défini  *}
     6{* au cas ou jquery non défini  *}
    87{combine_script id="jquery" load="header" path = "themes/default/js/jquery.min.js"}
    98{combine_script id="conflit_script0" load="header" path = $AUTOSIZE_PATH|@cat:"js/conflit_2.js" require="jquery" }
  • extensions/Autosize/template/picture.tpl

    r8957 r11277  
     1 
     2
     3
    14 <style type="text/css">
    25         #bp_cla {ldelim}
     
    1215
    1316 <script language=javascript type="text/javascript">
     17 
     18
     19 {if $ASP.width}
     20 var asp_options ={ldelim} };
     21
     22    var w = $("#imageToolBar").width();
     23        if (w === null) {ldelim} w = $("#theImage").width(); }
     24        if (w < {$ASP.min_viewport_width}) {ldelim} w = .75 * $("#theImage").width(); }
     25        var m = w;
     26        w = w * ( Math.min( Math.max({$ASP.viewport_width} / 100, .5) , 1 ));
     27        w = Math.round(Math.min( {$ASP.max_viewport_width} , Math.max( {$ASP.min_viewport_width}, w) ));
     28        var s = (100 - {$ASP.speed}) * 2000;
     29        var p = Math.round(Math.min(Math.max({$ASP.width} * ( {$ASP.start_position} / 100 ), 0), {$ASP.width}));
     30        if ({$ASP.width} > w) {ldelim}
     31                $("#theImage img").eq(0).removeAttr("style").attr({ldelim}width:{$ASP.width},height:{$ASP.height}}).addClass("simple_panorama");
     32                asp_options = {ldelim}
     33                                         viewport_width: w,
     34                                         speed: s,
     35                                         direction: '{$ASP.direction}',
     36                                         control_display: '{$ASP.control_display}',
     37                                         start_position : p,
     38                                         auto_start : {$ASP.auto_start},
     39                                         mode_360 : {$ASP.mode_360},
     40                                         loop_180 : {$ASP.loop_180}
     41                         };
     42                //$("#theImage img.simple_panorama").panorama(asp_options);
     43        };
     44 
     45  {/if}
     46
    1447 var src1="{$cl_autosize_button.ICON}";
    1548 var src2="{$cl_autosize_button.ICON2}";
Note: See TracChangeset for help on using the changeset viewer.