Changeset 9007


Ignore:
Timestamp:
Jan 31, 2011, 12:57:41 PM (13 years ago)
Author:
cljosse
Message:

[Autosize][beta] Return the information of the window.
.


Location:
extensions/Autosize
Files:
3 edited

Legend:

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

    r8959 r9007  
    108108            $autoscript .="<input id='src_img_h'  type='hidden' value='' />";
    109109            $autoscript .="<input id='src_img_w'   type='hidden' value='' />";
     110            $autoscript .="<input id='window_height'  type='hidden' value='' />";
     111            $autoscript .="<input id='window_width'   type='hidden' value='' />";
     112             $autoscript .='<div id="Debug6"  align=center style="display:none"></div>';
    110113                $template->append('footer_elements',$autoscript); 
    111114                return ;
  • extensions/Autosize/css/autosize.css

    r8981 r9007  
    4242}
    4343#imageContainer{
    44  height:1000px;
     44 height:1400px;
    4545}
  • extensions/Autosize/js/Affiche_script.js

    r8981 r9007  
    5555        return
    5656    }
    57     nu_img++; 
    58    
     57    nu_img++;
     58
    5959    if (fade_in == 0) {
    6060        jQuery(Parent).css({ opacity: "1" });
    61     } else {       
    62                 jQuery(Parent).animate( { opacity: "1" },
     61    } else {
     62        jQuery(Parent).animate({ opacity: "1" },
    6363                                         fade_in, "swing",
    6464                                         function (i) {
    65                                               jQuery(Parent).css({ opacity: "1" });
    66                                                 if (DEBUG == "true") {
    67                                                     bp1 = jQuery('.debug').get(nu_img);
    68                                                     if (!bp1) nu_img = 0;
    69                                                     bp1 = jQuery('.debug').get(nu_img);
    70                                                     jQuery(bp1).trigger('ON');
    71                                                   }
     65                                             jQuery(Parent).css({ opacity: "1" });
     66                                             if (DEBUG == "true") {
     67                                                 bp1 = jQuery('.debug').get(nu_img);
     68                                                 if (!bp1) nu_img = 0;
     69                                                 bp1 = jQuery('.debug').get(nu_img);
     70                                                 jQuery(bp1).trigger('ON');
     71                                             }
    7272                                         }
    7373                                       );
    74                      
    75     }
    76  //   if (nu_img > 1) return;
     74
     75    }
     76    //   if (nu_img > 1) return;
    7777
    7878
     
    8484    jQuery("#src_img_w").val(img_w);
    8585    jQuery("#ret_autosize").val(src_img);
    86    
    87     jQuery("#ret_autosize").trigger('ON', { width: img_w, height: img_h, theImage: TheImg, src_img: src_img });
     86    jQuery("#window_height").val(Window_Affichage.height);
     87    jQuery("#window_width").val(Window_Affichage.width);
     88    jQuery("#ret_autosize").trigger('ON', { width: img_w,
     89        height: img_h,
     90        theImage: TheImg,
     91        src_img: src_img,
     92        window_height: Window_Affichage.height,
     93        window_width: Window_Affichage.width
     94    });
    8895
    8996
     
    131138        marginLeft = "auto";
    132139
    133     jQuery(Obj).css({ width: "auto",marginTop:marge_top,
     140    jQuery(Obj).css({ width: "auto", marginTop: marge_top,
    134141        marginLeft: "auto", marginBottom: 0 + "px",
    135142        verticalAlign: "middle", textAlign: "center"
     
    189196                    img = jQuery(this);
    190197                    rap.push((img.width() / img.height()));
    191                     width.push( img.width()   );
    192                     height.push( img.height() );
     198                    width.push(img.width());
     199                    height.push(img.height());
    193200                });
    194201
     
    228235         jQuery(window).unload(function () {
    229236             if (TheImg) {
    230                  jQuery.cookie('old_img', TheImg.src); // créer un cookie avec une valeur
    231                  jQuery.cookie('old_img_h', jQuery(TheImg).height()); // créer un cookie avec une valeur
    232                  jQuery.cookie('old_img_w', jQuery(TheImg).width()); // créer un cookie avec une valeur
     237                 jQuery.cookie('img', TheImg.src); // créer un cookie avec une valeur
     238                 jQuery.cookie('img_h', jQuery(TheImg).height());
     239                 jQuery.cookie('img_w', jQuery(TheImg).width());
     240                 jQuery.cookie('window_height', Window_Affichage.height);
     241                 jQuery.cookie('window_width', Window_Affichage.width);
    233242             }
    234243
     
    255264                 options = { imageAutosizeMargin: 0, imageAutosize: false }
    256265             }
    257      
    258             old_img= jQuery.cookie('old_img');
    259             old_img_h= jQuery.cookie('old_img_h');
    260             old_img_w= jQuery.cookie('old_img_w');
    261 
     266
     267             old_img = jQuery.cookie('img');
     268             old_img_h = jQuery.cookie('img_h');
     269             old_img_w = jQuery.cookie('img_w');
     270             old_window_height = jQuery.cookie('window_height');
     271             old_window_width = jQuery.cookie('window_width');
    262272
    263273             //============================================================
     
    361371                 var chk = eval(user_status + "_enabled");
    362372                 if (chk == "") { return true; }
    363 
    364373                 //=================================================================
    365 
    366 
    367374                 var winwidth = jQuery(window).width();
    368375                 var winheight = jQuery(window).height();
     
    10441051                 }
    10451052                 info_frame = jQuery(Cadre).infos();
    1046 
     1053                 if (theme.match(RegExp("stripped", "gi"))) {
     1054                     pos = "absolute";
     1055                     info_theImageBox = jQuery("#theImageAndTitle").infos();
     1056                     t1 = info_theImageBox.top;
     1057                     l1 = info_theImageBox.left;
     1058                     info_theImageBox = jQuery(Parent).infos();
     1059
     1060                 } else {
     1061                     pos = "absolute";
     1062                     t1 = info_frame.top;
     1063                     l1 = info_frame.left;
     1064                     info_theImageBox = jQuery(Parent).infos();
     1065                 }
     1066
     1067                 info_theImageBox.margin.margin = info_frame.margin.margin;
     1068                 info_theImageBox.top = t1;
     1069                 info_theImageBox.left = l1;
     1070                 info_theImageBox.pos = "absolute";
     1071                 Window_Affichage = info_theImageBox;
    10471072                 if (DEBUG == "true") {
    1048                      if (theme.match(RegExp("stripped", "gi"))) {
    1049                          pos = "absolute";
    1050                          t1 = info_imageInfoBar.bottom;
    1051                          l1 = info_imageInfoBar.left;
    1052                      } else {
    1053                          pos = "absolute";
    1054                          t1 = info_frame.top;
    1055                          l1 = info_frame.left;
    1056                      }
    10571073                     //   jQuery(Cadre).css("border", "solid green");
    1058                      margins = info_frame.margin.margin;
     1074
    10591075                     jQuery("#Debug5").css({ background: "transparent",
    10601076                         position: pos,
    10611077                         border: "green solid 2px",
    10621078                         textAlign: align_auto,
    1063                          margin: margins,
    1064                          top: t1 + "px",
    1065                          left: l1 + "px",
    1066                          width: info_frame.width + "px",
    1067                          height: info_frame.height + "px"
     1079                         margin: Window_Affichage.margin.margin,
     1080                         top: Window_Affichage.top + "px",
     1081                         left: Window_Affichage.left + "px",
     1082                         width: Window_Affichage.width + "px",
     1083                         height: Window_Affichage.height + "px"
    10681084                     }); //red
    10691085                     jQuery("#Debug4").css({ top: info_frame.bottom - info_description.height + "px" }); //green
     
    11341150    info_theImage = jQuery(Parent).infos();
    11351151    info_thePicturePage = jQuery("#thePicturePage").infos();
     1152
     1153
    11361154    if (theme.match(RegExp("stripped", "gi"))) {
    1137               optiontop = 0;// Info_the_page.top+ info_imageInfoBar.bottom + llgboframe.top + info_imageToolBar.top + info_imageToolBar.height;
     1155
     1156        info_theImageAndTitle = jQuery("#theImageAndTitle").infos();
     1157        info_theImageBox = jQuery("#theImageBox").infos();
     1158
     1159        optiontop = (marges_llgbo / 2) + info_theImageAndTitle.margin.top;
     1160
    11381161    }
    11391162
     
    13331356        //=========================================================
    13341357    } else if (theme.match(RegExp("stripped", "gi"))) {
    1335    
    1336         info_theImageAndTitle = jQuery("#theImageAndTitle").infos();
    1337         info_description.top = info_img.bottom;
    1338         info_description.bottom = info_description.borderwidth.top +
    1339                     info_description.borderwidth.bottom;
    13401358       
    1341         if (options.imageAutosizeTitle) {
    1342 
    1343             check_desc_v = true;
    1344             h0 = info_theImageAndTitle.bottom - info_img.bottom;
    1345             info_description.bottom += info_theImageAndTitle.bottom+
    1346             marges_llgbo/2 ; //+
    1347               // info_theImageAndTitle.margin.top;
    1348               // info_theImageAndTitle.margin.bottom +
    1349          }        ;
    1350          
     1359        if (options.imageAutosizeTitle == false) {
     1360            info_description.top = info_theImageAndTitle.bottom +
     1361                                    info_theImageAndTitle.margin.bottom +
     1362                                    info_theImageAndTitle.margin.top;
     1363
     1364            info_description.bottom = info_theImageAndTitle.bottom +
     1365                                    info_description.borderwidth.top +
     1366                                    info_description.borderwidth.bottom +
     1367                                    (marges_llgbo / 2);   
     1368
     1369        } else {
     1370            info_description.top = info_theImageBox.bottom +
     1371                                    info_theImageAndTitle.margin.bottom +
     1372                                    info_theImageAndTitle.margin.top;
     1373            info_description.bottom = info_theImageAndTitle.bottom +             
     1374                                    info_description.borderwidth.top +
     1375                                    info_description.borderwidth.bottom  ;       
     1376           
     1377        };
     1378        check_desc_v = true;
    13511379
    13521380    } else {
    13531381        info_description.bottom = info_theImage.bottom;
    13541382        info_description.top = info_img.height + info_theImage.top;
    1355        // info_description.bottom -= info_img.top;
     1383        // info_description.bottom -= info_img.top;
    13561384    }
    13571385    //   if (msie == true) info_description.bottom -= 4;
    1358    
     1386
    13591387    info_description.height = info_description.bottom - info_description.top;
    13601388
    1361     if (check_desc_v ==false) {
     1389    if (check_desc_v == false) {
    13621390        info_description.height = 0;
    13631391    }
     
    13651393    Debug_pos();
    13661394
    1367   //  cl_visible=false ;
     1395    //  cl_visible=false ;
    13681396    return info_description;
    13691397}
     
    13711399//====================================================
    13721400function Debug_info(index, infos, nom) {
    1373     if (DEBUG != "true") return;
     1401
    13741402    if (infos.height > 0) {
    13751403
Note: See TracChangeset for help on using the changeset viewer.