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

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

[Autosize][beta] adjust width with pamooramic.

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