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