Changeset 6953

Show
Ignore:
Timestamp:
09/17/10 10:23:58 (3 years ago)
Author:
cljosse
Message:

[Autosize]IImprovement pamooramic compatibility


Location:
extensions/Autosize
Files:
1 added
2 modified

Legend:

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

    r6936 r6953  
    1313            Type_Img = "embed"; 
    1414        } else if (jQuery("#pamoorama").length) { 
    15            
     15 
    1616            Type_Img = "pamoorama"; 
    1717        } else if (jQuery("#theImage").find("img").length > 0) { 
     
    4242                var Image = jQuery(Images).get(0); 
    4343 
    44                 if (!Image) return; 
    45                 var TheImg = jQuery(Image); 
     44                var TheImg = jQuery("#pamoorama").get(0); 
     45                if (!TheImg) return; 
    4646                break 
    4747        } 
     
    121121        jQuery("#theImage").width("100%"); 
    122122        jQuery("#theImage").height("auto"); 
    123             jQuery(TheImg).height(Image_height + "px"); 
    124             jQuery(TheImg).width(Imgage_Width + "px"); 
    125123 
    126         if (Type_Img = "pamoorama") { 
    127124 
    128             return; 
    129             jQuery("#pamoorama_inner").css("zoom", "1"); 
    130             jQuery("#pamoorama_inner").css("height", Image_height + "px"); 
    131             jQuery("#pamoorama_inner").css("width", Imgage_Width + "px"); 
    132125 
    133             jQuery("#pamoorama_outter").css("zoom", "1"); 
     126        if (Type_Img == "pamoorama") { 
     127            h1 = jQuery("#pamoorama").height(); 
     128            jQuery("#pamoorama").css("overflow", "hidden"); 
     129            jQuery("#pamoorama").css(jQuery(window).width() + "px"); 
     130   
    134131            jQuery("#pamoorama_outter").css("height", Image_height + "px"); 
    135             jQuery("#pamoorama_outter").css("width", Imgage_Width + "px"); 
     132            jQuery("#pamoorama_outter").css("width", jQuery(window).width() + "px"); 
     133/* 
     134            jQuery(TheImg).css(Image_height + "px"); 
     135            jQuery(TheImg).css(jQuery(window).width() + "px"); 
     136            */ 
     137            zoom = Image_height / img_height; 
     138 
     139            jQuery("#pamoorama_inner").css("zoom", zoom); 
     140 
    136141 
    137142 
    138143        } else { 
    139       
     144        jQuery(TheImg).height(Image_height + "px"); 
     145        jQuery(TheImg).width(Imgage_Width + "px"); 
    140146 
    141147        } 
  • extensions/Autosize/main.inc.php

    r6936 r6953  
    22/* 
    33Plugin Name: AutoSize 
    4 Version: 1.0.4 
     4Version: 1.0.5 
    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 
     
    1616); 
    1717 
    18  
    19 //add_event_handler('render_element_content', 'cl_autosize_affiche',EVENT_HANDLER_PRIORITY_NEUTRAL+1); 
    20 //add_event_handler('loc_end_picture', 'cl_autosize_affiche',EVENT_HANDLER_PRIORITY_NEUTRAL); 
    21 //add_event_handler('loc_begin_picture', 'cl_autosize_affiche',EVENT_HANDLER_PRIORITY_NEUTRAL); 
    22 add_event_handler('loc_end_picture', 'cl_autosize_affiche',EVENT_HANDLER_PRIORITY_NEUTRAL); 
    23  
     18add_event_handler('loc_end_picture', 'cl_autosize_affiche',EVENT_HANDLER_PRIORITY_NEUTRAL+10); 
    2419function cl_autosize_affiche() 
    2520{ 
    26     global $user, $picture, $template; 
    27     global $content, $element_info; 
    28     $my_path = dirname(__FILE__).'/'; 
    29    
    30     
     21    global $user, $picture, $template,$page; 
     22    global $content, $element_info;    
    3123    global $infos_message,$erreur_message; 
    3224    global  $conf,$lang ; 
     25    if ( $page['body_id']=='thePicturePage'  ) { 
     26   if ( isset($picture['current'])){ 
     27    $my_path = dirname(__FILE__).'/'; 
    3328    $autosize_parametres = cl_autosize_Get_Options(); 
    34  include (AUTOSIZE_PATH."include/affiche.php");                  
     29    include (AUTOSIZE_PATH."include/affiche.php");               
    3530  
    36   $template->set_filenames( 
    37     array('default_content'=> $my_path.'template/picture.tpl') 
     31    $template->set_filenames( 
     32        array('autosize_content'=> $my_path.'template/autosize.tpl') 
    3833    ); 
    39        return $template->parse( 'default_content', true); 
     34 
     35       return $template->parse( 'autosize_content', false); 
     36       } 
     37       } 
    4038} 
    4139 
     
    5048    return $menu; 
    5149} 
    52  
    53  
    54  
     50//=================================================================== 
    5551function cl_autosize_aff_infos_plus() 
    5652{