Ignore:
Timestamp:
Aug 10, 2012, 5:37:39 PM (12 years ago)
Author:
cljosse
Message:

[extensions] Autosize fix compatibility with 2.4, update

File:
1 edited

Legend:

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

    r17503 r17538  
    1616    var theImg;
    1717    var Zone_image;
    18 
     18    /******************************************
     19    * test_theme("mont,pur") ...
     20    ******************************************/
     21    test_theme = function (param) {
     22      if (!param) return
     23      regx = new RegExp(param, "gi");
     24      return (options.theme.match(regx))
     25
     26    }
    1927    /******************************************
    2028    * Save_cookies
     
    296304      infos_imageInfos = jQuery(imageInfos_id).infos(true);             // information
    297305      infos_theMainImage = jQuery(theMainImage_id).infos(true);         // Image
     306      infos_copyright = jQuery("#copyright").infos(true);
    298307
    299308      jQuery("#loading").show(0);
    300 
     309      zheight = infos_window.height - (infos_theImage.top);
     310      h01 = 0;
     311      h02 = 0;
    301312      if (options.check_desc_v) {
    302         info_comments = jQuery("#comments").infos(true);
     313
     314        infos_comments = jQuery("#comments").infos(true);
    303315        infos_Licence = jQuery(".licencetag").infos(true);
    304316        infos_imageComment = jQuery(imageComment_id).infos(true);
    305         h01 = info_comments.top - infos_theMainImage.bottom;
     317
     318        if (infos_imageComment.visible = true && infos_imageComment.general.bottom > infos_theMainImage.bottom) {
    306319      h02 = infos_imageComment.general.bottom - infos_theMainImage.bottom;
     320        }
     321        if (infos_Licence.visible = true && infos_Licence.general.bottom > infos_theMainImage.bottom) {
     322          h01 = infos_Licence.general.bottom - infos_theMainImage.bottom;
     323        }
    307324        delta_h = infos_imageInfos.bottom - infos_imageInfos.top;
    308         if (options.theme.match(RegExp("blanc", "gi")) || options.theme.match(RegExp("pure", "gi"))
    309          || options.theme.match(RegExp("hr_", "gi")))  {
     325        info_comments1 = jQuery(theImage_id + " p").infos(true);
     326        if (test_theme("simple")) {
     327          options.marge_basse += info_comments1.general.height;
    310328   
    311           h01 = infos_Licence.general.bottom-infos_theMainImage.bottom;
    312           options.marge_basse += h01;
     329        } else {
     330          options.marge_basse += Math.max(h01, h02);
     331          if (test_theme("blanc , pure, hr_ ")) {
    313332          options.marge_gauche += 10;
    314333          options.marge_droite += 10;
    315 
    316         } else {
    317 
    318           if (options.theme != "simple")
    319             if (delta_h > 5 && (infos_imageInfos.top > infos_theMainImage.bottom)) {
    320               if (infos_imageComment.visible) {
    321                
    322334              }
    323335            }
    324 
    325 
    326           h01 = infos_Licence.general.bottom - infos_theMainImage.bottom;
    327           h02 = infos_imageComment.general.bottom - infos_theMainImage.bottom;
    328 
    329           if (Type_Img == "pamoorama") {
    330             h01 = infos_Licence.general.bottom - infos_theMainImage.bottom;
    331            
    332             ;
    333             options.marge_basse += (h01);
    334           } else
    335             options.marge_basse += Math.max(h01, h01);
    336 
    337         }
    338       }
    339 
    340       infos_theMainImage = jQuery(theMainImage_id).infos(true);
    341       infos_theImage = jQuery(theImage_id).infos(true);
    342 
     336        }
    343337      Zone_image = { image_init: {
    344338        width: infos_theMainImage.width,
     
    353347        container: {
    354348          width: infos_theImage.general.width,
    355           height: infos_window.height - (infos_theImage.top),
     349          height: zheight,
    356350          margesWidth: infos_window.width - infos_theImage.width + (options.marge_droite + options.marge_gauche)
    357351        }
    358352      }
     353
    359354
    360355
     
    391386          }
    392387        }
     388
     389        if (test_theme("simple")) {
     390          jQuery(theMainImage_id).css({ maxWidth: "none" });
     391          infos_menubar = jQuery("#menubar").infos(true);
     392          if (infos_menubar.visible == true) {
     393            jQuery(theImage_id).width(infos_window.width - infos_imageInfos.general.width - infos_menubar.general.width-20);
     394            infos_theImage = jQuery(theImage_id).infos(true);
     395
     396          }
     397        }
     398
    393399        if ((old_w - infos_theImage.width) != 0) {
    394400          Zone_image.container.width = infos_theImage.width;
     
    398404        infos_body = jQuery("body").infos();
    399405        infos_content = jQuery(content_id).infos();
    400 
    401 
    402406        // imageInfos
    403 
    404 
    405 
    406407        infos_theImageAndInfos = jQuery(theImageAndInfos_id).infos();  // Cadre general
    407408        //=============================================================
    408 
    409409        Zone_image.container = {
    410410          height: infos_window.height - (infos_theImage.top),
     
    413413        };
    414414
    415         if (options.theme.match(RegExp("simple", "gi"))) {
    416           jQuery(theMainImage_id).css({ maxWidth: "none" });
    417           infos_menubar = jQuery("#menubar").infos(true);
    418           if (infos_menubar.visible == true) {
    419             Zone_image.container.width -= infos_menubar.right;
    420           }
    421         }
    422 
    423415        jQuery(theImage_id).height(Zone_image.container.height + 2);
     416
     417
     418
    424419
    425420        if (DEBUG_autosize == "no") return;
     
    515510    fade_in = options.fade_in || 0;
    516511    imageComment_id = ".imageComment";
    517     if (options.theme.match(RegExp("simple", "gi"))) {
     512    if (test_theme("simple")) {
    518513      jQuery("#theImage p").addClass("imageComment");
    519514    }
    520     if (options.theme.match(RegExp("mont", "gi"))) {
     515    if (test_theme("mont")) {
    521516      jQuery("#content").css({ marginLeft: 'auto' }); //monblanc
    522517    }
     
    885880          jQuery(theMainImage_id).height(Zone_image.image.height);
    886881          jQuery(theMainImage_id).width(Zone_image.image.width);
     882
     883          if (test_theme("xxxxxxx")) {
     884            jQuery(theImage_id).css({ height: "auto" });
     885            jQuery(theImage_id).height(Zone_image.image.height + Zone_image.marges.height);
     886            jQuery(theImage_id).width(Zone_image.image.width + Zone_image.marges.width);
     887
     888          }
    887889        }
    888890
     
    890892        set_cl(true);
    891893      } else {
    892         jQuery(theImage_id).height(Zone_image.image.height + Zone_image.marges.height);
     894        //   jQuery(theImage_id).height(Zone_image.image.height + Zone_image.marges.height);
    893895        Set_Pamoorama({ width: Zone_image.container.width, height: Zone_image.image.height });
    894896        set_cl(false);
     
    11291131      if (typeof Zone_image == "undefined") Zone_image = { image: {} };
    11301132      if (typeof Zone_image.image == "undefined") Zone_image.image = { height: Zone_image.image_init.height, width: Zone_image.image_init.width };
    1131       theImg.width = img_init.height;
     1133      theImg.height = img_init.height;
    11321134      theImg.width = img_init.width;
    11331135
     
    15301532
    15311533      //==========================================================
    1532       if (options.theme.match(RegExp("stripped", "gi"))) {
     1534      if (test_theme("stripped")) {
    15331535        infos_the_page.margin.left = 20;  //taille fleche
    15341536        infos_the_page.margin.right = 20;
     
    15361538
    15371539
    1538       if (options.theme.match(RegExp("elegant", "gi"))) {
     1540      if (test_theme("elegant")) {
    15391541
    15401542        jQuery("#imageInfos").css({ position: "absolute", right: 0, top: 0
     
    15521554        marge_left += 1;
    15531555
    1554       } else if (options.theme.match(RegExp("stripped", "gi"))) {
    1555 
    1556       } else if (options.theme.match(RegExp("simple", "gi"))) {
    1557 
    1558 
    1559 
    1560       } else if (options.theme.match(RegExp("OS", "gi"))) {
    1561 
    1562       } else if (options.theme.match(RegExp("pur", "gi"))) {
     1556      } else if (test_theme("stripped")) {
     1557
     1558      } else if (test_theme("simple")) {
     1559
     1560
     1561
     1562      } else if (test_theme("OS")) {
     1563
     1564      } else if (test_theme("pur")) {
    15631565        marge_right += 0;
    15641566        // marge_right += 25;
    1565       } else if (options.theme.match(RegExp("mont", "gi"))) {
     1567      } else if (test_theme("mont")) {
    15661568        marge_right += 0;
    15671569
     
    19481950    //_______________________ init_gen _______________________
    19491951
    1950     if (typeof changeImgSrc != "function") {
    1951 
    1952     }
    19531952  });                                                                                                                                                                                                                                       // ready
    19541953
Note: See TracChangeset for help on using the changeset viewer.