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

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

[Autosize][beta] fix bug with pamooramic...

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