Changeset 7820


Ignore:
Timestamp:
Nov 19, 2010, 2:31:09 PM (13 years ago)
Author:
cljosse
Message:
 
Location:
extensions/Autosize
Files:
3 edited

Legend:

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

    r7817 r7820  
    145145if ( !empty($content) )   {  return $content;  }       
    146146if ($ThePicture['is_picture'] <> 1 )    {  return $content;  ; }       
    147  $tpls=' {known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js" now=1}';
    148          $autosizejs = '<script type="text/javascript" charset="utf-8"  src="'.$ROOT_URL;
     147
     148         $autosizejs = '<script type="text/javascript" charset="utf-8"  src="';
    149149              $autocss =   $autosizejs.'themes/default/js/jquery.packed.js"></script>'."\n";
    150150                  $template->append('head_elements',$autocss);
    151151
    152 $autocss="<script type='text/javascript'>
    153 jQuery('#theImage').css({opacity:'0.1'});
     152                $autocss="<script type='text/javascript'>
     153jQuery('#theImage').css({opacity:'0.0'});
    154154</script>";
    155155
     
    186186           global  $template,$user,$conf,$picture ,$page;
    187187           //userDefManage ??
    188                 $my_path =  basename(dirname(__FILE__)).'/' ;
    189             $my_path = dirname(__FILE__).'/';
     188                        $my_path =  basename(dirname(__FILE__)).'/' ;
     189                        $my_path = dirname(__FILE__).'/';
    190190                        $debug = isset($conf['debug']) ? $conf['debug'] : false ;
    191191                        $cl_conflit =  isset($conf['cl_conflit']) ? $conf['cl_conflit'] : 'true' ;
    192                           $theme=$user['theme'];
    193                                 $template->assign(
    194                                                 array('ma_page' =>      $page['body_id'],
    195                                                 'cl_conflit' => $cl_conflit  ,
    196                                                 'theme' => $theme  ,
    197                                                 'DEBUG' => $debug   ,
    198                                                 'AUTOSIZE_PATH' => AUTOSIZE_PATH)
    199                                                  );
     192                        $theme=$user['theme'];
     193                        $template->assign(
     194                                        array('ma_page' =>      $page['body_id'],
     195                                        'cl_conflit' => $cl_conflit  ,
     196                                        'theme' => $theme  ,
     197                                        'DEBUG' => $debug   ,
     198                                        'AUTOSIZE_PATH' => AUTOSIZE_PATH)
     199                                                );
    200200                                                 
    201201$autoscript="<script type='text/javascript'>
    202202if (typeof (save_framework) == 'function')
    203203save_framework('".$page['body_id']."');
    204 
    205204</script>";
    206205                         $template->append('footer_elements',$autoscript); 
  • extensions/Autosize/js/Affiche_script.js

    r7819 r7820  
    2323   
    2424}
    25 //=================================================================================================
    26  function Wait_Pamoorama() {
     25 
     26//==========================================================================
     27function Wait_Affichage() {
     28   if (jQuery("#pamoorama").length) {
     29               jQuery().newResize() ;
    2730               mypanorama = window.myPamoorama;
    28                if (!mypanorama) setTimeout("Wait_Pamoorama()", 500);
    29                  if ( mypanorama.skipInit==false) setTimeout("Wait_Pamoorama()", 500);
     31               if (!mypanorama){
     32                    setTimeout("Wait_Affichage()", 500);
     33                    return false ;
     34               }
     35                 if ( mypanorama.skipInit==false) {
     36                    setTimeout("Wait_Affichage()", 500);
     37                    return false ;
     38               }
    3039                     info_pamoorama = jQuery("#pamoorama").infos();
    3140                    new_width= info_pamoorama.width ;
    32               if(! jQuery().newResize()) setTimeout("Wait_Pamoorama()", 500);
    33                  if (  myPamoorama.options.width!= new_width ) return
    34                  jQuery("#theImage").css(
    35                          { opacity: 1 }
    36                         );
    37                          
    38 }
    39 function Wait_Affichage() {
    40                 if(!jQuery().newResize()) {
     41               
     42                 if (  Math.abs(new_width - myPamoorama.options.width)>10  ) {
    4143                 setTimeout("Wait_Affichage()", 500);
    42                  }
     44                 return false ;
     45                 }
     46         
     47
     48     }else  if(!jQuery().newResize()) {
     49                 setTimeout("Wait_Affichage()", 500);
     50                 return
     51    }
     52
     53
    4354      fade_in = parseInt(fade_in);
    4455            if (fade_in==0 )
    4556                 {
    4657                 jQuery("#theImage").css({
    47                          opacity: 1,
    48                          filter: 'alpha(opacity:100)'}
     58                         opacity: 1
     59                         
     60                         }
    4961                 )
    5062                                 }else{
     
    5567
    5668
    57                  jQuery("#theImage").css(
    58                          { opacity: 1 }
    59                         );
    6069                         
    6170}
     
    342351
    343352             jQuery(window).resize(
    344                function (event, ui) {       
     353               function (event, ui) {   
     354               return ;
     355                   
    345356               event = event || window.event;
    346357
     
    409420           return ;
    410421
    411                  if(jQuery.browser.msie)
    412                  {    var el = e.srcElement;
    413                         ID = el.id;               
    414                         Prop = e.propertyName.split(".");
    415                         if(Prop.length < 2) return ;                     
    416                           Property = Prop[1];
    417                  }
    418                  else
    419                  {ID =this.id ;
    420                      Prop = e.attrName ;
    421                      Property = e.newValue  ;
    422                  }
    423            jQuery().affiche_debug({ Dragg: {texte:"onPropertyChange : " + ID,
    424                      css:{
    425                          opacity: 0.5,
    426                          filter: 'alpha(opacity:50)',
    427                          position: "absolute",
    428                          width: "500px",
    429                          border: "solid 1px green",
    430                          top: 130 + "px"}
    431                      }
    432                      });
    433                   mypanorama = window.myPamoorama;
    434                  if (Property.match("width","gi")) {
    435                    
    436                  
    437                 if(!mypanorama)
    438                   setTimeout("wait_Pamoorama()", 500);
    439                    
    440 
    441 
    442                if(jQuery("#pamoorama_outter").length == 0)
    443                {
    444                elem=jQuery("#pamoorama").get(0);
    445                  type="propertychange";
    446             handle=jQuery().onPropertyChange;
    447 
    448                      if (elem.addEventListener) {// Firefox, Opera, Google Chrome and Safari
    449                             elem.addEventListener('DOMAttrModified', handle, false);
    450                         } else if (elem.attachEvent) {
    451                             elem.attachEvent("on" + type, handle);
    452                         }
    453                   setTimeout("wait_Timer()", 600);
    454                   }
    455                else if( jQuery("#pamoorama_footer").length == 0)
    456                    setTimeout("wait_Pamoorama()", 600);
    457                 else if( jQuery("#pamoorama_frame").length == 0)
    458                     setTimeout("wait_Pamoorama()", 600);
    459                  }
    460                  return;
     422
    461423             },
    462                      /*
     424             /*
    463425             * recherche la plus grande image (hauteur ou largeur)
    464426             */
     
    592554
    593555                     if (myPamoorama.skipInit == false) {
    594                             setTimeout("Wait_Pamoorama()", 500);
     556                           
    595557                            return false;
    596558                     }
  • extensions/Autosize/main.inc.php

    r7816 r7820  
    22/*
    33Plugin Name: AutoSize
    4 Version: 1.3.5
     4Version: 1.3.7
    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
Note: See TracChangeset for help on using the changeset viewer.