Changeset 7375


Ignore:
Timestamp:
Oct 24, 2010, 2:57:11 PM (13 years ago)
Author:
cljosse
Message:

[Autosize][beta] fix bug.

Location:
extensions/Autosize
Files:
3 edited

Legend:

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

    r7354 r7375  
    114114 * conflit =============================================
    115115 */
    116         static public function cl_autosize_script($pictures)
    117         {       $my_path = dirname(__FILE__).'/';
    118                    global  $template,$user,$conf ;
     116        static public function cl_autosize_script()
     117        {
     118           global  $template,$user,$conf ;
     119
     120 
     121                $my_path = dirname(__FILE__).'/';
    119122                $template->set_filenames(
    120123                     array('autosize_cl_init'=> $my_path.'template/cl_conflit.tpl')
     
    128131                                                 );
    129132
    130                    $template->parse( 'autosize_cl_init', false);
    131 
    132  return $pictures;
     133                   return $template->parse( 'autosize_cl_init', false);
     134
    133135       
    134136        }// function cl_autosize_script
  • extensions/Autosize/js/Affiche_script.js

    r7369 r7375  
    2727          var old_w = 0;
    2828
     29          var llgboframe = jQuery("#gbo div:first");
     30          var marges_llgbo = 0;
     31          if (llgboframe.length > 0) {
     32
     33              marges_llgbo = jQuery(llgboframe).outerWidth() - jQuery("#gbo div:last").innerWidth();
     34          }
     35       
    2936
    3037          //=========================================================
     
    208215                  info_description.bottom = info_description.top = 1;
    209216
    210               var llgboframe = jQuery("#gbo div:first");
    211               var marges_llgbo = 0;
    212               if (llgboframe.length > 0) {
    213 
    214                   marges_llgbo = jQuery(llgboframe).outerWidth() - jQuery("#gbo div:last").innerWidth();
    215               }
    216217              if (theme.match(RegExp("gally", "g"))) {
    217                   marges_llgbo = 0;
     218                     marges_llgbo = 0;
    218219              }
    219220
     
    716717                  else
    717718                      widthmin = parseInt(width_user);
    718 
     719                 var marges = 0;
    719720                  widthmin -= Get_Val_int(info_img.borderwidth.left);
    720721                  widthmin -= Get_Val_int(info_img.borderwidth.right);
    721722                  if (jQuery("#gbo") && jQuery("#gbo div:first").length > 0) {
    722723                      llgboframe = jQuery("#gbo div:first");
    723                       marges = jQuery(llgboframe).outerWidth() - jQuery("#gbo div:last").outerWidth();
     724                      marges = jQuery(llgboframe).outerWidth() - jQuery("#gbo div:last").innerWidth();
    724725                  }
    725                   widthmin -=2*marges;
     726                  widthmin -= 2 * marges;
    726727                  if (Image_width > widthmin) {
    727728                      //   Image_width largeur à atteindre
     
    761762                          _width = maxWidth;
    762763                      } else {
    763                           _width = Image_width - (marges/2);
     764                          _width = Image_width - (marges / 2);
    764765                      }
    765766
    766                         jQuery("#gbo").outerWidth(_width);
    767                         jQuery("#gbo").css("width", (_width) + "px");
    768                         jQuery("#gbo").css("height", (Image_height) + "px");
    769                         jQuery("#gbo").outerHeight(Image_height);
    770                         Image_width = jQuery("#gbo div:last").innerWidth();
    771                         Image_height = parseInt(Image_width / rapport);
     767                      jQuery("#gbo").outerWidth(_width);
     768                      jQuery("#gbo").css("width", (_width) + "px");
     769                      jQuery("#gbo").css("height", (Image_height) + "px");
     770                      jQuery("#gbo").outerHeight(Image_height);
     771                      Image_width = jQuery("#gbo div:last").innerWidth();
     772                      Image_height = parseInt(Image_width / rapport);
    772773
    773774                  } else {
     
    818819              }
    819820
    820  
     821
    821822              jQuery(Cadre).width(zone_affichage.width);
    822823              //==============================================================
     
    947948
    948949      } // function
    949 );                                                                                                                                                                                                                                                                                                                 // ready
     950);                                                                                                                                                                                                                                                                                                                  // ready
    950951    /*
    951952*
  • extensions/Autosize/main.inc.php

    r7355 r7375  
    22/*
    33Plugin Name: AutoSize
    4 Version: 1.2.5
     4Version: 1.2.6
    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
     
    1515$autosize_controler = new autosize_controler();
    1616
     17add_event_handler('loc_after_page_header', array(&$autosize_controler, 'cl_autosize_affiche'), 95 );
    1718add_event_handler('get_admin_plugin_menu_links', array(&$autosize_controler,'cl_autosize_admin')  );
    18 
    19 //add_event_handler('loc_begin_page_header', array(&$autosize_controler,'cl_autosize_script'),20 );
    20 //add_event_handler('loc_begin_picture', array(&$autosize_controler,'cl_autosize_script'),20 );
    21 add_event_handler('loc_begin_page_tail', array(&$autosize_controler,'cl_autosize_script'),100 );
    22 
    23 add_event_handler('loc_after_page_header', array(&$autosize_controler, 'cl_autosize_affiche'), 95 );
    24 //add_event_handler('amd_jpegMD_loaded', array(&$autosize_controler, 'cl_autosize_affiche'),45);
    25 //add_event_handler('loc_after_page_header', array(&$autosize_controler, 'cl_autosize_affiche'), 100 );
     19add_event_handler('load_profile_in_template', array(&$autosize_controler,'cl_autosize_script'),50 );
    2620
    2721?>
Note: See TracChangeset for help on using the changeset viewer.