Changeset 8187 for extensions/cl_conflit


Ignore:
Timestamp:
Dec 18, 2010, 12:33:20 PM (13 years ago)
Author:
cljosse
Message:

[cl_conflit] fix bug whith user $.post


Location:
extensions/cl_conflit
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • extensions/cl_conflit/conflit.inc.php

    r7945 r8187  
    3939                $template->set_filenames(array('cl_conflit_init'=>$my_path. "template/conflit.tpl" ) );
    4040                $debug = isset($conf['debug']) ? $conf['debug'] : false ;
    41                 $cl_conflit_parametres =         cl_conflit_Get_Options() ;                     
     41$cl_conflit_parametres =         cl_conflit_Get_Options() ;
     42
     43                       
    4244                $theme=$user['theme'];
    4345               
     
    5153                                                'theme' => $theme  ,
    5254                                                'DEBUG' => $debug   ,
    53                                                 'CONFLIT_PATH' => CONFLIT_PATH)
     55                                                'CONFLIT_ROOT' => CONFLIT_PATH)
    5456                                                 );
    5557
     
    155157  global $cl_conflit_parametres;
    156158//=============================================================================
    157   $my_para=$cl_conflit_parametres;
     159$cl_conflit_parametres->query =(isset($_POST['query'])) ? $_POST['query'] : ((isset($cl_conflit_parametres->query )) ? $cl_conflit_parametres->query : 'Qt' ) ;
     160$cl_conflit_parametres->type=(isset($_POST['type']))? $_POST['type']: ((isset($cl_conflit_parametres->type)) ? $cl_conflit_parametres->type:  'Ty') ;
    158161
    159 $my_para->query =(isset($_POST['query'])) ? $_POST['query'] : ((isset($my_para->query )) ? $my_para->query : 'Qt' ) ;
    160 $my_para->type=(isset($_POST['type']))? $_POST['type']: ((isset($my_para->type)) ? $my_para->type:  'Ty') ;
    161162 
    162  
    163 return $my_para;
     163return $cl_conflit_parametres;
    164164}
    165165        /*
  • extensions/cl_conflit/js/conflit.js

    r7945 r8187  
    1 //==== autosize  remplace $(... avec jQuery( ====
     1//==== cl_conflit  remplace $(... avec jQuery( ====
    22/*
    33*[gmaps=id:1;width:800;height:640;]
     
    99var dom = {};
    1010if (typeof jQuery == 'undefined') {
    11     alert(" jQuery n'est pas chargé");
     11  //  alert(" jQuery n'est pas chargé");
    1212} else {
    1313    // jQuery est chargé
    1414}
    15 try(
    16 DEBUG = DEBUG || "false";
    17 }catch(e)
    18 {
    19 
    20 }
     15
    2116//===================================================
    2217var detect = navigator.userAgent.toLowerCase();
     
    8277netscape = mybrowser.netscape || false;
    8378
    84 
    85 //========================================
    86 /*function $defined(A) {
    87 $ = _$2; //   ;
    88 return A != undefined;
    89 }
    90 */
    91 
    9279var time_out = 0;
    9380//===================================================
     
    9683var Fn;
    9784function conflit(element, nc) {
    98     //--- cl_conflit   
     85    //--- cl_conflit
     86if (typeof MooTools=="undefined" && typeof  Prototype=="undefined" ) {
     87       ret_element = jQuery(element);
     88        return ret_element;
     89    }
     90    //====================================================
     91    if (typeof (element) == "string") {
     92        if (element.match("^#|.ui", "gi")) {
     93            ret_element = jQuery(element);
     94            return ret_element;
     95        }
     96   
     97    }
     98
    9999    var retour = (getStackTrace());
    100100    Fn = retour.fn;
    101101    retour = retour.state;
    102102
    103     n = document;
    104     v = window;
    105103    var ret_element = "";
    106104    if (retour.match(RegExp("jQuery", "gi"))) {
     
    108106    }
    109107    else if (retour.match(RegExp("rv_gmaps", "gi"))) {
    110         ret_element = jQuery().$Prototype(element);
    111     } else if (retour.match(RegExp("GMaps", "gi"))) {
    112        
     108    try{
     109        ret_element = myjQuery().$Prototype(element);
     110        }
     111        catch(e)
     112        {
     113
     114         ret_element = myjQuery().$Prototype(element);
     115
     116        }
     117    } else if (retour.match(RegExp("GMaps", "gi"))) {     
    113118
    114119        ret_element = jQuery(element);
     
    120125
    121126        }
    122         nbpa += 1;
     127       
    123128
    124129    } else if (retour.match(RegExp("luciano", "gi"))) {
     
    151156
    152157
     158    } else if (element == window) {
     159
     160        ret_element = jQuery(element);
     161        return ret_element;
     162
     163
    153164    }
    154165    tp0 = typeof (element);
     
    162173    return ret_element;
    163174} // conflit(element,nc)
    164 
     175//======================================================
     176/*
     177*
     178*
     179*/
     180//======================================================
    165181jQuery(document).ready(
    166     function (jQuery) {
    167         jQuery(window).load(function () {
    168             //============================================================
    169             jQuery("#icon_gmaps").bind('click', function () {
     182       function (jQuery) {
     183            jQuery(window).load(function () {
     184             //============================================================
     185             jQuery("#icon_gmaps").bind('click', function () {
    170186
    171187                jQuery('html,body').stop().scrollTop(0);
     
    182198            if (typeof(Parent)=="undefined")
    183199                Parent = "#theImage";
    184 
    185             info_image = jQuery(Parent).infos();
    186             p0 = jQuery(Parent);
    187             if (p0.length > 0) {   
    188 
    189                 //======================================================
    190                 if (theme.match("gally", "gi"))
     200                info_image = jQuery(Parent).infos();
     201                p0 = jQuery(Parent);
     202                if (p0.length > 0) {   
     203                    //======================================================
     204                    if (theme.match("gally", "gi"))
    191205                    if (jQuery.isFunction(inittoolbar)) {
    192206                        if (typeof (currentTab) == "undefined") inittoolbar();
    193                         else initializeImageMode("resize");
    194                    
    195 
    196                     if (info_image.position != "static") {
    197                     //==== compatibilité Gally/LLGBO ===
    198                     //--- passage relative ==> static ===/
    199                     jQuery(Parent).css({ position: "static" } );
    200                     jQuery("#imageToolBar").css({ position: "relative", top: "0px" });
    201                     };
     207                            else initializeImageMode("resize");
     208                        if (info_image.position != "static") {
     209                            //==== compatibilité Gally/LLGBO ===
     210                            //--- passage relative ==> static ===/
     211                            jQuery(Parent).css({ position: "static" } );
     212                            jQuery("#imageToolBar").css({ position: "relative", top: "0px" });
     213                        };
     214                     }
    202215                }
    203             }
    204216            //   jQuery(window).resize();
    205217
    206218        });
    207         //=============================================================       
    208 
    209         //  $ = _$2; ;
    210 
    211 
    212     })
    213 ;
     219    //=============================================================       
     220    //  $ = _$2; ;
     221});
    214222
    215223
     
    219227jQuery.fn.extend({
    220228
    221     //---------------- luciano -------------------------------
    222     $Luciano: function (el, nc) {
    223         return document.id(el, nc, this.document);
    224     },
    225     //=============== PaMOOramics ===========================
    226 
    227     $Pamoorama: function (B) {
     229//---------------- luciano -------------------------------
     230$Luciano: function (el, nc) {
     231return document.id(el, nc, this.document);
     232},
     233//=============== PaMOOramics ===========================
     234
     235$Pamoorama: function (B) {
    228236
    229237
     
    499507}
    500508//====================================
    501 
    502 
    503 (function ($) {
    504     $(document).ready(function () {
    505         jQuery(window).load(function () {
    506             a = jQuery(':Description');
    507         });
    508     });
    509     //==============================================
    510     librairies=[];
    511     jQuery.extend(jQuery.expr[':'], {
    512         // Nom du sélecteur personnalisé
    513         Description: function (a) {
    514             n = jQuery(a).infos();
    515             if (n.id != "") {
    516                 //alert("<" + n.nodeName  +" id= " + n.id    + " >") ;
    517             }
    518             if (n.nodeName == "SCRIPT")
    519                 if (a.src == "") {
    520                     Match = jQuery(a).html();
    521                     /*
    522                     if ( Match.match(new RegExp("jQuery", "gi") )) {
    523                     alert(n.id + n.nodeName + a.outerHTML ) ;
    524                     }
    525                     if ( Match.match(new RegExp("ajax", "gi") )) {
    526                     alert(n.id + n.nodeName + a.outerHTML ) ;
    527                     }
    528                     */
    529                     if (Match.match(new RegExp("\\$", "gi"))) {
    530 
    531                         if (Match.match(new RegExp("ajax", "gi"))) {
    532                             //     alert(n.id + n.nodeName + a.outerHTML);
    533 
    534                         }
    535                     }
    536                     if (Match.match(new RegExp("pamoorama", "ig"))) {
    537 
    538                         //     alert(n.id + n.nodeName + a.innerHTML);
    539 
    540                     }
    541                 } else {
    542 
    543                     if (a.src.match(RegExp("mootools|pamooramic|luciano", "gi"))) {
    544                         jQuery.noop;
    545                         librairies.push(a.src);
    546                     }
    547 
    548                 }
    549 
    550             return a;
    551 
    552         }
    553     }); //fin extend
    554     /*
    555     *
    556     */
    557 
    558 
    559 
    560 
    561 
    562 
    563 })(jQuery);
    564 
    565  
    566  
    567 $_0= $;
    568 function $(element, nc0) {
    569     a = conflit(element, nc0);
    570     return a;
    571 }
    572 if (typeof ($.ajax) != "function") {
    573     $.ajax = function (origSettings) {
    574         jQuery.ajax(origSettings);
    575     }
    576 
    577 
    578     $.parseJSON = function (msg) {
    579         return jQuery.parseJSON(msg);
    580     }
    581 
    582 
    583 }
    584 //============================================
    585 /* url (String): URl de la page à charger
    586 * params (Map): (optionnel) paires de clé/valeur qui seront envoyées au serveur.
    587 * callback (Fonction): (optionnel) fonction qui sera éxécutée quand les données sera chargées.
    588 * type (String): (optionnel) format des données renvoyées à la fonction de callback
    589 */
    590 if (typeof ($.get) != "function") {
    591     $.get = function ( a, b, c, d) {
    592         return jQuery.get(a, b, c,d );
    593     }
    594 
    595 
    596 }
    597  
     509test_conflit = false;
     510 librairies =new Array;
     511
     512
    598513
    599514$_ = $;
     
    604519
    605520    }
    606    
    607     $_2 = $;
     521        $_2 = $;
    608522    return
    609 
     523    }
     524
     525(function ($) {
     526    $(document).ready(function () {   
     527          //=================================================
     528          if (typeof  jQuery.fn.infos !="function")
     529          {
     530               jQuery=myjQuery;
     531               $=my$ ;
     532               }
     533        });
     534
     535})(jQuery);
     536
     537if(test_conflit!=true)
     538{
     539//--------------------------------------------------------------
     540$_0 = $;
     541 
     542        function $(element, nc0) {
     543            if (typeof  jQuery.fn.infos !="function") 
     544             if (typeof  myjQuery !="undefined")
     545                 jQuery=myjQuery;   
     546             a = conflit(element, nc0);
     547            return a;
     548
     549        }
     550       
     551        if (typeof ($.ajax) != "function") {
     552            $.ajax = function (origSettings) {
     553                jQuery.ajax(origSettings);
     554            }
     555
     556
     557            $.parseJSON = function (msg) {
     558                return jQuery.parseJSON(msg);
     559            }
     560
     561
     562        }
     563        //============================================
     564        /* url (String): URl de la page à charger
     565        * params (Map): (optionnel) paires de clé/valeur qui seront envoyées au serveur.
     566        * callback (Fonction): (optionnel) fonction qui sera éxécutée quand les données sera chargées.
     567        * type (String): (optionnel) format des données renvoyées à la fonction de callback
     568        */
     569        if (typeof ($.get) != "function") {
     570            $.get = function ( a, b, c, d) {
     571                return jQuery.get(a, b, c,d );
     572            }
     573        }
     574        if (typeof ($.post) != "function") {
     575
     576            $.post = function (a, b, c,d) {
     577                return jQuery.post(a, b, c, d);
     578            }
     579            ;
     580
     581        }
     582       
     583
     584 
    610585}
    611 
     586//--------------------------------------------------------------
  • extensions/cl_conflit/js/jquery.dimensions.js

    r7914 r8187  
    3232                        borr = name == 'Height' ? 'Bottom' : 'Right';
    3333                    options = options || false;
    34                     options = jQuery.extend({ margin: options } );
     34                    options = jQuery.extend({ margin: options });
    3535
    3636                    var val = this.is(':visible') ? this[0]['offset' + name] :
     
    299299    };
    300300
    301 
     301    myjQuery = jQuery;
     302    my$ = $;
    302303
    303304})(jQuery);
  • extensions/cl_conflit/template/conflit.tpl

    r7945 r8187  
    11{html_head}
    2 <!--- cl_conflit/template/confilt.tpl (html_head) --->
    3 <!--- Ajout scripts {$CONFLIT_PATH}--->
    4 {known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js" } <!--- jquery.packed.js --->
    5 {known_script id="conflit_script" src=$CONFLIT_PATH|@cat:"js/conflit.js"}<!--- conflit.js --->
    6 {known_script id="dimensions" src=$CONFLIT_PATH|@cat:"js/jquery.dimensions.js"}<!---jquery.dimensions.js --->
    7 <!--- fin Ajout scripts  --->
     2<!--- Autosize/template/confilt.tpl (before) --->
     3{known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js" }
     4{known_script id="conflit_script" src=$CONFLIT_ROOT|@cat:"js/conflit.js"}
     5    {known_script id="dimensions" src=$CONFLIT_ROOT|@cat:"js/jquery.dimensions.js"}
     6<!---FIN Autosize/template/confilt.tpl (before) --->    {/html_head}   
    87<script type="text/javascript">
    98    var DEBUG = '{$DEBUG}';
     
    2221{/if}
    2322</script>
    24 <!---FIN cl_conflit/template/confilt.tpl (html_head) --->
    25 {/html_head}   
Note: See TracChangeset for help on using the changeset viewer.