Changeset 7574


Ignore:
Timestamp:
Nov 2, 2010, 1:56:10 PM (13 years ago)
Author:
cljosse
Message:

[Autosize][beta] adjust width with pamooramic.

Location:
extensions/Autosize
Files:
4 edited

Legend:

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

    r7536 r7574  
    132132        static public function cl_autosize_script()
    133133        {
    134            global  $template,$user,$conf ;
    135  
    136                  
     134           global  $template,$user,$conf,$picture ;
    137135
    138136                $my_path =  basename(dirname(__FILE__)).'/' ;
     
    152150        /*
    153151        *
    154         */
    155         static public function cl_ajuste_data($content, $image){
    156  
    157            global  $template,$user,$conf ;
     152    */
     153        static public function cl_ajuste_data($content){
     154           global  $template,$user,$conf,$picture ;
    158155                        $my_path = realpath(AUTOSIZE_PATH .'/');
    159                        
    160                         $template->set_filenames(
    161                      array('autosize_cl_init'=> $my_path.'template/conflit.tpl')
    162                       );
    163  /*
    164156         $userdata=$user;
    165157         $fields = array( 'maxwidth', 'maxheight' );
     158         
    166159         $ThePicture = $template->get_template_vars('current');
    167 
    168160                        $data = array();
    169                         $data['maxheight'] = $ThePicture['scaled_height'];
    170                         $data['maxwidth'] = $ThePicture['scaled_width'];
     161                       
     162
     163 return $content;
     164
     165                        $data['maxwidth'] = '1200';
     166$data['maxheight'] ='250';
    171167                        $data['user_id'] = $userdata['id'];
    172168           foreach ($fields as $field)
     
    180176        if($data['maxwidth'] != "" )
    181177{
    182        
     178        $picture['current']['scaled_width']=$data['maxwidth'];
     179                 $picture['current']['scaled_height']=$data['maxheight'];
    183180       mass_updates(USER_INFOS_TABLE,
    184181                   array('primary' => array('user_id'), 'update' => $fields),
     
    187184}
    188185
    189    */
    190 
     186 
     187   return $content;
     188   /*
    191189 $template->assign(
    192190                                                array(
     
    198196                $template->parse( 'autosize_cl_init', false);
    199197        return $content;
    200 
     198        */
    201199
    202200                                                                                 
  • extensions/Autosize/js/Affiche_script.js

    r7572 r7574  
    355355              var winheight = jQuery(window).height();
    356356              if (old_w == winwidth && old_h == winheight) return;
     357
    357358
    358359
     
    437438                  var info_pamoorama_footer = jQuery("#pamoorama_footer").info();
    438439                  TheImg = jQuery("#pamoorama");
    439 
     440                  if (typeof (myPamoorama) == "undefined") {
     441                      return
     442
     443                  }
     444
     445
     446                  po = myPamoorama;
     447
     448                  /*
     449                  myPamoorama = new pamoorama('pamoorama',{ activateSlider:     {$PANO_ACTIVATESLIDER},
     450                  width:                {$PANO_WIDTH},
     451                  footercolor:          '{$PANO_FOOTERCOLOR}',
     452                  captioncolor:         '{$PANO_CAPTIONCOLOR}',
     453                  caption:              '{$ALT_IMG}',
     454                  enableAutoscroll:     {$PANO_ENABLEAUTOSCROLL},
     455                  autoscrollSpeed:      {$PANO_AUTOSCROLLSPEED},
     456                  autoscrollOnLoad:     {$PANO_AUTOSCROLLONLOAD},
     457                  startAutoscroll:      '{'pamooramics_startAutoscroll'|@translate}',
     458                  stopAutoscroll:               '{'pamooramics_stopAutoscroll'|@translate}',
     459                  loadingMessage: '{'pamooramics_loading'|@translate}',
     460                  clickMessage:         '{'pamooramics_clickMessage'|@translate}',
     461                  dragMessage:          '{'pamooramics_dragMessage'|@translate}'
     462                  });
     463                  */
    440464                  /*
    441465                  pamoorama_outter
     
    547571                  case "pamoorama":
    548572                      //=========================================================
    549                       var Images = jQuery("#pamoorama img");
    550                       var Image = jQuery("#pamoorama").find("img");
    551 
     573
     574
     575                      if (typeof (myPamoorama.imageHeight) == "undefined") return;
     576
     577                      img_reelle.height = myPamoorama.imageHeight;
     578                      img_reelle.width = myPamoorama.imageWidth;
     579                      TheImg = myPamoorama.image;
    552580                      info_theImage = jQuery("#pamoorama").info();
    553581                      info_the_page = jQuery("#the_page").info();
     582
    554583                      break
    555584
     
    875904
    876905              } else if (Type_Img == "pamoorama") {
    877                   return;
     906
     907                  img_height = myPamoorama.imageHeight
    878908
    879909                  marge_left += 0;
    880910                  new_width = Zone_Affichage.width - marge_right - marge_left;
    881                   jQuery("#pamoorama").css({ margin: 0 + "px",
    882                       left: marge_left + "px",
     911                  new_width -= 4;
     912                  jQuery("#pamoorama").css({ marginLeft: "auto",
     913                      marginRight: "auto",
     914
    883915                      height: Image_height + info_pamoorama_footer.height + "px",
    884916                      width: new_width + "px"
    885917                  });
    886918
     919                  myPamoorama.options.width = new_width;
    887920                  jQuery("#pamoorama").width(new_width);
     921
     922
    888923
    889924
    890925                  jQuery("#pamoorama_outter").css({
    891926                      left: marge_left + "px",
    892                       height: Image_height + "px",
     927                      height: myPamoorama.imageHeight + "px",
    893928                      width: (new_width) + "px"
    894929                  });
    895930                  jQuery("#pamoorama_outter").width(new_width);
    896 
    897 
    898                   jQuery("#pamoorama_footer").width((Zone_Affichage.width - marge_right - marge_left));
    899                   jQuery("#pamoorama_footer").css('width', (Zone_Affichage.width - marge_right - marge_left) + "px");
     931                  h = info_theImage.height;
     932                  jQuery("#pamoorama").css({ height: h + "px" });
     933
     934                  jQuery("#pamoorama_footer").width(new_width);
     935                  jQuery("#pamoorama_footer").css('width', new_width + "px");
     936
     937                  jQuery("#linkNext").css({ width: "200px", overflow: "hidden" });
     938                  jQuery("#linkPrev").css({ width: "200px", overflow: "hidden" });
    900939                  zoom = Image_height / img_height;
    901                   info_pamoorama_outter = jQuery("#pamoorama_outter").info();
    902 
    903                   h_frame = jQuery("#pamoorama").width();
    904                   if (old_w == jQuery(window).width() && old_h == jQuery(window).height()) {
    905 
    906                       /*   if (info_pamoorama_outter.width == 0)
    907                       setTimeout("wait_Timer()", 100);
    908                       */
    909                       //     jQuery(TheImg).css("zoom", zoom);
    910                   }
     940                  var init_old_w;
     941                  if (init_old_w == 0) {
     942                      init_old_w = old_w;
     943                      old_w = 0;
     944                  }
     945
    911946
    912947
     
    10221057
    10231058      } // function
    1024 );                                                                                                                                                                                                                                                                                                                                                                                                                                       // ready
     1059);                                                                                                                                                                                                                                                                                                                                                                                                                                                       // ready
    10251060    /*
    10261061*
  • extensions/Autosize/js/conflit.js

    r7542 r7574  
    11//==== autosize  remplace $(... avec jQuery( ====
    22var d1 = 0;
    3 var init_tb = 0;             
    4 
     3var init_tb = 0;
     4function ne(a) {
     5    return new V(a[ib], a[hc])
     6}
    57
    68 function $(element, nc) {
     
    1719          if (tpj.length > 0) {             }
    1820          jQuery(window).load(function () {
     21
     22
    1923              if (jQuery("#theImage").css("position") == "relative") {
    2024                  //==== compatibilité Gally/LLGBO ===
     
    374378
    375379//=========================================================
    376 (function ($) {
    377               $.fn.panorama2 =
     380(function ($2) {
     381              $2.fn.panorama2 =
    378382              function (height, width) {
    379383               
  • extensions/Autosize/main.inc.php

    r7572 r7574  
    1515$autosize_controler = new autosize_controler();
    1616
     17add_event_handler('get_admin_plugin_menu_links', array(&$autosize_controler,'cl_autosize_admin')  );
    1718
    18 add_event_handler('loc_after_page_header', array(&$autosize_controler, 'cl_autosize_affiche'), 40 );
     19 add_event_handler('loc_after_page_header', array(&$autosize_controler, 'cl_autosize_affiche'), 40 );
     20
     21//======================================================================================================
     22//add_event_handler('render_element_content', array(&$obj, 'paMOOramics_load'),41,2);
     23add_event_handler('render_element_content', array(&$autosize_controler, 'cl_ajuste_data'),40,2 );
    1924
    2025
    21 add_event_handler('get_admin_plugin_menu_links', array(&$autosize_controler,'cl_autosize_admin')  );
    22 
     26//=================================================================================================
    2327//add_event_handler('loc_after_page_header', array(&$autosize_controler, 'cl_autosize_script'),40 );
    2428
    25 //---- Categorie ----
     29//---- Categorie - attention Gmaps ne marche plus($.ajax)---
    2630//add_event_handler('loc_begin_index', array(&$autosize_controler, 'cl_autosize_script'),51 );
    2731
    28 //add_event_handler('load_profile_in_template', array(&$autosize_controler,'cl_autosize_script'),40 );
     32// add_event_handler('load_profile_in_template', array(&$autosize_controler,'cl_autosize_script'),40 );
    2933
    3034?>
Note: See TracChangeset for help on using the changeset viewer.