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

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

[Autosize][beta]Include an option for the description and the copyright.


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