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

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

[Autosize][beta] save

File size: 9.5 KB
Line 
1//==== autosize  remplace $(... avec jQuery( ====
2/*
3* A faire Compatibilité entre LLGBO GMAPS
4*           Infobulles spécifiques pour les EXIFS au survol du bouton :  Non  pour être ok
5*
6*       Luciano rv_gmaps
7*/
8var d1 = 0;
9var init_tb = 0;
10//$ = jQuery.noConflict();
11
12//===================================================
13function $(element, nc) {
14
15        return conflit(element, nc)
16    }
17
18//===================================================
19function conflit(element, nc) {
20    var retour = (getStackTrace());
21 
22var ret_element = "";
23if (retour.match(RegExp("jQuery", "gi"))) {
24        ret_element = jQuery(element);
25    } else if (retour.match(RegExp("GMaps", "gi"))) {
26        ret_element = jQuery(element);
27    } else if (retour.match(RegExp("pamooramics", "gi"))) {
28    ret_element = jQuery().$Pamoorama(element);
29} else if (retour.match(RegExp("luciano", "gi"))) {
30    ret_element = jQuery().$Luciano(element);
31} else if (retour.match(RegExp("rv_gmaps", "gi"))) {
32        ret_element = jQuery().$Prototype(element);
33}else if (retour.match(RegExp("jQuery", "gi"))) {
34        ret_element = jQuery(element);
35    }
36
37if (ret_element != "")
38    return ret_element;
39
40if (typeof (element) == "string") {
41    if (element.match("^#|.ui", "gi")) {
42        ret_element = jQuery(element);
43        return ret_element;
44    }
45} else if (typeof (element) == "function") {
46    fn = element.toString();
47    if (fn.match("#pwg", "gi")) {
48        ret_element = jQuery(element);
49        return ret_element;
50    }
51} else if ( element==document) {
52 
53        ret_element = jQuery(element);
54        return ret_element;
55   
56     
57    }
58tp0 = typeof (element);
59
60 ret_element = jQuery(element);
61if (DEBUG == "true") {
62     retour = (getStackTrace());
63     alert("element : " + element + " retour : " + retour);
64   
65}
66 return  ret_element ;
67}
68
69//============================================================
70jQuery(document).ready(
71    function (jQuery) {
72        jQuery(window).load(function () {
73            function $(element, nc) {
74                return conflit(element, nc);
75            }
76            p0 = jQuery("#theImage");
77            if (p0.length) {
78                if (theme.match("gally", "gi"))
79                    if (isFunction(inittoolbar)) {
80                        if (typeof (currentTab) == "undefined") inittoolbar();
81                        else initializeImageMode("resize");
82                    };
83
84                p1 = jQuery("#theImage").css("position");
85                if (p1 != "static") {
86                    //==== compatibilité Gally/LLGBO ===
87                    //--- passage relative ==> static ===/
88                    jQuery("#theImage").css({ position: "static",
89                        opacity: '0', filter: 'alpha(opacity= 0)'
90                    }
91
92                   );
93                    jQuery("#imageToolBar").css({ position: "relative", top: "0px" });
94                }
95            }
96            //   jQuery(window).resize();
97
98        });
99
100    })
101;
102
103function isFunction(fn) {
104    tpfn = typeof (fn);
105    if (tpfn == "function") return true;
106}
107//=========================================================
108(function ($2) {
109ajax: function () {return jQuery.ajax;
110}
111return jQuery;
112$2.fn.panorama2 =
113function (height, width) {               
114var src =jQuery(this);
115return ;
116} 
117
118
119})(jQuery);
120
121
122jQuery.fn.extend({
123     
124    //---------------- luciano -------------------------------
125    $Luciano: function (el, nc) {
126        return document.id(el, nc, this.document);
127    },
128    //=============== PaMOOramics ===========================
129
130    $Pamoorama: function (B) {
131        if (!B) {
132            if (typeof (B) == "boolean") return null;
133
134        }
135       
136            try {
137                if (B.htmlElement) {
138                    return Garbage.collect(B);
139                }
140            } catch (e) { 
141           
142            }
143
144        if ([window, document].contains(B)) { return B; }
145        var A = $type(B);
146        if (A == "string") { B = document.getElementById(B); A = (B) ? "element" : false; }
147        if (A != "element") {
148            return null;
149        }
150        if (B.htmlElement) { return Garbage.collect(B); }
151        if (["object", "embed"].contains(B.tagName.toLowerCase())) { return B; }
152        $extend(B, Element.prototype);
153        B.htmlElement = function () { };
154        try { return Garbage.collect(B); } catch (e) {
155            return;
156        }
157
158    },
159    //===================================================
160    $Prototype: function (element) {
161        //======== prototype.js =====================
162        if (arguments.length > 1) {
163            for (var i = 0, elements = [], length = arguments.length; i < length; i++)
164                elements.push($(arguments[i]));
165            return elements;
166        }
167        if (typeof element == "string")
168            element = document.getElementById(element);
169
170        return Element.extend(element);
171
172        try {
173            new_element = Element.extend(element);
174        } catch (e) {
175            return new_element;
176        }
177        return new_element;
178    }
179    //=========================================================
180});    // fin extend
181
182
183
184/*
185* mootools.js  version: "1.11"
186* pamoorama0.3.js
187*
188* main.js (google maps)
189* prototype.js(mootool version: "1.62")
190* windows.js
191*
192*/
193function getStackTrace() {
194    var callstack = [];
195    var isCallstackPopulated = false;
196    try {
197            i.dont.exist += 0; //doesn't exist- that's the point
198    } catch (e) {
199        var retcallstack = [];
200        var e_message = e.message;
201        var  e_stack = e.stack;
202if (e_stack) { //Firefox Opera 3.6
203//=== test fichier source =============
204var lines = e.stack.split("\n");
205for (var i = 0, len = lines.length; i < len; i++) {
206var Src_Match = lines[i];
207if (Src_Match.match(/conflit.js/)) {
208//
209} else {
210if (Src_Match.match(/^\s*[A-Za-z0-9\-_\$]+\(/)) {
211callstack.push(Src_Match); //php?
212} else {
213callstack.push(Src_Match);
214}
215if (Src_Match.match("GMaps|applyMap|markupMaps|applyMarkers")) {
216callstack.push("GMaps");
217isCallstackPopulated = true;
218break;
219}
220if (Src_Match.match("rv_gmaps", "gi")) {
221callstack.push("rv_gmaps");
222isCallstackPopulated = true;
223break;
224}
225if (Src_Match.match("paMOOramics")) {
226isCallstackPopulated = true;
227callstack.push("paMOOramics");
228break;
229}
230if (Src_Match.match("Luciano","gi")) {
231callstack.push("Luciano");
232isCallstackPopulated = true;
233break;
234}
235if (Src_Match.match("main")) {
236alert(Src_Match)
237callstack.push("main");
238isCallstackPopulated = true;
239break;
240}
241
242if (Src_Match.match("jQuery")) {
243callstack.push("jQuery");
244isCallstackPopulated = true;
245break;
246}
247}
248}
249//callstack.shift();
250}
251if (window.opera && e.message && isCallstackPopulated == false) {
252   callstack = [];
253//Opera =================================
254var lines = e.message.split("\n");
255for (var i = 0, len = lines.length; i < len; i++) {
256if (lines[i].match(/^\s*[A-Za-z0-9\-_\$]+\(/)) {
257var entry = lines[i];
258//Append next line also since it has the file info
259if (lines[i + 1]) {
260entry += " at " + lines[i + 1];
261i++;
262}
263callstack.push(entry);
264 isCallstackPopulated = true;
265}
266}
267
268}
269//===== fin Opera======================================
270}
271if (!isCallstackPopulated) { //IE and Safari
272    var currentFunction = arguments.callee.caller;
273    //next
274    callstack = [];
275    all_functions = [];
276    if (currentFunction == null) {
277        return ("");
278    }
279    var fn1 = currentFunction.toString();
280    currentFunction = currentFunction.caller;
281    //$family
282    while (currentFunction) {
283        var fn = currentFunction.toString();
284         
285
286        var fname = fn.substring(fn.indexOf("function") + 8, fn.indexOf("(")) || " ";
287        if (fname != " $") {
288            callstack.push(fn);
289            // if (fname != " $") callstack.push(fn);
290                if (fn.match(RegExp("jquery|switchmenu|switchTabs|switchInterface|gally|initializeImageMode", "gi"))) {
291                    callstack = [];
292                    callstack.push('jQuery');
293                    break;
294                }
295                if (fn.match(RegExp("GMaps|applyMap|markupMaps|applyMarkers", "gi"))) {
296                    callstack = [];
297                    callstack.push('GMaps');
298                    break;
299                }
300                //======================
301                if (fn.match(RegExp("_footer|ie_ready|makeDraggable|droppables", "gi"))) {
302                    callstack = [];
303                    callstack.push('paMOOramics');
304                    break;
305                }
306                if (fn.match(RegExp("observe|responder|stopobserving|fireContentLoadedEvent", "gi"))) {
307                    callstack = [];
308                    callstack.push('rv_gmaps');
309                    break;
310                }
311                //? bubble 
312                Expression = new RegExp("\$", "gi")
313                if (fn.match(Expression)) {
314                    if (fn.match(RegExp("rateForm", "gi"))) {
315                        callstack = [];
316                        callstack.push('Luciano');
317                        break;
318                    }
319                }
320                if (fn.match(RegExp("(splat|buildFrameWork|photoNext)", "gi"))) {  //luciano
321                    callstack = [];
322                    callstack.push('Luciano');
323                    break;
324                }
325
326            }
327         
328        currentFunction = currentFunction.caller;
329        }
330 
331}
332   
333    return callstack.join('\n');
334}
Note: See TracBrowser for help on using the repository browser.