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

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

[Autosize][beta] Add option Fade in

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