source: extensions/Autosize/js/conflit.js @ 7672

Last change on this file since 7672 was 7672, checked in by cljosse, 13 years ago

[Autosize][beta] fix display time(to test!)

File size: 9.0 KB
Line 
1//==== autosize  remplace $(... avec jQuery( ====
2var d1 = 0;
3var init_tb = 0;
4//===================================================
5 
6function $(element, nc) {
7   return conflit(element, nc) 
8}
9//===================================================
10function conflit(element, nc) {
11    try {
12       var  retour = alert(nonExistentVariable);
13       
14    } catch (e) {
15
16   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);
37if (retour.match(RegExp("jquery|switchmenu|gmaps|switchInterface|gally", "gi"))) {
38    return jQuery(element);
39}
40 
41
42if (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      })
125;
126
127
128//=========================================================
129(function ($2) {
130              $2.fn.panorama2 =
131                    function (height, width) {               
132                        var src =jQuery(this);
133                         return ;
134                        } 
135
136
137})(jQuery);
138
139
140jQuery.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    //=========================================================
192});   // fin extend
193
194
195
196
197function getStackTrace() {
198    var callstack = [];
199    var isCallstackPopulated = false;
200   try {
201        i.dont.exist += 0; //doesn't exist- that's the point
202    } 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======================================
245    }
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("(")) || " ";
258            callstack.push(fn);
259            // if (fname != " $") callstack.push(fn);
260            if (fn.match(RegExp("buildFrameWork", "gi"))) {  //luciano
261                break;
262            }
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", "gi"))) {
274    break ;
275}
276            currentFunction = currentFunction.caller;
277        }
278 
279    }
280   
281    return callstack.join('\n');
282}
283/*
284//1.2.4
285 Element1.Events.domready = {
286    onAdd: function (fn) {
287        if (Browser.loaded) fn.call(this);
288    }
289} ;
290
291Element2.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 TracBrowser for help on using the repository browser.