Changeset 7943 for extensions/Autosize


Ignore:
Timestamp:
Nov 30, 2010, 9:01:46 AM (13 years ago)
Author:
cljosse
Message:

[Autosize][beta] fix bug cl_conflit/autosize

Location:
extensions/Autosize
Files:
5 edited

Legend:

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

    r7912 r7943  
    4343                if (isset( $page['body_id'])  ) {
    4444                if ( $page['body_id']=='thePicturePage'  ) {
    45                         if ( isset($picture['current'])){
    46                                
     45                        if ( isset($picture['current'])){                               
    4746                                $autosize_parametres = cl_autosize_Get_Options();
    4847                                include (AUTOSIZE_PATH."include/affiche.php"); 
     
    139138                $my_path = dirname(__FILE__).'/';
    140139                $debug = isset($conf['debug']) ? $conf['debug'] : false ;
    141                 $cl_conflit =  isset($conf['cl_conflit']) ? $conf['cl_conflit'] : 'true' ;
    142 
     140               
    143141                $ThePicture = $template->get_template_vars('current');
    144142                $tpl_name =   $user['theme'] ;
     
    162160 {
    163161           global  $template,$user,$conf,$picture ,$page, $cl_plugin ;
    164            //userDefManage ??
     162         
    165163                        $my_path =  basename(dirname(__FILE__)).'/' ;
    166164                        $my_path = dirname(__FILE__).'/';
    167165                        $debug = isset($conf['debug']) ? $conf['debug'] : false ;
    168                         $cl_conflit =  isset($conf['cl_conflit']) ? $conf['cl_conflit'] : 'true' ;
     166                       
    169167                        $theme=$user['theme'];
    170168                        $template->assign(
     
    173171                                        'name' => $cl_plugin['name'] ,
    174172                                        'ma_page' =>    $page['body_id'],
    175                                         'cl_conflit' => $cl_conflit  ,
     173                                       
    176174                                        'theme' => $theme  ,
    177175                                        'DEBUG' => $debug   ,
     
    182180$autoscript="<script type='text/javascript'>
    183181if (typeof (save_framework) == 'function')
    184 save_framework('".$page['body_id']."');
     182   save_framework('".$page['body_id']."');
    185183</script>";
    186184                         $template->append('footer_elements',$autoscript); 
     
    199197                $template->set_filenames(array('autosize_init'=>$my_path. "template/conflit.tpl" ) );   
    200198                $debug = isset($conf['debug']) ? $conf['debug'] : false ;
    201                 $cl_conflit =  isset($conf['cl_conflit']) ? $conf['cl_conflit'] : 'true' ;                     
     199               
    202200                $theme=$user['theme'];
    203201                         
     
    206204                                                'cl_version' => $cl_plugin['version'] ,
    207205                                                'name' => $cl_plugin['name'] ,
    208                                                 'cl_conflit' => $cl_conflit  ,
     206                                               
    209207                                                'theme' => $theme  ,
    210208                                                'DEBUG' => $debug   ,
     
    220218*/
    221219static public function cl_ajuste_data($content){
    222            global  $template,$user,$conf,$picture ;
    223          $my_path = realpath(AUTOSIZE_PATH .'/');
    224          $userdata=$user;
    225          $fields = array( 'maxwidth', 'maxheight' );
     220        global  $template,$user,$conf,$picture ;
     221        $my_path = realpath(AUTOSIZE_PATH .'/');
     222        $userdata=$user;
     223        $fields = array( 'maxwidth', 'maxheight' );
    226224         
    227          $ThePicture = $template->get_template_vars('current');
    228                         $data = array();
    229                        
    230                          
    231 
     225        $ThePicture = $template->get_template_vars('current');
     226        $data = array();
    232227 return $content;
    233228
    234                         $data['maxwidth'] = '1200';
    235 $data['maxheight'] ='250';
    236                         $data['user_id'] = $userdata['id'];
    237            foreach ($fields as $field)
    238       {
    239         if (isset($_POST[$field]))
    240         {
    241           $data[$field] = $_POST[$field];
    242         }
    243       }
     229        $data['maxwidth'] = '1200';
     230        $data['maxheight'] ='250';
     231        $data['user_id'] = $userdata['id'];
     232        foreach ($fields as $field)
     233        {
     234                if (isset($_POST[$field]))
     235                {
     236                        $data[$field] = $_POST[$field];
     237                }
     238        }
    244239       
    245240        if($data['maxwidth'] != "" )
    246 {
    247         $picture['current']['scaled_width']=$data['maxwidth'];
    248                  $picture['current']['scaled_height']=$data['maxheight'];
    249        mass_updates(USER_INFOS_TABLE,
    250                    array('primary' => array('user_id'), 'update' => $fields),
    251                    array($data));
    252        
    253 }
    254 
    255  
    256                 return $content;
    257    /*
    258                 $template->assign(
    259                                                 array(
    260                                                 'AUTOSIZE_PATH' => $my_path,
    261                                                                                         )
    262                                                  );
    263  
    264                 $template->parse( 'autosize_cl_init', false);
    265                 return $content;
    266         */
    267 
    268                                                                                  
     241                {
     242                $picture['current']['scaled_width']=$data['maxwidth'];
     243                $picture['current']['scaled_height']=$data['maxheight'];
     244                mass_updates(USER_INFOS_TABLE,
     245                                array('primary' => array('user_id'), 'update' => $fields),
     246                                array($data)); 
     247                }
     248                 
     249                return $content;                                                                                 
    269250         }
    270251
  • extensions/Autosize/js/Affiche_script.js

    r7934 r7943  
    390390
    391391                         //=========================================================
    392                          img_reelle.height = img_height  ;
     392                         img_reelle.height = img_height;
    393393                         img_reelle.width = Zone_Affichage.width;
    394394
     
    665665
    666666                 //================ Zone affichage =========================
    667                  //  Image_height, Image_width = valeur a atteindre.
     667 
    668668                 if (theme.match(RegExp("luciano", "g"))) {
    669669                     //---- information en dehors du cadre
    670                      //   Zone_Affichage.height -= Bandeau_bas.height - 20;
    671670                     jQuery(Cadre).height(Zone_Affichage.height -= Bandeau_bas.height);
    672 
    673671                 }
    674672
     
    877875                     jQuery("#Debug5").css({ background: "transparent",
    878876                         border: "red solid 2px",
    879 
     877                         top: info_frame.top + "px",
    880878                         left: info_frame.left + "px",
    881879                         width: info_frame.width + "px",
  • extensions/Autosize/js/conflit.js

    r7931 r7943  
    119119
    120120    } else if (retour.match(RegExp("luciano", "gi"))) {
    121         $1 = $_;
     121         
    122122
    123123        ret_element = jQuery().$Luciano(element, nc);
     
    417417            }
    418418            //======================
     419            //? bubble 
     420            Expression = new RegExp("\\$", "gi")
     421            if (fn.match(Expression)) {
     422                if (fn.match(RegExp("rateForm", "gi"))) {
     423
     424                    states.push('Luciano');
     425                    break;
     426                }
     427            }
     428            // "window.fireEvent('domready')"
     429            Expression = new RegExp("window.fireEvent", "gi")
     430            if (fn.match(Expression)) {  //luciano
     431                // "window.fireEvent('domready')"
     432                Expression = new RegExp("window.fireEvent..domready..", "gi")
     433                if (fn.match(Expression)) {
     434                    states.push('Luciano');
     435                    break;
     436                }
     437            }
     438            if (fn.match(RegExp("(splat|buildFrameWork|photoNext)", "gi"))) {  //luciano
     439
     440                states.push('Luciano');
     441                break;
     442            }
     443            //======================
    419444            if (fn.match(RegExp("_footer|ie_ready|makeDraggable|droppables", "gi"))) {
    420445
     
    444469                break;
    445470            }
    446             //? bubble 
    447             Expression = new RegExp("\\$", "gi")
    448             if (fn.match(Expression)) {
    449                 if (fn.match(RegExp("rateForm", "gi"))) {
    450 
    451                     states.push('Luciano');
    452                     break;
    453                 }
    454             }
    455             // "window.fireEvent('domready')"
    456             Expression = new RegExp("window.fireEvent", "gi")
    457             if (fn.match(Expression)) {  //luciano
    458                 // "window.fireEvent('domready')"
    459                 Expression = new RegExp("window.fireEvent..domready..", "gi")
    460                 if (fn.match(Expression)) {
    461                     states.push('Luciano');
    462                     break;
    463                 }
    464             }
    465             if (fn.match(RegExp("(splat|buildFrameWork|photoNext)", "gi"))) {  //luciano
    466 
    467                 states.push('Luciano');
    468                 break;
    469             }
     471
    470472
    471473            if (all_functions.length > 50)
     
    555557})(jQuery);
    556558
    557 
     559 
     560 
     561$_0= $;
    558562function $(element, nc0) {
    559563    a = conflit(element, nc0);
     
    583587    }
    584588}
     589 
     590
    585591$_ = $;
    586592function save_framework(page) {
     
    591597    }
    592598   
    593     $_ = $;
     599    $_2 = $;
    594600    return
    595601
  • extensions/Autosize/main.inc.php

    r7934 r7943  
    22/*
    33Plugin Name: AutoSize
    4 Version: 1.3.9.4
     4Version: 1.3.9.5
    55Description: Ajuste l'affichage des photos en fonction de la hauteur de la fenetre de navigation
    66Plugin URI: http://piwigo.org/ext/extension_view.php?eid=448
  • extensions/Autosize/template/conflit.tpl

    r7912 r7943  
    33{known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js" now=1}
    44{known_script id="dimensions" src=$AUTOSIZE_PATH|@cat:"js/jquery.dimensions.js"}
    5 {if $cl_conflit == 'true'}
    6    {known_script id="conflit_script" src=$AUTOSIZE_PATH|@cat:"js/conflit.js"}
    7 {/if}
     5{known_script id="conflit_script" src=$AUTOSIZE_PATH|@cat:"js/conflit.js"}
     6
    87
    98
Note: See TracChangeset for help on using the changeset viewer.