Changeset 8057


Ignore:
Timestamp:
Dec 9, 2010, 3:10:07 PM (13 years ago)
Author:
cljosse
Message:

[Autosize][beta] fix warning on jquery


Location:
extensions/Autosize
Files:
8 edited

Legend:

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

    r7964 r8057  
    4040                load_language('lang', AUTOSIZE_PATH);
    4141                $my_path = dirname(__FILE__).'/';
    42                
    43                 if (isset( $page['body_id'])  ) {
    44                 if ( $page['body_id']=='thePicturePage'  ) {
     42       
     43                 if (isset( $page['body_id']) && $page['body_id']=='thePicturePage'  ) {
    4544                        if ( isset($picture['current'])){                               
    4645                                $autosize_parametres = cl_autosize_Get_Options();
    4746                                include (AUTOSIZE_PATH."include/affiche.php"); 
    48                                 $debug = isset($conf['debug']) ? $conf['debug'] : false ;
    49                                 $cl_visible=isset($conf['cl_auto']) ? $conf['cl_auto'] : 'true' ;
    5047                               
    51                                 if($autosize_parametres->check_icon_v == 'on'){
    52                                  
    53                                 $template->assign('cl_autosize_button',
    54                                  array(
    55                                                 'cl_autosize_info' => 'cl_autosize_info' ,
    56                                                 'cl_autosize_info_2' => 'cl_autosize_info_2' ,   
    57                                                 'URL' => $_SERVER['REQUEST_URI'] ,
    58                                                 'ICON2' => AUTOSIZE_PATH . 'icons/button-maximize.png',
    59                                                 'ICON' => AUTOSIZE_PATH . 'icons/button-minimize.png'
    60                                         )
    61 
    62                                         );
    63  
    64                                 $template->set_filenames(array('cl_bp' => $my_path. 'template/picture.tpl'));
    65                                 $template->concat('PLUGIN_PICTURE_ACTIONS', $template->parse('cl_bp', true));
     48                               
     49                                if($autosize_parametres->check_icon_v == 'on'){                         
     50                                                $template->assign('cl_autosize_button',
     51                                                array(  'cl_autosize_info' => 'cl_autosize_info' ,
     52                                                                'cl_autosize_info_2' => 'cl_autosize_info_2' ,   
     53                                                                'URL' => $_SERVER['REQUEST_URI'] ,
     54                                                                'ICON2' => AUTOSIZE_PATH . 'icons/button-maximize.png',
     55                                                                'ICON' => AUTOSIZE_PATH . 'icons/button-minimize.png'
     56                                                                )
     57
     58                                                        );
     59 
     60                                        $template->set_filenames(array('cl_bp' => $my_path. 'template/picture.tpl'));
     61                                        $template->concat('PLUGIN_PICTURE_ACTIONS', $template->parse('cl_bp', true));
    6662                                }
    67                                  
    68 
    69                                 $template->set_filenames(
     63                                 $template->set_filenames(
    7064                                                array('autosize_content'=> $my_path.'template/autosize.tpl')
    7165                                        );
    72                    $template->assign(
    73                                                 array('DEBUG' => $debug   ,
    74                                                 'cl_visible' =>  $cl_visible
    75                                                 )
    76                                                  );             
    77                                                                        
     66                                                                                                       
    7867                                return $template->parse( 'autosize_content', false);
    79                         }
    80      
    81                 }
     68     
     69                  }
    8270                }
    8371        } //public function cl_autosize_affiche
     
    133121 {
    134122                global  $template,$user,$conf,$picture ,$page,$cl_plugin;
    135                 //userDefManage ??
     123 
    136124                $my_path =  basename(dirname(__FILE__)).'/' ;
    137125                $my_path = dirname(__FILE__).'/';
    138                 $debug = isset($conf['debug']) ? $conf['debug'] : false ;
     126                $DEBUG = isset($conf['cl_debug']) ? $conf['cl_debug'] : "false" ;
    139127               
    140128                $ThePicture = $template->get_template_vars('current');
    141129                $tpl_name =   $user['theme'] ;
    142                 if ( !empty($content) )   {  return $content;  }       
    143                 if ($ThePicture['is_picture'] <> 1 )    {  return $content;  ; }       
     130
    144131 $autosizejs ='<!--- cl_autosize_script_3 -->';
    145132                $autosizejs = $autosizejs.'<script type="text/javascript" id="jquery" charset="utf-8"  src="';
    146133                $autocss =   $autosizejs.'themes/default/js/jquery.packed.js"></script>'."\n";
    147                 $template->append('head_elements',$autocss);
     134        //      $template->append('head_elements',$autocss);
    148135 
    149136                $autocss="<script type='text/javascript'>
    150 jQuery('#theImage').css({opacity:'0.0'});
     137                /* cl_autosize_script_3 */
     138                var DEBUG=\"".$DEBUG."\" ;
     139                if (fade_in !=0) jQuery('#theImage').css({opacity:'0.0'});
    151140</script>";
    152141
    153142                $template->append('footer_elements',"\n".$autocss);
     143
     144                if ( !empty($content) )   {  return $content;  }       
     145                if ($ThePicture['is_picture'] <> 1 )    {
     146                 return $content;  ;
     147                 }     
     148
     149
    154150                return $content ;
    155151
     
    162158                        $my_path =  basename(dirname(__FILE__)).'/' ;
    163159                        $my_path = dirname(__FILE__).'/';
    164                         $debug = isset($conf['debug']) ? $conf['debug'] : false ;
    165                        
     160                        $DEBUG =  isset($conf['cl_debug']) ? $conf['cl_debug'] : "false" ;
     161                        $ma_page=isset($page['body_id'])?$page['body_id']:"" ;
    166162                        $theme=$user['theme'];
    167163                        $template->assign(
     
    169165                                        'cl_version' => $cl_plugin['version'] ,
    170166                                        'name' => $cl_plugin['name'] ,
    171                                         'ma_page' =>    $page['body_id'],
     167                                        'ma_page' =>    $ma_page,
    172168                                       
    173169                                        'theme' => $theme  ,
    174                                         'DEBUG' => $debug   ,
     170                                        'DEBUG' => $DEBUG   ,
    175171                                        'AUTOSIZE_PATH' => AUTOSIZE_PATH
    176172                                        )
     
    178174                                                 
    179175$autoscript="<script type='text/javascript'>
     176/* cl_autosize_script_2 */
     177var DEBUG=\"".$DEBUG."\" ;
    180178if (typeof (save_framework) == 'function')
    181    save_framework('".$page['body_id']."');
     179   save_framework('".$ma_page."');
    182180</script>";
    183181                         $template->append('footer_elements',$autoscript); 
     
    192190        {
    193191           global  $template,$user,$conf,$picture ,$page, $cl_plugin ;
    194 
    195                 $my_path =  basename(dirname(__FILE__)).'/' ;
     192                if(isset($page['body_id']) &&   $page['body_id'] == 'theAdminPage' ) return ;
     193
    196194            $my_path = dirname(__FILE__).'/';
    197195                $template->set_filenames(array('autosize_init'=>$my_path. "template/conflit.tpl" ) );   
    198                 $debug = isset($conf['debug']) ? $conf['debug'] : false ;
     196                $DEBUG = isset($conf['cl_debug']) ? $conf['cl_debug'] : "false" ;
    199197                $autosize_parametres =   cl_autosize_Get_Options() ;                   
    200198                $theme=$user['theme'];
    201                          
     199                $url = get_root_url();   
     200                 
    202201                $template->assign(
    203                                                 array(
     202                                                array(  
    204203                                                'autosize_parametres' => $autosize_parametres ,
    205204                                                'cl_plugins' => $cl_plugin ,
    206205                                                'cl_version' => $cl_plugin['version'] ,
    207206                                                'name' => $cl_plugin['name'] ,
    208                                                
     207                                                 
     208                                                 'MY_ROOT' => get_root_url(),
    209209                                                'theme' => $theme  ,
    210                                                 'DEBUG' => $debug   ,
     210                                                'DEBUG' => $DEBUG   ,
    211211                                                'AUTOSIZE_PATH' => AUTOSIZE_PATH)
    212212                                                 );
    213 
    214                 if(     $page['body_id'] == 'theAdminPage' ) return ;
     213 
    215214                return $template->parse( 'autosize_init', false);
    216215        }// function cl_autosize_script
  • extensions/Autosize/include/affiche.php

    r7962 r8057  
    99$cl_version=isset($cl_version)?$cl_version:"";
    1010$cl_plugin=isset($cl_plugin)?$cl_plugin:"";
     11$cl_visible=isset($conf['cl_auto']) ? $conf['cl_auto'] : 'true' ;
     12 $DEBUG=isset($_POST['cl_debug']) ? $_POST['cl_debug'] : "false" ;
     13$DEBUG= isset($conf['cl_debug']) ? $conf['cl_debug'] : $DEBUG ;
     14 
    1115
    1216$theme=$user['theme'];
    1317$user_status = $user['status'] ;
    14 
     18                   $template->assign( array(
     19                                                                                        )
     20                                                                        );             
    1521        $template->assign(
    1622                                        array(
     23                                        'DEBUG' =>  $DEBUG   ,
     24                                        'cl_visible' =>  $cl_visible,
    1725                                        'cl_version' => $cl_version,
    1826                                        'cl_plugin' => $cl_plugin,
  • extensions/Autosize/js/Affiche_script.js

    r8007 r8057  
    13111311
    13121312
    1313 
    1314      $(function () {
    1315 
     1313$(function () {
    13161314         jQuery('#pamoorama').live('ON', function (e) {
    13171315             jQuery(jQuery('.debug').get(1)).trigger('ON');
     
    13561354
    13571355         // Add 10 testing debugs to start with
    1358 
     1356         jQuery(window).load(function () {
    13591357         if (DEBUG == "true") {
    13601358             for (var i = 0; i < 10; i++) {
     
    13641362
    13651363         }
    1366          //  }); //on load
     1364        }); //on load
    13671365     });
  • extensions/Autosize/js/conflit.js

    r7962 r8057  
    1 //==== autosize  remplace $(... avec jQuery( ====
    2 /*
    3 *[gmaps=id:1;width:800;height:640;]
    4 *       Luciano rv_gmaps
    5 * pb : Gmaps llgbo pamooramics rv_map
    6 */
    7 var d1 = 0;
    8 var init_tb = 0;
    9 var dom = {};
    10 
    11 if (typeof jQuery == 'undefined') {
    12     alert(" jQuery n'est pas chargé");
    13 } else {
    14     // jQuery est chargé
    15 }
    16 
    17 try{
    18     if (DEBUG == "true") {
    19 
    20     }
    21 }catch(e)
    22 {
    23     DEBUG = "false";
    24 }
     1//==== cl_conflit  remplace $(... avec jQuery( ====
     2
    253//===================================================
    264var detect = navigator.userAgent.toLowerCase();
     
    8765netscape = mybrowser.netscape || false;
    8866
    89 
    90 //========================================
    91 /*function $defined(A) {
    92 $ = _$2; //   ;
    93 return A != undefined;
    94 }
    95 */
    96 
    9767var time_out = 0;
    9868//===================================================
     
    11484    else if (retour.match(RegExp("rv_gmaps", "gi"))) {
    11585        ret_element = jQuery().$Prototype(element);
    116     } else if (retour.match(RegExp("GMaps", "gi"))) {
    117        
     86    } else if (retour.match(RegExp("GMaps", "gi"))) {     
    11887
    11988        ret_element = jQuery(element);
     
    167136    return ret_element;
    168137} // conflit(element,nc)
    169 
    170 
    171 
    172 
    173 
     138//======================================================
     139/*
     140*
     141*
     142*/
     143//======================================================
    174144jQuery(document).ready(
    175     function (jQuery) {
    176         jQuery(window).load(function () {
    177             //============================================================
    178             jQuery("#icon_gmaps").bind('click', function () {
     145       function (jQuery) {
     146            jQuery(window).load(function () {
     147             //============================================================
     148             jQuery("#icon_gmaps").bind('click', function () {
    179149
    180150                jQuery('html,body').stop().scrollTop(0);
     
    191161            if (typeof(Parent)=="undefined")
    192162                Parent = "#theImage";
    193 
    194             info_image = jQuery(Parent).infos();
    195             p0 = jQuery(Parent);
    196             if (p0.length > 0) {   
    197 
    198                 //======================================================
    199                 if (theme.match("gally", "gi"))
     163                info_image = jQuery(Parent).infos();
     164                p0 = jQuery(Parent);
     165                if (p0.length > 0) {   
     166                    //======================================================
     167                    if (theme.match("gally", "gi"))
    200168                    if (jQuery.isFunction(inittoolbar)) {
    201169                        if (typeof (currentTab) == "undefined") inittoolbar();
    202                         else initializeImageMode("resize");
    203                    
    204 
    205                     if (info_image.position != "static") {
    206                     //==== compatibilité Gally/LLGBO ===
    207                     //--- passage relative ==> static ===/
    208                     jQuery(Parent).css({ position: "static" } );
    209                     jQuery("#imageToolBar").css({ position: "relative", top: "0px" });
    210                     };
     170                            else initializeImageMode("resize");
     171                        if (info_image.position != "static") {
     172                            //==== compatibilité Gally/LLGBO ===
     173                            //--- passage relative ==> static ===/
     174                            jQuery(Parent).css({ position: "static" } );
     175                            jQuery("#imageToolBar").css({ position: "relative", top: "0px" });
     176                        };
     177                     }
    211178                }
    212             }
    213179            //   jQuery(window).resize();
    214 
    215180        });
    216         //=============================================================       
    217 
    218         //  $ = _$2; ;
    219 
    220 
    221     })
    222 ;
     181    //=============================================================       
     182    //  $ = _$2; ;
     183});
    223184
    224185
     
    228189jQuery.fn.extend({
    229190
    230     //---------------- luciano -------------------------------
    231     $Luciano: function (el, nc) {
    232         return document.id(el, nc, this.document);
    233     },
    234     //=============== PaMOOramics ===========================
    235 
    236     $Pamoorama: function (B) {
    237 
    238 
    239         if (!B) {
    240             if (typeof (B) == "boolean") return null;
    241 
    242         }
    243 
    244         try {
    245             if (B.htmlElement) {
    246                 return Garbage.collect(B);
    247             }
    248         } catch (e) {
    249 
    250         }
    251 
    252         if ([window, document].contains(B)) { return B; }
    253         var A = $type(B);
    254         if (A == "string") { B = document.getElementById(B); A = (B) ? "element" : false; }
    255         if (A != "element") {
    256             return null;
    257         }
    258         if (B.htmlElement) { return Garbage.collect(B); }
    259         if (["object", "embed"].contains(B.tagName.toLowerCase())) { return B; }
    260         $extend(B, Element.prototype);
    261         B.htmlElement = function () { };
    262         try { return Garbage.collect(B); } catch (e) {
    263             return;
    264         }
    265 
    266     },
    267     //===================================================
    268     $Prototype: function (element) {
    269         //======== prototype.js =====================
    270         if (arguments.length > 1) {
    271             for (var i = 0, elements = [], length = arguments.length; i < length; i++)
    272                 elements.push($(arguments[i]));
    273             return elements;
    274         }
    275         if (typeof element == "string")
    276             element = document.getElementById(element);
    277 
    278         return Element.extend(element);
    279 
    280         try {
    281             new_element = Element.extend(element);
    282         } catch (e) {
    283             return new_element;
    284         }
    285         return new_element;
    286     }
    287     //=========================================================
     191//---------------- luciano -------------------------------
     192$Luciano: function (el, nc) {
     193return document.id(el, nc, this.document);
     194},
     195//=============== PaMOOramics ===========================
     196
     197$Pamoorama: function (B) {
     198
     199
     200if (!B) {
     201if (typeof (B) == "boolean") return null;
     202
     203}
     204
     205try {
     206if (B.htmlElement) {
     207return Garbage.collect(B);
     208}
     209} catch (e) {
     210
     211}
     212
     213if ([window, document].contains(B)) { return B; }
     214var A = $type(B);
     215if (A == "string") { B = document.getElementById(B); A = (B) ? "element" : false; }
     216if (A != "element") {
     217return null;
     218}
     219if (B.htmlElement) { return Garbage.collect(B); }
     220if (["object", "embed"].contains(B.tagName.toLowerCase())) { return B; }
     221$extend(B, Element.prototype);
     222B.htmlElement = function () { };
     223try { return Garbage.collect(B); } catch (e) {
     224return;
     225}
     226
     227},
     228//===================================================
     229$Prototype: function (element) {
     230//======== prototype.js =====================
     231if (arguments.length > 1) {
     232for (var i = 0, elements = [], length = arguments.length; i < length; i++)
     233elements.push($(arguments[i]));
     234return elements;
     235}
     236if (typeof element == "string")
     237element = document.getElementById(element);
     238
     239return Element.extend(element);
     240
     241try {
     242new_element = Element.extend(element);
     243} catch (e) {
     244return new_element;
     245}
     246return new_element;
     247}
     248//=========================================================
    288249});    // fin extend
    289250
     
    509470//====================================
    510471
    511 
    512 (function ($) {
    513     $(document).ready(function () {
    514         jQuery(window).load(function () {
    515             a = jQuery(':Description');
    516         });
    517     });
    518     //==============================================
    519     librairies=[];
    520     jQuery.extend(jQuery.expr[':'], {
    521         // Nom du sélecteur personnalisé
    522         Description: function (a) {
    523             n = jQuery(a).infos();
    524             if (n.id != "") {
    525                 //alert("<" + n.nodeName  +" id= " + n.id    + " >") ;
    526             }
    527             if (n.nodeName == "SCRIPT")
    528                 if (a.src == "") {
    529                     Match = jQuery(a).html();
    530                     /*
    531                     if ( Match.match(new RegExp("jQuery", "gi") )) {
    532                     alert(n.id + n.nodeName + a.outerHTML ) ;
    533                     }
    534                     if ( Match.match(new RegExp("ajax", "gi") )) {
    535                     alert(n.id + n.nodeName + a.outerHTML ) ;
    536                     }
    537                     */
    538                     if (Match.match(new RegExp("\\$", "gi"))) {
    539 
    540                         if (Match.match(new RegExp("ajax", "gi"))) {
    541                             //     alert(n.id + n.nodeName + a.outerHTML);
    542 
    543                         }
    544                     }
    545                     if (Match.match(new RegExp("pamoorama", "ig"))) {
    546 
    547                         //     alert(n.id + n.nodeName + a.innerHTML);
    548 
    549                     }
    550                 } else {
    551 
    552                     if (a.src.match(RegExp("mootools|pamooramic|luciano", "gi"))) {
    553                         jQuery.noop;
    554                         librairies.push(a.src);
    555                     }
    556 
    557                 }
    558 
    559             return a;
    560 
    561         }
    562     }); //fin extend
    563     /*
    564     *
    565     */
    566 })(jQuery);
    567 
    568  
    569472 
    570473$_0= $;
  • extensions/Autosize/main.inc.php

    r8006 r8057  
    1212define(  'AUTOSIZE_PATH',   PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/' );
    1313//=================================================================================
    14         $path = AUTOSIZE_PATH;
    15 //============================================================================         
    16  include($path."include/constants.php");           
     14               
     15 include(AUTOSIZE_PATH."include/constants.php");           
    1716 include_once(AUTOSIZE_PATH.'autosize.inc.php');
    1817//==================================================================
  • extensions/Autosize/template/autosize.tpl

    r7962 r8057  
    44    {known_script id="jquery.cluetip" src=$ROOT_URL|@cat:"themes/default/js/plugins/jquery.cluetip.packed.js"}
    55    {known_script id="dimensions" src=$AUTOSIZE_PATH|@cat:"js/jquery.dimensions.js"}
    6 
    7 
    86 <script type="text/javascript">
    9     var visible = '{$visible}';
    107    var fade_in = '{$fade_in}';
    118    var cl_visible = "{$cl_visible}" =="true";
     
    5350 <!--  << autosize/template/autosize.tpl   -->
    5451{/html_head} 
    55 
    56 
     52<script type="text/javascript">
     53    var DEBUG = '{$DEBUG}';
     54    var visible = '{$visible}';
     55   </script>
    5756{if $DEBUG == "true"}
    5857  {assign var="visible" value="block"}
     
    9695    {/literal}
    9796    {else}
    98   {assign var="visible" value="none"} {/if}<!--  << autosize/template/autosize.tpl body  -->
     97  {assign var="visible" value="none"} {/if}
     98 
     99  <!--  << autosize/template/autosize.tpl body  -->
  • extensions/Autosize/template/cl_conflit.tpl

    r7912 r8057  
    55        {/html_head}
    66
    7 <!--- {$AUTOSIZE_PATH} template/cl_confilt.tpl (body) --->
     7<!---{$ROOT_URL} -- {$AUTOSIZE_PATH} template/cl_confilt.tpl (body) --->
    88 
    99<!---FIN  {$AUTOSIZE_PATH} template/cl_confilt.tpl (body) --->
  • extensions/Autosize/template/conflit.tpl

    r7962 r8057  
    11{html_head}
    2   <!--- Autosize/template/confilt.tpl (head) ---> 
     2  <!--- {$AUTOSIZE_PATH}template/confilt.tpl (head) ---> 
    33  <!--- Ajout scripts {$AUTOSIZE_PATH}--->   
    4 {known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js"  now=1} <!--- jquery.packed.js --->
    5 {known_script id="conflit_script" src=$AUTOSIZE_PATH|@cat:"js/conflit.js"}<!--- conflit.js --->
    6 {known_script id="dimensions" src=$AUTOSIZE_PATH|@cat:"js/jquery.dimensions.js"}<!---jquery.dimensions.js --->
     4{known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js"  now=1}<!--- RECHARGE DE {$ROOT_URL|@cat:"themes/default/js/jquery.packed.js"} --->
     5<script type="text/javascript">
     6    var DEBUG = '{$DEBUG}';
     7</script>
     8{known_script id="conflit_script" src=$AUTOSIZE_PATH|@cat:"js/conflit.js"}<!--- {$AUTOSIZE_PATH|@cat:"js/conflit.js"} --->
     9{known_script id="dimensions" src=$AUTOSIZE_PATH|@cat:"js/jquery.dimensions.js"}<!---{$AUTOSIZE_PATH|@cat:"js/jquery.dimensions.js"} --->
    710<!--- fin Ajout scripts  --->
    811<script type="text/javascript">
    9     var DEBUG = '{$DEBUG}';
    1012    var theme = '{$theme}';
    1113    var cl_version = '{$cl_version}';
     
    2426<!---FIN Autosize/template/confilt.tpl (/head) --->     
    2527{/html_head}
    26 
    27 <!--- Autosize/template/confilt.tpl (body) ---> 
    28 
    29 
    30 <!---FIN Autosize/template/confilt.tpl (body) --->     
     28<!---{$ROOT_URL} --- {$AUTOSIZE_PATH}template/confilt.tpl (body) ---> 
     29<!---FIN {$ROOT_URL} --- {$AUTOSIZE_PATH}template/confilt.tpl (body) --->       
Note: See TracChangeset for help on using the changeset viewer.