Changeset 17503


Ignore:
Timestamp:
Aug 9, 2012, 8:35:17 PM (12 years ago)
Author:
cljosse
Message:

[extensions] Autosize fix compatibility with 2.4, update

Location:
extensions/Autosize
Files:
1 added
13 edited

Legend:

Unmodified
Added
Removed
  • extensions/Autosize/admin/admin_autosize.php

    r11442 r17503  
    9797 $visible=true;
    9898 $path = AUTOSIZE_PATH;
    99  $autosize_parametres = cl_autosize_Get_Options();
     99global $has_pamoorama,$select_type,$autosize_parametres;
     100global $defined_types,$maxi_img ,$pictureDeriv ,$liste_type,$SRC_IMG;
     101  $defined_types = array_keys(ImageStdParams::get_defined_type_map()); 
     102  $autosize_parametres = cl_autosize_Get_Options();
    100103         
    101104   if (isset($_POST['submit']))  { 
     
    109112                 unset($_POST);
    110113                 }
    111  include (AUTOSIZE_PATH."include/affiche.php");                 
     114  include (AUTOSIZE_PATH."include/affiche.php");                 
    112115//================================================================================
    113116$base_url = get_root_url().'admin_autosize.php';
     
    127130    <div class='autosize'
    128131         autosize='MargeBasse:30px;MargeHaute:30px;parent:fieldset;ResizePicture:true'>
    129         <img src='./plugins/Autosize/images/ECO_050.jpg ' width='100%' />       
     132        <img src='./plugins/Autosize/images/quadrille_100.png ' width='100%' />       
    130133    </div>
    131134</fieldset>";
  • extensions/Autosize/autosize.inc.php

    r17308 r17503  
    2121// +-----------------------------------------------------------------------+
    2222class autosize_controler {
    23  //============================================================
    24  /*
    25   *  cl_autosize_script_1
    26  */
    27  static public function cl_autosize_script_1()
    28         {
     23        /*********************************
     24        * cl_autosize_admin
     25        **********************************/
     26        static public function cl_autosize_admin($menu)         {
     27                global  $lang ;
     28                array_push($menu, array('NAME' => 'Autosize',
     29                'URL' => get_admin_plugin_menu_link(AUTOSIZE_PATH . 'admin/admin_autosize.php')));
     30                return $menu;
     31        } //function cl_autosize_admin
     32/*********************
     33* INIT
     34*********************/
     35static public function init($content){
     36  // header ('X-UA-Compatible: n=7')  ;
     37 // header ('X-UA-Compatible: IE=Edge')  ;
     38 global  $template,$version,$icon_path,$page,$picture,$conf;
     39
     40   $current = $template->get_template_vars('current');
     41
     42   $model=  $_COOKIE['picture_deriv'] ;
     43      $has_pamoorama=isset($template->files['pamooramics_content']);
     44 //====================================================================   
     45    $pictureDeriv = pwg_get_session_var('picture_deriv',$conf['derivative_default_size']);
     46    $SRC_IMG="";
     47       $selected_derivative =  $current['derivatives'][$pictureDeriv];
     48        if (!isset($current['selected_derivative'])){ 
     49          $template->append('current', array(
     50                                        'selected_derivative' => $selected_derivative
     51                                            ),
     52                             true);
     53          $current = $template->get_template_vars('current');
     54        }
     55
     56        if(isset($current['derivatives'][$model])) {
     57            $selected_derivative =  $current['derivatives'][$model];
     58            $template->assign('current[selected_derivative]', $selected_derivative
     59                              , true);
     60            $current = $template->get_template_vars('current');
     61        }
     62   
     63    return $content;
     64
     65}//INIT
     66/**************************
     67*  autosize_calcContent   *
     68**************************/
     69 static public function autosize_calcContent($content){
     70  global $conf,$page, $template,$picture,$user;
     71  global $defined_types,$maxi_img ,$pictureDeriv ,$liste_type,$SRC_IMG,$select_type;
     72  global  $has_pamoorama;
     73  global $autosize_parametres,$user_status;
     74$defined_types = array_keys(ImageStdParams::get_defined_type_map());   
     75//===============================================================
     76 if(isset($page['body_id']) &&  $page['body_id'] == 'theAdminPage' ) return ;   
     77    if (!isset($_COOKIE['autosize_reload'])){   
     78            $autoscript="<script type='text/javascript' src='themes/default/js/jquery.min.js'></script>                        <script type='text/javascript' src='plugins/autosize/js/autosizeDetect.js'></script>
     79      <script type='text/javascript' src='plugins/Autosize/js/autosize.cookie.js'></script>
     80      <body onload=on_load() style='background-color:black;color :white;font-size:30px '  > 
     81     please wait, loading...
     82      </body>";   
     83                  echo $autoscript; 
     84      die();
     85    } 
     86  $current = $template->get_template_vars('current');
     87                       if (!isset($current)) return ;
     88//===============================================================
     89    $derivative = $current['src_image'] ;
     90    $imgScaledWH = $derivative->get_size();
     91    $SRC_IMG    = $derivative->get_url(); 
     92    $picture['current']['scaled_width']=$imgScaledWH[0];
     93    $picture['current']['scaled_height']= $imgScaledWH[1];
     94    $picture['current']['high_url']= $SRC_IMG;   
     95    $picture['current']['image_url']=$SRC_IMG; 
     96//===============================================================
     97
     98    $user_status = $user['status'] ;
     99    $autosize_parametres = cl_autosize_Get_Options();
     100    $user_type= get_user_status($user_status)."_type";
     101    $select_type=$autosize_parametres->$user_type ;
     102 
     103
     104  if (isset($_COOKIE['theImageHeight'])){   
     105      pwg_set_session_var('theImageWidtht',$_COOKIE['theImageWidth']); 
     106      pwg_set_session_var('theImageHeight',$_COOKIE['theImageHeight']);   
     107  }
     108if (isset($_COOKIE['theMainImageHeight']))  pwg_set_session_var('theMainImageHeight',$_COOKIE['theMainImageHeight']); 
     109if (isset($_COOKIE['theMainImageWidth']))  pwg_set_session_var('theImageWidth',$_COOKIE['theMainImageWidth']);
     110
     111
     112if (isset($_COOKIE['picture_deriv'])) 
     113    pwg_set_session_var('picture_deriv',$_COOKIE['picture_deriv']);
     114else
     115  pwg_set_session_var('picture_deriv',$select_type);
     116
     117 
     118$model=   $conf['derivative_default_size'] ; // par defaut
     119  $pictureDeriv = pwg_get_session_var('picture_deriv',  $model);
     120
     121 
     122 $model=$pictureDeriv ;
     123
     124    $value=0;
     125    $liste_type="";
     126    $maxi_info="";
     127    if($model!="Autosize" & $model!="SelMaxi"){
     128     
     129    }else{
     130        $model=$conf['derivative_default_size'] ; 
     131    }
     132  $derivative=$current['derivatives'][$model] ; 
     133    $img_all= $derivative->get_all($derivative->src_image);
     134    $maxi_img="";
     135    $mini_img="";
     136    $maxi_url="";
     137    $imgSizeWH  = $derivative->get_size();     
     138    //==== valeur taille image ====
     139   
     140     $window_width=$imgSizeWH[0];
     141     $window_height=$imgSizeWH[1];
     142 //echo "<div style='background-color:black;color:white' >INIT: $model  w:$window_width x  h:$window_height  </div>";
     143
     144   
     145    $window_width = pwg_get_session_var('theMainImageWidth',$imgSizeWH[0]);
     146 $window_height =  pwg_get_session_var('theMainImageHeight',$imgSizeWH[1]);
     147
     148 if (!isset($_COOKIE['theMainImageHeight']))    setcookie('theMainImageHeight', $window_height );
     149if (!isset($_COOKIE['theMainImageWidth']))  setcookie('theMainImageWidth',$window_width);
     150
     151  //  echo "<div style='background-color:black;color:white' >$select_type w: $window_width x h: $window_height  </div>";
     152
     153    $last_defined=ImageStdParams::get_defined_type_map();   
     154    foreach ($img_all as $img_select){
     155            $img_type  =  $img_select->get_type();     
     156            if ($img_type=="square" || $img_type=="thumb" ) continue ;
     157
     158            $img_url  = $img_select->get_url();
     159            $imgSizeWH  =  $img_select->get_size();     
     160            if($img_type=="Autosize" || $img_type=="SelMaxi"){
     161                $img_url = $img_select->src_image->get_url();
     162                $imgSizeWH  =  $img_select->src_image->get_size();
     163                $liste_type[$img_type]=$img_type.",".$img_url.",".$imgSizeWH[0] .",".$imgSizeWH[1] ;
     164            }else{
     165            $liste_type[$img_type]=$img_type.",".$img_url.",".$imgSizeWH[0] .",".$imgSizeWH[1] ;
     166            if ($img_type=="Original"){
     167         
     168            break ;
     169            }
     170           
     171               
     172
     173              if($window_height < $imgSizeWH[0] ){
     174                          $maxi_img=  $img_type;
     175                          $maxi_url= $img_url;
     176                          $maxi_i=$img_select;
     177              }
     178              if($window_height < $imgSizeWH[0] && $mini_img==""){
     179                      $mini_img=  $img_type;
     180                      $mini_url= $img_url;
     181                      $mini_i=$img_select;
     182                     
     183                 }else if($imgSizeWH[0] > 10 && $maxi_img==""){
     184                      $last_img=$img_select;
     185              }
     186
     187 
     188               if($select_type==$img_type){
     189                  if($maxi_img==""){
     190                      $maxi_img=  $img_type;
     191                      $maxi_url= $img_url;
     192                      $maxi_i=$img_select;
     193                  }
     194                     
     195                      break ;
     196                    }
     197         }
     198
     199      }
     200 
     201//==============================================================   
     202  //==== Réécriture selection ====
     203  if( $img_type=="SelMaxi"){
     204  $maxi_img= $mini_img;
     205  $maxi_url= $mini_img;
     206  }
     207  if ( !array_key_exists($maxi_img, $last_defined) ){
     208            $maxi_img = $last_img->get_type();   
     209            $maxi_url  = $last_img->get_url();
     210            $imgSizeWH  =  $last_img->get_size();       
     211  }
     212    $model= $maxi_img;
     213    pwg_set_session_var('picture_deriv', $maxi_img);
     214    $_COOKIE['picture_deriv']=$maxi_img ;
     215    $_COOKIE['picture_map']=  $maxi_img ;
     216    $_COOKIE['imgSrc']=       $maxi_url;
     217
     218  if (isset($_COOKIE['picture_deriv'])){   
     219      if ( array_key_exists($_COOKIE['picture_deriv'], ImageStdParams::get_defined_type_map()) ){
     220            pwg_set_session_var('picture_deriv', $_COOKIE['picture_deriv']);
     221        }else{
     222        echo "<pre>".$_COOKIE['picture_deriv']. "No exist  " ;
     223        print_r($img_all );
     224        die();
     225        }
     226    setcookie('picture_deriv', false, 0, cookie_path() );
     227  } 
     228
     229 
     230return false ;
     231
     232 }
     233
     234/************************
     235* cl_autosize_affiche
     236*************************/     
     237        static public function cl_autosize_affiche(){
     238                global $user, $picture, $template,$page,$known_script;
     239                global $content, $element_info;   
     240                global $infos_message,$erreur_message;
     241                global  $conf,$lang ,$user,$userdata;
     242      global $defined_types,$maxi_img ,$pictureDeriv ,$liste_type,$SRC_IMG,$select_type;
     243  global  $has_pamoorama;
     244  global $autosize_parametres,$user_status;
     245
     246    if(isset($page['body_id']) &&       $page['body_id'] == 'theAdminPage' ) return ;   
     247
     248 if ('kardon' == $user['theme'] and isset($_GET['slideshow'])) return ;
     249                load_language('plugin.lang', AUTOSIZE_PATH);
     250                $AUTOSIZE_PATH = dirname(__FILE__).'/';
     251                 if (isset( $page['body_id']) && $page['body_id']=='thePicturePage'  ) {
     252
     253                        if ( isset($picture['current'])){       
     254                                include (AUTOSIZE_PATH."include/affiche.php");
     255
     256        $file =AUTOSIZE_PATH_ABS.'template/picture_1.tpl' ;
     257        $template->set_filenames(array('autosize_content_header'=> $file ));
     258        $template->assign(
     259                                        array( 
     260            'select_type' =>$select_type,
     261            ));
     262
     263        $template->concat('autosize_content', $template->parse('autosize_content_header', true)); 
     264
     265        $file =AUTOSIZE_PATH_ABS.'template/header.tpl' ;
     266        $template->set_filenames(array('autosize_init_header'=> $file ));
     267        $template->parse( 'autosize_init_header', false);     
     268
     269                $theme=$user['theme']; 
     270                                       
     271                                if($autosize_parametres->check_icon_v == 'on'){                         
     272                                                $template->assign('cl_autosize_button',
     273                                                array(  'cl_autosize_info' => 'cl_autosize_info' ,
     274                    'cl_autosize_info_1' => 'cl_autosize_info_' , 
     275                                                                    'cl_autosize_info_2' => 'cl_autosize_info_2' ,   
     276                                                                    'URL' => $_SERVER['REQUEST_URI'] ,
     277                                                                    'ICON2' => AUTOSIZE_PATH . 'icons/button-maximize.png',
     278                                                                    'ICON' => AUTOSIZE_PATH . 'icons/button-minimize.png',
     279                    'ICON1' => AUTOSIZE_PATH . 'icons/button-no.png'
     280                                                                )
     281
     282                                                        );
     283                                        $template->set_filenames(array('cl_bp' => $AUTOSIZE_PATH. 'template/picture.tpl'));
     284                                        $template->concat('PLUGIN_PICTURE_ACTIONS', $template->parse('cl_bp', true));
     285                                }
     286                                 $template->set_filenames(
     287                                                array('autosize_content'=> $AUTOSIZE_PATH.'template/autosize.tpl',
     288             'theme' => $theme   )
     289                                        );
     290                        $template->concat('autosize_content', $template->parse('autosize_content_header', true));       
     291       
     292      if(isset($conf['go_up_down']) && ($conf['go_up_down']==true) ){
     293        $template->set_filenames(array('mes_script' => realpath(AUTOSIZE_PATH).'/template/mes_scripts.tpl') );
     294        $template->func_combine_script(array('id'=>'my_script_2',
     295        'path'=> AUTOSIZE_PATH.'/js/JScript.js',
     296        'require' => 'jquery'),
     297        $template->smarty);
     298        $template->assign(array(
     299                          'MY_FOOTER_PATH' =>AUTOSIZE_PATH
     300                          ));                                   
     301        $template->parse('mes_script');
     302      }   
     303        return $template->parse( 'autosize_content', false);
     304                                  }
     305                }
     306
     307        } //public function cl_autosize_affiche
     308
     309   /************************
     310 *  cl_autosize_script_1
     311 *************************/
     312 static public function cl_autosize_script_1(){
    29313  global $user,$page,$template,$cl_plugin;
    30  // header ('X-UA-Compatible: n=7')  ;
    31  // header ('X-UA-Compatible: IE=Edge')  ;
    32314    if(isset($page['body_id']) &&       $page['body_id'] == 'theAdminPage' ) return ;   
     315 
    33316    $ma_page=isset($page['body_id'])?$page['body_id']:"" ;
    34     if ($ma_page=='thePiwiShackControllerPage') return ;
    35     if (!isset($template->files['pamooramics_content'])) return ; 
     317    if ($ma_page=='thePiwiShackControllerPage') return ;   
    36318    if ('kardon' == $user['theme'] and isset($_GET['slideshow'])) return ;
     319    global  $has_pamoorama;
    37320    $has_pamoorama=isset($template->files['pamooramics_content']);
    38 
    39     $file =AUTOSIZE_PATH_ABS.'template/header.tpl' ;
    40     $template->set_filenames(array('autosize_init_header'=> $file ));
     321  if (!$has_pamoorama) return ;
     322
    41323    $template->set_filenames(array('autosize_init'=>AUTOSIZE_PATH_ABS. "template/conflit.tpl" ) );
    42 //================================================================
    43 $DEBUG_autosize = isset($_POST['cl_debug_conflit']) ? $_POST['cl_debug_conflit'] : "false" ;
    44 $DEBUG_autosize = isset($_GET['cl_debug_conflit']) ? $_GET['cl_debug_conflit'] : $DEBUG_autosize ;
    45 $DEBUG_autosize = isset($conf['cl_debug_conflit']) ? $conf['cl_debug_conflit'] : $DEBUG_autosize ;
    46 //======================================================================
    47324    $autosize_parametres =       cl_autosize_Get_Options() ;                   
    48325    $theme=$user['theme'];
     326    //==============================================================================
     327    $DEBUG_autosize = isset($_POST['cl_debug_conflit']) ? $_POST['cl_debug_conflit'] : "false" ;
     328    $DEBUG_autosize = isset($_GET['cl_debug_conflit']) ? $_GET['cl_debug_conflit'] :  $DEBUG_autosize ;
     329    $DEBUG_autosize = isset($conf['cl_debug_conflit']) ? $conf['cl_debug_conflit'] : $DEBUG_autosize ;
     330    //==============================================================================
    49331    $template->assign(
    50332      array(   
     
    54336          'name' => $cl_plugin['name'] ,
    55337          'pamoorama' =>  $has_pamoorama,                                                               
    56           'theme' => $theme  ,
    57           'DEBUG_autosize' =>  $DEBUG_autosize ,
     338          'theme' => $theme  , 
     339          'DEBUG_autosize' => $DEBUG_autosize,
    58340          'AUTOSIZE_PATH' => str_replace("../","",AUTOSIZE_PATH)  ,
    59341          'AUTOSIZE_PATH_ABS' => AUTOSIZE_PATH_ABS,
    60342          'Version_pwg' => PHPWG_VERSION           )
    61343    );
    62                 $template->concat('cl_conflit_init', $template->parse('autosize_init_header', true));
    63                 return $template->parse( 'autosize_init', false);
     344    return $template->parse( 'autosize_init', false);
    64345        }// function cl_autosize_script_1
    65346
     
    71352           global  $template,$user,$conf,$picture ,$page, $cl_plugin,$known_script ;
    72353                global  $template,$user,$conf,$picture ,$page, $cl_plugin ;
     354            if(isset($page['body_id']) &&       $page['body_id'] == 'theAdminPage' ) return ;   
     355   
    73356   if ('kardon' == $user['theme'] and isset($_GET['slideshow'])) return ;
    74    if (!isset($PAMOORAMICS_PATH)) return ;   
     357     global  $has_pamoorama;
     358       if (!$has_pamoorama) return ;
     359     
    75360                        $AUTOSIZE_PATH = dirname(__FILE__).'/';
    76361//================================================================
     
    88373    $src_img_h=isset($_POST['src_img_h'])?$_POST['src_img_h']: $img_width               ;
    89374    $src_img_w= isset($_POST['src_img_w'])?$_POST['src_img_w']:$img_height              ;
     375
     376
     377  include_once (PHPWG_ROOT_PATH.'include/functions_cookie.inc.php') ;
    90378if(isset($_COOKIE['img_w'])){
    91379    $src_img_w=$_COOKIE['img_w'];
     
    93381}
    94382
    95 $window_height= isset($_POST['window_height'])?$_POST['window_height']: $img_scaled_height ;
    96 $window_width= isset($_POST['window_width'])?$_POST['window_width']: $img_scaled_width    ;
     383$window_height= isset($_SESSION['height'])?$_SESSION['height']: $img_scaled_height ;
     384$window_width= isset($_SESSION['width'])?$_SESSION['width']: $img_scaled_width    ;
    97385
    98386
     
    118406                                        )
    119407                                                );
    120   include_once (PHPWG_ROOT_PATH.'include/functions_cookie.inc.php') ;
     408
    121409                        $autoscript="<script type='text/javascript'>
    122410                        /* cl_autosize_script_2 */
     
    131419 * cl_autosize_script_3()
    132420 **************************************/
    133  static public function cl_autosize_script_3()
    134  {
    135            global  $template;
    136  
    137 
    138     $has_pamoorama=isset($template->files['pamooramics_content']);
    139     if (!$has_pamoorama) return ; 
    140 
    141                         $autoscript="<div id='debug' >TEST</div>
    142       <script type='text/javascript'>                   
     421 static public function cl_autosize_script_3() {
     422           global  $template,$page;
     423    if(isset($page['body_id']) &&       $page['body_id'] == 'theAdminPage' ) return ;   
     424          global  $has_pamoorama;
     425       if (!$has_pamoorama) return ;
     426
     427                        $autoscript="<script type='text/javascript'>                   
    143428                        if (typeof (Ajout_Ajax) == 'function')
    144429                           Ajout_Ajax(); 
     
    148433 }// function cl_autosize_script_3
    149434
    150         //================================================================
    151         /*
    152         * cl_autosize_admin
    153         */
    154         static public function cl_autosize_admin($menu)
    155                 {
    156                 global  $lang ;
    157                 array_push($menu, array('NAME' => 'Autosize',
    158                 'URL' => get_admin_plugin_menu_link(AUTOSIZE_PATH . 'admin/admin_autosize.php')));
    159                 return $menu;
    160         } //function cl_autosize_admin
    161   //=====================================
    162 
    163 
    164   // this is the default handler that generates the display for the element
    165  static public function autosize_calcContent($content)
    166 {
    167   global $conf;
    168    
    169  global $page, $template,$picture;
    170 
    171 
    172   $current = $template->get_template_vars('current');
    173   $defined_types = array_keys(ImageStdParams::get_defined_type_map()); 
    174 if (isset($current)){
    175     if (!isset($current['selected_derivative'])){ 
    176       $model= $defined_types[count($defined_types)-1];
    177       $selected_derivative =      $current['derivatives'][$model];
    178       $template->append('current', array(
    179       'selected_derivative' => $selected_derivative
    180     ), true);
    181 
    182 
    183     $current = $template->get_template_vars('current');
    184         }
    185 
    186          $derivative=$current['selected_derivative'] ;
    187           $imgScaledWH=$derivative->src_image->get_size();
    188           $imgSizeWH  =  $derivative->get_size();       
    189           $img_type  =  $derivative->get_type();       
    190           $img_url  = $derivative->get_url();
    191           $img_all= $derivative->get_all($derivative->src_image);
    192           $scaled_size=$derivative->get_size_hr(); //792 x 441
    193           $scaled_size=$derivative->get_scaled_size_htm(); // width="792" height="441"
    194          //================= taille mis a l'échelle
    195           $scaled_size=$derivative->get_scaled_size(100,100); // array([0]=>100,[1]=>55)
    196           $src= $derivative->src_image ;
    197        
    198     }
    199  
    200     $img_scaled_width=isset($imgScaledWH)?$imgScaledWH[0]:"480";
    201     $img_scaled_height=isset($imgScaledWH)?$imgScaledWH[1]:"320";
    202     $current = $template->get_template_vars('picture');
    203     $picture['current']['scaled_width']=$img_scaled_width;
    204     $picture['current']['scaled_height']= $img_scaled_height;
    205     $picture['current']['image_url']=$src->rel_path;
    206    
    207  }
    208 
    209     //===============================================================
    210         /*
    211         *
    212         */     
    213         static public function cl_autosize_affiche()
    214         {
    215                 global $user, $picture, $template,$page,$known_script;
    216                 global $content, $element_info;   
    217                 global $infos_message,$erreur_message;
    218                 global  $conf,$lang ,$user,$userdata;
    219  if ('kardon' == $user['theme'] and isset($_GET['slideshow'])) return ;
    220                 load_language('plugin.lang', AUTOSIZE_PATH);
    221 
    222                 $AUTOSIZE_PATH = dirname(__FILE__).'/';
    223                  if (isset( $page['body_id']) && $page['body_id']=='thePicturePage'  ) {
    224                         if ( isset($picture['current'])){       
    225                                 $autosize_parametres = cl_autosize_Get_Options();
    226                                 include (AUTOSIZE_PATH."include/affiche.php");
    227         $file =AUTOSIZE_PATH_ABS.'template/picture_1.tpl' ;
    228         $template->set_filenames(array('autosize_content_header'=> $file ));
    229         $template->concat('autosize_content', $template->parse('autosize_content_header', true));                           
    230         $template->set_filenames(array('autosize_init_header'=> $file ));
    231                 $theme=$user['theme'];   
    232           $deriv_type = pwg_get_session_var('picture_deriv', IMG_LARGE);   
    233           $defined_types = array_keys(ImageStdParams::get_defined_type_map());
    234                                        
    235                                 if($autosize_parametres->check_icon_v == 'on'){                         
    236                                                 $template->assign('cl_autosize_button',
    237                                                 array(  'cl_autosize_info' => 'cl_autosize_info' ,
    238                     'cl_autosize_info_1' => 'cl_autosize_info_' , 
    239                                                                     'cl_autosize_info_2' => 'cl_autosize_info_2' ,   
    240                                                                     'URL' => $_SERVER['REQUEST_URI'] ,
    241                                                                     'ICON2' => AUTOSIZE_PATH . 'icons/button-maximize.png',
    242                                                                     'ICON' => AUTOSIZE_PATH . 'icons/button-minimize.png',
    243                     'ICON1' => AUTOSIZE_PATH . 'icons/button-no.png'
    244                                                                 )
    245 
    246                                                         );
    247                                         $template->set_filenames(array('cl_bp' => $AUTOSIZE_PATH. 'template/picture.tpl'));
    248                                         $template->concat('PLUGIN_PICTURE_ACTIONS', $template->parse('cl_bp', true));
    249                                 }
    250                                  $template->set_filenames(
    251                                                 array('autosize_content'=> $AUTOSIZE_PATH.'template/autosize.tpl',
    252              'theme' => $theme   )
    253                                         );
    254                         $template->concat('autosize_content', $template->parse('autosize_content_header', true));               
    255       if(isset($conf['go_up_down']) && ($conf['go_up_down']==true) ){
    256         $template->set_filenames(array('mes_script' => realpath(AUTOSIZE_PATH).'/template/mes_scripts.tpl') );
    257         $template->func_combine_script(array('id'=>'my_script_2',
    258         'path'=> AUTOSIZE_PATH.'/js/JScript.js',
    259         'require' => 'jquery'),
    260         $template->smarty);
    261         $template->assign(array(
    262                           'MY_FOOTER_PATH' =>AUTOSIZE_PATH
    263                           ));
    264                                        
    265         $template->parse('mes_script');
    266       }     
    267            
    268         return $template->parse( 'autosize_content', false);
    269                                   }
    270                 }
    271 
    272         } //public function cl_autosize_affiche
    273435        //===============================================================
    274436                /*
     
    520682                        pwg_query($query);
    521683          }
    522          
     684    if (!isset($conf['cl_derivatives_sav']))  {   
     685      $q = '
     686        INSERT INTO '.CONFIG_TABLE.' (param, value, comment)
     687        VALUES ("cl_derivatives_sav","","sauvegarde derivatives")
     688      ;';
     689      pwg_query($q);     
     690      }
    523691 }
    524692
    525  function auto_memo_var($variables)
     693 function print_var($variables)
    526694{
    527695  ob_start();
  • extensions/Autosize/css/autosize.css

    r17308 r17503  
    4444
    4545}
    46 #theImage {
    47 
    48    }
     46#theImage {/*
     47background-color: #DDE3E3;
     48background-image: url('../images/quadrille_100.png');*/
     49 /*height:auto;
     50   */
     51}
     52/*
    4953.imageComment{
    50  
     54 background-color: green;
     55background-image: url('../images/quadrille_100.png');
    5156  }
    5257.licencetag {
    53 
     58background-color:blue;
     59background-image: url('../images/quadrille_100.png');
    5460}
    5561
    5662#theMainImage {
    5763
    58 }
     64} */
    5965#imageInfos{
    6066overflow:hidden ;
    61 
     67 
    6268
    6369 }
    64  
     70
    6571#imageInfoBar {
    6672
  • extensions/Autosize/include/affiche.php

    r17309 r17503  
    11<?php 
    2 $visible=(isset($visible))?$visible:false;
    32
     3$visible=(isset($visible))?$visible:false;
    44$cl_version=isset($cl_version)?$cl_version:"";
    55$cl_plugin=isset($cl_plugin)?$cl_plugin:"";
    66$cl_visible=isset($conf['cl_auto']) ? $conf['cl_auto'] :
    7 (isset($_GET['cl_visible'])?$_GET['cl_visible']:'true')
     7(isset($_GET['cl_visible'])?$_GET['cl_visible']:'true');
     8//==============================================================================
     9$DEBUG_autosize = isset($_POST['cl_debug']) ? $_POST['cl_debug'] : "false" ;
     10$DEBUG_autosize = isset($_GET['cl_debug']) ? $_GET['cl_debug'] : $DEBUG_autosize ;
     11$DEBUG_autosize = isset($conf['cl_debug']) ? $conf['cl_debug'] : $DEBUG_autosize ;
     12//===========================================================================
     13$cookies="' x '";
    814
    9  ;
    10 //==============================================================================
    11 $DEBUG_autosize = isset($_POST['cl_debug_conflit']) ? $_POST['cl_debug_conflit'] : "false" ;
    12 $DEBUG_autosize = isset($_GET['cl_debug_conflit']) ? $_GET['cl_debug_conflit'] : $DEBUG_autosize ;
    13 $DEBUG_autosize = isset($conf['cl_debug_conflit']) ? $conf['cl_debug_conflit'] : $DEBUG_autosize ;
    14 //===========================================================================
    15 $cookies="' x '";
    16 
    17 $current = $template->get_template_vars('current');
    18 if (isset($_COOKIE['picture_deriv']))
    19   {
    20   if (isset($_COOKIE['theImageWidth']))
    21   $cookies =  '"'.$_COOKIE['theImageWidth']." x ".  $_COOKIE['theImageHeight'] .'"';
    22 
    23     if ( array_key_exists($_COOKIE['picture_deriv'], ImageStdParams::get_defined_type_map()) )
    24     {
    25       pwg_set_session_var('picture_deriv', $_COOKIE['picture_deriv']);
    26     }
    27     setcookie('picture_deriv', false, 0, cookie_path() );
    28   }
    29   $deriv_type = pwg_get_session_var('picture_deriv', $conf['derivative_default_size']);
    30   $defined_types = array_keys(ImageStdParams::get_defined_type_map()); 
    31 
    32 if (isset($current)){
    33     if (!isset($current['selected_derivative'])){ 
    34       $model= $defined_types[count($defined_types)-1];
    35       $selected_derivative =      $current['derivatives'][$model];
    36        $img_all= $derivative->get_all($derivative->src_image);
    37       $template->append('current', array(
    38       'selected_derivative' => $selected_derivative
    39     ), true);
    40 
    41 
    42     $current = $template->get_template_vars('current');
    43         }
    44          $derivative=$current['selected_derivative'] ;
    45           $imgScaledWH=$derivative->src_image->get_size();
    46           $imgSizeWH  =  $derivative->get_size();       
    47           $img_type  =  $derivative->get_type();       
    48           $img_url  = $derivative->get_url();
    49           $img_all= $derivative->get_all($derivative->src_image);
    50           $scaled_size=$derivative->get_size_hr(); //792 x 441
    51           $scaled_size=$derivative->get_scaled_size_htm(); // width="792" height="441"
    52          //================= taille mis a l'échelle
    53           $scaled_size=$derivative->get_scaled_size(100,100); // array([0]=>100,[1]=>55)
    54           $src= $derivative->src_image ;
    55        
    56     }
    57  
    5815$img_width=isset($imgScaledWH)?$imgSizeWH[0]:"480";
    5916$img_height=isset($imgScaledWH)?$imgSizeWH[1]:"320";
     
    6118$img_scaled_width=isset($imgScaledWH)?$imgScaledWH[0]:"480";
    6219$img_scaled_height=isset($imgScaledWH)?$imgScaledWH[1]:"320";
    63 
    64 
    6520 
    6621$src_img_h=isset($_POST['src_img_h'])?$_POST['src_img_h']: $img_height  ;
    6722$src_img_w= isset($_POST['src_img_w'])?$_POST['src_img_w']:  $img_width ;
     23 
     24$window_height= isset($_SESSION['windowHeight'])?$_SESSION['windowHeight']: $img_scaled_height ;
     25$window_width= isset($_SESSION['windowWidth'])?$_SESSION['windowWidth']: $img_scaled_width    ;
    6826
    69 $window_height= isset($_POST['window_height'])?$_POST['window_height']: $img_scaled_height ;
    70 $window_width= isset($_POST['window_width'])?$_POST['window_width']: $img_scaled_width    ;
    7127global $size ;
    7228$size=  array(
     
    7632            'window_width' => $window_width
    7733          );
    78 
     34       
    7935  $my_path = AUTOSIZE_PATH_ABS;
    8036  $theme=$user['theme'];
     37
     38
    8139  $user_status = $user['status'] ;
    8240
     
    8846                                                                        );     
    8947if (!isset($conf['prefix_thumbnail'])) $conf['prefix_thumbnail']="TN_";   
     48//======================================================   
     49
     50//=== type possible ===
     51if(isset($defined_types))
     52    foreach ($defined_types as $type_size){
     53      $value = $type_size;
     54      $options[$value] = $type_size;   
     55    } 
     56
     57 //===========================================
     58        $template->assign(
     59                                        array( 
     60            'select_type' =>$select_type,
     61            'select_map' =>$select_type,
     62
     63            'pictureDeriv' =>$pictureDeriv ,
     64
     65            'maxi_img' =>$maxi_img ,
     66            'ratio' =>$img_scaled_width/$img_scaled_height ,         
    9067
    9168
    92 //======================================================   
    93 
    94 $options['Autosize'] = ''.l10n('Autosize').'';
    95 foreach ($defined_types as $type_size){
    96   $value = $type_size;
    97   $options[$value] = $type_size;   
    98 
    99 //===================
    100 $value=0;
    101 $liste_type="";
    102 if(isset($img_all ))
    103 foreach ($img_all as $img_select){
    104           $imgSizeWH  =  $img_select->get_size();       
    105           $img_type  =  $img_select->get_type();       
    106           $img_url  = $img_select->get_url(); 
    107 
    108           $liste_type .= $img_type.",".$img_url.",".$imgSizeWH[0] .",".$imgSizeWH[1]."|" ;
    109           if(strtolower($img_type)=="original") break ;
    110 
    111 
    112 
    113 
    114 //===================================     
    115        
    116         $template->assign(
    117                                         array(
    118             'ratio' =>$img_scaled_width/$img_scaled_height ,
    119             'cookies' =>  $cookies ,
    120             'deriv_type' =>$deriv_type ,
    121             'liste_type' => $liste_type ,
    12269            'webmaster_type' => array(
    12370                                            'OPTIONS' => $options,
     
    15097
    15198            'theme' => $theme,
     99
     100            'windowHeight' => $window_height,
     101            'windowWidth' =>  $window_width,
     102
    152103            'SCALED_WIDTH' => $img_scaled_width,
    153104            'SCALED_HEIGHT' => $img_scaled_height,     
     
    158109            'MINI_HEIGHT' => $autosize_parametres->mini_height,
    159110            'MINI_WIDTH'        => $autosize_parametres->mini_width,
     111
    160112            'MINI_HEIGHT2' => $autosize_parametres->mini_height2,
    161113            'MINI_WIDTH2'       => $autosize_parametres->mini_width2,
     
    176128
    177129            'user_status'   => get_user_status($user_status)  ,
    178 'Size' => $size
    179          
     130            'SRC_IMG' => $SRC_IMG,
     131            'liste_type' => $liste_type ,
     132            'Size' => $size       
    180133                                       
    181134                                 )
  • extensions/Autosize/js/Affiche_script.js

    r17308 r17503  
    1 
    21// problème avec GMaps+diaporama:
    32// corriger   gmaps_pip.class.inc.php ajouter ligne 90 if ( !isset($_GET['slideshow']))
     
    76  *  document ready
    87  ********************************************/
     8
     9
    910  jQuery(document).ready(function (jQuery) {
     11
     12
     13
     14
    1015    var Type_Img;
    1116    var theImg;
     17    var Zone_image;
     18
    1219    /******************************************
    1320    * Save_cookies
    1421    ******************************************/
    1522    Save_cookies = function (parametres) {
    16       if (parametres.typeSave) document.cookie = 'picture_deriv=' + parametres.typeSave + ';path="' + "/" + '" ';
    17       if (parametres.typeSave) jQuery.cookie('picture_deriv', parametres.typeSave, { path: "/" });
    18       if (parametres.pictureMap) jQuery.cookie('picture_map', parametres.pictureMap, { path: "/" });
     23      if (parametres.pictureDeriv) document.cookie = 'picture_deriv=' + parametres.pictureDeriv + ';path="' + "/" + '" ';
     24
     25      if (parametres.pictureDeriv) jQuery.cookie('picture_deriv', parametres.pictureDeriv, { path: "/" });
     26      if (parametres.pictureMap) jQuery.cookie('picture_map', parametres.pictureDeriv, { path: "/" });
    1927      if (parametres.imgSrc) jQuery.cookie('imgSrc', parametres.imgSrc, { path: "/" });
    2028      if (parametres.theMainImageHeight) jQuery.cookie('theMainImageHeight', parametres.theMainImageHeight, { path: "/" });
     
    2331      if (parametres.theImageWidth) jQuery.cookie('theImageWidth', parametres.theImageWidth, { path: "/" });
    2432      if (parametres.windowHeight) jQuery.cookie('windowHeight', parametres.windowHeight, { path: "/" });
    25       if (parametres.windowWidth) jQuery.cookie('windowWidth', parametres.WindowWidth, { path: "/" });
     33      if (parametres.windowWidth) jQuery.cookie('windowWidth', parametres.windowWidth, { path: "/" });
    2634    }
    2735    //____________________ Save_cookies _____________________________
    2836    Get_cookies = function () {
    2937      parametres = {
    30         typeSave: jQuery.cookie('picture_deriv'),
     38        pictureDeriv: jQuery.cookie('picture_deriv'),
    3139        pictureMap: jQuery.cookie('picture_map'),
    3240        imgSrc: jQuery.cookie('imgSrc'),
     
    116124    //====================================
    117125    set_cl = function (Valid) {
    118       if (typeof Valid == "undefined") Valid = options.useMap.match(RegExp("Autosize", "gi")) || false;
     126      if (typeof Valid == "undefined") Valid = options.select_map.match(RegExp("Autosize", "gi")) || false;
    119127      if (typeof options.cl_visible == "undefined") return;
    120128      if (typeof src1 == "undefined") return;
     
    131139      }
    132140
    133       if ((typeof Zone_image != "undefined") && typeof Zone_image.image != "undefined" && Valid) {
     141      if (!Valid) {
     142        Zone_image.image.height = Zone_image.image_init.height;
     143        Zone_image.image.width = Zone_image.image_init.width;
     144        src = src6;
     145      }
     146      if ((typeof Zone_image != "undefined") && typeof Zone_image.image != "undefined") {
     147
    134148        Zone_image.zoom = (Zone_image.image.height / Zone_image.image_init.height);
    135149        zoom_cl = parseInt(100 * Zone_image.zoom);
     
    161175          color_back = jQuery('body').css("color");
    162176        jQuery('#bp_cla span').css({ color: color_back, aling: "center" });
    163         jQuery('#auto_details').text(" (" + Zone_image.image.width + " x " + Zone_image.image.height + ")");
    164 
     177        if (options.src_deriv) {
     178          jQuery('.auto_details').text(" (" + Zone_image.image.width + " x " + Zone_image.image.height + ") " + options.src_deriv);
     179        }
    165180        //===============================================
    166181      } else {
    167182        src = src6;
    168         jQuery('#auto_details').text("");
     183        jQuery('.auto_details').text("");
     184
    169185      }
    170186      bp_scr = jQuery('#bp_img_cla');
     
    195211        return;
    196212      }
    197       nom_map = theImg.useMap.replace("#", "");
     213      if (theImg)
     214        nom_map = theImg.useMap.replace("#", "");
     215      else
     216        nom_map = "Autosize";
    198217      maps = jQuery("map[name='" + nom_map + "']");
    199218      if (maps.length == 0) return;
     
    228247    jQuery(window).load(function () {
    229248      href = location.href;
     249      options.old_theme = options.theme;
     250
    230251      var aff_ok = false;
    231252      if (DEBUG_autosize == "true") {
     
    275296      infos_imageInfos = jQuery(imageInfos_id).infos(true);             // information
    276297      infos_theMainImage = jQuery(theMainImage_id).infos(true);         // Image
    277       if (infos_theMainImage.visible == false) {
    278 
    279       }
     298
    280299      jQuery("#loading").show(0);
    281300
    282301      if (options.check_desc_v) {
     302        info_comments = jQuery("#comments").infos(true);
    283303        infos_Licence = jQuery(".licencetag").infos(true);
    284304        infos_imageComment = jQuery(imageComment_id).infos(true);
    285         h01 = (infos_Licence.general.height);
    286         h02 = (infos_imageComment.general.height);
    287         options.marge_basse += Math.max(h01, h02);
     305        h01 = info_comments.top - infos_theMainImage.bottom;
     306      h02 = infos_imageComment.general.bottom - infos_theMainImage.bottom;
     307        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")))  {
     310   
     311          h01 = infos_Licence.general.bottom-infos_theMainImage.bottom;
     312          options.marge_basse += h01;
     313          options.marge_gauche += 10;
     314          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               
     322              }
     323            }
     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        }
    288338      }
    289339
     
    303353        container: {
    304354          width: infos_theImage.general.width,
    305           height: infos_window.height - (infos_theImage.top)
    306         }
    307       }
     355          height: infos_window.height - (infos_theImage.top),
     356          margesWidth: infos_window.width - infos_theImage.width + (options.marge_droite + options.marge_gauche)
     357        }
     358      }
     359
     360
    308361      if (Type_Img == "pamoorama") {
    309362        jQuery(theMainImage_id).width(Zone_image.container.width);
     363        jQuery(theMainImage_id).height(Zone_image.container.height);
     364        jQuery(theImage_id).width(Zone_image.container.width);
     365        jQuery(theImage_id).height(Zone_image.container.height);
    310366      }
    311367
     
    314370      ***********************************************************/
    315371      jQuery(window).resize(function (event, ui) {
     372        infos_window = jQuery(window).infos();
     373        infos_imageInfos = jQuery("#imageInfos").infos(true);
     374        old_w = infos_theImage.width;
    316375        infos_theImage = jQuery(theImage_id).infos(true);
    317         infos_window = jQuery(window).infos();
     376        if (options.set_sw) {
     377          if (Type_Img == "pamoorama") {
     378            if (options.set_sw == "menuSwitcher") {
     379
     380            } else {
     381              p_width = jQuery(theImage_id).width();
     382            }
     383            if (infos_imageInfos.visible)
     384              p_width = infos_window.width - infos_theImage.left - infos_imageInfos.width - 20;
     385            else
     386              p_width = infos_window.width - infos_theImage.left - 20;
     387            jQuery(theImage_id).width(p_width);
     388            infos_theImage = jQuery(theImage_id).infos(true);
     389
     390
     391          }
     392        }
     393        if ((old_w - infos_theImage.width) != 0) {
     394          Zone_image.container.width = infos_theImage.width;
     395        }
     396
     397
    318398        infos_body = jQuery("body").infos();
    319399        infos_content = jQuery(content_id).infos();
    320400
     401
     402        // imageInfos
     403
     404
     405
    321406        infos_theImageAndInfos = jQuery(theImageAndInfos_id).infos();  // Cadre general
    322         Zone_image.container = { height: infos_window.height - (infos_theImage.top),
    323           width: infos_theImage.width
     407        //=============================================================
     408
     409        Zone_image.container = {
     410          height: infos_window.height - (infos_theImage.top),
     411          width: Zone_image.container.width,
     412          margesWidth: infos_window.width - infos_theImage.width
    324413        };
    325414
    326415        if (options.theme.match(RegExp("simple", "gi"))) {
    327416          jQuery(theMainImage_id).css({ maxWidth: "none" });
    328           Zone_image.container.height = infos_window.height - infos_theImage.top - infos_content.general.marges.height - (infos_theImage.general.marges.height);
    329           //jQuery("#menubar").css("margin-right", "0");
    330417          infos_menubar = jQuery("#menubar").infos(true);
    331418          if (infos_menubar.visible == true) {
     
    335422
    336423        jQuery(theImage_id).height(Zone_image.container.height + 2);
     424
     425        if (DEBUG_autosize == "no") return;
     426
     427        Autosize_resize(true, options);
    337428        jQuery("#loading").hide(fade_in);
    338         if (DEBUG_autosize == "no") return;
    339         Autosize_resize(true, options);
    340 
    341429      });
    342430      //_____________ widow.resize _______________
     
    352440      infos_llgboh2 = jQuery("#llgboh2").infos();
    353441      marges_llgbo = 0;
    354       //==========================================================================================
    355       jQuery("#loading").show(0);
    356       if (DEBUG_autosize != "no")
    357         init_gen();
     442      //==========================================================================================
     443
     444      init_gen();
    358445      jQuery(window).resize();
    359446      jQuery(window).resize();
     447
    360448    });
    361449    //__________________window.onload_________________
     
    370458        if (typeof theMainImage_id != "undefined") {
    371459          infos_window = jQuery(window).infos(true);
    372           infos_theImage = jQuery("#" + infos_theImage.id).infos(true);
    373           infos_theMainImage = jQuery("#" + theMainImage.id).infos(true);
    374           useMap = options.useMap;
    375 
     460          infos_theImage = jQuery(theImage_id).infos(true);
     461          infos_theMainImage = jQuery(theMainImage_id).infos(true);
    376462          Save_cookies({
    377463            pictureMap: cookies.pictureMap,
    378             typeSave: cookies.typeSave,
     464            pictureDeriv: cookies.pictureDeriv,
    379465            windowHeight: infos_window.height,
    380466            windowWidth: infos_window.width,
     
    408494    options = jQuery.extend(Autosize_options, options);
    409495    var defaults = {
    410       useMap: '#Autosize',
    411496      imageAutosizeMargin: 0,
    412497      imageAutosize: false,
     
    417502    options = jQuery.extend(defaults, options);
    418503
    419     options.liste_type = options.liste_type.split("|");
    420     options.liste_type.pop();
     504
    421505    for (i = 0; i < options.liste_type.length; i++) {
    422506      options.liste_type[i] = options.liste_type[i].split(",");
     
    447531    //===================
    448532    var cookies = Get_cookies();
    449     var Zone_image;
     533
     534
    450535    var theMainImage_id = "#theMainImage";
    451536    var theImage_id = "#theImage";
     
    459544    var llgbo_id = "#llgbo0";
    460545    var marges_llgbo = 0;
    461     var type_size = cookies.typeSave; // xxx
     546    var pictureDeriv = cookies.pictureDeriv; // xxx
    462547    var useMap = cookies.pictureMap; // #mapxxx
    463548    var user_status = options.user_status;
    464     var type_size_maxi = eval("options." + user_status + "_type"); //limite taille
     549    var pictureDeriv_maxi = eval("options." + user_status + "_type"); //limite taille
    465550
    466551
     
    471556    //=============================================================
    472557    jQuery("#theMainImage," + theMainImage_id + ",.preload, .next1 , ").load(function (e) {
    473       if (this.complete) {
    474         jQuery("#loading").hide(1000);
    475       }
    476       //_________ theMainImage  ___________
     558      jQuery("#loading").hide(1000);
     559      jQuery(this).removeAttr("width");
     560      jQuery(this).removeAttr("height");
     561      jQuery(this).css({ height: "", width: "" });
    477562
    478563      if (typeof theMainImage_id != "undefined")
    479         if (init_img(this))
     564        if (!init_img(this)) {
    480565          nu_img = 0;
    481     });
     566        }
     567
     568      jQuery('#derivativeSwitchBox .switchCheck').css('visibility', 'hidden');
     569      jQuery('#derivativeChecked' + options.pictureDeriv).css('visibility', 'visible');
     570
     571      jQuery(window).resize();
     572
     573
     574
     575    });
     576    //_________ theMainImage  ___________
    482577
    483578
     
    485580      location.reload();
    486581    });
     582
    487583    var mouseLocation = new Point(-500, -500);
    488     //========================================================
    489     jQuery("#pamoorama").live("on", function (e) {
    490       myPamoorama = window.myPamoorama;
    491     });
    492     jQuery("#pamoorama_inner").live("on", function (e) {
    493       myPamoorama = window.myPamoorama;
    494     });
    495 
    496584    function Point(x, y) {
    497585      this.x = x; this.y = y;
     
    554642    //==========================================================
    555643    jQuery("map area").mouseover(function (e) {
    556       nok = theImg.useMap;
    557       hok = this;
     644      try {
     645        nok = theImg.useMap;
     646        hok = this;
     647      }
     648      catch (r) {
     649
     650      }
    558651    });
    559652
     
    623716
    624717
     718
     719    // Custom Event, ON to turn on a debug.
     720    jQuery('.debug').live('ON', function (e) {
     721
     722      nu_img = jQuery(this).text();
     723      jQuery('.debug').trigger('OFF');
     724      jQuery(this).addClass('debugOn');
     725
     726    });
     727
     728    // On Click = debugs On
     729    jQuery('.debug').live('click', function (e) {
     730      i = jQuery(this).text();
     731      jQuery(this).trigger('ON');
     732    });
     733
     734    // Custom Event, Turn off a debug
     735    jQuery('.debug').live('OFF', function (e) {
     736      jQuery(this).removeClass('debugOn');
     737    });
     738
     739    // on Double Click, remove the debug from the DOM
     740    jQuery('.debug').live('dblclick', function () {
     741      jQuery(this).fadeOut(function () { jQuery(this).remove() });
     742    });
     743
     744    // Add another debug to the DOM
     745    jQuery('#adddebugs').click(function () {
     746      i = jQuery('.debug').length;
     747      jQuery('<div>' + i + '</div>')
     748    .addClass('debug')
     749    .appendTo('#debugsContainer');
     750    });
     751
     752
     753    /*********************************
     754    *
     755    ********************************/
     756    jQuery("#menuSwitcher,#infoSwitcher").click(function (e) {
     757      options.set_sw = this.id;
     758      setTimeout(function () { jQuery(window).resize() }, 10);
     759      setTimeout(function () { jQuery(window).resize() }, 12);
     760      nu_img = 0;
     761    });
     762
     763
     764    //===========================================
     765    // jQuery("#theImageAndInfos").trigger("ON");
     766    //===========================================
     767    jQuery("#theImageAndInfos").live('ON', function (e) {
     768      infos_theImageAndInfos = jQuery("#theImageAndInfos").infos();
     769      //   setTimeout(function () { Autosize_resize(true) }, 100);
     770      nu_img = 0;
     771    }); // fin click #theImageAndInfos ON
     772    jQuery("#theImageAndInfos").resize(function (e) {
     773
     774      nu_img = 0;
     775    });
     776
     777
     778    jQuery("#linkAutosize").click(function (e) {
     779      nu_img = 0;
     780    });
     781    //==================================
     782    //
     783    //===================================
     784    jQuery('#derivativeCheckedAutosize').click(function () {
     785      try {
     786        pathnames = jQuery(this).attr("href").split(":");
     787
     788        //  eval(pathnames[1]);
     789      } catch (e) {
     790        n = false;
     791      }
     792    }); // fin click derivativeCheckedAutosize
     793    //====================================================
     794    jQuery("#derivativeSwitchBox a").click(function () {
     795      theImg = document.getElementById(theMainImage_id.replace("#", ""));
     796      if (theImg) {
     797        pathnames = jQuery(this).attr("href").split(":")[1].toString();
     798        selecteur = pathnames.split(",")[2].replace("')", "").replace("'", "").replace(" ", "");
     799        if (this.name) {
     800          options.select_type = this.name;
     801          options.pictureDeriv = this.name;
     802          options.select_map = this.name;
     803          pathnames = pathnames.replace(selecteur, this.name);
     804        } else {
     805          options.select_type = selecteur;
     806          options.pictureDeriv = selecteur;
     807          options.select_map = selecteur;
     808        }
     809        jQuery("#derivativeSwitchBox span").removeClass("auto_details linkAutosize");
     810        jQuery("#derivativeSwitchBox a").removeClass("auto_details linkAutosize");
     811        if (options.select_type == "Autosize" || options.select_type == "SelMaxi") {
     812          spans = jQuery("#derivativeChecked" + options.select_type).next();
     813          spans.addClass("linkAutosize");
     814          spans.find("span").addClass("auto_details");
     815          jQuery(".auto_details").text("");
     816        }
     817
     818        try {
     819          //      eval(pathnames);
     820          n = true;
     821        } catch (e) {
     822          n = false;
     823        }
     824      }
     825    });
     826    //__________ fin click #derivativeSwitchBox a ____________
     827
     828    jQuery("input").click(function () {
     829      if (this.name.match(RegExp("_enabled", "gi"))) {
     830        sel = "[name*=" + this.name + "]";
     831        obj = jQuery("tr" + sel);
     832
     833        if (this.checked)
     834          obj.css({ backgroundColor: "green", color: "white" });
     835        else
     836          obj.css({ backgroundColor: "red", color: "white" });
     837        return;
     838      }
     839      return;
     840    });
     841    //____________________ set_llgbo _____________________________
     842
     843    //====================================
     844    Autosize_init = function (name, value) {
     845      img_defaut = { height: options.scaled_height, width: options.scaled_width };
     846      img_reelle = { height: options.img_height, width: options.img_width };
     847      img_init = { height: options.img_height, width: options.img_width };  // taille initiale
     848
     849      img_finale = img_init;
     850
     851      useMap = infos_theMainImage.useMap; // #mapmedium
     852
     853      useMap = cookies.pictureMap; // #mapxxx
     854      pictureDeriv = cookies.pictureDeriv; //picturederiv xxx
     855
     856
     857      old_img = cookies.imgSrc;
     858      old_window_height = cookies.windowHeight || jQuery(window).height();
     859      old_window_width = cookies.windowWidth || jQuery(window).width();
     860      old_img_h = cookies.imgHeight;
     861      old_img_w = cookies.imgWidth;
     862      if (infos_theMainImage.visible == true) {
     863        theImg = document.getElementById(theMainImage_id.replace("#", ""));
     864        theImg.useMap = useMap;
     865      }
     866      fade_in = parseInt(options.fade_in || 0);
     867
     868    }
     869    //____________________ Autosize_init _____________________
     870
     871    /***************************
     872    * Autosize_resize
     873    ***************************/
     874    Autosize_resize = function (force, parametres) {
     875      if (Get_dimensions(force, parametres)) {
     876        jQuery(theImageAndInfos_id).css({ height: "auto" });
     877        if (Type_Img == "pamoorama") {
     878          Set_Pamoorama({ width: Zone_image.container.width, height: Zone_image.image.height });
     879          if (nopano)
     880            if (window.myPamoorama.options.autoscrollOnLoad) {
     881              window.myPamoorama.startAnimRight();
     882            }
     883        } else {
     884
     885          jQuery(theMainImage_id).height(Zone_image.image.height);
     886          jQuery(theMainImage_id).width(Zone_image.image.width);
     887        }
     888
     889
     890        set_cl(true);
     891      } else {
     892        jQuery(theImage_id).height(Zone_image.image.height + Zone_image.marges.height);
     893        Set_Pamoorama({ width: Zone_image.container.width, height: Zone_image.image.height });
     894        set_cl(false);
     895
     896      }
     897
     898
     899      Set_llbgo(true);
     900      return true;
     901    };
     902    //_________________Autosize ____________________________________   
     903
     904    /*****************
     905    * changeImgSrc
     906    ******************/
     907    changeImgSrc = function (url, typeSave, typeMap) {
     908      theImg = document.getElementById(theMainImage_id.replace("#", ""));
     909      if (theImg.src) {
     910        theImg.removeAttribute("width");
     911        theImg.removeAttribute("height");
     912        // jQuery(theMainImage_id).eq(0).removeAttr("style");
     913        jQuery('#derivativeSwitchBox .switchCheck').css('visibility', 'hidden');
     914        jQuery('#derivativeChecked' + typeSave).css('visibility', 'visible');
     915        pictureMap = "#map" + typeMap;
     916        theImg.useMap = pictureMap;
     917        src = jQuery(theImg).css("backgroundImage");
     918        if (theImg.src)
     919          if (theImg.src.match(RegExp(url, "gi"))) {
     920            jQuery("#loading").hide(0);
     921          } else {
     922            jQuery("#loading").show(0);
     923          } else {
     924          jQuery("#loading").hide(0);
     925        }
     926        Zone_image.src = theImg.src;
     927        theImg.src = url; // charge Image       
     928        //===================================================
     929        options.pictureDeriv = typeSave;
     930        options.pictureMap = typeMap;
     931        Save_cookies({
     932          pictureDeriv: typeSave,
     933          pictureMap: pictureMap,
     934          imgSrc: url
     935        });
     936        cookies = Get_cookies();
     937      }
     938    }
     939    //__________________ changeImgSrc ______________________
     940
     941    /*****************************
     942    *      pamoorama
     943    ******************************/
     944
     945    jQuery("#pamoorama").bind("on", function () { alert($(this).text()); });
     946    jQuery("#pamoorama").bind("on", function (e) {
     947      myPamoorama = window.myPamoorama;
     948    });
     949    jQuery("#pamoorama_inner").live("on", function (e) {
     950      myPamoorama = window.myPamoorama;
     951    });
    625952    jQuery('#pamoorama').live('ON', function (e) {
    626953      jQuery(jQuery('.debug').get(1)).trigger('ON');
    627       if (typeof Bandeau_bas == "undefined" || Bandeau_bas.width == 0) {
    628 
    629       }
     954      jQuery(window).resize();
    630955    });
    631956
     
    635960    jQuery("#theImage").live('Start_right', function (e) {
    636961      if (typeof Zone_image == "undefined") return
    637       if (nu_img == "") nu_img = 7;
    638       jQuery(jQuery('.debug').get(nu_img)).trigger('ON');
    639962      test_w = window.myPamoorama.autoSlideFx.to;
    640963      test_w = window.myPamoorama.autoScrollFx.to;
     
    646969      nw = (200 * Zone_image.container.width) / window.myPamoorama.imageWidth;
    647970      jQuery("#pamoorama_frame").width(nw);
    648 
    649 
    650 
    651971    });
    652972    //===============================================
     
    664984    });
    665985
    666     // Custom Event, ON to turn on a debug.
    667     jQuery('.debug').live('ON', function (e) {
    668 
    669       nu_img = jQuery(this).text();
    670       jQuery('.debug').trigger('OFF');
    671       jQuery(this).addClass('debugOn');
    672 
    673     });
    674 
    675     // On Click = debugs On
    676     jQuery('.debug').live('click', function (e) {
    677       i = jQuery(this).text();
    678       jQuery(this).trigger('ON');
    679     });
    680 
    681     // Custom Event, Turn off a debug
    682     jQuery('.debug').live('OFF', function (e) {
    683       jQuery(this).removeClass('debugOn');
    684     });
    685 
    686     // on Double Click, remove the debug from the DOM
    687     jQuery('.debug').live('dblclick', function () {
    688       jQuery(this).fadeOut(function () { jQuery(this).remove() });
    689     });
    690 
    691     // Add another debug to the DOM
    692     jQuery('#adddebugs').click(function () {
    693       i = jQuery('.debug').length;
    694       jQuery('<div>' + i + '</div>')
    695           .addClass('debug')
    696           .appendTo('#debugsContainer');
    697     });
    698 
    699 
    700     /*********************************
    701     *
    702     ********************************/
    703     jQuery("#menuSwitcher,#infoSwitcher").click(function (e) {
    704 
    705       setTimeout(function () { jQuery(window).resize() }, 10);
    706       setTimeout(function () { jQuery(window).resize() }, 12);
    707       nu_img = 0;
    708     });
    709 
    710 
    711     //===========================================
    712     // jQuery("#theImageAndInfos").trigger("ON");
    713     //===========================================
    714     jQuery("#theImageAndInfos").live('ON', function (e) {
    715       infos_theImageAndInfos = jQuery("#theImageAndInfos").infos();
    716       //   setTimeout(function () { Autosize_resize(true) }, 100);
    717       nu_img = 0;
    718     }); // fin click #theImageAndInfos ON
    719     jQuery("#theImageAndInfos").resize(function (e) {
    720 
    721       nu_img = 0;
    722     });
    723 
    724 
    725     jQuery("#linkAutosize").click(function (e) {
    726       nu_img = 0;
    727     });
    728     //==================================
    729     //
    730     //===================================
    731     jQuery('#derivativeCheckedAutosize').click(function () {
    732       pathnames = jQuery(this).attr("href").split(":");
    733       try {
    734         eval(pathnames[1]);
    735       } catch (e) {
    736         n = false;
    737       }
    738     }); // fin click derivativeCheckedAutosize
    739     //====================================================
    740     jQuery("#derivativeSwitchBox a").click(function () {
    741       theImg = document.getElementById(theMainImage_id.replace("#", ""));
    742       if (theImg) {
    743         pathnames = jQuery(this).attr("href").split(":");
    744 
    745         try {
    746           eval(pathnames[1]);
    747           n = true;
    748         } catch (e) {
    749           n = false;
    750         }
    751 
    752         infos_theMainImage = jQuery(theMainImage_id).infos();
    753 
    754         theImg.removeAttribute("width");
    755         theImg.removeAttribute("height");
    756 
    757         var nw = "100% x 100%".split("x");
    758         if (jQuery(this).text().match(RegExp("x", "gi"))) {
    759           nw = jQuery(this).text().split("(")[1].split(")")[0];
    760           nw = nw.split("x");
    761           init_img(theImg);
    762           wx = parseInt(nw[0]);
    763           wh = parseInt(wx / Zone_image.image_init.rapport);
    764 
    765           jQuery(theImg).width(wx);
    766           jQuery(theImg).height(wh);
    767           set_cl(useMap == "#Autosize");
    768           Set_llbgo();
    769         }
    770 
    771       }
    772 
    773     });  // fin click #derivativeSwitchBox a
    774 
    775     jQuery("input").click(function () {
    776       if (this.name.match(RegExp("_enabled", "gi"))) {
    777         sel = "[name*=" + this.name + "]";
    778         obj = jQuery("tr" + sel);
    779 
    780         if (this.checked)
    781           obj.css({ backgroundColor: "green", color: "white" });
    782         else
    783           obj.css({ backgroundColor: "red", color: "white" });
    784 
    785         return;
    786       }
    787 
    788 
    789 
    790       return;
    791 
    792 
    793 
    794 
    795     });
    796     //____________________ set_llgbo _____________________________
    797 
    798     //====================================
    799     Autosize_init = function (name, value) {
    800       img_defaut = { height: options.scaled_height, width: options.scaled_width };
    801       img_reelle = { height: options.img_height, width: options.img_width };
    802       img_init = { height: options.img_height, width: options.img_width };  // taille initiale
    803 
    804       img_finale = img_init;
    805 
    806       useMap = infos_theMainImage.useMap; // #mapmedium
    807 
    808       useMap = cookies.pictureMap; // #mapxxx
    809       typeSave = cookies.typeSave; //picturederiv xxx
    810 
    811 
    812       old_img = cookies.imgSrc;
    813       old_window_height = cookies.windowHeight || jQuery(window).height();
    814       old_window_width = cookies.windowWidth || jQuery(window).width();
    815       old_img_h = cookies.imgHeight;
    816       old_img_w = cookies.imgWidth;
    817       if (infos_theMainImage.visible == true) {
    818         theImg = document.getElementById(theMainImage_id.replace("#", ""));
    819         theImg.useMap = useMap;
    820       }
    821       fade_in = parseInt(options.fade_in || 0);
    822 
    823     }
    824     //____________________ Autosize_init _____________________
    825 
    826     /***************************
    827     * Autosize_resize
    828     ***************************/
    829     Autosize_resize = function (force, parametres) {
    830       theImg = document.getElementById(theMainImage_id.replace("#", ""));
    831       if (theImg) {
    832         theImg.removeAttribute("width");
    833         theImg.removeAttribute("height");
    834       }
    835       if (Get_dimensions(force, parametres)) {
    836 
    837         jQuery(theImageAndInfos_id).css({ height: "auto" });
    838         if (Type_Img == "pamoorama") {
    839           Set_Pamoorama({ width: Zone_image.container.width - 5, height: Zone_image.image.height });
    840           if (nopano)
    841             if (window.myPamoorama.options.autoscrollOnLoad) {
    842               window.myPamoorama.startAnimRight();
    843             }
    844         } else {
    845 
    846           jQuery(theMainImage_id).height(Zone_image.image.height);
    847           jQuery(theMainImage_id).width(Zone_image.image.width);
    848         }
    849 
    850 
    851         set_cl(true);
    852       } else {
    853 
    854         Set_Pamoorama({ width: Zone_image.container.width, height: Zone_image.image.height });
    855         set_cl(false);
    856       }
    857 
    858 
    859       Set_llbgo(true);
    860       return true;
    861     };
    862     //_________________Autosize ____________________________________   
    863 
    864 
    865 
    866 
    867 
    868 
    869 
    870 
    871 
    872     /*****************
    873     * changeImgSrc
    874     ******************/
    875     changeImgSrc = function (url, typeSave, useMap) {
    876       theImg = document.getElementById(theMainImage_id.replace("#", ""));
    877       if (theImg) {
    878         theImg.removeAttribute("width");
    879         theImg.removeAttribute("height");
    880         //  theImg.useMap = "#map" + useMap;
    881         jQuery('#derivativeSwitchBox .switchCheck').css('visibility', 'hidden');
    882         jQuery('#derivativeChecked' + useMap.replace("#", "")).css('visibility', 'visible');
    883         options.useMap = useMap;
    884         if (useMap.match("Autosize")) {
    885           pictureMap = "#" + "Autosize";
    886         } else {
    887           pictureMap = "#map" + typeSave;
    888         }
    889         theImg.useMap = pictureMap;
    890         if (theImg.src.match(RegExp(url, "gi"))) {
    891           jQuery("#loading").hide(0);
    892         } else {
    893           jQuery("#loading").show(0);
    894         }
    895         theImg.src = url; // charge Image       
    896         //===================================================
    897         Save_cookies({
    898           typeSave: typeSave,
    899           pictureMap: pictureMap,
    900           imgSrc: url
    901         });
    902         cookies = Get_cookies();
    903       }
    904     }
    905     //__________________ changeImgSrc ______________________
    906 
    907986    /************************************
    908     *
     987    * Wait_pamoorama
    909988    ************************************/
    910989    Wait_pamoorama = function () {
    911990      if (Type_Img != "pamoorama") return;
    912 
    913       // jQuery("#loading").attr("id", "theMainImage");
    914991      tempo = 0;
    915 
    916992      Wait_pamoorama_st = false;
     993
     994
    917995      while (Wait_pamoorama_st == false) {
    918996        Wait_pamoorama_st = Wait_pamoorama_time();
     
    920998      }
    921999      tempo = 0;
    922 
    923       Wait_pamoorama_st = false;
    924       while (Wait_pamoorama_st == false) {
    925         Wait_pamoorama_st = Wait_pamoorama_time();
    926         jQuery.noop()
    927       }
    928 
    929       if (nopano)
     1000      if (nopano) {
    9301001        if (window.myPamoorama.options.autoscrollOnLoad) {
    9311002          window.myPamoorama.startAnimRight();
    932           jQuery.noop()
    933         }
     1003          jQuery.noop();
     1004        }
     1005
     1006      }
    9341007
    9351008    }
     
    9371010
    9381011    Wait_pamoorama_time = function () {
    939 
     1012      if (nopano == true) return true;
    9401013      if (jQuery("#pamoorama").length) {
    9411014        tempo = tempo + 1;
    942 
     1015        jQuery("#loading").show(1000);
    9431016        mypanorama = window.myPamoorama;
    9441017        if (!mypanorama) {
    945           jQuery("#loading").show(5000);
    946           tempo = tempo + 1;
    947           if (tempo > 5000) return true;
    948           nopano = false;
     1018          if (tempo > 500) return true;
    9491019          setTimeout("Wait_pamoorama_time()", 500);
    9501020          return false;
     
    9531023
    9541024        if (mypanorama.skipInit == false) {
    955           if (tempo > 4000) return true;
     1025          if (tempo > 500) return true;
    9561026          setTimeout("Wait_pamoorama_time()", 500);
    9571027          return false;
    9581028        }
    9591029        //=============================================================
    960         infos_pamoorama = jQuery("#pamoorama").infos();
    961         if (Math.abs(infos_pamoorama.height) < 50) {
     1030        if (Math.abs(mypanorama.imageHeight) < 100) {
    9621031          setTimeout("Wait_pamoorama_time()", 500);
    9631032          return false;
     
    9651034
    9661035        nopano = true;
    967         jQuery("#pamoorama").show(1000);
     1036        Zone_image.image_init = { width: mypanorama.imageWidth,
     1037          height: mypanorama.imageHeight
     1038        }
     1039        jQuery("#pamoorama").trigger("ON");
    9681040        return true;
    9691041
     
    10261098        jQuery("#ret_autosize").val(infos_theMainImage.src);
    10271099        if (typeof infos_theImage == "undefined") return;
    1028 
    10291100        jQuery("#ret_autosize").trigger('ON', {
    10301101          width: img_w,
     
    10451116    **********************/
    10461117    init_img = function (theImg) {
     1118      if (theImg.complete == false) {
     1119        return;
     1120      }
    10471121      name_src = theImg.src;
    10481122      img_init = { width: jQuery(theImg).width(), height: jQuery(theImg).height() }
     
    10521126      if (typeof theImg.naturalHeight != "undefined")
    10531127        img_init.height = theImg.naturalHeight;
    1054 
    10551128      img_init.rapport = img_init.width / img_init.height;
    1056 
    1057       if (typeof Zone_image.image == "undefined") Zone_image.image = { height: Zone_image.image_init.height, width: Zone_image.image_init.width }; ;
    1058 
    1059       Zone_image.image_init.height = img_init.height;
    1060       Zone_image.image_init.width = img_init.width;
     1129      if (typeof Zone_image == "undefined") Zone_image = { image: {} };
     1130      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;
     1132      theImg.width = img_init.width;
     1133
     1134      Zone_image.image_init = { height: img_init.height, width: img_init.width, rapport: img_init.rapport };
    10611135      Zone_image.zoom = Zone_image.image_init.height / img_init.height;
    1062       Zone_image.image_init.rapport = img_init.rapport;
    1063       nu_img = 0;
     1136
    10641137      if (typeof Zone_image.src == "undefined") {
    10651138        Zone_image.src = name_src;
    10661139        return false;
    10671140      }
    1068       stx = name_src.match(Zone_image.src);
    1069       sty = infos_theMainImage.src;
     1141      stx = name_src.match(RegExp(Zone_image.src, "gi"));
    10701142      return stx;
    10711143    }
     
    12011273    //
    12021274    //=====================================
     1275    Get_Maxi = function (Maxi_image) {
     1276      var pt = options.liste_type;
     1277      if (pt.length > 0) {
     1278        tw = Maxi_image.width;  // valeur maxi
     1279        th = Maxi_image.height;  // valeur maxi
     1280        n = 0;
     1281        maxi_size = { w: Maxi_image.width, h: Maxi_image.height, idx: -1 };
     1282        mini_size = { w: tw, h: th, idx: 0 };
     1283        size_derive = { w: 0, h: 0 };
     1284        size_encours = { w: tw, h: th };
     1285        //=================================
     1286        jQuery(pt).each(function (i) {
     1287          vn = this;
     1288          size_derive = { w: parseInt(vn[2]), h: parseInt(vn[3]) };
     1289          if (vn[0] != "square" && vn[0] != "thumb" && vn[0] != "SelMaxi" && vn[0] != "Autosize") {
     1290            if (size_derive.h > size_encours.h) {
     1291              if (maxi_size.idx < 0) {
     1292                maxi_size = size_derive;
     1293                maxi_size.idx = n;
     1294                return false
     1295              }
     1296            }
     1297            if (size_derive.h < size_encours.h && size_derive.h > 10) {
     1298              mini_size = size_derive;
     1299              mini_size.idx = n;
     1300            }
     1301          }
     1302          n++;
     1303        });
     1304        n = maxi_size.idx;
     1305        if (n < 0) {
     1306          n = mini_size.idx;
     1307        }
     1308        if (options.select_type.match(RegExp("SelMaxi", "gi"))) {
     1309          n = mini_size.idx;
     1310
     1311        }
     1312        if (options.select_type.match(RegExp("Autosize", "gi"))) {
     1313
     1314        }
     1315        options.src_deriv = pt[n][0];
     1316        return { url: pt[n][1], pictureDeriv: pt[n][0], pictureMap: pt[n][0], width: pt[n][2], height: pt[n][3] };
     1317      }
     1318      return { imgSrc: "", pictureDeriv: "", width: "", height: "" };
     1319    }
     1320    //_______________ Get_Maxi ______
     1321
    12031322    Select_Image = function () {
    12041323      var pt = options.liste_type;
     
    12071326        //===== calcul Image ===
    12081327        Calcul_Image();
    1209         tw = Zone_image.image.width;  // valeur maxi
    1210         th = Zone_image.image.height;  // valeur maxi
    1211         n = 0;
    1212         maxi_size = { w: tw, h: th, idx: -1 };
    1213         mini_size = { w: tw, h: th, idx: 0 };
    1214         size_derive = { w: 0, h: 0 };
    1215         size_encours = { w: tw, h: th };
    1216 
    1217         jQuery(pt).each(function (i) {
    1218           vn = this;
    1219           size_derive = { w: parseInt(vn[2]), h: parseInt(vn[3]) };
    1220           if (size_derive.h > size_encours.h) {
    1221             if (maxi_size.idx < 0) {
    1222               maxi_size = size_derive;
    1223               maxi_size.idx = n + 1;
    1224             }
    1225           }
    1226           if (size_derive.h < size_encours.h) {
    1227             mini_size = size_encours;
    1228             mini_size.idx = n;
    1229           }
    1230 
    1231           n++;
    1232         });
    1233 
    1234 
    1235         // n = n - 1 ;
    1236         n = maxi_size.idx;
    1237 
    1238         if (n > pt.length - 1) n = pt.length - 1; // format le plus grand
    1239         if (n < 0) n = pt.length - 1; // format le plus grand
    1240 
    1241         imgSrc = pt[n][1];
    1242         last_map = pt[n][0];
    1243         //     if (Type_Img == "pamoorama") return;
     1328        IMg = Get_Maxi(Zone_image.image);
     1329        imgSrc = IMg.url;
     1330
     1331        ing_width = IMg.width;
     1332        ing_height = IMg.height;
     1333        if (Type_Img == "pamoorama") return;
     1334        if (options.select_type != "SelMaxi" && options.select_type != "Autosize") return;
    12441335        if (typeof Zone_image.src == "undefined") Zone_image.src = " ";
    1245         status = imgSrc.match(RegExp(Zone_image.src, "gi"));
     1336        status = imgSrc.match(RegExp(Zone_image.src, "gi")); // status = '' si ==
    12461337        status1 = (imgSrc.toString() == Zone_image.src.toString());
    12471338
    12481339        if (status1 == true) return;
     1340        href_path = "javascript:changeImgSrc('" + imgSrc + "', '" + options.select_type + "', '" + options.select_type + "')";
     1341        jQuery(".linkAutosize").attr("href", href_path);
    12491342        theImg = document.getElementById(theMainImage_id.replace("#", ""));
    1250         href_path = "javascript:changeImgSrc('" + imgSrc + "', '" + last_map + "', '" + "Autosize" + "')";
    1251         jQuery("#linkAutosize").attr("href", href_path);
     1343
    12521344        if (theImg.tagName != "IMG") {
    1253           theImg.useMap = "#Autosize";
     1345          theImg.useMap = "#map" + options.select_type;
    12541346          imgSrc_i = jQuery(theImg).css("backgroundImage");
    12551347          imgSrc_j = jQuery(theImg).css("background-image");
    12561348
    12571349        } else {
    1258           if (theImg.useMap.match(RegExp("map", "gi"))) return;
    1259           if (theImg.src.match(RegExp(imgSrc, "gi"))) return;
    1260           changeImgSrc(imgSrc, last_map, "#Autosize");
     1350
     1351          // if (!theImg.useMap.match(RegExp("SelMaxi", "gi"))) return;
     1352          //  if (!theImg.useMap.match(RegExp("Autosize", "gi"))) return;
     1353
     1354          changeImgSrc(imgSrc, options.select_type, options.select_type);
    12611355        }
    12621356        return true;
     
    12781372
    12791373    };
    1280 
    1281 
    12821374    /*************************************************
    12831375    * correction pamoorama
    12841376    *************************************************/
    12851377    Set_Pamoorama = function (Format) {
     1378      myPamoorama = window.myPamoorama;
    12861379      if (Type_Img == "pamoorama") {
    1287         if (!Format) return;
    1288 
    1289         myPamoorama = window.myPamoorama;
     1380
    12901381        if (!nopano) {
     1382          theMainImage_Id = "#pamoorama";
    12911383          nopano = false;
    12921384          Wait_pamoorama();
    1293         }
     1385          infos_theMainImage = jQuery(theMainImage_Id).infos();
     1386          //theMainImage_Id = "#pamoorama";
     1387        }
     1388
     1389
    12941390        if (typeof myPamoorama == "undefined") {
    12951391          return;
     
    12971393        //========================================================= 
    12981394        if (!nopano) {
     1395          //theMainImage_Id = "#pamoorama";
    12991396          nopano = false;
    13001397          Wait_pamoorama();
    1301         }
    1302 
    1303         jQuery("#pamoorama").show(1000);
    1304         jQuery("#loading").hide(1000);
    1305 
    1306         Wait_pamoorama();
    1307         window.myPamoorama.stopAnim();
    1308         infos_theMainImage = jQuery("#pamoorama").infos(true);
     1398          infos_theMainImage = jQuery(theMainImage_Id).infos();
     1399          //theMainImage_Id = "#pamoorama";
     1400        }
     1401
     1402
     1403
     1404        infos_pamoorama = jQuery("#pamoorama").infos();
     1405        infos_pamoorama_outter = jQuery("#pamoorama_outter").infos(true);
     1406        infos_pamoorama_inner = jQuery("#pamoorama_inner").infos();
     1407
     1408        infos_pamoorama_frame = jQuery("#pamoorama_frame").infos();
     1409        infos_frame = jQuery(myPamoorama.frame).infos();
     1410
     1411
    13091412        //====================================================
    13101413        jQuery("#pamoorama").css({
     
    13131416          //  height: Zone_Affichage.height + "px" , sinon déclenchement panorama sur la hauteur;
    13141417        });
    1315         //============================================================
    1316         infos_pamoorama = jQuery("#pamoorama").infos(true);
    1317         infos_pamoorama_outter = jQuery("#pamoorama_outter").infos();
    1318         infos_pamoorama_inner = jQuery("#pamoorama_inner").infos();
    1319         infos_pamoorama_footer = jQuery("#pamoorama_footer").infos();
    1320         infos_pamoorama_frame = jQuery("#pamoorama_frame").infos();
    1321 
    1322         infos_frame = jQuery(myPamoorama.frame).infos();
     1418
    13231419        marges_w = infos_pamoorama.general.marges.width;
    13241420        marges_h = infos_pamoorama.general.marges.height;
     1421
     1422        jQuery("#pamoorama_footer").css({
     1423          width: Format.width + "px"
     1424        });
     1425        infos_pamoorama_footer = jQuery("#pamoorama_footer").infos();
    13251426        marges_h += infos_pamoorama_footer.general.height;
     1427
    13261428        jQuery("#pamoorama").css({
    13271429          width: ""
    13281430        });
    13291431
    1330 
    1331         outter_width = Format.width;
    1332         pos = jQuery("#theImage").offset();
    1333         pos.top = infos_pamoorama.top;
    1334         pos.left = infos_pamoorama.left;
    1335         outter_height = Format.height - marges_h;
    1336         /*
    1337         jQuery("#theMainImage").width(outter_width);
    1338         jQuery("#theMainImage").height(outter_height);
    1339         jQuery("#theMainImage").css({ left: pos.left, top: pos.top, margin: "auto", border: "solid 1px red"
    1340 
     1432        outter_height = Format.height;
     1433
     1434        Zoom_pano = (Format.height - marges_h) / Zone_image.image_init.height;
     1435        new_image = { height: Math.ceil(Zone_image.image_init.height * Zoom_pano),
     1436          width: Math.ceil(Zone_image.image_init.width * Zoom_pano)
     1437        }
     1438
     1439        jQuery("#pamoorama_inner").css({
     1440          width: new_image.width + "px", height: new_image.height + "px", "background-size": "100%"
    13411441        });
    13421442
    1343         */
    1344 
    1345         Zoom_pano = outter_height / Format.height;
    1346         new_image = { height: Math.ceil(Format.height * Zoom_pano),
    1347           width: Math.ceil(Format * Zoom_pano)
    1348         }
    1349 
    1350         jQuery("#pamoorama_inner").css({ width: new_image.width, height: new_image.height, "background-size": "100%"
    1351         });
    1352 
    1353         //  jQuery("#pamoorama_inner").width(Zone_image.width_init * Zoom_pano);
    1354         //  jQuery("#pamoorama_inner").height(Zone_image.height_init * Zoom_pano);
    13551443
    13561444
    13571445        //---------- test largeur image
    13581446        new_width = Format.width;
     1447
    13591448        if (new_width > new_image.width) {
    13601449          new_width = new_image.width;
    13611450          jQuery("#pamoorama_outter").css({
    1362             position: 'absolute',
     1451
    13631452            align: "center",
    13641453            margin: "auto"
     
    13671456        outter_width = new_width;
    13681457
    1369 
    1370         //  jQuery("#pamoorama_thumb").width(200 /  Zone_image.zoom);
    1371 
    13721458        jQuery("#pamoorama_outter").css({
    1373 
    13741459          align: 'center',
    13751460          margin: 'auto',
    13761461          width: outter_width + "px",
    1377           height: outter_height + "px"
     1462          height: Format.height - marges_h + "px"
    13781463        });
    13791464        //============= Mise à l'echelle ==================
    1380         jQuery("#pamoorama_footer").css({
    1381           width: Format.width + "px"
    1382         });
    1383 
    13841465        window.myPamoorama.options.width = Math.ceil(Format.width);
    13851466        //==================================================================
    13861467        new_max_left = new_image.width - outter_width;
    1387         //   jQuery(window.myPamoorama.inner).width(Zone_image.width_init* Zoom_pano);
    1388         //    jQuery(window.myPamoorama.inner).height(Zone_image.height_init * Zoom_pano);
    1389 
    13901468        if (!window.myPamoorama.outter) return;
    13911469        window.myPamoorama.outter.scrollTo(new_max_left, 0);
     
    13981476        jQuery("#pamoorama_thumb img").width(200);
    13991477        jQuery("#pamoorama_thumb img").height(nf);
     1478        jQuery("#pamoorama_thumb").css({
     1479          position: "absolute",
     1480          left: (Format.width - 215) + "px"
     1481        });
    14001482        // 200=window.myPamoorama.width
    14011483        // frame = Zone_image.container.width
     
    14041486        jQuery("#pamoorama_frame").width(nw);
    14051487        jQuery("#pamoorama").css({
    1406           width: outter_width, height: "auto"
     1488          width: outter_width + "px", height: Format.height + "px"
    14071489        });
    1408         //        jQuery("#theImage").trigger("Start_right");
    1409         jQuery("#theImage").height(Zone_image.container.height + 1);
    1410 
    1411         jQuery("#theImage").css({
    1412           height: Zone_image.container.height
    1413         });
    1414 
    1415 
    1416         return true
    1417       } // test img
     1490
     1491        //   jQuery("#theImage").css({ margin: "auto" });
     1492        //   jQuery("#theImage").width(Format.width);
     1493
     1494        jQuery("#loading").css("display", "none");
     1495      } // 
    14181496    } // Set_Pamoorama
     1497
    14191498    /*********************************************************/
    14201499
     
    15021581      + Math.ceil(infos_theMainImage.general.marges.height);
    15031582      retrait_img.height += 2;
     1583     
    15041584      //===============================================================
    15051585      retrait_img.width = Math.ceil(infos_theMainImage.general.marges.width); // borderwidth+padding
    15061586      retrait_img.width += Math.ceil(options.marges_llgbo || 0);
    15071587      retrait_img.width += 2;
     1588   
    15081589
    15091590      //================== Limite Format Image =====================
    15101591      container.height_interne = container.height - marge_top - marge_bottom;
    15111592      container.width_interne = container.width - marge_left - marge_right;
     1593
     1594      container.height_interne = Math.max(container.height_interne, Math.ceil(options.mini_height) + retrait_img.height),
     1595      container.width_interne = Math.max(container.width_interne, Math.ceil(options.mini_width) + retrait_img.width)
     1596
     1597
    15121598      image_max = {
    1513         height: container.height_interne - retrait_img.height,
    1514         width: container.width_interne - retrait_img.width
     1599        height: (container.height_interne - retrait_img.height),
     1600        width: (container.width_interne - retrait_img.width)
    15151601      }
    15161602      //=========================
     
    15211607
    15221608      if (Type_Img == "pamoorama") {
    1523 
     1609        if (height_theMainImage > container.height_interne) {
     1610
     1611        }
    15241612      } else {
    15251613
    15261614        height_theMainImage = Math.ceil(width_theMainImage / Zone_image.image_init.rapport);
     1615
     1616
    15271617
    15281618        if (height_theMainImage > container.height_interne) {
     
    15441634        }
    15451635
     1636
     1637
     1638
    15461639      }
    15471640      //================================================================
    15481641      Zone_image.image = {
    15491642        width: width_theMainImage,
    1550         height: height_theMainImage
     1643        height: height_theMainImage,
     1644        rapport: width_theMainImage / height_theMainImage
    15511645      };
    15521646
     
    15691663        Zone_image.src = infos_theMainImage.src;
    15701664      }
    1571 
    1572 
    1573       if (typeof Zone_image.image_init.rapport == "undefined") return;
    1574       if (force && force == true) old_window.width = 0;
    1575 
    1576 
    1577       if (infos_theMainImage.useMap.match(RegExp("Autosize", "gi")))
    1578         infos_theMainImage.useMap = "#Autosize";
    1579 
    1580       useMap = options.useMap;
    1581 
    1582 
    1583       if (typeof useMap == "") useMap = "Autosize";
    1584       if (options.useMap) {
    1585         //  useMap = options.useMap;
    1586       }
     1665      if (typeof Zone_image.image_init.rapport == "undefined") {
     1666        Zone_image.image_init.rapport = Zone_image.image_init.width / Zone_image.image_init.height;
     1667      }
     1668      useMap = options.select_type;
     1669
    15871670      if (useMap) {
    15881671        if (!useMap.match(RegExp("Autosize", "gi"))) {
     
    16011684      var chk = eval("options." + user_status + "_enabled");
    16021685      if (chk == "") { return; }
    1603 
    1604       if (!options.useMap.match(RegExp("Autosize", "gi"))) {
    1605 
    1606         return;
    1607       }
    1608 
    16091686      Calcul_Image();
    16101687      jQuery("#loading").hide();
     
    16811758
    16821759        case "pamoorama":
    1683 
     1760          Wait_pamoorama();
    16841761          /*
    1685        
     1762         
    16861763          infos_the_page = jQuery("#the_page").infos();
    16871764          */
     
    16921769
    16931770
    1694       //================= Vérification Taille image minimun autorisée ========
    1695       if ((Zone_image.image.height < options.mini_height) || (Zone_image.image.width < options.mini_width)) {
    1696         Zone_image.image.width = Math.ceil(Zone_image.width_init);
    1697         Zone_image.image.height = Math.ceil(Zone_image.image.width / Zone_image.image_init.rapport);
    1698       }
    16991771
    17001772      //=================================================
     
    17121784      if (Type_Img != "pamoorama") {
    17131785        echelle_max = parseFloat(options.echelle_max, '3');
    1714         if (Zone_image.zoom > 1) {
    1715           Select_Image(); //+calcul
    1716         }
    17171786        if (Zone_image.zoom > echelle_max) {
    17181787          Zone_image.zoom = echelle_max;
    1719           Zone_image.image.width = parseInt(Zone_image.width_init * Zone_image.zoom);
     1788          Zone_image.image.width = parseInt(Zone_image.image_init.width * Zone_image.zoom);
    17201789          if (Zone_image.image_init.rapport > 0)
    1721             Zone_image.image.height = parseInt(Zone_image.width_init / Zone_image.image_init.rapport);
     1790            Zone_image.image.height = parseInt(Zone_image.image_init.width / Zone_image.image_init.rapport);
    17221791        }
    17231792      }
     
    17791848      options.marge_top += infos_theImage.general.marges.top + infos_content.general.marges.top + Math.ceil(options.marge_haute);
    17801849      options.marge_bottom = Math.ceil(options.marge_basse); // +infos_content.general.marges.bottom; ;
    1781 
     1850      if (cookies.pictureDeriv == null)
     1851        options.first = true;
     1852      else
     1853        options.first = false;
    17821854      //=================== Gestion liste photos size ============================
    17831855      us = 0;
    1784       type_size = cookies.typeSave; // xxx
    1785       useMap = cookies.pictureMap; // #mapxxx
    1786 
     1856      if (options.first) {
     1857        IMg = Get_Maxi(Zone_image.image);
     1858        options.src_deriv = IMg.pictureDeriv;
     1859        imgSrc = IMg.url;
     1860        width = IMg.width;
     1861        height = IMg.height;
     1862      }
    17871863      user_status = options.user_status;
    1788       type_size_maxi = eval("options." + user_status + "_type"); //limite taille
    1789       type_size = type_size || type_size_maxi;
     1864      pictureDeriv_maxi = eval("options." + user_status + "_type"); //limite taille
     1865      options.pictureDeriv_maxi = pictureDeriv_maxi;
     1866      pictureDeriv_maxi = options.select_type;
     1867
     1868      //==========================================================
     1869      href_path = "javascript:changeImgSrc('" + options.src_img + "', '" + "SelMaxi" + "', '" + "SelMaxi" + "')";
     1870      spans = jQuery("#derivativeCheckedSelMaxi").next();
     1871      spans.attr("href", href_path);
     1872      spans.attr("name", "SelMaxi");
     1873      spans = spans.find("span");
     1874      spans.attr("name", "SelMaxi");
     1875      spans.text("(" + cookies.theMainImageWidth + " x " + cookies.theMainImageHeight + ")");
     1876      //==========================================================
     1877      href_path = "javascript:changeImgSrc('" + options.src_img + "', '" + "Autosize" + "', '" + "Autosize" + "')";
     1878
     1879      spans = jQuery("#derivativeCheckedAutosize").next();
     1880      spans.attr("href", href_path);
     1881      spans.attr("name", "Autosize");
     1882      spans = spans.find("span");
     1883      spans.attr("name", "Autosize");
     1884      spans.text("(" + cookies.theMainImageWidth + " x " + cookies.theMainImageHeight + ")");
     1885      //==========================================================
     1886
     1887      Zone_image.image.width = cookies.theMainImageWidth;
     1888      Zone_image.image.height = cookies.theMainImageHeight;
     1889
     1890      if (options.select_type == "Autosize" || options.select_type == "SelMaxi") {
     1891        spans = jQuery("#derivativeChecked" + options.select_type).next();
     1892        spans.addClass("linkAutosize");
     1893        spans.find("span").addClass("auto_details");
     1894      }
     1895      pictureDeriv = pictureDeriv || pictureDeriv_maxi;
     1896
     1897      IMg = Get_Maxi(Zone_image.image);
     1898      imgSrc = IMg.url;
     1899
     1900      width = IMg.width;
     1901      height = IMg.height;
     1902
    17901903      n = 0;
    1791 
    17921904      var pt = new Array();
    1793       jQuery("#derivativeSwitchBox .switchCheck").css('visibility', 'hidden');
     1905
     1906
     1907      //uyu = jQuery(uyu + " span");
     1908      //
     1909
     1910      // auto_details
     1911      //==== limite affichage selection = select_type ====
    17941912      jQuery("#derivativeSwitchBox a").css('visibility', 'hidden');
    1795 
    17961913      jQuery("#derivativeSwitchBox a").each(function (i) {
    17971914        href_path = jQuery(this).attr("href");
    17981915        pt[i] = href_path.split("'");
    17991916        tsz = pt[i][5];
     1917
    18001918        jQuery(this).css('visibility', 'visible');
    18011919        //--- recherche limite ---
    1802         if (tsz.match(RegExp(type_size_maxi, "gi"))) {
    1803           return false;
     1920        if (tsz.match(RegExp(pictureDeriv_maxi, "gi"))) {
     1921          if (tsz.match(RegExp(options.select_type, "gi"))) {
     1922            us = n;
     1923          } else {
     1924            return false;
     1925          }
    18041926        }
    18051927        //--- type en cours ---
    1806         if (tsz.match(RegExp("^" + type_size, "gi"))) {
     1928        if (tsz.match(RegExp("^" + pictureDeriv, "gi"))) {
    18071929          us = n;
    18081930        }
     
    18101932        n++;
    18111933      });
    1812 
    1813       jQuery("derivativeChecked" + options.type_size).css('visibility', 'visible');
     1934      jQuery(".switchCheck").css('visibility', 'hidden');
     1935      jQuery("derivativeChecked" + pictureDeriv_maxi).css('visibility', 'visible');
     1936      /*  */
    18141937      //==== en cours ============
    1815       n = pt.length - 1;
    1816       if (n >= 0) {
    1817         imgSrc = pt[n][1];
    1818         last_map = pt[n][5];  // dernière position
    1819         //=======================================
    1820         imgSrc = pt[us][1];
    1821         last_map = pt[us][5]; // taille selectionné.
    1822         href_path = "javascript:changeImgSrc('" + imgSrc + "', '" + last_map + "', '" + "Autosize" + "')";
    1823         new_html = '<br /><span class="switchCheck" id="derivativeCheckedAutosize" style="visibility:visible" >&#x2714; </span>';
    1824         new_html += '<a id="linkAutosize" href="' + href_path + '">';
    1825         new_html += 'Autosize<span class="derivativeSizeDetails" id="auto_details" > - Autosize</span>  </a>';
    1826         if (!type_size.match(RegExp("Autosize", "gi"))) {
    1827           jQuery("#derivativeSwitchBox br:last").before(new_html);
    1828         }
    1829 
    1830         useMap = "#" + type_size_maxi; // #mapxxx
    1831         if (useMap == "#Autosize" && type_size_maxi == "Autosize") {
    1832 
    1833         } else {
    1834           useMap = last_map;
    1835         }
    1836 
    1837         typeSave = cookies.typeSave; //picturederiv xxx
    1838         options.type_size = useMap.replace("#", "");
    1839 
    1840         type_size = options.type_size;
    1841         cookies.pictureMap = "#" + type_size_maxi; // #mapxxx
    1842         cookies.typeSave = type_size_maxi; //picturederiv xxx
    1843         cookies.imgSrc = imgSrc;
    1844         changeImgSrc(imgSrc, last_map, type_size);
    1845       } else {
    1846         type_size_maxi = cookies.pictureMap; // #mapxxx
    1847         type_size_maxi = cookies.typeSave; //picturederiv xxx
    1848         imgSrc = cookies.imgSrc;
    1849         last_map = type_size_maxi;
    1850         href_path = "";
    1851       }
     1938      cookies.pictureMap = pictureDeriv_maxi; // #mapxxx
     1939      cookies.pictureDeriv = pictureDeriv_maxi; //picturederiv xxx
     1940      cookies.imgSrc = imgSrc;
     1941
     1942      changeImgSrc(imgSrc, cookies.pictureDeriv, cookies.pictureMap);
     1943      imgSrc = cookies.imgSrc;
     1944      pictureDeriv = pictureDeriv_maxi;
     1945      href_path = "";
     1946
    18521947    };
    18531948    //_______________________ init_gen _______________________
    18541949
    1855     //============= Gestion Maps ================
    1856     nom_map = "Autosize";
    1857     a_up = jQuery("map[name='" + nom_map + "'] area[rel=up]");
    1858     a_prev = jQuery("map[name='" + nom_map + "'] area[rel=prev]");
    1859     a_next = jQuery("map[name='" + nom_map + "'] area[rel=next]");
    1860     new_html = '<map name="' + nom_map + '" >';
    1861     nb_zone = jQuery("div .navigationButtons a").length;
    1862     Largeur_zone = (jQuery("#theMainImage").width() / nb_zone);
    1863     Hauteur_zone = jQuery("#theMainImage").height();
    1864     init_zone = 0;
    1865     j = 0;
    1866     jQuery("div .navigationButtons a").each(function (e) {
    1867       Hauteur_zone = jQuery("#theMainImage").height();
    1868       title = jQuery(this).attr("title");
    1869       h_ref = jQuery(this).attr("href");
    1870       init_zone = Largeur_zone * j;
    1871       if (title.match(":")) {
    1872         if (j == 0)
    1873           rel = "prev";
    1874         else
    1875           rel = "next";
    1876       } else {
    1877         rel = "up";
    1878         Hauteur_zone = Hauteur_zone / 4;
    1879       }
    1880       coord = init_zone + "," + 0 + "," + Math.ceil(init_zone + Largeur_zone) + "," + Hauteur_zone;
    1881       new_html += '<area rel="' + rel + '" title="' + title + '" href="' + h_ref + '" shape="rect" coords="' + coord + '" alt="' + title + '" />';
    1882 
    1883       j++;
    1884     });
    1885     new_html += '</map>';
    1886     jQuery("#theImage map:last").after(new_html);
    1887    
    1888   });                                                                                                                          // ready
    1889 
     1950    if (typeof changeImgSrc != "function") {
     1951
     1952    }
     1953  });                                                                                                                                                                                                                                       // ready
     1954
     1955
     1956  jQuery("#derivativeSwitchBox a").click(function (e) {
     1957    k1 = 0;
     1958  });
  • extensions/Autosize/js/JScript.js

    r11961 r17503  
    1818  }
    1919  return yWithScroll - innerh;
    20 }
    21 
     20}                   
    2221jQuery(document).ready(function (jQuery) {
    2322  jQuery(window).load(function () {
  • extensions/Autosize/js/autosize.cookie.js

    r17308 r17503  
    1 /**
    2  * Cookie plugin
    3  *
    4  * Copyright (c) 2006 Klaus Hartl (stilbuero.de)
    5  * Dual licensed under the MIT and GPL licenses:
    6  * http://www.opensource.org/licenses/mit-license.php
    7  * http://www.gnu.org/licenses/gpl.html
    8  *
    9  */
    10 
    11 /**
    12  * Create a cookie with the given name and value and other optional parameters.
    13  *
    14  * @example $.cookie('the_cookie', 'the_value');
    15  * @desc Set the value of a cookie.
    16  * @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
    17  * @desc Create a cookie with all available options.
    18  * @example $.cookie('the_cookie', 'the_value');
    19  * @desc Create a session cookie.
    20  * @example $.cookie('the_cookie', null);
    21  * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
    22  *       used when the cookie was set.
    23  *
    24  * @param String name The name of the cookie.
    25  * @param String value The value of the cookie.
    26  * @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
    27  * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
    28  *                             If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
    29  *                             If set to null or omitted, the cookie will be a session cookie and will not be retained
    30  *                             when the the browser exits.
    31  * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
    32  * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
    33  * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
    34  *                        require a secure protocol (like HTTPS).
    35  * @type undefined
    36  *
    37  * @name $.cookie
    38  * @cat Plugins/Cookie
    39  * @author Klaus Hartl/klaus.hartl@stilbuero.de
    40  */
    41 
    42 /**
    43  * Get the value of a cookie with the given name.
    44  *
    45  * @example $.cookie('the_cookie');
    46  * @desc Get the value of a cookie.
    47  *
    48  * @param String name The name of the cookie.
    49  * @return The value of the cookie.
    50  * @type String
    51  *
    52  * @name $.cookie
    53  * @cat Plugins/Cookie
    54  * @author Klaus Hartl/klaus.hartl@stilbuero.de
    55  */
    561jQuery.cookie = function(name, value, options) {
    572    if (typeof value != 'undefined') { // name and value given, set cookie
  • extensions/Autosize/js/autosize.dimensions.js

    r17308 r17503  
    194194
    195195          myposition = "";
    196           width = jQuery(elem).width();
    197           height = jQuery(elem).height();
    198           out_width = width;
    199           out_height = height;
    200           in_width = width; ;
    201           in_height = height;
     196          var myWidth = 0, myHeight = 0;
     197
     198          var xHeight = jQuery(document).height();
     199          var x2Height = jQuery(window).height();
     200
     201          if (typeof (window.innerWidth) == 'number') {
     202            //Non-IE
     203            myWidth = window.innerWidth;
     204            myHeight = window.innerHeight;
     205          } else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
     206            //IE 6+ in 'standards compliant mode'
     207            myWidth = document.documentElement.clientWidth;
     208            myHeight = document.documentElement.clientHeight;
     209          } else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
     210            //IE 4 compatible
     211            myWidth = document.body.clientWidth;
     212            myHeight = document.body.clientHeight;
     213          }
     214
     215          if (myHeight != x2Height) {
     216            width = myWidth;
     217          }
     218
     219          width = myWidth;
     220          height = myHeight;
     221          out_width = myWidth;
     222          out_height = myHeight;
     223          in_width = myWidth; ;
     224          in_height = myHeight;
    202225
    203226        } else {
  • extensions/Autosize/main.inc.php

    r17309 r17503  
    22/*
    33Plugin Name: AutoSize
    4 Version: 2.05
     4Version: 2.06
    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
     
    3434add_event_handler('get_admin_plugin_menu_links', array(&$autosize_controler,'cl_autosize_admin')  );
    3535
    36  add_event_handler('loc_after_page_header', array(&$autosize_controler, 'cl_autosize_script_1'),  EVENT_HANDLER_PRIORITY_NEUTRAL   );   
    3736
    38 add_event_handler('loc_after_page_header', array(&$autosize_controler, 'cl_autosize_affiche'), EVENT_HANDLER_PRIORITY_NEUTRAL+21  );
    39 
    40 add_event_handler('loc_end_page_tail',array(&$autosize_controler, 'cl_autosize_script_3'),  EVENT_HANDLER_PRIORITY_NEUTRAL-1);
     37// init cl_autosize_script_1 cl_autosize_affiche
    4138
    4239
    43 add_event_handler('render_element_content', array(&$autosize_controler, 'autosize_calcContent'),40,2);
     40add_event_handler('render_element_content',  array(&$autosize_controler,'init'),EVENT_HANDLER_PRIORITY_NEUTRAL,2  );
     41
     42//avant pamooramics
     43add_event_handler('render_element_content', array(&$autosize_controler, 'autosize_calcContent'),40,2);
     44
     45add_event_handler('loc_after_page_header', array(&$autosize_controler, 'cl_autosize_script_2'),  EVENT_HANDLER_PRIORITY_NEUTRAL   );
     46
     47add_event_handler('loc_after_page_header', array(&$autosize_controler, 'cl_autosize_script_1'),  EVENT_HANDLER_PRIORITY_NEUTRAL   );
     48
     49add_event_handler('loc_after_page_header',array(&$autosize_controler, 'cl_autosize_script_3'),  EVENT_HANDLER_PRIORITY_NEUTRAL  );
     50
     51add_event_handler('loc_after_page_header', array(&$autosize_controler, 'cl_autosize_affiche'), EVENT_HANDLER_PRIORITY_NEUTRAL +21    );
     52
     53
    4454
    4555?>
  • extensions/Autosize/maintain.inc.php

    r7193 r17503  
    3030{
    3131 global $conf;
    32 
    33   if (!isset($conf['cl_autosize']))
    34   {
    35    
     32  if (!isset($conf['cl_autosize'])){   
    3633  $q = '
    3734    INSERT INTO '.CONFIG_TABLE.' (param, value, comment)
     
    4643
    4744
    48 function plugin_uninstall()
    49 {
     45function plugin_uninstall(){
    5046  global $conf;
    5147  if (isset($conf['cl_autosize']))
     
    6157 }
    6258
     59 function plugin_deactivate(){
     60 global $conf ;
     61 if (isset($conf['cl_derivatives_sav']))  {   
     62    $arr = @unserialize($conf['cl_derivatives_sav']);         
     63      if(isset($arr['d'])){
     64        $query = '
     65                UPDATE '.CONFIG_TABLE.'
     66                  SET value="'.addslashes(serialize($arr)).'"
     67                WHERE param = "derivatives"
     68                LIMIT 1';
     69                          pwg_query($query);
     70
     71        $q = 'DELETE FROM '.CONFIG_TABLE.' WHERE param="cl_derivatives_sav"   ;';
     72     pwg_query($q);
     73       }
     74    }     
     75 }
     76
     77function plugin_activate(){
     78 global $conf ;
     79 if (isset($conf['derivatives']))  {   
     80    $arr = @unserialize($conf['derivatives']); 
     81     if(isset($arr['d'])){
     82       if (!isset($conf['cl_derivatives_sav'])){   
     83            $q = 'INSERT INTO '.CONFIG_TABLE.' (param, value, comment)
     84            VALUES ("cl_derivatives_sav","","derivatives save")
     85            ;';
     86            pwg_query($q);
     87       
     88            $query = '
     89            UPDATE '.CONFIG_TABLE.'
     90              SET value="'.addslashes(serialize($arr)).'"
     91            WHERE param = "cl_derivatives_sav"
     92            LIMIT 1';
     93            pwg_query($query);       
     94 
     95            $arr = @unserialize($conf['derivatives']);
     96            if(!isset($arr['d']['Autosize'])){   
     97                  $arr['d']['SelMaxi']=ImageStdParams::get_custom(9,9);
     98                  $arr['d']['Autosize']=ImageStdParams::get_custom(10, 10); 
     99                  $conf['derivatives']=serialize($arr);
     100                  $arr = @unserialize($conf['derivatives']);       
     101                  $query = '
     102                      UPDATE '.CONFIG_TABLE.'
     103                      SET value="'.addslashes(serialize($arr)).'"
     104                      WHERE param = "derivatives"
     105                      LIMIT 1';
     106                  pwg_query($query);             
     107            }   
     108        }
     109     }
     110   }     
     111 }
     112
    63113?>
  • extensions/Autosize/template/autosize.tpl

    r17308 r17503  
    22{html_head} <!-- autosize/template/autosize.tpl  -->
    33 <script type="text/javascript">
    4  
    54var  Autosize_options={ldelim}
    6    
    7     cookies :{$cookies} ,
    8     deriv_type :'{$deriv_type}' ,
    9     liste_type:'{$liste_type}'   ,
    10 
    11     type_size:'{$deriv_type}' ,
     5        select_type:'{$select_type}',
     6        maxi_img:'{$maxi_img}',       
     7        pictureDeriv :'{$pictureDeriv}' ,
     8        liste_type:new Array()   ,
    129      DEBUG_autosize:'{$DEBUG_autosize}',
    1310     theme:'{$theme}',
     
    2320     img_height : '{ $IMG_HEIGHT }',
    2421
    25      cookie_width:'{$COOKIE_WIDTH }',
    26      cookie_height : '{ $COOKIE_HEIGHT }',
     22     windowWidth:'{$windowWidth }',           
     23     windowHeight : '{ $windowHeight}',
    2724
    2825     marge_basse:'{ $MARGE_BASSE }',
     
    5047     user_status:'{$user_status}',   
    5148     check_auto_w : '{$check_auto_w}',     
    52      check_desc_v :  '{$check_desc_v}'
     49     check_desc_v :  '{$check_desc_v}' ,
     50     Size : new Array()
    5351    } ;
     52     
     53       
     54     {if not empty($liste_type)}   
     55            {foreach from=$liste_type item=cl_size key=value}           
     56         Autosize_options.liste_type.push('{$cl_size}'  )       
     57        {/foreach}
     58     {/if}
     59   
     60
     61     {if not empty($Size )}   
     62            {foreach from=$Size item=cl_size key=value}
     63         Autosize_options.Size.push( {ldelim}'{$value}':{$cl_size}}  )       
     64        {/foreach}
     65     {/if}
     66   
    5467
    5568 </script>
  • extensions/Autosize/template/header.tpl

    r17308 r17503  
     1
    12{if not empty($pamoorama)}
    23{combine_script id="conflit_script"  load="header" path = $AUTOSIZE_PATH|@cat:"js/conflit.js" require="jquery" }
     
    45{combine_script id="autosize.dimensions" path = $AUTOSIZE_PATH|@cat:"js/autosize.dimensions.js" require="jquery"}
    56{combine_script id="conflit_script1" load="footer" path = $AUTOSIZE_PATH|@cat:"js/conflit_2.js" require="jquery" }
     7{else}
    68
    7 {else}
    89{/if}
    910
  • extensions/Autosize/template/picture_1.tpl

    r17308 r17503  
     1
     2{if $select_type=="Autosize" || $select_type=="Selmaxi" }{/if}
    13{combine_script id="Affiche_script" path= $AUTOSIZE_PATH|@cat:"js/Affiche_script.js" require='jquery,autosize.dimensions'  }
     4
     5
    26{if $theme != "elegant"}
    37{combine_script id="autosize.cookie" path = $AUTOSIZE_PATH|@cat:"js/autosize.cookie.js" require="jquery"  }{/if}
Note: See TracChangeset for help on using the changeset viewer.