Changeset 8981


Ignore:
Timestamp:
Jan 30, 2011, 11:37:52 AM (13 years ago)
Author:
cljosse
Message:

[Autosize][beta] Add cookies, adjust size of picture.


Location:
extensions/Autosize
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • extensions/Autosize/admin/template/admin.tpl

    r8912 r8981  
    3232
    3333     var check_desc_v = '{$check_desc_v}';
    34 
    35      </script>
     34     check_desc_v = (check_desc_v == 'checked="checked"');
     35 </script>
    3636 
    3737  {if PHPWG_VERSION < 2.2 }
  • extensions/Autosize/css/autosize.css

    r8957 r8981  
    2121    opacity: 0;
    2222    filter: alpha(opacity:0);
    23         padding-top: 0px;
     23    padding-top: 0px;
    2424    padding-bottom: 0px;
    2525    padding-left: 0px;
  • extensions/Autosize/js/Affiche_script.js

    r8957 r8981  
    5151function Wait_Affichage() {
    5252    fade_in = parseInt(fade_in);
    53 
    5453    if (!jQuery().newResize()) {
    5554        setTimeout("Wait_Affichage()", 500);
    5655        return
    5756    }
    58     nu_img++;
     57    nu_img++;
     58   
    5959    if (fade_in == 0) {
    6060        jQuery(Parent).css({ opacity: "1" });
    61     } else {
    62 
    63         jQuery(Parent).animate(
    64                          { opacity: "1" }, fade_in, "swing"
    65                        , function (i) {
    66                            jQuery(Parent).css({ opacity: "1" });
    67                            if (DEBUG == "true") {
    68                                bp1 = jQuery('.debug').get(nu_img);
    69                                if (!bp1) nu_img = 0;
    70                                bp1 = jQuery('.debug').get(nu_img);
    71                                jQuery(bp1).trigger('ON');
    72                            }
    73                        }
    74               );
     61    } else {       
     62                jQuery(Parent).animate( { opacity: "1" },
     63                                         fade_in, "swing",
     64                                         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                                                  }
     72                                         }
     73                                       );
     74                     
    7575    }
    7676 //   if (nu_img > 1) return;
     
    8484    jQuery("#src_img_w").val(img_w);
    8585    jQuery("#ret_autosize").val(src_img);
    86 
     86   
    8787    jQuery("#ret_autosize").trigger('ON', { width: img_w, height: img_h, theImage: TheImg, src_img: src_img });
    8888
     
    227227
    228228         jQuery(window).unload(function () {
     229             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
     233             }
     234
    229235         });
    230236
     
    245251                 return;
    246252             }
     253             //=========================================================
     254             if (typeof (options) == "undefined") {
     255                 options = { imageAutosizeMargin: 0, imageAutosize: false }
     256             }
     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
     262
    247263             //============================================================
    248264             img_init = { height: img_height, width: img_width };  // taille initiale
     
    331347             newResize: function () {
    332348                 // 
     349                 //if (options.imageAutosize) return true ;stripped
    333350                 if (DEBUG == "true") {
    334351                     nu_img += 1;
     
    630647
    631648                 //====================================================
    632 
    633                  Marge_Basse = parseInt(marge_basse || 0); // hors bandeau
     649                 if (options.imageAutosizeMargin > 0) Marge_Basse = options.imageAutosizeMargin;
     650                 else Marge_Basse = parseInt(marge_basse || 0); // hors bandeau
    634651                 //==========================================================================
    635652                 h = 0;
     
    726743                 if (theme.match(RegExp("stripped", "gi"))) {
    727744                     img_finale.width -= (llgboframe.top * 2);
    728                      img_finale.height = (img_finale.width / rapport);
     745                     if (rapport > 0) img_finale.height = (img_finale.width / rapport);
     746                     else img_finale.height -= (llgboframe.top * 2);
    729747                 }
    730748                 zoom = echelle;
     
    10111029                 if (pos != jQuery("#copyright").infos())
    10121030                     pos = jQuery("#copyright").infos();
    1013                  if (!theme.match(RegExp("stripped", "gi"))) {
     1031                 if (theme.match(RegExp("stripped", "gi"))) {
     1032                     var TitleBox = jQuery("#imageTitleContainer");
     1033                     if (TitleBox.length != 0) TitleBox.css("width", img_finale.width + "px");
     1034                 } else {
    10141035                     if (pos.top > 100)
    1015 
    10161036                         jQuery("#the_page").height(pos.top);
     1037
    10171038                 }
    10181039
     
    11141135    info_thePicturePage = jQuery("#thePicturePage").infos();
    11151136    if (theme.match(RegExp("stripped", "gi"))) {
    1116         optiontop =Info_the_page.top+ info_imageInfoBar.bottom + llgboframe.top + info_imageToolBar.top + info_imageToolBar.height;
     1137              optiontop = 0;// Info_the_page.top+ info_imageInfoBar.bottom + llgboframe.top + info_imageToolBar.top + info_imageToolBar.height;
    11171138    }
    11181139
     
    11891210    llgboframe = jQuery("#gbo").infos();
    11901211    marges_llgbo = 0;
    1191     //=========================================================
    11921212
    11931213    if (llgboframe.height > 0) {
     
    12961316
    12971317
    1298     if (llgboframe.height > 0) info_img = llgboframe;
     1318    if (llgboframe.height > 0) info_img = llgboframe; // format de l'image+largeur du cadre
    12991319
    13001320    if (theme.match(RegExp("luciano", "g"))) {
     
    13131333        //=========================================================
    13141334    } else if (theme.match(RegExp("stripped", "gi"))) {
    1315 
     1335   
    13161336        info_theImageAndTitle = jQuery("#theImageAndTitle").infos();
    13171337        info_description.top = info_img.bottom;
    1318         info_description.bottom = info_theImageAndTitle.bottom +
    1319                     info_theImageAndTitle.margin.bottom +
    1320                     info_theImageAndTitle.margin.top +
    1321                     info_description.borderwidth.top +
     1338        info_description.bottom = info_description.borderwidth.top +
    13221339                    info_description.borderwidth.bottom;
     1340       
     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         
    13231351
    13241352    } else {
    13251353        info_description.bottom = info_theImage.bottom;
    13261354        info_description.top = info_img.height + info_theImage.top;
    1327         info_description.bottom -= info_img.top;
     1355       // info_description.bottom -= info_img.top;
    13281356    }
    13291357    //   if (msie == true) info_description.bottom -= 4;
    1330 
     1358   
    13311359    info_description.height = info_description.bottom - info_description.top;
    13321360
    1333     if (check_desc_v != 'checked="checked"') {
     1361    if (check_desc_v ==false) {
    13341362        info_description.height = 0;
    13351363    }
     
    13371365    Debug_pos();
    13381366
    1339 
     1367  //  cl_visible=false ;
    13401368    return info_description;
    13411369}
  • extensions/Autosize/main.inc.php

    r8957 r8981  
    22/*
    33Plugin Name: AutoSize
    4 Version: 1.4.42
     4Version: 1.4.44
    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

    r8957 r8981  
    4141   
    4242    var check_auto_w = '{$check_auto_w}';
    43     var check_desc_v = '{$check_desc_v}';
     43     
     44    var check_desc_v = ('{$check_desc_v}' == 'checked="checked"') ? true : false;
    4445 </script>
    4546
  • extensions/Autosize/template/header_2_1.tpl

    r8959 r8981  
    44{known_script id="conflit_script" src = $AUTOSIZE_PATH|@cat:"js/conflit.js" }
    55{known_script id="dimensions" src = $AUTOSIZE_PATH|@cat:"js/jquery.dimensions.js" }
     6
     7{known_script
     8id="cookie" src = $AUTOSIZE_PATH|@cat:"js/jquery.cookie.js" }
    69{/html_head}
Note: See TracChangeset for help on using the changeset viewer.