Ignore:
Timestamp:
Nov 8, 2010, 3:00:27 PM (13 years ago)
Author:
cljosse
Message:

[Autosize][beta] save

File:
1 edited

Legend:

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

    r7673 r7702  
    11//==== autosize  remplace $(... avec jQuery( ====
     2/*
     3* A faire Compatibilité entre LLGBO GMAPS
     4*       Luciano rv_gmaps
     5*/
    26var d1 = 0;
    37var init_tb = 0;
    48//===================================================
    5  
    69function $(element, nc) {
    7    return conflit(element, nc)
     10        return conflit(element, nc)
    811}
    912//===================================================
    1013function conflit(element, nc) {
    11     try {
    12        var  retour = alert(nonExistentVariable);
    13        
    14     } catch (e) {
    15 
    1614   var retour=(getStackTrace());
    17 
    18     }
    19 
    20     if (retour == "")
    21         return jQuery(element);
    22 
    23 
    24     if (retour.match(RegExp("pamoorama", "gi"))) {
    25         return jQuery().$Pamoorama(element);
    26     }
    27 
    28     if (retour.match(RegExp("luciano", "gi"))) {
    29         return jQuery().$Luciano(element);
    30     }
    31 
    32     if (retour.match(RegExp("prototype.js", "gi"))) {
    33     return jQuery().$Prototype(element);
    34 }   
    35 
    36 //alert(retour);
    37 if (retour.match(RegExp("jquery|switchmenu|gmaps|switchTabs|switchInterface|gally|initializeImageMode", "gi"))) {
    38     return jQuery(element);
    39 }
    40  
    41 
    42 if (retour.match(RegExp("ie_ready", "gi"))) {
    43     return jQuery().$Pamoorama(element);
    44 }
    45     if (retour.match(RegExp("skipInit", "gi"))) {
    46         return jQuery().$Pamoorama(element);
    47     }
    48     //==============================================================
    49    
    50     if (retour.match(RegExp("(splat|buildFrameWork|photoNext)", "gi"))) {
    51            ret = jQuery().$Luciano(element);
    52            return ret;
    53        }
    54 
    55        //  var form = $('rateForm');
    56        Expression = new RegExp("\$", "gi")
    57        if (retour.match(Expression)) {
    58            if (retour.match(RegExp("rateForm", "gi"))) {
    59                ret = jQuery().$Luciano(element);
    60                return ret;
    61            }
    62        }
    63        if (typeof(Browser)!="undefined")
    64            if (Browser.loaded)
    65                b="mootools1.2.4"
    66 
    67 
    68 
    69     if (retour.match(RegExp("gmaps", "gi"))) {
    70         return jQuery(element);
    71     }
    72     if (retour.match(RegExp("responder", "gi"))) {
    73         return jQuery().$Prototype(element);
    74     }
    75     if (retour.match(RegExp("fire", "gi"))) {
    76         return jQuery().$Prototype(element);
    77     }
    78     if (retour.match(RegExp("createResponder", "gi"))) {
    79         return jQuery().$Prototype(element);
    80     }
    81     if (retour.match(RegExp("element =", "gi"))) {
    82       //  return jQuery().$Prototype(element);
    83     }
    84     if (retour.match(RegExp("stopO", "g"))) {
    85         return jQuery().$Prototype(element);
    86     }
    87     if (element == "document") return jQuery(element);
    88    // alert(retour);
    89 
    90     retour= jQuery(element);
    91     return retour;
    92 
    93 
    94          return jQuery().$Pamoorama(element);
    95            
    96               }
    97               //============================================================
    98 
    99               jQuery(document).ready(
    100       function (jQuery) {
    101 
    102           tpj = jQuery("#pamoorama");
    103           if (tpj.length > 0) { }
    104           jQuery(window).load(function () {
    105 
    106               function $(element, nc) {
    107                   return conflit(element, nc);
    108               }
    109               tpfn=typeof( inittoolbar);
    110 
    111               if (tpfn == "function") inittoolbar();
    112               jQuery("#imageToolBar").css({ position: "relative", top: "0px" });
    113              
    114 
    115               if (jQuery("#theImage").css("position") == "relative") {
    116                   //==== compatibilité Gally/LLGBO ===
    117                   //--- passage relative ==> static ===/
    118                   jQuery("#theImage").css("position", "static");
    119                   jQuery("#imageToolBar").css({ position: "relative", top: "0px" });
    120               }
    121  jQuery(window).resize();
    122           });
    123 
    124       })
     15var ret_element = "";
     16if (retour.match(RegExp("jQuery", "gi"))) {
     17        ret_element = jQuery(element);
     18    } else if (retour.match(RegExp("pamooramics", "gi"))) {
     19    ret_element = jQuery().$Pamoorama(element);
     20} else if (retour.match(RegExp("luciano", "gi"))) {
     21    ret_element = jQuery().$Luciano(element);
     22} else if (retour.match(RegExp("rv_gmaps", "gi"))) {
     23        ret_element = jQuery().$Prototype(element);
     24}else if (retour.match(RegExp("GMaps", "gi"))) {
     25        ret_element = jQuery(element);
     26}else if (retour.match(RegExp("jQuery", "gi"))) {
     27        ret_element = jQuery(element);
     28}
     29if (ret_element != "")
     30        return ret_element;
     31if (DEBUG)
     32    alert(retour);
     33        if (retour == "")
     34                return jQuery(element);
     35}
     36
     37//============================================================
     38jQuery(document).ready(
     39    function (jQuery) {
     40        jQuery(window).load(function () {
     41            function $(element, nc) {
     42                return conflit(element, nc);
     43            }
     44
     45            if (theme.match("gally", "gi"))
     46                if (isFunction(inittoolbar)) {
     47                    if (typeof (currentTab) == "undefined") inittoolbar();
     48                    else initializeImageMode("resize");
     49                };
     50
     51                p1 = jQuery("#theImage").css("position");
     52                if (p1 != "static") {
     53                    //==== compatibilité Gally/LLGBO ===
     54                    //--- passage relative ==> static ===/
     55                    jQuery("#theImage").css( {position:"static",
     56                         opacity: '0', filter: 'alpha(opacity= 0)'
     57                     }
     58
     59                   );
     60                    jQuery("#imageToolBar").css({ position: "relative", top: "0px" });
     61                }
     62
     63            jQuery(window).resize();
     64
     65        });
     66
     67    })
    12568;
    12669
    127 
     70function isFunction(fn) {
     71    tpfn = typeof (fn);
     72    if (tpfn == "function") return true;
     73}
    12874//=========================================================
    12975(function ($2) {
    130               $2.fn.panorama2 =
    131                     function (height, width) {               
    132                         var src =jQuery(this);
    133                          return ;
    134                         }
     76$2.fn.panorama2 =
     77function (height, width) {               
     78var src =jQuery(this);
     79return ;
     80}
    13581
    13682
     
    13985
    14086jQuery.fn.extend({
    141     //---------------- luciano -------------------------------
    142     $Luciano: function (el, nc) {
    143         return document.id(el, nc, this.document);
    144     },
    145     //=============== PaMOOramics ===========================
    146 
    147     $Pamoorama: function (B) {
    148         if (!B) {
    149             if (typeof (B) == "boolean") return null;
    150             return jQuery();
    151         }
    152         if (B.htmlElement) {
    153             return Garbage.collect(B);
    154 
    155         }
    156         if ([window, document].contains(B)) { return B; }
    157         var A = $type(B);
    158         if (A == "string") { B = document.getElementById(B); A = (B) ? "element" : false; }
    159         if (A != "element") {
    160             return null;
    161         }
    162         if (B.htmlElement) { return Garbage.collect(B); }
    163         if (["object", "embed"].contains(B.tagName.toLowerCase())) { return B; }
    164         $extend(B, Element.prototype);
    165         B.htmlElement = function () { };
    166        try{ return Garbage.collect(B);}catch(e){
    167        return ;
    168        }
    169 
    170     },
    171     //===================================================
    172     $Prototype: function (element) {
    173         //======== prototype.js =====================
    174         if (arguments.length > 1) {
    175             for (var i = 0, elements = [], length = arguments.length; i < length; i++)
    176                 elements.push($(arguments[i]));
    177             return elements;
    178         }
    179         if (typeof element == "string")
    180             element = document.getElementById(element);
    181 
    182           return Element.extend(element);
    183 
    184         try {
    185             new_element = Element.extend(element);
    186         } catch (e) {
    187             return new_element;
    188         }
    189         return new_element;
    190     }
    191     //=========================================================
     87//---------------- luciano -------------------------------
     88$Luciano: function (el, nc) {
     89return document.id(el, nc, this.document);
     90},
     91//=============== PaMOOramics ===========================
     92
     93$Pamoorama: function (B) {
     94if (!B) {
     95if (typeof (B) == "boolean") return null;
     96return jQuery();
     97}
     98if (B.htmlElement) {
     99return Garbage.collect(B);
     100
     101}
     102if ([window, document].contains(B)) { return B; }
     103var A = $type(B);
     104if (A == "string") { B = document.getElementById(B); A = (B) ? "element" : false; }
     105if (A != "element") {
     106return null;
     107}
     108if (B.htmlElement) { return Garbage.collect(B); }
     109if (["object", "embed"].contains(B.tagName.toLowerCase())) { return B; }
     110$extend(B, Element.prototype);
     111B.htmlElement = function () { };
     112try{ return Garbage.collect(B);}catch(e){
     113return ;
     114}
     115
     116},
     117//===================================================
     118$Prototype: function (element) {
     119//======== prototype.js =====================
     120if (arguments.length > 1) {
     121for (var i = 0, elements = [], length = arguments.length; i < length; i++)
     122elements.push($(arguments[i]));
     123return elements;
     124}
     125if (typeof element == "string")
     126element = document.getElementById(element);
     127
     128return Element.extend(element);
     129
     130try {
     131new_element = Element.extend(element);
     132} catch (e) {
     133return new_element;
     134}
     135return new_element;
     136}
     137//=========================================================
    192138});   // fin extend
    193139
    194140
    195141
    196 
     142/*
     143* mootools.js  version: "1.11"
     144* pamoorama0.3.js
     145*
     146* main.js (google maps)
     147* prototype.js(mootool version: "1.62")
     148* windows.js
     149*
     150*/
    197151function getStackTrace() {
    198152    var callstack = [];
    199153    var isCallstackPopulated = false;
    200    try {
    201         i.dont.exist += 0; //doesn't exist- that's the point
     154    try {
     155            i.dont.exist += 0; //doesn't exist- that's the point
    202156    } catch (e) {
    203      
    204    var retcallstack = [];
    205         if (e.stack) { //Firefox
    206             var lines = e.stack.split("\n");
    207             for (var i = 2, len = lines.length; i < len; i++) {
    208                 if (lines[i].match(/conflit.js/)) {
    209                     //
    210                 } else if (lines[i].match(/^\s*[A-Za-z0-9\-_\$]+\(/)) {
    211                     callstack.push(lines[i]); //php?
    212                 } else {
    213                     callstack.push(lines[i]);
    214 
    215                 }
    216                 if (lines[i].match("prototype")) {
    217                     break;
    218                 }
    219             }
    220             //Remove call to printStackTrace()
    221             //callstack.shift();
    222             isCallstackPopulated = true;
    223             isCallstackPopulated = false;
    224 
    225         }
    226         else if (window.opera && e.message) {
    227             //Opera =================================
    228             var lines = e.message.split("\n");
    229             for (var i = 0, len = lines.length; i < len; i++) {
    230                 if (lines[i].match(/^\s*[A-Za-z0-9\-_\$]+\(/)) {
    231                     var entry = lines[i];
    232                     //Append next line also since it has the file info
    233                     if (lines[i + 1]) {
    234                         entry += " at " + lines[i + 1];
    235                         i++;
    236                     }
    237                     callstack.push(entry);
    238                 }
    239             }
    240             //Remove call to printStackTrace()
    241            // callstack.shift();
    242             isCallstackPopulated = true;
    243         }
    244         //===== fin Opera======================================
     157        var retcallstack = [];
     158        var e_message = e.message;
     159        var  e_stack = e.stack;
     160if (e_stack) { //Firefox Opera 3.6
     161//=== test fichier source =============
     162var lines = e.stack.split("\n");
     163for (var i = 0, len = lines.length; i < len; i++) {
     164var Src_Match = lines[i];
     165if (Src_Match.match(/conflit.js/)) {
     166//
     167} else {
     168if (Src_Match.match(/^\s*[A-Za-z0-9\-_\$]+\(/)) {
     169callstack.push(Src_Match); //php?
     170} else {
     171callstack.push(Src_Match);
     172}
     173if (Src_Match.match("rv_gmaps", "gi")) {
     174callstack.push("rv_gmaps");
     175isCallstackPopulated = true;
     176break;
     177}
     178if (Src_Match.match("paMOOramics")) {
     179isCallstackPopulated = true;
     180callstack.push("paMOOramics");
     181break;
     182}
     183if (Src_Match.match("Luciano","gi")) {
     184callstack.push("Luciano");
     185isCallstackPopulated = true;
     186break;
     187}
     188if (Src_Match.match("main")) {
     189alert(Src_Match)
     190callstack.push("main");
     191isCallstackPopulated = true;
     192break;
     193}
     194if (Src_Match.match("GMaps|applyMap")) {
     195callstack.push("GMaps");
     196isCallstackPopulated = true;
     197break;
     198}
     199if (Src_Match.match("jQuery")) {
     200callstack.push("jQuery");
     201isCallstackPopulated = true;
     202break;
     203}
     204}
     205}
     206//callstack.shift();
     207}
     208if (window.opera && e.message && isCallstackPopulated == false) {
     209   callstack = [];
     210//Opera =================================
     211var lines = e.message.split("\n");
     212for (var i = 0, len = lines.length; i < len; i++) {
     213if (lines[i].match(/^\s*[A-Za-z0-9\-_\$]+\(/)) {
     214var entry = lines[i];
     215//Append next line also since it has the file info
     216if (lines[i + 1]) {
     217entry += " at " + lines[i + 1];
     218i++;
     219}
     220callstack.push(entry);
     221 isCallstackPopulated = true;
     222}
     223}
     224
     225}
     226//===== fin Opera======================================
     227}
     228if (!isCallstackPopulated) { //IE and Safari
     229    var currentFunction = arguments.callee.caller;
     230    //next
     231    callstack = [];
     232    all_functions = [];
     233    if (currentFunction == null) {
     234        return ("");
    245235    }
    246     if (!isCallstackPopulated) { //IE and Safari
    247         var currentFunction = arguments.callee.caller;
    248         //next
    249         if (currentFunction == null) {
    250             return ("The function was called from the top!");
    251         }
    252 
    253         currentFunction = currentFunction.caller;
    254         //$family
    255         while (currentFunction) {
    256             var fn = currentFunction.toString();
    257             var fname = fn.substring(fn.indexOf("function") + 8, fn.indexOf("(")) || " ";
     236
     237    currentFunction = currentFunction.caller;
     238    //$family
     239    while (currentFunction) {
     240        var fn = currentFunction.toString();
     241         
     242
     243        var fname = fn.substring(fn.indexOf("function") + 8, fn.indexOf("(")) || " ";
     244        if (fname != " $") {
    258245            callstack.push(fn);
    259246            // if (fname != " $") callstack.push(fn);
    260             if (fn.match(RegExp("buildFrameWork", "gi"))) {  //luciano
    261                 break;
     247                           if (fn.match(RegExp("jquery|switchmenu|gmaps|switchTabs|switchInterface|gally|initializeImageMode", "gi"))) {
     248                    callstack.push('jQuery');
     249                    break;
     250                }
     251
     252
     253                if (fn.match(RegExp("_footer|ie_ready", "gi"))) {
     254                    callstack.push('paMOOramics');
     255                    break;
     256                }
     257                if (fn.match(RegExp("observe|responder|stopobserving|fireContentLoadedEvent", "gi"))) {
     258                    callstack.push('rv_gmaps');
     259                    break;
     260                }
     261                //? bubble 
     262                Expression = new RegExp("\$", "gi")
     263                if (fn.match(Expression)) {
     264                    if (fn.match(RegExp("rateForm", "gi"))) {
     265                        callstack.push('Luciano');
     266                        break;
     267                    }
     268                }
     269                if (fn.match(RegExp("(splat|buildFrameWork|photoNext)", "gi"))) {  //luciano
     270                    callstack.push('Luciano');
     271                    break;
     272                }
     273
    262274            }
    263             if (fn.match(RegExp("_footer", "gi"))) {
    264                 break;
    265             }
    266             if (fn.match(RegExp("observe|responder|stopobserving", "gi"))) {
    267                 callstack.push('prototype.js');
    268                  break;
    269             }
    270             if (fn.match(RegExp("stopobserving", "gi"))) {
    271               break;
    272             }
    273           if (fn.match(RegExp("jquery|switchmenu|gmaps|switchTabs|switchInterface|gally|initializeImageMode", "gi"))) {
    274     break ;
    275 }
    276             currentFunction = currentFunction.caller;
     275         
     276        currentFunction = currentFunction.caller;
    277277        }
    278278 
    279     }
     279}
    280280   
    281281    return callstack.join('\n');
    282282}
    283 /*
    284 //1.2.4
    285  Element1.Events.domready = {
    286     onAdd: function (fn) {
    287         if (Browser.loaded) fn.call(this);
    288     }
    289 } ;
    290 
    291 Element2.Events.domready = {
    292     add: function (B) {
    293         if (window.loaded) { B.call(this); return; }
    294         var A = function () {
    295             if (window.loaded) { return; }
    296             window.loaded = true;
    297             window.timer = $clear(window.timer);
    298             this.fireEvent("domready");
    299         } .bind(this);
    300     }
    301 }
    302 */
Note: See TracChangeset for help on using the changeset viewer.