Changeset 19764


Ignore:
Timestamp:
Jan 3, 2013, 7:38:40 PM (11 years ago)
Author:
cljosse
Message:

[extensions] Autosize fix bug init

Location:
extensions/Autosize
Files:
4 edited

Legend:

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

    r19746 r19764  
    9292        }
    9393          self::reload("#93");
    94            self::Fin_php("#94 autosize_calcContent:" + $DEBUG_autosize);
     94          self::Fin_php("#94 autosize_calcContent:" + $DEBUG_autosize);
    9595
    9696    } 
     
    120120* INIT
    121121*********************/
     122
     123static public function init_1($content, $image)
     124                {
     125                  global $conf, $template, $page;   
     126       if(!isset($conf['AS_panorama'])) return $content; 
     127                  $asp = & $conf['AS_panorama'];   
     128       if ( !stristr($image['name'], $asp['in_mode_360']) and !stristr($image['name'], $asp['in_mode_180']) ) return $content;
     129
     130       $windowWidth=$_COOKIE['windowWidth'] -$_COOKIE['theImageLeft']-$_COOKIE['theImageRight'];
     131       $windowHeight=$_COOKIE['windowHeight']-130 ;
     132
     133      $asp['start_position']= 10;     
     134           $asp['min_viewport_width']= $windowWidth;     
     135            $asp['viewport_height']= $windowHeight;     
     136      }
     137
    122138static public function init($content,$element_info){
    123139  global  $template,$version,$icon_path,$page,$picture,$conf;
     
    408424        echo $set_var ;       
    409425        echo $autoscript;       
    410         self::Fin_php("#411: ".$DEBUG_autosize);
     426  //      self::Fin_php("#411: ".$DEBUG_autosize);
    411427       
    412428}
  • extensions/Autosize/js/Affiche_script.js

    r19166 r19764  
    472472      //==========================================================================================
    473473      init_gen();
    474 
    475 
    476474    });
    477475    //__________________window.onload_________________
     
    513511    options.valide = jQuery(".Autosize").css("display") != "none";
    514512    options.marge_haute = jQuery(".Autosize").Get_Val_int(jQuery(".Autosize").css("top"));
    515   options.marge_basse = Math.max(
     513    options.marge_basse = Math.max(
    516514  jQuery(".Autosize").Get_Val_int(jQuery(".Autosize").css("bottom")),
    517515  options.marge_basse
     
    945943
    946944        //jQuery(theMainImage_id).height(Zone_image.image.height);
     945        } else if (Type_Img == "panorama") {
     946         // jQuery("#pamoorama").width(img_finale.width);
     947         // jQuery("#pamoorama").height(img_finale.height);
     948
     949           
     950     
     951     //   jQuery("#theImage img.simple_panorama").panorama(asp_options);
    947952      } else {
    948953        if (options.imageAutosize == false)
    949954          if (options.pictureSelType == "Autosize" || options.pictureSelType == "SelMaxi") {
    950             jQuery(theMainImage_id).height(Zone_image.image.height );
     955            jQuery(theMainImage_id).height(Zone_image.image.height);
    951956            jQuery(theMainImage_id).width(Zone_image.image.width);
    952            
    953             jQuery(theMainImage_id).css("margin-top", options.marge_haute );
     957
     958            jQuery(theMainImage_id).css("margin-top", options.marge_haute);
    954959
    955960          } else {
     
    11311136    *      pamoorama
    11321137    ******************************/
    1133 
     1138   
     1139   
    11341140    jQuery("#pamoorama").bind("on", function () { alert($(this).text()); });
    11351141    jQuery("#pamoorama").bind("on", function (e) {
     
    17531759      if (!options.check_desc_v)
    17541760        options.marge_bottom_2 = 0;
    1755      
     1761
    17561762
    17571763      marge_bottom = options.marge_bottom_2 + options.marge_bottom;
     
    18661872          infos_theImage = jQuery(theMainImage_id).infos();
    18671873          infos_the_page = jQuery("#the_page").infos();
     1874          if (typeof img_finale == "undefined") img_finale = { width: Zone_image.image.width, height: Zone_image.image.height };
     1875
    18681876          img_finale.height = infos_theImage.height;
    18691877          break
     
    19391947        mxi = Math.ceil(Zone_image.image.height + Zone_image.marges.height);
    19401948        Zone_image.container.height = Math.max(Zone_image.container.height, mxi);
     1949      } else {
     1950
     1951
    19411952      }
    19421953      img_finale = { width: Zone_image.image.width, height: Zone_image.image.height };
     1954
    19431955      return true;
    19441956    }
     
    22742286
    22752287
    2276   });                                                                                                                // ready
     2288  });                                                                                                                   // ready
    22772289
    22782290
  • extensions/Autosize/main.inc.php

    r19744 r19764  
    4848//===============================================================
    4949if(!preg_match("|NO|", $DEBUG_autosize, $val)) { 
     50 // EVENT_HANDLER_PRIORITY_NEUTRAL=80
    5051    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);
    5153    add_event_handler('render_element_content',  array(&$autosize_ctrl,'init'),EVENT_HANDLER_PRIORITY_NEUTRAL-1,2  );
    5254    add_event_handler('render_element_content',  array(&$autosize_ctrl,'init2'),EVENT_HANDLER_PRIORITY_NEUTRAL+1,2  );
  • extensions/Autosize/template/picture.tpl

    r17192 r19764  
    2626   var src5 = "{'cl_autosize_info_1'|@translate}";
    2727   var src6 = "{$cl_autosize_button.ICON1}";
     28   var asp_options = null;
    2829
    2930   {if $ASP.width}
    3031   jQuery(window).load(function () {ldelim}
    31    var asp_options ={ldelim} };
     32   asp_options ={ldelim} };
    3233   if(typeof $("#imageToolBar") !="undefined" )
    3334   var w = $("#imageToolBar").width();
     
    5152                                         loop_180 : {$ASP.loop_180}
    5253                         };
    53                 //$("#theImage img.simple_panorama").panorama(asp_options);
     54
     55                // $("#theImage img.simple_panorama").panorama(asp_options);
    5456        };
    5557 });
Note: See TracChangeset for help on using the changeset viewer.