Changeset 22191


Ignore:
Timestamp:
Apr 13, 2013, 4:53:32 PM (11 years ago)
Author:
cljosse
Message:

[extensions] Autosize update to piwigo 2.5 (fix init)

Location:
extensions/Autosize
Files:
6 edited

Legend:

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

    r22133 r22191  
    3939                global $defined_types,$pictureSelType,$pictureMap ,$pictureDeriv ,$liste_type,$SRC_IMG;
    4040                global $autosize_parametres,$user_status;
    41                 global $infos_message,$error_message;
    4241                //==============================================================================
    43                 global $DEBUG_autosize;
     42                global $DEBUG_autosize,$infos_message,$error_message;
    4443                if(preg_match("|event|", $DEBUG_autosize, $val))  $infos_message =  "autosize_calcContent, " ;
     44                if(!realpath($element_info['path'])) return $content;
     45
    4546                $ma_page=isset($page['body_id'])?$page['body_id']:"" ;
    4647                if ($ma_page !='thePicturePage') return ;
     
    9394        *********************/
    9495        static public function init_3(){
     96                global $DEBUG_autosize,$infos_message,$error_message;
     97                if(preg_match("|event|", $DEBUG_autosize, $val))  $infos_message .=  "init_3, " ;
    9598
    9699        }
     
    98101        {
    99102                global $conf, $template, $page;
     103                global $DEBUG_autosize,$infos_message,$error_message;
     104                if(!realpath($image['path'])) return $content;
     105                if(preg_match("|event|", $DEBUG_autosize, $val))  $infos_message .=  "init_1, " ;
    100106                if(!isset($conf['AS_panorama'])) return $content;
    101                 if(  !is_array($conf['AS_panorama']) ){
    102                         return $content;
    103                 }
     107                if(  !is_array($conf['AS_panorama']) )                  return $content;
    104108                $asp = & $conf['AS_panorama'];
    105109                if(!isset($asp['in_mode_360'])) $asp['in_mode_360']="";
    106110                if(!isset($asp['in_mode_180'])) $asp['in_mode_180']="";
    107 
    108111                if ( !stristr($image['name'], $asp['in_mode_360']) and !stristr($image['name'], $asp['in_mode_180']) ) return $content;
    109 
    110112                $asp['min_viewport_width']=$_COOKIE['windowWidth'] -$_COOKIE['theImageLeft']-$_COOKIE['theImageRight'];
    111113                $asp['viewport_height']=$_COOKIE['windowHeight']-130 ;
    112 
    113114                $asp['start_position']= 10;
    114 
    115115        }
    116116        /*********************/
     
    119119                global $user,$Css,$css_slideshow,$css_display,$liste_type;
    120120                global $has_pamoorama,$pictureSelType,$pictureDeriv,$pictureMap;
    121                 global $infos_message,$warnings_message;
    122 
    123                 global $set_miniature,$imgSizeWH,$DEBUG_autosize;
     121                global $warnings_message;
     122
     123                global $set_miniature,$imgSizeWH;
    124124                global $theImageHeight,$theImageWidth,$theImageLeft,$theImageTop,$windowWidth,$windowHeight,$theMainImageSize;
    125125                //=======================================================
    126                 global $has_pamoorama, $DEBUG_autosize ;
    127 
    128                 if(preg_match("|event|", $DEBUG_autosize, $val)) {
    129                         $infos_message .=  "init, ";
    130                 } ;
     126                global $has_pamoorama  ;
     127                global $DEBUG_autosize,$infos_message,$error_message;
     128                if(!realpath($element_info['path'])) return $content;
     129                if(preg_match("|event|", $DEBUG_autosize, $val))  $infos_message .=  "init, " ;
    131130
    132131                $has_pamoorama = isset($template->files['pamooramics_content'])?"true":"false";
     
    194193                if(preg_match("|test|", $DEBUG_autosize, $val)) {
    195194                        $infos_message .=  "#208 <br>Init:SESSION:"  . cl_print_var($_SESSION) ;
    196                          
     195
    197196                        if ( isset($_COOKIE['pwg_id']) ) unset ($_COOKIE['pwg_id']) ;
    198197                        $infos_message .=  "Init: COOKIE:"  . cl_print_var($_COOKIE) ;
     
    210209                        if(preg_match("|c1|", $DEBUG_autosize, $val)) {
    211210                                echo "<!-- " . $theImageWidth . "x" . $theImageHeight . " " .cl_print_var($content) ." -->";
    212                                 self::Fin_php("#212: " . $DEBUG_autosize);
     211                                self::Fin_php("#211: " . $DEBUG_autosize);
    213212                        }
    214213                        return  $content;
     
    260259        *************************/
    261260        static public function init2($content,$element_info){
    262 
    263 
    264261                global  $template,$version,$icon_path,$page,$picture,$conf;
    265262                global $user,$Css,$css_slideshow,$css_display,$liste_type;
     
    270267                global  $has_pamoorama,$pictureSelType,$pictureDeriv;
    271268                global $DEBUG_autosize;
    272                 if(preg_match("|event|", $DEBUG_autosize, $val)) {
    273                         $infos_message .= "init2, ";
    274                 } ;
     269                if(preg_match("|event|", $DEBUG_autosize, $val)) $infos_message .= "init2, ";
     270                if(!realpath($element_info['path'])) return $content;
    275271                global $theImageHeight,$theImageWidth,$theImageLeft,$theImageTop,$windowWidth,$windowHeight,$theMainImageSize;
    276272                //-- si Autosize correction redim ---------------
     
    307303                echo "left:".$theImageLeft."px;top:".$theImageTop."px;width:".$theImageWidth ."px;height:" .$theImageHeight."px;";
    308304                echo "<div style='position:absolute;left:".$theImageLeft."px;top:".$theImageTop."px;width:".$theImageWidth ."px;height:" .  $theImageHeight."px;background-color:green;'>";
    309                 self::Fin_php("#309 : " . $content + $DEBUG_autosize);
     305                self::Fin_php("#305 : " . $content + $DEBUG_autosize);
    310306
    311307        } //INIT2
     
    320316                global $conf;
    321317                $set_miniature = "<!DOCTYPE html><html><head>
    322                                 <meta http-equiv='content-type' content='text/html; charset=UTF-8'/>
    323                                 <script type='text/javascript' src='themes/default/js/jquery.min.js'></script>
    324                                 <script type='text/javascript' src='plugins/Autosize/js/autosizeDetect.js'></script>
    325                                 <script type='text/javascript' src='plugins/Autosize/js/autosize.cookie.js'></script>
    326                                 <script type='text/javascript' src='themes/default/js/plugins/jquery.ajaxmanager.js'></script>";   $set_miniature .= "<script type='text/javascript' src='plugins/Autosize/js/autosize_ajax.js' id='autosize_ajax' >  </script >";
     318                <meta http-equiv='content-type' content='text/html; charset=UTF-8'/>
     319                <script type='text/javascript' src='themes/default/js/jquery.min.js'></script>
     320                <script type='text/javascript' src='plugins/Autosize/js/autosizeDetect.js'></script>
     321                <script type='text/javascript' src='plugins/Autosize/js/autosize.cookie.js'></script>
     322                <script type='text/javascript' src='themes/default/js/plugins/jquery.ajaxmanager.js'></script>";
     323                $set_miniature .= "<script type='text/javascript' src='plugins/Autosize/js/autosize_ajax.js' id='autosize_ajax' >  </script >";
    327324                $set_var = "<script type='text/javascript'>\n var COOKIE_PATH =  '".cookie_path()."';\n";
    328325                if(preg_match("|noreload|", $DEBUG_autosize, $val)) {
     
    370367                        echo "INIT <pre>";
    371368                        print_r($_COOKIE);
    372                         self::Fin_php("#372:  No COOKIE['picture_deriv'] ".$DEBUG_autosize);
     369                        self::Fin_php("#369:  No COOKIE['picture_deriv'] ".$DEBUG_autosize);
    373370                }
    374371
     
    380377                        echo "GET:"  . cl_print_var($_GET) ;
    381378                        echo "POST:"  . cl_print_var($_POST) ;
    382                         self::Fin_php("#382: ".$DEBUG_autosize);
     379                        self::Fin_php("#379: ".$DEBUG_autosize);
    383380                }
    384381
     
    391388                echo $autoscript;
    392389                if (!isset($_COOKIE['autosize_reload'])  ){
    393                         self::Fin_php("#393:  Initialisation ".$DEBUG_autosize);
    394                 }
    395                 //
    396                  
     390                        self::Fin_php("#390:  Initialisation ".$DEBUG_autosize);
     391                }                       
    397392        }
    398393
     
    452447                );
    453448                if( preg_match("|c2|", $DEBUG_autosize, $val) ){
    454                         self::Fin_php( "454: " . $DEBUG_autosize);
     449                        self::Fin_php( "449: " . $DEBUG_autosize);
    455450                        return $content ;
    456451
     
    517512                if ($ma_page !='thePicturePage') return ;
    518513
    519                  
     514                       
    520515                $template->func_combine_script(array('id'=>'my_script_2',
    521516                                'path'=> AUTOSIZE_PATH.'js/JScript.js',
     
    540535                $template->append('footer_elements',$autoscript);
    541536
    542                  
     537                       
    543538                return ;
    544539        }// function cl_autosize_script_3
     
    578573                                if(count($set_miniatures)> 1 )
    579574                                        $infos_message .= "PictureDeriv:" . $pictureDeriv. ' miniature:' . cl_print_var( $set_miniature);
    580                                  
     575                                       
    581576                        }else {
    582577
     
    664659                        $template->parse('mes_script');
    665660                }
    666                  
     661                       
    667662
    668663                if(preg_match("|vue_cookies|", $DEBUG_autosize, $val)) {
     
    679674                        $infos_message .= "<br />SelType:" . $pictureSelType."; pictureDeriv:".$pictureDeriv ."; pictureMap:".$pictureMap;
    680675
    681                         self::Fin_php("#681: ".$DEBUG_autosize);
     676                        self::Fin_php("#676: ".$DEBUG_autosize);
    682677                }
    683678                cl_aff_infos_plus();
     
    847842                }
    848843
    849                  
     844                       
    850845                return $css;
    851846        }
     
    872867                                $i++;
    873868                        }
    874                          
     869
    875870                }
    876871                ;
     
    920915                        if(file_exists(PHPWG_ROOT_PATH.$img_url)){
    921916                        } // if file
    922                          
     917
    923918                        if ($theImage_def==0){
    924919                                // Avant Autosize ou Original;
     
    976971                                else
    977972                                        $maxi_image = $img_select;
    978                                  
     973                                       
    979974                                $maxi_image->url  =  $maxi_image->get_path();
    980975
     
    986981                                $mini_image->url  =  $mini_image->get_path();
    987982                        }
    988                          
     983
    989984                } // for
    990985                //================================================
     
    993988                $imgSizeWH  =  $img_select->src_image->get_size();
    994989                $liste_type["Original"]="Original".",".$img_url.",".$imgSizeWH[0] .",".$imgSizeWH[1] ;
    995                  
     990                       
    996991
    997992                $retour=(object)'' ;
     
    10631058                        if(!file_exists(PHPWG_ROOT_PATH.$img_url)){
    10641059                                $img_type  =  $img_select->get_type();
    1065                                  
     1060                                       
    10661061                                $file_id=explode("?",$img_url);
    10671062                                if(count($file_id) ==1){
     
    10761071                                        array_push($nofiles,serialize($file_no)) ;
    10771072                                        if( $img_type == $pictureDeriv){
    1078                                                  
     1073                                                       
    10791074                                                break ;
    10801075                                        }
     
    11201115        ****************************/
    11211116        static public  function  get_cookies(){
    1122                 global $pictureDeriv,$pictureSelType,$pictureDeriv,$pictureMap;
     1117                global $pictureDeriv,$pictureSelType,$pictureDeriv,$pictureMap,$DEBUG_autosize;
    11231118                if(!isset($_COOKIE['picture_deriv'])){
    11241119                        $pictureDeriv= pwg_get_session_var('picture_deriv');
     
    11331128                $_COOKIE['picture_deriv']=$pictureDeriv;
    11341129                $_COOKIE['picture_map']=$pictureMap;
    1135                 //================================================================
    1136                 global $DEBUG_autosize;
    1137                 if( isset($_GET['cl_debug']) && $_GET['cl_debug'] =='false') {
    1138                         $DEBUG_autosize="";
    1139                 }else{
    1140                         $DEBUG_autosize = isset($_POST['cl_debug']) ? $_POST['cl_debug'] : "" ;
    1141                         $DEBUG_autosize = isset($_GET['cl_debug']) ? $_GET['cl_debug'] :  $DEBUG_autosize ;
    1142                         $DEBUG_autosize = isset($conf['cl_debug']) ? $conf['cl_debug']."," . $DEBUG_autosize : $DEBUG_autosize ;
    1143                         //===============================================================
    1144                 }
    11451130                if(!isset($_COOKIE['picture_deriv'] )){
    11461131                        if(preg_match("|test_1|", $DEBUG_autosize, $val)) {
    11471132                                $infos_message .= "not COOKIE['picture_deriv'] -> reload(): <br>";
    1148                                 self::Fin_php("#1148 autosize_calcContent:" . $DEBUG_autosize );
     1133                                self::Fin_php("#1133 autosize_calcContent:" . $DEBUG_autosize );
    11491134                        }
    11501135                        unset($_COOKIE['autosize_reload']);
     
    11531138                        if(preg_match("|test_2|", $DEBUG_autosize, $val)) {
    11541139                                $infos_message .= "not COOKIE['autosize_reload'] -> reload(): <br>";
    1155                                 self::Fin_php("#1155 autosize_calcContent:" . $DEBUG_autosize);
    1156                         }
    1157                         self::reload("#1157");
     1140                                self::Fin_php("#1140 autosize_calcContent:" . $DEBUG_autosize);
     1141                        }
     1142                        self::reload("#1142");
    11581143                }
    11591144        }
  • extensions/Autosize/js/Affiche_script.js

    r22133 r22191  
    33//============================================================== 
    44  jQuery.Affiche_script = { version: '2.0.0' };
    5   /********************************************
    6   * document ready
    7   ********************************************/
     5  /***************************************************************************
     6         * document ready
     7         **************************************************************************/
    88  jQuery(document).ready(function (jQuery) {
    9     var Type_Img;
    10     var theImg;
    11     var Zone_image;
    12 
    13     /******************************************
     9    var Type_Img = "";
     10    var theImg = "";
     11    var Zone_image = "";
     12    var OptionsCookie = jQuery.extend({}, { path: '/', expires: 1 });
     13
     14    /***************************************************************************
    1415    * test_theme("mont,pur") ...
    15     ******************************************/
    16 
     16    **************************************************************************/
    1717    test_theme = function (param) {
    1818      if (!param) return
    1919      if (!options.theme) return;
    20 
    2120      regx = new RegExp(param, "gi");
    22       return (options.theme.match(regx))
    23 
    24     }
    25     /******************************************
     21      return (options.theme.match(regx));
     22    };
     23    /***************************************************************************
    2624    * Save_cookies
    27     ******************************************/
     25    **************************************************************************/
    2826    Save_cookies = function (parametres) {
    2927      parametres.windowHeight = jQuery(window).height();
    3028      parametres.windowWidth = jQuery(window).width();
    3129      try {
    32         if (parametres.pictureDeriv) jQuery.cookie('picture_deriv', parametres.pictureDeriv, { path: COOKIE_PATH });
    33         if (parametres.pictureSelType) jQuery.cookie('picture_sel_type', parametres.pictureSelType, { path: COOKIE_PATH });
    34         if (parametres.pictureMap) jQuery.cookie('picture_map', parametres.pictureMap, { path: COOKIE_PATH });
    35         if (parametres.imgSrc) jQuery.cookie('img_src', parametres.imgSrc, { path: COOKIE_PATH });
    36         if (parametres.theMainImageHeight) jQuery.cookie('theMainImageHeight', parametres.theMainImageHeight, { path: COOKIE_PATH });
    37         if (parametres.theMainImageWidth) jQuery.cookie('theMainImageWidth', parametres.theMainImageWidth, { path: COOKIE_PATH });
    38         if (parametres.theImageHeight) jQuery.cookie('theImageHeight', parametres.theImageHeight, { path: COOKIE_PATH });
    39         if (parametres.theImageWidth) jQuery.cookie('theImageWidth', parametres.theImageWidth, { path: COOKIE_PATH });
    40         if (parametres.windowHeight) jQuery.cookie('windowHeight', parametres.windowHeight, { path: COOKIE_PATH });
    41         if (parametres.windowWidth) jQuery.cookie('windowWidth', parametres.windowWidth, { path: COOKIE_PATH });
    42         if (parametres.theImageTop) jQuery.cookie('theImageTop', parametres.theImageTop, { path: COOKIE_PATH });
    43         if (parametres.theImageLeft) jQuery.cookie('theImageLeft', parametres.theImageLeft, { path: COOKIE_PATH });
    44         if (parametres.theImageRight) jQuery.cookie('theImageRight', parametres.theImageRight, { path: COOKIE_PATH });
    45         if (parametres.theImageBottom) jQuery.cookie('theImageBottom', parametres.theImageBottom, { path: COOKIE_PATH });
     30        if (parametres.pictureDeriv) jQuery.cookie('picture_deriv', parametres.pictureDeriv, OptionsCookie);
     31        if (parametres.pictureSelType) jQuery.cookie('picture_sel_type', parametres.pictureSelType, OptionsCookie);
     32        if (parametres.pictureMap) jQuery.cookie('picture_map', parametres.pictureMap, OptionsCookie);
     33        if (parametres.imgSrc) jQuery.cookie('img_src', parametres.imgSrc, OptionsCookie);
     34        if (parametres.theMainImageHeight) jQuery.cookie('theMainImageHeight', parametres.theMainImageHeight, OptionsCookie);
     35        if (parametres.theMainImageWidth) jQuery.cookie('theMainImageWidth', parametres.theMainImageWidth, OptionsCookie);
     36        if (parametres.theImageHeight) jQuery.cookie('theImageHeight', parametres.theImageHeight, OptionsCookie);
     37        if (parametres.theImageWidth) jQuery.cookie('theImageWidth', parametres.theImageWidth, OptionsCookie);
     38        if (parametres.windowHeight) jQuery.cookie('windowHeight', parametres.windowHeight, OptionsCookie);
     39        if (parametres.windowWidth) jQuery.cookie('windowWidth', parametres.windowWidth, OptionsCookie);
     40        if (parametres.theImageTop) jQuery.cookie('theImageTop', parametres.theImageTop, OptionsCookie);
     41        if (parametres.theImageLeft) jQuery.cookie('theImageLeft', parametres.theImageLeft, OptionsCookie);
     42        if (parametres.theImageRight) jQuery.cookie('theImageRight', parametres.theImageRight, OptionsCookie);
     43        if (parametres.theImageBottom) jQuery.cookie('theImageBottom', parametres.theImageBottom, OptionsCookie);
    4644        if (parametres.theImageMargeZone) {
    47           jQuery.cookie('theImageMargeWidth', parametres.theImageMargeZone.width, { path: COOKIE_PATH });
    48           jQuery.cookie('theImageMargeHeight', parametres.theImageMargeZone.height, { path: COOKIE_PATH });
     45          jQuery.cookie('theImageMargeWidth', parametres.theImageMargeZone.width, OptionsCookie);
     46          jQuery.cookie('theImageMargeHeight', parametres.theImageMargeZone.height, OptionsCookie);
    4947        }
    5048      } catch (e) {
    5149        n = 1;
    52       }
    53 
    54 
    55     }
    56     //____________________ Save_cookies _____________________________
    57     /************************************************
    58     *  Get COOKIE
    59     *************************************************/
     50      };
     51    };
     52    // ____________________ Save_cookies _____________________________
     53    /***************************************************************************
     54    * Get COOKIE
     55    **************************************************************************/
    6056    Get_cookies = function () {
    6157      parametres = {
     
    8278
    8379
    84       }
     80      };
    8581      return parametres;
    86     }
    87     //____________________ Get_cookies _____________________________
    88 
    89 
    90 
    91     /*************************************************
     82    };
     83    // ____________________ Get_cookies _____________________________
     84    /***************************************************************************
    9285    * Recupère le Type d'mage
    93     *************************************************/
     86    **************************************************************************/
    9487    Get_type_img = function (e) {
    95       //====== détection du type d'images ======
    96 
     88      // ====== détection du type d'images ======
    9789      if (jQuery("#charlie").length > 0) {
    9890        Type_Img = "charlie";
     
    10395        Type_Img = "pamoorama";
    10496        options.valide = true;
    105 
    10697        infos_pamoorama = jQuery("#pamoorama").infos({ absolute: true });
    10798
     
    127118        frm1 = jQuery("#theImage" + " " + type_src).get(0);
    128119        Type_Img = "iframe";
    129         //'fb - xfbml - like - button
     120        // 'fb - xfbml - like - button
    130121        objs = jQuery("#theImage" + " div").get(0);
    131122        if (jQuery(objs).length > 0) {
     
    137128              jQuery(frm1).attr("id", "charlie");
    138129            } else {
    139               //  Type_Img = "img";
     130              // Type_Img = "img";
    140131            }
    141132          }
     
    156147      } else {
    157148        return;
    158       }
    159     }
    160     //____________________ Get_type_img _____________________________
    161 
    162     //====================================
    163     //  set_cl
    164     //====================================
     149      };
     150    };
     151    // ____________________ Get_type_img _____________________________
     152
     153    // ====================================
     154    // set_cl
     155    // ====================================
    165156    set_cl = function (Valid) {
    166 
    167157      if (typeof Valid == "undefined") Valid = options.pictureSelType.match(RegExp("Autosize", "gi")) || false;
    168158      if (typeof options.cl_visible == "undefined") return;
     
    170160      if (options.cl_visible) src = src1;
    171161      else src = src2;
    172 
    173162      if (typeof options.pictureSelType != "undefined" && (options.pictureSelType == "Autosize" || options.pictureSelType == "SelMaxi")) {
    174163        if (options.pictureSelType == "SelMaxi") src = src6;
     
    207196          src_info = "";
    208197          src = src2;
    209         }
     198        };
    210199
    211200        jQuery('#bp_cla').attr('alt', src_info);
     
    216205          rap: jQuery("#theMainImage").width() / jQuery("#theMainImage").height(),
    217206          rap_init: Zone_image.image_init.rapport
    218         }
     207        };
    219208        jQuery('#bp_cla span').text(zoom_cl);
    220209        color_back = jQuery('#imageToolBar').css("backgroundColor");
     
    249238          jQuery('.auto_details').text(" (" + Zone_image.image.width + " x " + Zone_image.image.height + ") " + options.pictureDeriv);
    250239        }
    251         //===============================================
     240        // ===============================================
    252241      } else {
    253242        src = src6;
     
    263252          jQuery('#bp_img_cla').attr('title', src_info);
    264253        }
    265       }
     254      };
    266255      Affiche_limite(pictureSelType_user);
    267     }
    268     //____________________ set_cl _____________________________
    269 
    270     /********************************
     256    };
     257    // ____________________ set_cl _____________________________
     258
     259    /***************************************************************************
    271260    * Set__llbgo
    272     *********************************/
     261    **************************************************************************/
    273262    Set_llbgo = function (Force) {
    274263
     
    315304
    316305      return;
    317     }
    318     //__________ Set_llbgo _______________
     306    };
     307    // __________ Set_llbgo _______________
    319308    var wpng = 0;
    320     /********************************************
    321     *  window LOAD
    322     ********************************************/
     309    /***************************************************************************
     310    * window LOAD
     311    **************************************************************************/
    323312    jQuery(window).load(function () {
    324313      location_href = location.href;
    325       var aff_ok = false;
    326       //=======================================================================
     314      // =======================================================================
    327315      infos_theImage = jQuery(theImage_id).infos({ absolute: true });
    328316      infos_theMainImage = jQuery(theMainImage_id).infos({ absolute: true });
    329       infos_theImageAndInfos = jQuery(theImageAndInfos_id).infos();  // Cadre general
     317      infos_theImageAndInfos = jQuery(theImageAndInfos_id).infos();  // Cadre
     318      // general
    330319      the_mainImage_obj = "theMainImage_obj";
    331320      infos_theMainImage_obj = jQuery("#" + the_mainImage_obj).infos({ absolute: true });
     
    374363        jQuery(theMainImage_id).css({ maxWidth: "none" });
    375364        theImageAndInfos_id = "#content";
    376         infos_theImageAndInfos = jQuery(theImageAndInfos_id).infos();  // Cadre general
     365        infos_theImageAndInfos = jQuery(theImageAndInfos_id).infos();  // Cadre
     366        // general
    377367        infos_theImage.height = infos_window.height - infos_theImage.top;
    378         //  jQuery(theImage_id).height(infos_theImage.height);
     368        // jQuery(theImage_id).height(infos_theImage.height);
    379369
    380370      } else {
    381         infos_theImageAndInfos = jQuery(theImageAndInfos_id).infos();  // Cadre general
     371        infos_theImageAndInfos = jQuery(theImageAndInfos_id).infos();  // Cadre
     372        // general
    382373        if (infos_theImageAndInfos.visible == false)
    383374          theImageAndInfos_id = "#imageContainer";
     
    391382      infos_theImage = jQuery(theImage_id).infos(true);                 // conteneur
    392383      infos_imageInfos = jQuery(imageInfos_id).infos(true);             // information
    393       infos_theMainImage = jQuery(theMainImage_id).infos(true);         // Image 
     384      infos_theMainImage = jQuery(theMainImage_id).infos(true);         // Image
    394385      infos_copyright = jQuery("#copyright").infos(true);
    395386
     
    423414          }
    424415      }
    425 
    426 
    427416      Zone_image = { image_init: {
    428417        width: infos_theMainImage.width,
     
    443432          width: 0
    444433        }
    445       }
    446 
    447 
     434      };
    448435      Zone_image.zoom = (Zone_image.image.height / Zone_image.image_init.height);
    449436
    450 
    451 
    452 
    453       /***********************************************************
    454       *  RESIZE (une fois document chargé)
    455       ***********************************************************/
    456       var new_dim;
     437      /***********************************************************************
     438      * RESIZE (une fois document chargé)
     439      **********************************************************************/
     440
    457441      jQuery(window).resize(function (event, ui) {
    458442        Autosize_resize(true, options);
    459443      });
    460       //_____________ widow.resize _______________
     444      // _____________ widow.resize _______________
    461445
    462446      type_src = "div";
     
    470454      infos_llgboh2 = jQuery("#llgboh2").infos(true);
    471455      marges_llgbo = 0;
    472       //==========================================================================================
     456      // ==========================================================================================
    473457      init_gen();
    474458    });
    475     //__________________window.onload_________________
    476 
    477     /********************************************
    478     *  window unLOAD
    479     ********************************************/
     459    // __________________window.onload_________________
     460
     461    /***************************************************************************
     462    * window unLOAD
     463    **************************************************************************/
    480464    jQuery(window).unload(function () {
    481       //  return;
    482     });
    483     //_________ unload ___________
    484 
    485     //===================
    486     // VARIABLES 
    487 
    488 
    489     //===================
    490     // options 
    491     //=========================================================
     465      // return;
     466    });
     467    // _________ unload ___________
     468
     469    // ===================
     470    // VARIABLES
     471
     472
     473    // ===================
     474    // options
     475    // =========================================================
    492476    if (typeof (options) == "undefined") {
    493       options = { imageAutosize: false }
     477      options = { imageAutosize: false };
    494478    }
    495479    options = jQuery.extend(Autosize_options, options);
     
    508492    jQuery("#the_page").append("<div id='form_autosize_picture' ></div>");
    509493    jQuery("#form_autosize_picture").addClass("Autosize");
    510     //===== marges suplémentaires en fonction theme ===
     494    // ===== marges suplémentaires en fonction theme ===
    511495    options.valide = jQuery(".Autosize").css("display") != "none";
    512496    options.marge_haute = jQuery(".Autosize").Get_Val_int(jQuery("#form_autosize_picture").css("top"));
     
    522506    DEBUG_autosize = options.DEBUG_autosize;
    523507    var COOKIE_PATH = options.COOKIE_PATH;
     508    OptionsCookie = jQuery.extend({}, { path: options.COOKIE_PATH, expires: 1 });
    524509    var cookies = Get_cookies();
    525510
     
    530515    }
    531516    if (test_theme("mont")) {
    532       jQuery("#content").css({ marginLeft: 'auto' }); //monblanc
     517      jQuery("#content").css({ marginLeft: 'auto' }); // monblanc
    533518    }
    534 
    535 
    536519    Get_type_img();
    537 
    538     var infos_theMainImage_obj;
    539520    var theMainImage_id = "#theMainImage";
    540521    var theImage_id = "#theImage";
    541522    var theImageAndInfos_id = "#theImageAndInfos";
    542523    var infos_window = jQuery(window).infos();
    543     var infos_theImageAndInfos = jQuery(theImageAndInfos_id).infos();  // Cadre general
     524    var infos_theImageAndInfos = jQuery(theImageAndInfos_id).infos();  // Cadre
     525    // general
    544526    var infos_content;
    545     var infos_body;
    546527    var infos_the_page = jQuery("#the_page").infos(true);
    547     var nopano;
     528    var nopano = false;
    548529    var llgbo_id = "#llgbo0";
    549     var marges_llgbo = 0;
    550530
    551531    var useMap = options.pictureMap; // #mapxxx
     
    555535
    556536    var pictureDeriv = options.pictureDeriv; // xxx
    557     var pictureSelType_user = eval("options." + user_status + "_type"); //limite taille
     537    var pictureSelType_user = eval("options." + user_status + "_type"); // limite
     538    // taille
    558539
    559540
     
    583564    }
    584565    new_liste = new Array();
    585     for (i = 0; i < options.liste_type.length; i++) {
     566    for (var i = 0; i < options.liste_type.length; i++) {
    586567      liste_types = options.liste_type[i].split(",");
    587568      new_liste.push(options.liste_type[i].split(","));
     
    593574
    594575    // auto_details
    595     //==== limite affichage selection = select_type ====
     576    // ==== limite affichage selection = select_type ====
    596577    var path_names = new Array();
    597578
     
    622603          jQuery(this).remove();
    623604        }
    624         //--- recherche limite ---
     605        // --- recherche limite ---
    625606
    626607        if (!options.valide && (tsz == "Autosize" || tsz == "SelMaxi")) {
     
    639620            old_path = patname;
    640621          path_names.push(patname);
    641 
    642         }
    643         //--- type en cours ---
     622        }
     623        // --- type en cours ---
    644624        if (tsz.match(RegExp("^" + options.pictureDeriv, "gi"))) {
    645625          us = n;
    646626        }
    647 
    648627        n++;
    649628      });
    650     }
    651     //=============================================================
     629    };
     630    // =============================================================
    652631    // REPONSE ACTION
    653     //=============================================================
     632    // =============================================================
    654633    theMainImage_st = false;
    655634    jQuery("#reset").click(function () {
     
    658637
    659638
    660     //===========================================================
    661     //  REPONSE TRIGGER
    662     //===========================================================
     639    // ===========================================================
     640    // REPONSE TRIGGER
     641    // ===========================================================
    663642    jQuery('#ret_autosize').live('ON', function (e) {
    664643      if (nu_img == "") nu_img = 8;
     
    667646    });
    668647
    669     //==========================================================
     648    // ==========================================================
    670649    jQuery("map area").mouseover(function (e) {
    671650      try {
     
    678657    });
    679658
    680     //==================================
     659    // ==================================
    681660    // jQuery("#llgbo").trigger("ON");
    682     //==================================
     661    // ==================================
    683662    jQuery(llgbo_id).live('ON', function (e) {
    684663      n_id = this;
     
    690669        infos_llgboframe1 = jQuery(llgbo_id + " div:last").infos();
    691670        infos_llgboframe31 = jQuery(llgbo_id + "  div:first").infos();
    692         //=============================================
     671        // =============================================
    693672        ll2 = infos_llgboframe1.width; // llgboframe1 interieur
    694         ll1 = infos_llgboframe31.exterieur.width; // llgboframe31 avec border width
     673        ll1 = infos_llgboframe31.exterieur.width; // llgboframe31 avec border
     674        // width
    695675        options.marges_llgbo = (ll1 - ll2);
    696676        infos_llgboh2 = jQuery("#llgboh2").infos();
    697677      }
    698678    });
    699     //==============================
     679    // ==============================
    700680    // jQuery("#mapPicture").trigger("ON");
    701     //==============================
     681    // ==============================
    702682    jQuery("#mapPicture").live('ON', function (e) {
    703683      p2 = jQuery("#infoSwitcher").infos();
    704684    });
    705     //==============================
     685    // ==============================
    706686    // jQuery("#map").trigger("ON");
    707     //==============================
     687    // ==============================
    708688    jQuery("#map").live('ON', function (e) {
    709689      p2 = jQuery("#map").infos();
    710690    });
    711     //===================================
     691    // ===================================
    712692    // jQuery("#theImage").trigger("ON");
    713     //===================================
     693    // ===================================
    714694    jQuery("#imageInfos").live('on', function (e) {
    715695      target = e.target.id;
    716696    });
    717697
    718     //===================================
     698    // ===================================
    719699    // jQuery("#theImage").trigger("ON");
    720     //===================================
     700    // ===================================
    721701    jQuery("#theImage").live('ON', function (e) {
    722702      target = e.target.id;
    723703
    724704      id = this.id;
    725       Select_Image(); //+calcul
    726     });
    727 
    728 
    729 
    730 
    731     //=================================================================
     705      Select_Image(); // +calcul
     706    });
     707
     708
     709
     710
     711    // =================================================================
    732712    jQuery(document).live('gallyInterfaceReady', function (e) {
    733713      i = jQuery(this).text();
     
    738718
    739719
    740     /*********************************
    741     *
    742     ********************************/
    743     var old_width;
    744 
     720    /***************************************************************************
     721    *
     722    **************************************************************************/
    745723    jQuery("#theImage").resize(function (e) {
    746724      nu_img = 0;
    747725    });
    748 
    749 
    750 
    751726    jQuery("#menuSwitcher,#infoSwitcher").click(function (e) {
    752727      options.set_sw = this.id;
    753       setTimeout(function () { div_resize() }, 10);
     728      setTimeout(function () { div_resize(); }, 10);
    754729      nu_img = 0;
    755730    });
     
    758733
    759734      jQuery("#theImage").trigger("resize");
    760       /*
    761       if (jQuery("#theImage").width() != old_width) {
    762       setTimeout(function () { div_resize() }, 10);
    763       }
     735      /*
     736      * if (jQuery("#theImage").width() != old_width) { setTimeout(function () {
     737      * div_resize() }, 10); }
    764738      */
    765     }
    766     //===========================================
     739    };
     740    // ===========================================
    767741    // jQuery("#theImageAndInfos").trigger("ON");
    768     //===========================================
     742    // ===========================================
    769743    jQuery("#theImageAndInfos").live('ON', function (e) {
    770744      infos_theImageAndInfos = jQuery("#theImageAndInfos").infos();
    771       //   setTimeout(function () { Autosize_resize(true) }, 100);
     745      // setTimeout(function () { Autosize_resize(true) }, 100);
    772746      nu_img = 0;
    773747    }); // fin click #theImageAndInfos ON
     
    782756      nu_img = 0;
    783757    });
    784     //==================================
     758    // ==================================
    785759    //
    786     //===================================
     760    // ===================================
    787761    jQuery('#derivativeCheckedAutosize').click(function () {
    788762      try {
    789763        pathnames = jQuery(this).attr("href").split(":");
    790764
    791         //  eval(pathnames[1]);
     765        // eval(pathnames[1]);
    792766      } catch (e) {
    793767        n = false;
    794768      }
    795769    }); // fin click derivativeCheckedAutosize
    796     //====================================================
     770    // ====================================================
    797771    if (typeof decode_href != 'function') {
    798772      function decode_href(myObj) {
     
    819793          pictureMap: pictureMap,
    820794          pictureSelType: pictureSelType
    821         }
     795        };
    822796      }
    823797    }
     
    828802      theImg = document.getElementById(theMainImage_id.replace("#", ""));
    829803      if (theImg) {
    830         // options.pictureDeriv = retour.pictureDeriv;       
     804        // options.pictureDeriv = retour.pictureDeriv;
    831805        if (this.name) {
    832806          options.pictureSelType = this.name;
     
    843817      }
    844818    });
    845     //__________ fin click #derivativeSwitchBox a ____________
     819    // __________ fin click #derivativeSwitchBox a ____________
    846820
    847821    jQuery("input").click(function () {
     
    860834
    861835
    862     //====================================
     836    // ====================================
    863837    Autosize_init = function (name, value) {
    864838      img_defaut = { height: options.scaled_height, width: options.scaled_width };
    865839      img_reelle = { height: options.theImageHeight, width: options.theImageWidth };
    866       img_init = { height: options.theImageHeight, width: options.theImageWidth };  // taille initiale
     840      img_init = { height: options.theImageHeight, width: options.theImageWidth };  // taille
     841      // initiale
    867842
    868843      img_finale = img_init;
     
    871846
    872847      useMap = options.pictureMap; // #mapxxx
    873       pictureDeriv = options.pictureDeriv; //picturederiv xxx
     848      pictureDeriv = options.pictureDeriv; // picturederiv xxx
    874849
    875850
     
    885860      fade_in = parseInt(options.fade_in || 0);
    886861
    887     }
    888     //____________________ Autosize_init _____________________
    889 
    890     /***************************
     862    };
     863    // ____________________ Autosize_init _____________________
     864
     865    /***************************************************************************
    891866    * Autosize_resize
    892     ***************************/
     867    **************************************************************************/
    893868    Autosize_resize = function (force, parametres) {
    894869      if (!force) {
     
    898873        }
    899874      }
    900       nAuto = Get_dimensions(true, options);
    901 
     875      nauto = Get_dimensions(true, options);
     876      if (nauto == "Wait") {
     877        setTimeout(function (force, parametres) { Autosize_resize(force, parametres); }, 100);
     878        return;
     879      }
    902880      Save_cookies(options);
    903       if (!options.valide || nAuto == false || (options.pictureSelType != "Autosize" && options.pictureSelType != "SelMaxi")) {
     881      if (!options.valide || !nauto || (options.pictureSelType != "Autosize" && options.pictureSelType != "SelMaxi")) {
    904882        if (options.imageAutosize == true) {
    905883          options.pictureSelType = options.pictureDeriv;
     
    910888          return;
    911889        }
    912         //  jQuery(theImg).width(Zone_image.image_init.width);
     890        // jQuery(theImg).width(Zone_image.image_init.width);
    913891        jQuery(theImg).height(Zone_image.image_init.height);
    914892        set_cl("no");
     
    924902      }
    925903
    926       //======================================================
     904      // ======================================================
    927905
    928906      affiche_debug({
     
    949927          }
    950928
    951         //jQuery(theMainImage_id).height(Zone_image.image.height);
     929        // jQuery(theMainImage_id).height(Zone_image.image.height);
    952930      } else if (Type_Img == "panorama") {
    953931        // jQuery("#pamoorama").width(img_finale.width);
     
    956934
    957935
    958         //   jQuery("#theImage img.simple_panorama").panorama(asp_options);
     936        // jQuery("#theImage img.simple_panorama").panorama(asp_options);
    959937      } else {
    960938        if (options.imageAutosize == false)
     
    996974            } else
    997975              h01 = Math.ceil(w01 / Zone_image.image.rapport);
    998             //==== Zone Affichage =====
     976            // ==== Zone Affichage =====
    999977            jQuery("#theMainImage").height(png_h);
    1000978            jQuery("#theMainImage").width(w01 + wpng);
     
    1004982            jQuery("#" + the_mainImage_obj).attr("height", h01);
    1005983
    1006             jQuery("#theMainImage_emb").attr("width", w01); //firefox opera
     984            jQuery("#theMainImage_emb").attr("width", w01); // firefox opera
    1007985            jQuery("#theMainImage_emb").attr("height", h01);
    1008986
     
    10341012      return true;
    10351013    };
    1036     //_________________Autosize ____________________________________   
    1037 
    1038     /*****************
    1039     * changeImgSrc 
    1040     ******************/
     1014    // _________________Autosize ____________________________________
     1015
     1016    /***************************************************************************
     1017    * changeImgSrc
     1018    **************************************************************************/
    10411019    changeImgSrc = function (url, typeSave, typeMap, type) {
    10421020      if (type == "Autosize" || type == "SelMaxi") {
     
    10551033      options.pictureMap = typeMap;
    10561034      options.pictureDeriv = typeSave;
    1057       jQuery.cookie('picture_deriv', typeSave, { path: COOKIE_PATH });
     1035      jQuery.cookie('picture_deriv', typeSave, { path: COOKIE_PATH, expires: 1 });
    10581036
    10591037      url_old = jQuery("#theMainImage").attr("src");
     
    10621040      if (typeof type != "undefined" && (type == "Autosize" || type == "SelMaxi")) {
    10631041        jQuery('#derivativeChecked' + type).css('visibility', 'visible');
    1064         jQuery.cookie('picture_sel_type', type, { path: COOKIE_PATH });
     1042        jQuery.cookie('picture_sel_type', type, OptionsCookie);
    10651043      } else {
    10661044
    10671045        jQuery('#derivativeChecked' + typeSave).css('visibility', 'visible');
    1068         jQuery.cookie('picture_sel_type', typeSave, { path: COOKIE_PATH });
     1046        jQuery.cookie('picture_sel_type', typeSave, OptionsCookie);
    10691047      }
    10701048      if (url != url_old) {
    1071         jQuery("#theMainImage").attr("src", url);
    1072       }
    1073       // jQuery("#theMainImage," + theMainImage_id + ",.preload, .next1 , ")
     1049        file_exists(url);
     1050        url_old = url;
     1051      }
    10741052      jQuery("#theMainImage").removeAttr("width height")
    10751053      .load(function (i) {
     
    10771055          return;
    10781056        }
    1079         //=======================================================================   
     1057        // =======================================================================
    10801058
    10811059      })
     
    10831061        imgsrc = this.src;
    10841062        if (!this.complete) {
    1085           // le fichier n'est pas present 
     1063          // le fichier n'est pas present
    10861064          imgsrc = jQuery(this).attr("src");
    10871065          return false;
     
    11291107              if (data.src) { }
    11301108              if (options.pictureDeriv == "Original" && data.src.match(RegExp("\-.." + ".jpg", "gi"))) {
    1131                 //    Autosize_resize(true, options);
     1109                // Autosize_resize(true, options);
    11321110              } else if (data.src.match(RegExp(options.pictureDeriv.substr(0, 2) + ".jpg", "gi"))) {
    1133                 //    Autosize_resize(true, options);
     1111                // Autosize_resize(true, options);
    11341112              } else {
    11351113
     
    11371115
    11381116            });
    1139       //_________ theMainImage ___________
    1140 
    1141     }
    1142 
    1143     //__________________ changeImgSrc ______________________
    1144 
    1145     /*****************************
    1146     *      pamoorama
    1147     ******************************/
     1117      // _________ theMainImage ___________
     1118
     1119    };
     1120
     1121    // __________________ changeImgSrc ______________________
     1122
     1123    /***************************************************************************
     1124    * pamoorama
     1125    **************************************************************************/
    11481126
    11491127
     
    11601138    });
    11611139
    1162     //===============================================
     1140    // ===============================================
    11631141    // jQuery("#theImage").trigger("Start_right");
    1164     //===============================================
     1142    // ===============================================
    11651143    jQuery("#theImage").live('Start_right', function (e) {
    11661144      if (typeof Zone_image == "undefined") return
     
    11701148      jQuery("#pamoorama_thumb img").width(200);
    11711149      jQuery("#pamoorama_thumb img").height(nf);
    1172       // 200=window.myPamoorama.imageWidth 
     1150      // 200=window.myPamoorama.imageWidth
    11731151      // frame = Zone_image.container.width
    11741152      nw = (200 * Zone_image.image.width) / window.myPamoorama.imageWidth;
    11751153      jQuery("#pamoorama_frame").width(nw);
    11761154    });
    1177     //===============================================
     1155    // ===============================================
    11781156    // jQuery("#theImage").trigger("Start_left");
    1179     //===============================================
     1157    // ===============================================
    11801158    jQuery("#theImage").live('Start_left', function (e) {
    11811159      if (typeof Zone_image == "undefined") return
     
    11891167    });
    11901168
    1191     /************************************
     1169    /***************************************************************************
    11921170    * Wait_pamoorama
    1193     ************************************/
     1171    **************************************************************************/
    11941172    Wait_pamoorama = function () {
    11951173      if (Type_Img != "pamoorama") return;
     
    12131191      }
    12141192
    1215     }
    1216     //__________________ Wait_pamoorama ______________________
     1193    };
     1194    // __________________ Wait_pamoorama ______________________
    12171195    jQuery(".pwg-icon-clock-minus, .pwg-icon-clock-plus").click(function (i) {
    12181196
     
    12391217          return false;
    12401218        }
    1241         //=============================================================
     1219        // =============================================================
    12421220        if (Math.abs(mypanorama.imageHeight) < 100) {
    12431221          setTimeout("Wait_pamoorama_time()", 500);
     
    12551233          height: mypanorama.imageHeight
    12561234        }
    1257         }
     1235        };
    12581236        jQuery("#pamoorama").trigger("ON");
    12591237        return true;
    12601238
    12611239      }
    1262     }
    1263     //__________________ Wait_pamoorama time______________________
    1264 
    1265     /**********************
    1266     *
    1267     ***********************/
     1240    };
     1241    // __________________ Wait_pamoorama time______________________
     1242
     1243    /***************************************************************************
     1244    * 
     1245    **************************************************************************/
    12681246    Wait_Affichage = function () {
    12691247      Wait_Affichage_st = false;
     
    12721250        Wait_Affichage_st = Wait_Affichage_time();
    12731251      }
    1274     }
    1275     //__________________ Wait_Affichage ______________________
     1252    };
     1253    // __________________ Wait_Affichage ______________________
    12761254
    12771255
     
    12801258      fade_in = parseInt(fade_in);
    12811259      /*
    1282       if (!Autosize_resize()) {
    1283       setTimeout("Wait_Affichage()", 500);
    1284       return
    1285       } 
    1286       nu_img++;     
     1260      * if (!Autosize_resize()) { setTimeout("Wait_Affichage()", 500); return }
     1261      * nu_img++;
    12871262      */
    12881263      if (typeof fade_in == "undefined") fade_in = 0;
    12891264
    1290       //   if (nu_img > 1) return;
     1265      // if (nu_img > 1) return;
    12911266      if (typeof stb != "undefined")
    12921267        stb.stop().fadeTo(3500, 0);
     
    13021277          return true;
    13031278        }
    1304         //=== attente Image chargée ===
     1279        // === attente Image chargée ===
    13051280        if (tempo > 100) return true;
    13061281        tempo++;
     
    13241299      }
    13251300      return true;
    1326     }
    1327     //______________ Wait_affichage ______
    1328 
    1329 
    1330     /***********************
    1331     *
    1332     **********************/
     1301    };
     1302    // ______________ Wait_affichage ______
     1303
     1304
     1305    /***************************************************************************
     1306    * 
     1307    **************************************************************************/
    13331308    init_img = function (theImg) {
    13341309      if (theImg.complete == false) {
     
    13401315        return false;
    13411316      }
    1342       img_init = { width: jQuery(theImg).width(), height: jQuery(theImg).height() }
     1317      img_init = { width: jQuery(theImg).width(), height: jQuery(theImg).height() };
    13431318
    13441319      if (typeof theImg.naturalWidth != "undefined")
     
    13501325      if (typeof Zone_image.image == "undefined") Zone_image.image = { height: Zone_image.image_init.height, width: Zone_image.image_init.width };
    13511326      // theImg.height = img_init.height;
    1352       //  theImg.width = img_init.width;
     1327      // theImg.width = img_init.width;
    13531328
    13541329      Zone_image.image_init = { height: img_init.height, width: img_init.width, rapport: img_init.rapport };
     
    13611336      stx = name_src.match(RegExp(Zone_image.src, "gi"));
    13621337      return stx;
    1363     }
    1364     //___________ init_img _______
    1365 
    1366 
    1367 
    1368     //===========================================
     1338    };
     1339    // ___________ init_img _______
     1340
     1341
     1342
     1343    // ===========================================
    13691344    //
    1370     //===========================================
     1345    // ===========================================
    13711346    Set_Map = function (nds) {
    13721347      p0 = jQuery("#map").offset();
     
    13791354      jQuery("#map").height(jQuery(window).height() - infos_theImage.top - infos_theImage.general.marges.height);
    13801355      return true;
    1381     }
     1356    };
    13821357
    13831358    jQuery("map [name='#Autosize'] area").mouseover(function (e) {
    13841359      return;
    13851360    });
    1386     //___ Set_Map ___
    1387 
    1388     //=====================================
     1361    // ___ Set_Map ___
     1362
     1363    // =====================================
    13891364    //
    1390     //=====================================
     1365    // =====================================
    13911366    Get_Maxi = function (Maxi_image) {
    13921367      var pt = options.liste_type;
     
    13991374        size_derive = { w: 0, h: 0 };
    14001375        size_encours = { w: tw, h: th };
    1401         //=================================
     1376        // =================================
    14021377        jQuery(pt).each(function (i) {
    14031378          vn = this;
     
    14071382            maxi_size = size_derive;
    14081383            maxi_size.idx = n;
    1409             return false
     1384            return false;
    14101385          }
    14111386
     
    14161391                maxi_size.idx = n;
    14171392                if (options.pictureSelType == "SelMaxi" || options.pictureSelType == "Autosize")
    1418                   return false
     1393                  return false;
    14191394              }
    14201395            }
     
    14591434      }
    14601435      return { imgSrc: "", pictureDeriv: "", width: "", height: "" };
    1461     }
    1462     //_______________ Get_Maxi ______
    1463 
    1464     /********************
    1465     *
    1466     ********************/
     1436    };
     1437    // _______________ Get_Maxi ______
     1438
     1439    /***********************
     1440    * Selection de l'image
     1441    ************************/
    14671442    Select_Image = function () {
    14681443      var pt = options.liste_type;
    1469 
    1470 
    14711444      if (pt.length > 0) {
    1472         //===== calcul Image ===
     1445        // ===== calcul Image ===
    14731446        if (typeof imageInfos_id == "undefined") return;
    1474         Calcul_Image(); // image en cours
     1447        if (Calcul_Image()=="Wait") {   // image en cours           
     1448          return "Wait";
     1449        }
     1450        //==================================================
    14751451        options.theImageMargeZone = Zone_image.marges;
    14761452        if (Type_Img != 'charlie') {
     
    14791455          if (options.imgSrc.match(RegExp(imgSrc, "gi")))
    14801456            options.imgSrc = imgSrc;
    1481           // dimension image 
     1457          // dimension image
    14821458          img_width = IMg.width;
    14831459          img_height = IMg.height;
    1484 
    14851460          Zone_image.image_init = { height: IMg.height,
    14861461            width: IMg.width,
    14871462            rapport: IMg.width / IMg.height
    1488 
    14891463          };
    14901464          if (typeof Zone_image.image == "undefined")
     
    14921466              width: IMg.width,
    14931467              rapport: IMg.width / IMg.height
    1494 
    14951468            };
    14961469        } else {
    1497           return;
     1470          return true;
    14981471        }
    14991472        Zone_image.zoom = Zone_image.image.height / Zone_image.image_init.height;
    1500         if (typeof Zone_image.src == "undefined") Zone_image.src = " ";
     1473        if (typeof Zone_image.src == "undefined")
     1474          Zone_image.src = " ";
     1475        if (typeof Zone_image.name == "undefined")
     1476          Zone_image.name = " ";
     1477        if (typeof Zone_image.path == "undefined")
     1478          Zone_image.path = " ";
    15011479
    15021480        identique = Zone_image.src.match(RegExp(imgSrc.replace("./", ""), "gi"));
    1503         if (identique) return;
     1481        if (identique) return true;
    15041482        href_path = get_href(IMg.pictureDeriv);
    15051483        if (options.pictureSelType == "Autosize" || options.pictureSelType == "SelMaxi") {
     
    15081486        }
    15091487        theImg = document.getElementById(theMainImage_id.replace("#", ""));
    1510 
    15111488        if ((theImg == null) || theImg.tagName != "IMG") {
    15121489          imgSrc_i = jQuery(theImg).css("backgroundImage");
    15131490          imgSrc_j = jQuery(theImg).css("background-image");
    1514           return;
     1491          return true;
    15151492        } else {
    15161493          last_id = IMg.pictureDeriv;
    1517           //    eval(href_path);
     1494          // eval(href_path);
    15181495          changeImgSrc(imgSrc.replace("./", ""), last_id, IMg.pictureMap, options.pictureSelType);
    15191496        }
    1520 
    15211497        theImg.useMap = "#map" + IMg.pictureMap;
    15221498        return true;
    1523 
    1524 
    15251499        theImg = document.getElementById(theMainImage_id.replace("#", ""));
    15261500        if (init_img(theImg)) {
    1527 
    15281501          return true;
    15291502        }
    15301503        return false;
    1531 
    15321504      } else {
    1533 
    1534 
    15351505        return false;
    15361506      }
    15371507
    1538 
    1539     };  //_______________ Select_Image ______
     1508    };  // _______________ Select_Image ______
    15401509
    15411510    get_href = function (NewpictureDeriv) {
     
    15611530    };
    15621531
    1563     /*************************************************
     1532    /***************************************************************************
    15641533    * correction pamoorama
    1565     *************************************************/
    1566 
     1534    **************************************************************************/
    15671535    Set_Pamoorama = function (Format) {
    15681536      myPamoorama = window.myPamoorama;
     
    15741542          Wait_pamoorama();
    15751543          infos_theMainImage = jQuery(theMainImage_Id).infos();
    1576           //theMainImage_Id = "#pamoorama";
     1544          // theMainImage_Id = "#pamoorama";
    15771545        }
    15781546
     
    15811549          return;
    15821550        }
    1583         //========================================================= 
     1551        // =========================================================
    15841552        if (!nopano) {
    1585           //theMainImage_Id = "#pamoorama";
     1553          // theMainImage_Id = "#pamoorama";
    15861554          nopano = false;
    15871555          Wait_pamoorama();
    15881556          infos_theMainImage = jQuery(theMainImage_Id).infos();
    1589           //theMainImage_Id = "#pamoorama";
     1557          // theMainImage_Id = "#pamoorama";
    15901558        }
    15911559
     
    15971565
    15981566
    1599         //====================================================
     1567        // ====================================================
    16001568        marges_w = infos_pamoorama.general.marges.width;
    16011569        marges_h = infos_pamoorama.general.marges.height;
     
    16111579        new_image = { height: Math.ceil(Zone_image.image_init.height * Zoom_pano),
    16121580          width: Math.ceil(Zone_image.image_init.width * Zoom_pano)
    1613         }
     1581        };
    16141582
    16151583        jQuery("#pamoorama_inner").css({
    16161584          width: new_image.width + "px", height: new_image.height + "px", "background-size": "100%"
    16171585        });
    1618         //---------- test largeur image
     1586        // ---------- test largeur image
    16191587        new_width = Format.width - (options.marge_right + options.marge_left);
    16201588
     
    16351603          height: Format.height - marges_h + "px"
    16361604        });
    1637         //============= Mise à l'echelle ==================
     1605        // ============= Mise à l'echelle ==================
    16381606        window.myPamoorama.options.width = Math.ceil(Format.width);
    1639         //==================================================================
     1607        // ==================================================================
    16401608        new_max_left = new_image.width - outter_width;
    16411609        if (!window.myPamoorama.outter) return;
     
    16511619
    16521620        jQuery("#pamoorama_thumb").css({
    1653           /*   position: "absolute", */
     1621          /* position: "absolute", */
    16541622          left: (Format.width - 215) + "px"
    16551623
     
    16581626
    16591627        });
    1660         // 200=window.myPamoorama.width 
     1628        // 200=window.myPamoorama.width
    16611629        // frame = Zone_image.container.width
    16621630
     
    16661634
    16671635      } // 
    1668     } // Set_Pamoorama
    1669 
    1670     /*********************************************************/
     1636    }; // Set_Pamoorama
     1637
     1638    /** ****************************************************** */
    16711639
    16721640    Toggle_bp = function () {
     
    16751643      Wait_Affichage();
    16761644
    1677     }
    1678 
    1679     //====================================
     1645    };
     1646
     1647    // ====================================
    16801648    //
    1681     //====================================
     1649    // ====================================
    16821650    Calcul_Image = function () {
    16831651
    1684       /****************************************/
     1652      /** ************************************* */
    16851653      if (typeof imageInfos_id == "undefined") return;
    16861654      infos_imageInfos = jQuery(imageInfos_id).infos({ absolute: true });             // information
    1687       infos_theMainImage = jQuery(theMainImage_id).infos({ absolute: true });         // Image   
     1655      infos_theMainImage = jQuery(theMainImage_id).infos({ absolute: true });         // Image
    16881656      // commentContent
    1689       // copyright 
     1657      // copyright
    16901658
    16911659      if (options.slideshow) {
     
    16951663
    16961664      }
    1697 
    1698 
     1665      if (typeof Zone_image.name == "undefined") {
     1666        var names = Array();
     1667        names = options.imgSrc.toString().split("/");
     1668        names = names[names.length - 1].split("-");
     1669        names = names[0].split(".");
     1670        Zone_image.name = names[0];
     1671      }
     1672
     1673      if (Type_Img == "img") {
     1674        Zone_image.src = jQuery(theMainImage_id).attr("src");
     1675        if (Zone_image.src.match(RegExp(Zone_image.name, "gi"))) {
     1676          Zone_image.path = infos_theMainImage.src;
     1677        } else
     1678          return "Wait";
     1679
     1680      } else {
     1681        Zone_image.src = jQuery(theMainImage_id).attr("src");
     1682        Zone_image.path = infos_theMainImage.src;
     1683      }
    16991684      pos_top = options.pos_top;
    1700       //    pos_top = infos_theImage.top;
     1685      // pos_top = infos_theImage.top;
    17011686
    17021687      pos = jQuery(theImage_id).offset();
    1703       infos_theImage = jQuery(theImage_id).infos(true);   // container 
     1688      infos_theImage = jQuery(theImage_id).infos(true);   // container
    17041689      infos_window = jQuery(window).infos(true);   // window
    1705       w = infos_theImage.general.marges.width
     1690      w = infos_theImage.general.marges.width;
    17061691
    17071692      container = {
    17081693        height: infos_window.height - options.theImageTop,
    17091694        width: infos_window.width - options.theImageLeft - options.theImageRight
    1710       }
     1695      };
    17111696      marge_left = options.marge_left | 0;
    17121697      marge_right = options.marge_right | 0;
     
    17141699
    17151700
    1716       //==========================================================
     1701      // ==========================================================
    17171702      if (test_theme("stripped")) {
    1718         infos_the_page.margin.left = 20;  //taille fleche
     1703        infos_the_page.margin.left = 20;  // taille fleche
    17191704        infos_the_page.margin.right = 20;
    17201705
     
    17241709
    17251710        if (infos_imageInfos.visible == true) {
    1726           //  marge_right += infos_imageInfos.general.width; ;
     1711          // marge_right += infos_imageInfos.general.width; ;
    17271712
    17281713        } else {
     
    17641749
    17651750      retrait_img = {};
    1766       //========== Format Image ============== 
     1751      // ========== Format Image ==============
    17671752      retrait_img.height = Math.ceil(options.marges_llgbo || 0)
    17681753      + Math.ceil(infos_theMainImage.general.marges.height) +
     
    17711756
    17721757
    1773       //===============================================================
     1758      // ===============================================================
    17741759      retrait_img.width = Math.ceil(infos_theMainImage.general.marges.width); // borderwidth+padding
    17751760      retrait_img.width = Math.ceil(infos_theImage.general.marges.width); // borderwidth+padding
     
    17811766
    17821767      marge_bottom = options.marge_bottom_2 + options.marge_bottom;
    1783       //================== Limite Format Image =====================
     1768      // ================== Limite Format Image =====================
    17841769      container.height_interne = container.height - marge_top - marge_bottom;
    17851770      container.width_interne = container.width - marge_left - marge_right;
    17861771
    1787       container.height_interne = Math.max(container.height_interne, Math.ceil(options.mini_height) + retrait_img.height),
    1788       container.width_interne = Math.max(container.width_interne, Math.ceil(options.mini_width) + retrait_img.width)
    1789 
    1790 
     1772      container.height_interne = Math.max(
     1773                  container.height_interne,
     1774                  Math.ceil(options.mini_height) + retrait_img.height);
     1775      container.width_interne = Math.max(container.width_interne,
     1776                  Math.ceil(options.mini_width) + retrait_img.width);
    17911777      image_max = {
    17921778        height: (container.height_interne - retrait_img.height),
    17931779        width: (container.width_interne - retrait_img.width)
    1794       }
    1795       //=========================
     1780      };
     1781      // =========================
    17961782      // test débordement
    1797       //=========================
     1783      // =========================
    17981784      height_theMainImage = Math.ceil(image_max.height);
    17991785      width_theMainImage = Math.ceil(image_max.width);
     
    18341820        }
    18351821      }
    1836       //=================================================================
     1822      // ======== Initilisation Zone_image ===============
    18371823      Zone_image.image = {
    18381824        width: width_theMainImage,
     
    18431829        height: marge_top + marge_bottom + retrait_img.height
    18441830      }
    1845       Zone_image.src = jQuery(theMainImage_id).attr("src");
     1831      return true;
    18461832    }
    18471833
    1848     /*********************************************
     1834    /***************************************************************************
    18491835    * Calcul les dimensions.
    1850     *********************************************/
     1836    **************************************************************************/
    18511837    Get_dimensions = function (force, parametres) {
    18521838      new_img = jQuery(theMainImage_id).infos({ absolute: true });
    18531839      new_dim = jQuery(theImage_id).infos({ absolute: true });
    1854       new_win = jQuery(window).infos({ absolute: true }); // avec ascenseur   
     1840      new_win = jQuery(window).infos({ absolute: true }); // avec ascenseur
    18551841      options.theImageTop = new_dim.top;
    18561842      options.theImageLeft = new_dim.left;
     
    18761862
    18771863      if (Type_Img != "map" && Type_Img != "iframe")
    1878         Select_Image();
    1879       infos_theMainImage = jQuery(theMainImage_id).infos({ absolute: true });
    1880       Zone_image.src = infos_theMainImage.src;
     1864        if (Select_Image() == "Wait") {
     1865          return "Wait";
     1866        }
    18811867      useMap = options.pictureSelType;
    1882       //=================================================================
     1868      // =================================================================
    18831869      switch (Type_Img) {
    18841870        case "map":
    18851871          if (Set_Map(true)) return false;
    1886           break
     1872          break;
    18871873        case "panorama":
    18881874          if (!theMainImage_id) {
     
    18941880
    18951881          img_finale.height = infos_theImage.height;
    1896           break
     1882          break;
    18971883        case "img":
    1898 
    1899 
    1900 
    1901 
    1902 
    1903           break
     1884          break;
    19041885        case "img_autre":
    19051886          if (!theMainImage_id) {
     
    19121893
    19131894
    1914           break
     1895          break;
    19151896        case "embed":
    19161897          //
     
    19191900          if (infos_theMainImage.width == 0)
    19201901            infos_theMainImage = jQuery("#the_page").infos();
    1921 
    1922 
    19231902          iph1 = jQuery("#theImage div").infos();
    1924 
    1925           break
     1903          break;
    19261904        case "charlie":
    1927 
    19281905          Zone_image.zoom = 1;
    1929 
    1930           break
    1931 
     1906          break;
    19321907        case "iframe":
    19331908          wpng = 0;
     
    19351910          Zone_image.image.height = options.theImageHeight;
    19361911          Zone_image.zoom = 1;
    1937           break
     1912          break;
    19381913        case "pamoorama":
    19391914          Wait_pamoorama();
    1940           break
    1941       }
    1942 
    1943 
    1944 
    1945       //=================================================
     1915          break;
     1916      }
     1917
     1918
     1919
     1920      // =================================================
    19461921      if (Zone_image.image.height < options.mini_height2) {
    19471922        Zone_image.image.height = parseInt(options.mini_height2);
     
    19521927        Zone_image.image.height = Math.ceil(Zone_image.image.width / Zone_image.image_init.rapport);
    19531928      }
    1954       //==================================================
    1955       //   ImageWidthidth largeur à atteindre
    1956       //   Calcul du rapport d'agrandissement
     1929      // ==================================================
     1930      // ImageWidthidth largeur à atteindre
     1931      // Calcul du rapport d'agrandissement
    19571932
    19581933      echelle_max = parseFloat(options.echelle_max, '3');
     
    19731948
    19741949      return true;
    1975     }
    1976     //________________ Get_dimensions ___________________
    1977 
    1978 
    1979     /*****************************
    1980     *  init_gen
    1981     *****************************/
     1950    };
     1951    // ________________ Get_dimensions ___________________
     1952
     1953
     1954    /***************************************************************************
     1955    * init_gen
     1956    **************************************************************************/
    19821957    init_gen = function (e) {
    19831958      theImg = document.getElementById(theMainImage_id.replace("#", ""));
    1984       //==================================================
     1959      // ==================================================
    19851960      marges_llgbo = 0;
    19861961      options.marges_llgbo = 0;
     
    19911966            infos_llgboframe1 = jQuery(llgbo_id + " div:last").infos();
    19921967            infos_llgboframe31 = jQuery(llgbo_id + "  div:first").infos();
    1993             //=============================================
     1968            // =============================================
    19941969            ll2 = infos_llgboframe1.width; // llgboframe1
    19951970            ll1 = infos_llgboframe31.general.width; // llgboframe31
     
    20021977      }
    20031978
    2004       //========= Récupération des informations ============= 
     1979      // ========= Récupération des informations =============
    20051980
    20061981      options.marge_top = 0;
     
    20262001      options.marge_left = infos_theImage.general.marges.left + Math.ceil(options.marge_gauche);
    20272002      options.marge_right = infos_theImage.general.marges.right + Math.ceil(options.marge_droite);
    2028       options.marge_top += infos_theImage.general.marges.top + infos_content.general.marges.top + Math.ceil(options.marge_haute);
     2003      options.marge_top += infos_theImage.general.marges.top +
     2004                           infos_content.general.marges.top +
     2005                           Math.ceil(options.marge_haute);
    20292006
    20302007      if (options.pictureDeriv == null)
     
    20322009      else
    20332010        options.first = false;
    2034       //=================== Gestion liste photos size ============================
     2011      // =================== Gestion liste photos size
     2012      // ============================
    20352013      us = 0;
    20362014      if (!options.theMainImageWidth) options.theMainImageWidth = options.scaledWidth;
     
    20552033      if (pictureSelType_user != options.pictureSelType) {
    20562034        /*
    2057         user_status = options.user_status;
    2058         pictureSelType_user = eval("options." + user_status + "_type"); //limite taille
     2035        * user_status = options.user_status; pictureSelType_user =
     2036        * eval("options." + user_status + "_type"); //limite taille
    20592037        */
    20602038        pictureDeriv_user = options.pictureDeriv;
     
    20642042      Affiche_limite(pictureSelType_user);
    20652043
    2066       //=================== 2==================================
     2044      // =================== 2==================================
    20672045      sav_p = options.pictureSelType;
    20682046      options.pictureSelType = "SelMaxi";
     
    20742052      spans.attr("name", "SelMaxi");
    20752053      spans.text("(" + options.theMainImageWidth + " x " + options.theMainImageHeight + ")");
    2076       //==========================================================
     2054      // ==========================================================
    20772055      options.pictureSelType = "Autosize";
    20782056      href_path = get_href(options.pictureDeriv);
     
    20832061      spans.attr("name", "Autosize");
    20842062      spans.text("(" + options.theMainImageWidth + " x " + options.theMainImageHeight + ")");
    2085       //==========================================================
     2063      // ==========================================================
    20862064      options.pictureSelType = sav_p;
    20872065      jQuery('#derivativeSwitchBox .switchCheck').css('visibility', 'hidden');
    20882066      if (options.pictureSelType == "Autosize" || options.pictureSelType == "SelMaxi") {
    2089         //  jQuery('#derivativeChecked' + options.pictureSelType).css('visibility', 'visible');
     2067        jQuery('#derivativeChecked' + options.pictureSelType).css('visibility', 'visible');
    20902068        spans = jQuery("#derivativeChecked" + options.pictureSelType).next();
    20912069        spans.addClass("linkAutosize");
    20922070        spans.find("span").addClass("auto_details");
    20932071      } else {
    2094         //  jQuery('#derivativeChecked' + options.pictureDeriv).css('visibility', 'visible');
     2072        jQuery('#derivativeChecked' + options.pictureDeriv).css('visibility', 'visible');
    20952073      }
    20962074      pictureDeriv = options.pictureDeriv;
     
    20992077      jQuery("#" + Type_Img).show(options.fade_in);
    21002078    };
    2101     //_______________________ init_gen _______________________
    2102 
    2103 
    2104     /*********************************************
     2079    // _______________________ init_gen _______________________
     2080
     2081
     2082    /***************************************************************************
    21052083    * DEBUG ....
    2106     *********************************************/
     2084    **************************************************************************/
    21072085    /*
    2108     if (DEBUG_autosize.match("true",gi))   {
    2109     for (var i = 0; i < 10; i++) {
    2110     jQuery('#adddebugs').click();
    2111     }
    2112     jQuery(jQuery('.debug').get(i - 1)).click();
    2113     }
     2086    * if (DEBUG_autosize.match("true",gi)) { for (var i = 0; i < 10; i++) {
     2087    * jQuery('#adddebugs').click(); } jQuery(jQuery('.debug').get(i -
     2088    * 1)).click(); }
    21142089    */
    21152090
     
    21362111    // on Double Click, remove the debug from the DOM
    21372112    jQuery('.debug').live('dblclick', function () {
    2138       jQuery(this).fadeOut(function () { jQuery(this).remove() });
     2113      jQuery(this).fadeOut(function () { jQuery(this).remove(); });
    21392114    });
    21402115
     
    21592134        mouse_x = 0;
    21602135        mouse_y = 0;
    2161         //  document.onmousemove = position;
     2136        // document.onmousemove = position;
    21622137
    21632138      }
     
    22022177
    22032178
    2204     //=======================================================================================
     2179    // =======================================================================================
    22052180    Debug_info = function (index, infos, Nom_str) {
    22062181      if (typeof infos == "undefined") return;
     
    22262201            top: infos.top + "px"
    22272202          }
    2228         }
     2203        };
    22292204        return myDebug;
    22302205
     
    22562231              top: 0 + "px"
    22572232            }
    2258           }
     2233          };
    22592234          return myDebug;
    22602235        }
     
    22622237
    22632238
    2264     } //Debug_info
    2265     //====================================================
     2239    }; // Debug_info
     2240    // ====================================================
    22662241    affiche_debug = function (aff_infos) {
    22672242      jQuery(jQuery("[id ^='Debug']")).each(function (i) {
     
    22742249      });
    22752250      return;
    2276     }
    2277     //___________ affiche_debug ____
    2278     //====================================================
     2251    };
     2252    // ___________ affiche_debug ____
     2253    // ====================================================
    22792254    function Debug_pos() {
    22802255      return;
     
    22832258        jQuery("[id ^='Debug']").show();
    22842259        /*
    2285         Debug2  background-color:yellow
    2286         Debug3 background-color:blue
    2287         Debug4 background-color:green
    2288         Debug5 background-color:red
    2289 
     2260        * Debug2 background-color:yellow Debug3 background-color:blue Debug4
     2261        * background-color:green Debug5 background-color:red
     2262        *
    22902263        */
    22912264
     
    22952268      }
    22962269    } // Debug_pos
    2297     //==========================================================
    2298 
    2299 
    2300 
    2301 
    2302 
    2303 
    2304 
    2305 
    2306 
    2307   });                                                                                                                                     // ready
     2270    // ==========================================================
     2271
     2272
     2273
     2274
     2275
     2276
     2277
     2278
     2279
     2280  });                                                                                                                                                            // ready
    23082281
    23092282
     
    23122285    k1 = 0;
    23132286  });
     2287//==========================================================
     2288  function file_exists(filename){       
     2289          var params = { filename: filename, types: [], src: [] };
     2290          url = "plugins/PersonalPlugin/fileok.php?filename=" + filename;
     2291    jQuery.ajax({
     2292        type: "POST",
     2293        url: url,
     2294        data: params,
     2295        dataType: "json",
     2296        success: function (data) {
     2297          if (!data.stat || data.stat != "ok") {
     2298            return;
     2299          }
     2300         if(data.result[1]=="ok"){
     2301        jQuery("#theMainImage").attr("src", data.result[0]);
     2302  }
     2303  /*
     2304          retour = "<ul>"  ;
     2305          jQuery(".infos").text(data.stat);       
     2306          for (var i = 0; i < data.result.length; i++) {
     2307            retour = retour + "<li >" + data.result[i] + "</li>";
     2308
     2309          }
     2310          retour += "</ul>";
     2311          jQuery(".infos").html(retour);
     2312  */
     2313        },
     2314        error: function (data) {
     2315          jQuery(".infos").html(data.responseText);
     2316        }
     2317      });
     2318  };
  • extensions/Autosize/js/autosizeDetect.js

    r22133 r22191  
    5151        retval2 = jQuery.cookie('picture_deriv');
    5252
    53         if (retval == "ok" && retval2)
    54                 return;
     53        if (!retval2)
     54          jQuery.cookie('picture_deriv','medium');
    5555        //
    56         jQuery.cookie('autosize_reload', "ok", {
    57                 path : COOKIE_PATH
    58         });
     56        jQuery.cookie('autosize_reload', "ok", {path : COOKIE_PATH,expires:1});
    5957
    6058        if (reload == "true") {
  • extensions/Autosize/js/autosize_ajax.js

    r19936 r22191  
    105105
    106106          }
    107         }
     107        };
  • extensions/Autosize/main.inc.php

    r22133 r22191  
    11<?php
    22/*
    3 Plugin Name: AutoSize
     3 Plugin Name: AutoSize
    44Version: 3.1.1
    55Description: Ajuste l'affichage des photos en fonction de la hauteur de la fenetre de navigation
     
    77Author: cljosse
    88Author URI:http://cljosse.free.fr
    9 */ 
     9*/
    1010/*****************************************
    11 *Ajouter .contentWithMenu{ margin-left:0 } dans themes montblanc
     11 *Ajouter .contentWithMenu{ margin-left:0 } dans themes montblanc
    1212*
    1313*****************************************/
    1414if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
    15 if (!defined('AUTOSIZE_PATH')) 
    16 define(  'AUTOSIZE_PATH',   PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/' );
    17 if (!defined('ROOT_URL')) 
    18 define(  'ROOT_URL',  get_root_url().'/' );
    19  
    20 if (!defined('AUTOSIZE_PATH_ABS')) 
    21 define(
    22   'AUTOSIZE_PATH_ABS',  realpath(AUTOSIZE_PATH)."/"
    23 );
     15if (!defined('AUTOSIZE_PATH'))
     16        define(  'AUTOSIZE_PATH',   PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/' );
     17if (!defined('ROOT_URL'))
     18        define(  'ROOT_URL',  get_root_url().'/' );
     19
     20if (!defined('AUTOSIZE_PATH_ABS'))
     21        define(
     22                        'AUTOSIZE_PATH_ABS',  realpath(AUTOSIZE_PATH)."/"
     23        );
    2424
    2525global $conf ;
    26   if( isset($_GET['cl_debug']) && $_GET['cl_debug'] =='false') {
    27       $DEBUG_autosize="";
    28   }else{
    29     $DEBUG_autosize = isset($_POST['cl_debug']) ? $_POST['cl_debug'] : "" ;
    30     $DEBUG_autosize = isset($_GET['cl_debug']) ? $_GET['cl_debug'] :  $DEBUG_autosize ;
    31     $DEBUG_autosize = isset($conf['cl_debug']) ? $conf['cl_debug']."," . $DEBUG_autosize : $DEBUG_autosize ;   
    32     }
    33 
    34 if(preg_match("|NO|", $DEBUG_autosize, $val)) { 
     26//================================================================
     27global $DEBUG_autosize;
     28if( isset($_GET['cl_debug']) && $_GET['cl_debug'] =='false') {
     29        $DEBUG_autosize="";
     30}else{
     31        $DEBUG_autosize = isset($_POST['cl_debug']) ? $_POST['cl_debug'] : "" ;
     32        $DEBUG_autosize = isset($_GET['cl_debug']) ? $_GET['cl_debug'] :  $DEBUG_autosize ;
     33        $DEBUG_autosize = isset($conf['cl_debug']) ? $conf['cl_debug']."," . $DEBUG_autosize : $DEBUG_autosize ;
     34        //===============================================================
     35}
     36if(preg_match("|NO|", $DEBUG_autosize, $val)) {
    3537
    3638}else{
    37 //==================================================================
    38         include(AUTOSIZE_PATH."include/constants.php");           
     39        //==================================================================
     40        include(AUTOSIZE_PATH."include/constants.php");
    3941        include_once(AUTOSIZE_PATH.'autosize.inc.php');
    40 //==================================================================
    41 global $page,$autosize_ctrl;
    42 if (!isset( $page['start'])) {
    43  $page['start']=0;
    44  }
    45 $autosize_ctrl = new autosize_ctrl();
    46 add_event_handler('get_admin_plugin_menu_links', array(&$autosize_ctrl,'cl_autosize_admin')  );
    47 
    48 //===============================================================
    49 if(!preg_match("|NO|", $DEBUG_autosize, $val)) { 
    50  // EVENT_HANDLER_PRIORITY_NEUTRAL=80
    51     add_event_handler('render_element_content', array(&$autosize_ctrl, 'autosize_calcContent'),EVENT_HANDLER_PRIORITY_NEUTRAL-11,2);
    52     add_event_handler('render_element_content', array(&$autosize_ctrl, 'init_1'),EVENT_HANDLER_PRIORITY_NEUTRAL-9,2);
    53     add_event_handler('render_element_content',  array(&$autosize_ctrl,'init'),EVENT_HANDLER_PRIORITY_NEUTRAL-1,2  );
    54     add_event_handler('render_element_content',  array(&$autosize_ctrl,'init2'),EVENT_HANDLER_PRIORITY_NEUTRAL+1,2  );
    55     add_event_handler('loc_after_page_header', array(&$autosize_ctrl, 'cl_autosize_script_1') );
    56     add_event_handler('loc_after_page_header', array(&$autosize_ctrl, 'cl_autosize_script_2')  );
    57     add_event_handler('loc_after_page_header',array(&$autosize_ctrl, 'cl_autosize_script_3')  );
    58     add_event_handler('loc_after_page_header', array(&$autosize_ctrl, 'cl_autosize_affiche'), EVENT_HANDLER_PRIORITY_NEUTRAL +21    );
    59     if(!isset($_GET['slideshow'])) add_event_handler('loc_begin_picture', array(&$autosize_ctrl, 'init_3'), EVENT_HANDLER_PRIORITY_NEUTRAL+6);
    60     }
     42        //==================================================================
     43        global $page,$autosize_ctrl;
     44        if (!isset( $page['start'])) {
     45                $page['start']=0;
     46        }
     47        $autosize_ctrl = new autosize_ctrl();
     48        add_event_handler('get_admin_plugin_menu_links', array(&$autosize_ctrl,'cl_autosize_admin')  );
     49        //===============================================================
     50        if(!preg_match("|NO|", $DEBUG_autosize, $val)) {
     51                // EVENT_HANDLER_PRIORITY_NEUTRAL=80
     52                global $autosize_ctrl;
     53                                add_event_handler('render_element_content', array(&$autosize_ctrl, 'autosize_calcContent'),EVENT_HANDLER_PRIORITY_NEUTRAL-11,2);
     54                                add_event_handler('render_element_content', array(&$autosize_ctrl, 'init_1'),EVENT_HANDLER_PRIORITY_NEUTRAL-9,2);
     55                                add_event_handler('render_element_content', array(&$autosize_ctrl, 'init'),EVENT_HANDLER_PRIORITY_NEUTRAL-1,2  );
     56                                add_event_handler('render_element_content', array(&$autosize_ctrl, 'init2'),EVENT_HANDLER_PRIORITY_NEUTRAL+1,2  );
     57                                add_event_handler('loc_after_page_header', array(&$autosize_ctrl, 'cl_autosize_script_1') );
     58                                add_event_handler('loc_after_page_header', array(&$autosize_ctrl, 'cl_autosize_script_2')  );
     59                                add_event_handler('loc_after_page_header',  array(&$autosize_ctrl, 'cl_autosize_script_3')  );
     60                                add_event_handler('loc_after_page_header', array(&$autosize_ctrl, 'cl_autosize_affiche'), EVENT_HANDLER_PRIORITY_NEUTRAL +21    );
     61                        if(!isset($_GET['slideshow'])) add_event_handler('loc_begin_picture', array(&$autosize_ctrl, 'init_3'), EVENT_HANDLER_PRIORITY_NEUTRAL+6);
     62        }
    6163} ;
    6264
    63      
     65
    6466
    6567
  • extensions/Autosize/template/picture_1.tpl

    r18949 r22191  
    1414    {/literal}{/footer_script}
    1515{else }
    16 {combine_script id="Affiche_script" path= $AUTOSIZE_PATH|@cat:"js/Affiche_script.js" require='jquery,autosize.dimensions'  }
    17 {if $theme != "elegant"}
    18 {combine_script id="autosize.cookie" path = $AUTOSIZE_PATH|@cat:"js/autosize.cookie.js" require="jquery"  }{/if}
    19 {combine_script id="autosize.dimensions" path = $AUTOSIZE_PATH|@cat:"js/autosize.dimensions.js" require="jquery"}
     16        {combine_script id="Affiche_script" path= $AUTOSIZE_PATH|@cat:"js/Affiche_script.js" require='jquery,autosize.dimensions'  }
     17        {if $theme != "elegant"}
     18                {combine_script id="autosize.cookie" path = $AUTOSIZE_PATH|@cat:"js/autosize.cookie.js" require="jquery"  }
     19        {/if}
     20        {combine_script id="autosize.dimensions" path = $AUTOSIZE_PATH|@cat:"js/autosize.dimensions.js" require="jquery"}
    2021{/if}
    2122 
    2223{if $gmaps_function=="true" }
    23 {combine_script id="maps.google.com/api" path="http://maps.google.com/maps/api/js?sensor=false" require="jquery" }
     24        {combine_script id="maps.google.com/api" path="http://maps.google.com/maps/api/js?sensor=false" require="jquery" }
    2425{/if}
Note: See TracChangeset for help on using the changeset viewer.