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

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

[Autosize][beta] test function makeDraggable(pamooramics).

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