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

Last change on this file since 7262 was 7262, checked in by cljosse, 14 years ago

[Autosize][beta] GMaps compatibility.


File size: 12.8 KB
Line 
1//==== remplace $(... avec jQuery( ====
2var d1 = 0;
3var init_tb = 0;
4 
5function $(element, nc) {
6    //============== détection framework ==================
7   
8
9    var tp1 = typeof (MooTools);
10    var MooTools_version = "0";
11
12    if (tp1 != "undefined") {
13        if (MooTools.version == "1.2.4") {
14            MooTools_version = "Luciano"; // luciano
15            ret_Luciano = jQuery().$Luciano(element, nc);
16        }
17
18    if (MooTools.version == "1.11") {
19        MooTools_version = "pamoorama"; //pamoorama
20        try {
21           
22        } catch (e) {
23       
24        };
25        }
26
27
28    }
29
30    tp1 = typeof (Prototype);
31   var Prototype_Version = '0';
32   if (tp1 != "undefined") {
33       if (Prototype.Version == '1.6.0.2') {
34           Prototype_Version = '1602';
35         
36       } else if (Prototype.Version == '1.6.1') {
37          Prototype_Version = '161';
38         
39       } else if (Prototype.Version == '1.0.0.0') {
40          Prototype_Version = '1';
41       
42       }
43   }
44     //===================================================
45   var  jq = jQuery(element).selector;
46   var  new_element = jQuery(element);
47
48   if (Prototype_Version == "0" && MooTools_version == "0") {
49       if (jq == "#iGMapsIconContent") {
50           
51           setTimeout('jQuery().recentrage_widget()', 0);
52           return new_element;
53         
54       }
55         return new_element;
56    }
57//=======================================================================================
58    if (arguments.caller && arguments.caller.length>0 ) {
59        if (arguments.caller.length > 1) {
60            if (element == "pamoorama") {
61                return jQuery().$Pamoorama(element) ;
62            }
63
64            //=========== options rv_maps prototype.js ===================================   
65            arg = arguments.caller[1];
66            if (Prototype_Version != '0')
67            switch (arg) {
68                case "dom:loaded":
69                    return element;
70                    return jQuery().$Protype(element);
71                    break;
72                case "load":
73                    return jQuery().$Protype(element); 
74                    break;
75                case "unload":
76                    return jQuery().$Protype(element);
77                    break;
78                case "prototype_event_registry":
79
80                    try {
81                        new_element = jQuery().$Protype(element);
82                    } catch (e) {
83                        new_element = null;
84                    }
85
86                   
87                    return new_element;
88                    break;
89                case "readystatechange":
90                    try {
91                        new_element = jQuery().$Protype(element);
92                    } catch (e) {
93                        new_element = null;
94                    }
95
96                    return new_element; 
97                    break;
98            }
99
100            if (MooTools_version == 'pamoorama')
101            //=========== options pamoorama =================================== 
102            {
103                var reg1 = new RegExp("pamoorama", "g");
104                switch (arg) {
105                    case "bottom":
106                        return jQuery().$Pamoorama(element) ;
107                        break;
108                    case "left":
109                        return jQuery().$Pamoorama(element) ;
110                        break;
111                    case "prototype_event_registry":
112                        return jQuery().$Pamoorama(element) ;
113                        break;
114                    case "readystatechange":
115                        return jQuery().$Pamoorama(element);
116                        break;
117
118                    default:
119                        if (arg.area) {
120                            return jQuery().$Pamoorama(element);
121                        } else
122                            if (arg.velocity) {
123                                return jQuery().$Pamoorama(element);
124                            } else if (arg.src) {
125                                return jQuery().$Pamoorama(element);
126                            } else if (arg.modifiers) {
127                                return jQuery().$Pamoorama(element);
128                            } else if (arg.limit) {
129                                return jQuery().$Pamoorama(element);
130                            } else if (arg.duration) {
131                                return jQuery().$Pamoorama(element);
132                            } else if (arg.id) {
133                                switch (arg.id) {
134                                    case "pamoorama_footer":
135                                        return jQuery().$Pamoorama(element);
136                                        break;
137                                    case "pamoorama_outter":
138                                        return jQuery().$Pamoorama(element);
139                                        break;
140                                    case "pamoorama_inner":
141                                        return jQuery().$Pamoorama(element);
142                                        break;
143
144                                    default:
145                                        return jQuery().$Pamoorama(element);
146                                        break;
147
148                                }
149                            } else if (arg.src) {
150                                return jQuery().$Pamoorama(element);
151
152                            }
153                        //=======================================================
154                            return new_element;
155                        break;
156
157                }
158            }else if (MooTools_version=='Luciano')
159             { //=========== options luciano ===================================
160                 //=== theme Luciano ====
161                 return ret_Luciano;
162             }
163        }
164    }
165
166     //==================================================
167     tpe = typeof (element);
168      if (Prototype_Version != '0') {
169          if (tpe == "string") {   
170           //=== rvmaps === //
171              if (element.match(/[a-z]_[a-z]/)) {
172                 
173                  return jQuery().$Protype(element);
174              }
175          id = "window_" + new Date().getTime();
176              var reg1 = new RegExp("^window_", "g");
177              if (element.match(reg1, "g")) {
178                 
179                  if (element.match(/_[a-z]/)) {
180                      return jQuery().$Protype(element);
181                  }
182                  return null;
183              }
184          }
185     }
186    //========== test jQuery ? ==============
187
188    if (jq.match(RegExp("^#", "g")) || jq == "html") {
189        return new_element;
190    }
191     if (tpe == "undefined") {
192        return jQuery();
193    }
194    //==== mootools ====
195    if (MooTools_version == "Luciano" && tpe=="string") {
196        //=== theme Luciano ====
197        new_element = jQuery().$Luciano(element, nc);
198        return new_element;
199
200    }
201
202    if (MooTools_version == 'pamoorama')
203    //=========== options pamoorama =================================== 
204    {
205     
206    if (tpe=="string")
207        switch (jq) {
208            case "ie_ready":
209                return jQuery().$Pamoorama(element);
210                break;
211            case "pamoorama":
212                return jQuery().$Pamoorama(element);
213                break;
214            case ".tab a":
215                return jQuery(element);
216                break;
217
218        }else if(tpe=="boolean")
219        {
220            return jQuery().$Pamoorama(element);
221        }
222        el = element.nodeName;
223        if (el == "DIV") return jQuery().$Pamoorama(element);
224        if (el == "IMG") return jQuery().$Pamoorama(element);
225        if (el == "#document") return jQuery(element) ;
226        if (el == "BODY") {
227            try { return jQuery().$Pamoorama(element) } catch (e) {
228  return jQuery(element);
229            };
230         
231        }
232        if (element == window)
233            return new_element;
234       jQuery().$Pamoorama(element);
235    }
236    obj_panorama = jQuery("#Panorama");
237    if (obj_panorama.length > 0 && jq != "rateForm" && jq != "order" && jq != "themeSelect") {
238        if (tpe == "object")
239            if (Prototype_Version != '0') {
240                //=== rvmaps ===
241                try { elem_retour=jQuery().$Protype(element);
242                    return elem_retour;
243                } catch (e) {
244                     
245                }
246            }
247
248        if (new_element.length < 2) return new_element;
249        if (new_element.length == 2) return jQuery(element).get(1);
250        if (new_element.length == 3) return jQuery(element).get(2);
251
252    }
253    afq = jQuery(document).data("initialized"); //2
254    if (element == window && afq != 1)
255        if (init_tb == 1) {
256            init_tb = 2;
257            return new_element;
258        }
259
260    if (new_element.context && afq != 1 && afq != undefined) {
261        if (init_tb != 2) init_tb = 1;
262        return new_element;
263    }
264    //==========================================================
265    if (new_element.context)
266        if (new_element.context.loaded) {
267    //=== theme Luciano ====
268        if (MooTools_version == "Luciano")  return ret_Luciano;
269        //=== theme gally ? ====
270       
271            return new_element;
272        }
273    init_tb = 0;
274    //================================================================
275
276        //==== mootools ====
277        if (MooTools_version == "Luciano") {
278            //=== theme Luciano ====
279            new_element = ret_Luciano;
280            tp = new_element.nodeName + new_element.nodeType;
281            if (tp == "DIV1") return new_element;
282            tp = element.nodeName + element.nodeType;
283            return new_element;
284
285        } else if (MooTools_version == "pamoorama") {
286            //=== paMOOramics ===
287            // ie_ready,undefined
288            return jQuery().$Pamoorama(element);
289        }
290
291    //=================================================================
292
293    if (Prototype_Version != '0') {
294        //=== rvmaps ===
295        try {
296            return jQuery().$Protype(element);
297        } catch (e) {
298            return jQuery(element);
299        }
300    }
301    return jQuery(element);
302
303}
304
305//=========================================================
306(function ($) {
307              $.fn.panorama2 =
308              function (height, width) {
309               
310           var src =jQuery(this);
311
312          return ;
313
314$("#theImage img").eq(0).removeAttr("style").attr({width:width,height:height});
315retour= jQuery('a.panorama-control-left').click();
316panoramaContainer=jQuery('panorama-container');
317
318            /*
319                $(panoramaContainer).stop();
320                op=options;
321                settings.direction = 'right';
322                panoramaContainer.panorama_animate(panoramaContainer, elemWidth, settings);
323             */ 
324               
325
326                           
327
328
329              } 
330
331
332})(jQuery);
333
334
335jQuery.fn.extend({
336    //---------------- luciano -------------------------------
337    $Luciano: function (el, nc) {
338        return document.id(el, nc, this.document);
339    },
340    //=============== PaMOOramics ===========================
341    $Pamoorama: function (B) {
342        if (!B) {
343            if (typeof (B) == "boolean") return null;
344            return jQuery();
345        }
346        if (B.htmlElement) {
347            return Garbage.collect(B);
348
349        }
350        if ([window, document].contains(B)) { return B; }
351        var A = $type(B);
352        if (A == "string") { B = document.getElementById(B); A = (B) ? "element" : false; }
353        if (A != "element") {
354            return null;
355        }
356        if (B.htmlElement) { return Garbage.collect(B); }
357        if (["object", "embed"].contains(B.tagName.toLowerCase())) { return B; }
358        $extend(B, Element.prototype);
359        B.htmlElement = function () { };
360       try{ return Garbage.collect(B);}catch(e){
361       return ;
362       }
363
364    },
365    //===================================================
366    $Protype: function (element) {
367        //======== prototype.js =====================
368        if (arguments.length > 1) {
369            for (var i = 0, elements = [], length = arguments.length; i < length; i++)
370                elements.push($(arguments[i]));
371            return elements;
372        }
373        if (typeof element == "string")
374            element = document.getElementById(element);
375
376          return Element.extend(element);
377
378        try {
379            new_element = Element.extend(element);
380        } catch (e) {
381            return new_element;
382        }
383        return new_element;
384    }
385    //=========================================================
386});   // fin extend
Note: See TracBrowser for help on using the repository browser.