Changeset 8926


Ignore:
Timestamp:
Jan 26, 2011, 6:42:36 PM (13 years ago)
Author:
cljosse
Message:

[cl_conflit] script compatibility with piwigo 2.2

Location:
extensions/cl_conflit/js
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/cl_conflit/js/conflit.js

    r8793 r8926  
    11//==== cl_conflit  remplace $(... avec jQuery( ====
    2 
    32//===================================================
    43var detect = navigator.userAgent.toLowerCase();
     4//   $_SERVER['HTTP_USER_AGENT'] ;
    55var OS, version;
    66//==============================================================================
    77browser = detect_browser();
    8 
    98function detect_browser() {
     9
    1010    mybrowser = {
    1111        browser: "",
     
    1717        firefox: false,
    1818        msie: false,
    19         netscape: false
     19        netscape: false,
     20        seamonkey: false
    2021    }
    2122    if (checkIt('konqueror')) { mybrowser.Konqueror = true; lbrowser = "konqueror"; OS = "Linux"; }
     23    else if (checkIt('seamonkey')) { mybrowser.seamonkey = true; lbrowser = "seamonkey"; }
    2224    else if (checkIt('chrome')) { mybrowser.chrome = true; lbrowser = "chrome"; }
    2325    else if (checkIt('safari')) { mybrowser.safari = true; lbrowser = "safari"; }
     
    3739        else OS = "an unknown operating system";
    3840    }
    39     mybrowser.version =version;
     41    mybrowser.version = version;
    4042    mybrowser.OS = OS;
    4143    mybrowser.browser = lbrowser;
    4244    return mybrowser
    43 
    44 
    4545};
    46 
    47 
    48 
    4946function checkIt(string) {
    5047    place = detect.indexOf(string) + 1;
     
    5249    return place;
    5350}
     51
    5452/*
    5553 
    5654*/
    57 
    58 
    5955konqueror = mybrowser.konqueror || false;
    6056chrome = mybrowser.chrome || false;
     
    6561msie = mybrowser.msie || false;
    6662netscape = mybrowser.netscape || false;
    67 
    6863var time_out = 0;
    6964//===================================================
    70 
    7165nbpa = 0;
    7266var Fn;
     
    8377            return ret_element;
    8478        }
    85    
     79
    8680    }
    8781
     
    113107
    114108        }
    115        
     109
    116110
    117111    } else if (retour.match(RegExp("luciano", "gi"))) {
    118          
     112
    119113
    120114        ret_element = jQuery().$Luciano(element, nc);
     
    184178            })
    185179            //============================================================= 
    186 
    187180            //   jQuery(window).resize();
    188181        });
    189         //=============================================================       
    190182        //  $ = _$2; ;
    191183    });
    192 
    193 
    194 
    195184//=========================================================
    196 
    197185jQuery.fn.extend({
     186    $: function (el, nc) {
     187        a = conflit(el, nc);
     188        return a;
     189    },
    198190
    199191    //---------------- luciano -------------------------------
     
    320312                        callstack.push("jQuery");
    321313                        isCallstackPopulated = true;
    322                      
     314
    323315                        break;
    324316                    }
     
    460452    state = states.join('\n');
    461453    if (state == "") {
    462        
     454
    463455        if (DEBUG == "true") {
    464456            Fn = all_functions.join('\n');
     
    469461        }
    470462
    471  
     463
    472464        state = state_ff;
    473465    }
     
    477469}
    478470//====================================
    479 test_conflit = false;
     471
    480472librairies = new Array;
    481 
    482 
    483 
    484473$_ = $;
    485474function save_framework(page) {
     
    512501                    //==== compatibilité Gally/LLGBO ===                 
    513502                    jQuery(Parent).css({ position: "static" });
    514 
    515503                }
    516504            } catch (e) {
     
    519507        }
    520508    }
    521      
     509
    522510    $_2 = $;
    523511    return
     
    535523})(jQuery);
    536524
    537 if (test_conflit != true) {
     525if (typeof MooTools == "undefined" && typeof Prototype == "undefined") {
     526
     527} else {}
    538528    //--------------------------------------------------------------
    539529    $_0 = $;
    540 
    541530    function $(element, nc0) {
    542531        if (typeof jQuery.fn.infos != "function")
     
    546535        return a;
    547536    }
    548 
    549 
    550         $.isFunction = function (value) { return jQuery.isFunction(value); }
    551         $.inArray = function (a, b) { return jQuery.inArray(a, b); }
    552         $.error  = function (a , b , c)  {jQuery.error(a , b , c);}
    553 
    554     if (typeof ($.extend) != "function") {
    555 
    556      $.extend = function (a,b) {
    557          return jQuery.extend(a, b);
    558         } ;
    559 
    560  
    561      }
    562 
    563     if (typeof ($.ajax) != "function") {
    564         $.ajax = function (origSettings) {
    565             jQuery.ajax(origSettings);
    566         }
    567 
    568 
    569         $.parseJSON = function (msg) {
    570             return jQuery.parseJSON(msg);
    571         }
    572 
    573 
    574     }
    575     //============================================
    576     /* url (String): URl de la page à charger
    577     * params (Map): (optionnel) paires de clé/valeur qui seront envoyées au serveur.
    578     * callback (Fonction): (optionnel) fonction qui sera éxécutée quand les données sera chargées.
    579     * type (String): (optionnel) format des données renvoyées à la fonction de callback
    580     */
    581     if (typeof ($.get) != "function") {
    582         $.get = function (a, b, c, d) {
    583             return jQuery.get(a, b, c, d);
    584         }
    585     }
    586     if (typeof ($.post) != "function") {
    587 
    588         $.post = function (a, b, c, d) {
    589             return jQuery.post(a, b, c, d);
    590         }
    591         ;
    592 
    593     }
    594  
    595 }
    596 //--------------------------------------------------------------
     537    //=== ajout des fonctions jQuery ===
     538    jQuery.extend($, jQuery);
     539
     540
     541    //--------------------------------------------------------------
     542
  • extensions/cl_conflit/js/jquery.dimensions.js

    r8740 r8926  
    5858            }) : this[0] == window || this[0] == document ? self[(name == 'Left' ? 'pageXOffset' : 'pageYOffset')] || jQuery.boxModel && document.documentElement['scroll' + name] || document.body['scroll' + name] : this[0]['scroll' + name];
    5959        };
     60        //================================================
     61        jQuery.fn['absolute' + name] = function (val) {
     62            if (!this[0]) return;
     63                       a = jQuery(this[0]);
     64            m = 0;
     65            while (a.length > 0) {
     66                val = jQuery(a).infos();
     67                if (val.position != "absolute") {
     68                    m += name == 'Left' ? val.left : val.top;
     69                    m += name == 'Left' ? val.margin.left : val.margin.top;
     70                    m += name == 'Left' ? val.margin.right : val.margin.bottom;
     71                    m += name == 'Left' ? val.borderwidth.left : val.borderwidth.top;
     72                 //   m += name == 'Left' ? val.borderwidth.right : val.borderwidth.bottom;
     73                 //   m += name == 'Left' ? val.padding.left : val.padding.top;
     74                 //   m += name == 'Left' ? val.padding.right : val.padding.bottom;
     75                     a = jQuery(a).offsetParent();
     76                } else
     77                    break;
     78
     79            }
     80            //306
     81
     82
     83            return m;
     84
     85
     86        };
     87
    6088
    6189    });
     90    //=====================================================
    6291    jQuery.fn.extend({
    6392
     
    106135                if (elem.nodeName) nodeName = elem.nodeName;
    107136
    108                
     137
    109138                if (elem == window) {
    110139
     
    113142                    height = jQuery(elem).height();
    114143                } else {
     144
    115145                    Css = jQuery(elem).getStyles(elem);
    116146                    myposition = Css.position || "";
     
    135165                    margin.top = jQuery(elem).Get_Val_int(Css.marginTop, "", "", 'marginTop');
    136166                    margin.bottom = jQuery(elem).Get_Val_int(Css.marginBottom, "", "", 'marginBottom');
     167
     168
    137169                    try {
    138170                        margin.margin = Css.margin;
     
    146178                    padding.top = jQuery(elem).Get_Val_int(Css.paddingTop, "", "", 'paddingTop');
    147179                    padding.bottom = jQuery(elem).Get_Val_int(Css.paddingBottom, "", "", 'paddingBottom');
     180
    148181                    try {
    149182                        padding.padding = Css.padding;
     
    155188                    Cl_Position = { Top: 0, Left: 0 };
    156189                } else {
    157                     Cl_Position = jQuery(elem).position();
     190                    Cl_Position = jQuery(elem).d_position();
    158191                }
    159192                Left = Cl_Position.left;
     
    181214        * Cl_Position de l'object elem
    182215        */
    183         position: function () {
     216        d_position: function () {
    184217            var left = 0, top = 0, elem = this[0], offset, parentOffset, offsetParent, results;
    185218
     
    249282        Get_Val_int: function (myObj, Maxi_val, Mini_val, prop) {
    250283            var val = 0;
    251 
    252284            Maxi_val = parseInt(Maxi_val || "0");
    253285
Note: See TracChangeset for help on using the changeset viewer.