Changeset 7805 for extensions/Autosize/js/conflit.js
- Timestamp:
- Nov 17, 2010, 5:04:11 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Autosize/js/conflit.js
r7741 r7805 8 8 var d1 = 0; 9 9 var init_tb = 0; 10 //$ = jQuery.noConflict(); 11 10 var dom = {}; 11 if (typeof jQuery == 'undefined') { 12 alert(" jQuery n'est pas chargé"); 13 } else { 14 // jQuery est chargé 15 } 16 17 function $(element, nc0) { 18 a = conflit(element, nc0); 19 return a; 20 } 21 22 23 12 24 //=================================================== 13 function $(element, nc) { 14 15 return conflit(element, nc) 16 } 17 25 26 var time_out = 0; 18 27 //=================================================== 28 29 nbpa = 0; 30 var Fn; 19 31 function conflit(element, nc) { 20 var retour = (getStackTrace()); 21 22 var ret_element = ""; 23 if (retour.match(RegExp("jQuery", "gi"))) { 24 ret_element = jQuery(element); 25 } 32 //--- cl_conflit 33 var retour = (getStackTrace()); 34 Fn=retour.fn ; 35 retour=retour.state ; 36 37 n=document ; 38 v=window; 39 var ret_element = ""; 40 if (retour.match(RegExp("jQuery", "gi"))) { 41 ret_element = jQuery(element); 42 } 26 43 else if (retour.match(RegExp("rv_gmaps", "gi"))) { 27 44 ret_element = jQuery().$Prototype(element); … … 29 46 ret_element = jQuery(element); 30 47 } else if (retour.match(RegExp("pamooramics", "gi"))) { 31 ret_element = jQuery().$Pamoorama(element); 48 49 ret_element = jQuery().$Pamoorama(element); 50 51 if (retour.match(RegExp("init_", "gi"))) { 52 53 } 54 nbpa +=1 ; 55 32 56 } else if (retour.match(RegExp("luciano", "gi"))) { 33 57 ret_element = jQuery().$Luciano(element); … … 47 71 } else if (typeof (element) == "function") { 48 72 fn = element.toString(); 49 if (fn.match("#pwg ", "gi")) {73 if (fn.match("#pwg|open", "gi")) { 50 74 ret_element = jQuery(element); 51 75 return ret_element; … … 67 91 } 68 92 return ret_element ; 69 } 70 71 //============================================================ 93 } // conflit(element,nc) 94 95 96 97 98 72 99 jQuery(document).ready( 73 100 function (jQuery) { 74 101 jQuery(window).load(function () { 75 function $(element, nc) { 76 return conflit(element, nc); 102 //============================================================ 103 jQuery("#icon_gmaps").bind('click', function () { 104 105 jQuery('html,body').stop().scrollTop(0); 106 jQuery('html,body').stop().scrollLeft(0); 107 jQuery(".ui-widget-overlay").css("opacity", "0.75"); 108 109 l1 = (jQuery(window).width() - (jQuery(".gmapsPopup").width())) / 2; 110 h1 = (jQuery(window).height() - (jQuery(".gmapsPopup").height())) / 2; 111 112 jQuery(".gmapsPopup").css("left", l1 + "px"); 113 jQuery(".gmapsPopup").css("top", h1 + "px"); 114 }) 115 //============================================================= 116 function $(element, nc0) { 117 a = conflit(element, nc0); 118 return a; 77 119 } 78 120 p0 = jQuery("#theImage"); 79 121 if (p0.length) { 122 123 //====================================================== 80 124 if (theme.match("gally", "gi")) 81 if ( isFunction(inittoolbar)) {125 if (jQuery.isFunction(inittoolbar)) { 82 126 if (typeof (currentTab) == "undefined") inittoolbar(); 83 127 else initializeImageMode("resize"); … … 88 132 //==== compatibilité Gally/LLGBO === 89 133 //--- passage relative ==> static ===/ 90 jQuery("#theImage").css({ position: "static", 91 opacity: '0', filter: 'alpha(opacity= 0)' 134 jQuery("#theImage").css({ position: "static" 92 135 } 93 136 94 );137 ); 95 138 jQuery("#imageToolBar").css({ position: "relative", top: "0px" }); 96 139 } … … 99 142 100 143 }); 144 //============================================================= 145 146 // $ = _$2; ; 147 101 148 102 149 }) 103 150 ; 104 151 105 function isFunction(fn) { 106 tpfn = typeof (fn); 107 if (tpfn == "function") return true; 108 } 152 153 109 154 //========================================================= 110 (function ($2) { 111 ajax: function () {return jQuery.ajax; 112 } 113 return jQuery; 114 $2.fn.panorama2 = 115 function (height, width) { 116 var src =jQuery(this); 117 return ; 118 } 119 155 ; (function ($) { 120 156 121 157 })(jQuery); 158 //mootools 159 /* */ 160 _$2 = $; 161 162 function $defined(A) { 163 $= _$2 ; // ; 164 return A != undefined; 165 } 166 167 168 122 169 123 170 124 171 jQuery.fn.extend({ 125 126 //---------------- luciano ------------------------------- 127 $Luciano: function (el, nc) { 128 return document.id(el, nc, this.document); 129 }, 130 //=============== PaMOOramics =========================== 131 132 $Pamoorama: function (B) { 133 if (!B) { 134 if (typeof (B) == "boolean") return null; 135 136 } 172 173 //---------------- luciano ------------------------------- 174 $Luciano: function (el, nc) { 175 return document.id(el, nc, this.document); 176 }, 177 //=============== PaMOOramics =========================== 178 179 $Pamoorama: function (B) { 180 181 182 if (!B) { 183 if (typeof (B) == "boolean") return null; 184 185 } 137 186 138 139 140 141 142 187 try { 188 if (B.htmlElement) { 189 return Garbage.collect(B); 190 } 191 } catch (e) { 143 192 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 193 } 194 195 if ([window, document].contains(B)) { return B; } 196 var A = $type(B); 197 if (A == "string") { B = document.getElementById(B); A = (B) ? "element" : false; } 198 if (A != "element") { 199 return null; 200 } 201 if (B.htmlElement) { return Garbage.collect(B); } 202 if (["object", "embed"].contains(B.tagName.toLowerCase())) { return B; } 203 $extend(B, Element.prototype); 204 B.htmlElement = function () { }; 205 try { return Garbage.collect(B); } catch (e) { 206 return; 207 } 208 209 }, 210 //=================================================== 211 $Prototype: function (element) { 212 //======== prototype.js ===================== 213 if (arguments.length > 1) { 214 for (var i = 0, elements = [], length = arguments.length; i < length; i++) 215 elements.push($(arguments[i])); 216 return elements; 217 } 218 if (typeof element == "string") 219 element = document.getElementById(element); 220 221 return Element.extend(element); 222 223 try { 224 new_element = Element.extend(element); 225 } catch (e) { 226 return new_element; 227 } 228 return new_element; 229 } 230 //========================================================= 182 231 }); // fin extend 183 232 … … 202 251 var e_message = e.message; 203 252 var e_stack = e.stack; 204 if (e_stack) { //Firefox Opera 3.6205 //=== test fichier source =============206 var lines = e.stack.split("\n");207 for (var i = 0, len = lines.length; i < len; i++) {208 var Src_Match = lines[i];209 if (Src_Match.match(/conflit.js/)) {210 //211 } else {212 if (Src_Match.match(/^\s*[A-Za-z0-9\-_\$]+\(/)) {213 callstack.push(Src_Match); //php?214 } else {215 callstack.push(Src_Match);216 }217 if (Src_Match.match("GMaps|applyMap|markupMaps|applyMarkers")) {218 callstack.push("GMaps");219 isCallstackPopulated = true;220 break;221 }222 if (Src_Match.match("rv_gmaps", "gi")) {223 callstack.push("rv_gmaps");224 isCallstackPopulated = true;225 break;226 }227 if (Src_Match.match("paMOOramics")) {228 isCallstackPopulated = true;229 callstack.push("paMOOramics");230 break;231 }232 if (Src_Match.match("Luciano","gi")) {233 callstack.push("Luciano");234 isCallstackPopulated = true;235 break;236 }237 if (Src_Match.match("main")) {238 alert(Src_Match)239 callstack.push("main");240 isCallstackPopulated = true;241 break;242 }243 244 if (Src_Match.match("jQuery")) { 245 callstack.push("jQuery");246 isCallstackPopulated = true;247 break; 248 }249 }250 } 251 //callstack.shift();253 if (e_stack) { //Firefox Opera 3.6 254 //=== test fichier source ============= 255 var lines = e.stack.split("\n"); 256 for (var i = 0, len = lines.length; i < len; i++) { 257 var Src_Match = lines[i]; 258 if (Src_Match.match(/conflit.js/)) { 259 // 260 } else { 261 if (Src_Match.match(/^\s*[A-Za-z0-9\-_\$]+\(/)) { 262 callstack.push(Src_Match); //php? 263 } else { 264 callstack.push(Src_Match); 265 } 266 if (Src_Match.match("GMaps|applyMap|markupMaps|applyMarkers")) { 267 callstack.push("GMaps"); 268 isCallstackPopulated = true; 269 break; 270 } 271 if (Src_Match.match("rv_gmaps", "gi")) { 272 callstack.push("rv_gmaps"); 273 isCallstackPopulated = true; 274 break; 275 } 276 if (Src_Match.match("paMOOramics")) { 277 isCallstackPopulated = true; 278 callstack.push("paMOOramics"); 279 break; 280 } 281 if (Src_Match.match("Luciano","gi")) { 282 callstack.push("Luciano"); 283 isCallstackPopulated = true; 284 break; 285 } 286 if (Src_Match.match("main")) { 287 alert(Src_Match) 288 callstack.push("main"); 289 isCallstackPopulated = true; 290 break; 291 } 292 if (Src_Match.match("jQuery")) { 293 callstack.push("jQuery"); 294 isCallstackPopulated = true; 295 break; 296 } 297 } 298 } 299 //callstack.shift(); 300 isCallstackPopulated = false; 252 301 } 253 302 if (window.opera && e.message && isCallstackPopulated == false) { … … 264 313 } 265 314 callstack.push(entry); 266 isCallstackPopulated = true;315 //isCallstackPopulated = true; 267 316 } 268 317 } … … 276 325 callstack = []; 277 326 all_functions = []; 327 state = ""; 278 328 if (currentFunction == null) { 279 329 return (""); 280 330 } 281 var fn1 = currentFunction.toString(); 331 states = []; 332 var fn1 = currentFunction.toString(); // fonction d'appel local (conflit) 333 334 currentFunction = currentFunction.caller; 282 335 currentFunction = currentFunction.caller; 283 336 //$family 337 284 338 while (currentFunction) { 285 339 var fn = currentFunction.toString(); 286 287 288 var fname = fn.substring(fn.indexOf("function") + 8, fn.indexOf("(")) || " "; 289 if (fname != " $") { 340 all_functions.push(fn); 341 var fname = fn.substring(fn.indexOf("function") + 8, fn.indexOf("(")) || " "; 342 if (fname != " ") { 343 344 jQuery.noop; 345 if (states.length>0) break; 346 347 // if (fname != " $") callstack.push(fn); 348 } if (fname != "") { 349 jQuery.noop; 350 // if (fname != " $") callstack.push(fn); 351 } 290 352 callstack.push(fn); 291 // if (fname != " $") callstack.push(fn);353 292 354 if (fn.match(RegExp("jquery|switchmenu|switchTabs|switchInterface|gally|initializeImageMode", "gi"))) { 293 callstack = []; 294 callstack.push('jQuery'); 295 break; 355 states.push('jQuery'); 356 357 } 358 if (fn.match(RegExp("dialog..open", "gi"))) { 359 states.push('GMaps'); 360 296 361 } 297 362 if (fn.match(RegExp("GMaps|applyMap|markupMaps|applyMarkers", "gi"))) { 298 callstack = []; 299 callstack.push('GMaps'); 300 break; 363 states.push('GMaps'); 364 301 365 } 302 366 //====================== 303 367 if (fn.match(RegExp("_footer|ie_ready|makeDraggable|droppables", "gi"))) { 304 callstack = []; 305 callstack.push('paMOOramics');306 break;368 369 states.push('paMOOramics'); 370 307 371 } 308 372 if (fn.match(RegExp("observe|responder|stopobserving|fireContentLoadedEvent", "gi"))) { 309 callstack = []; 310 callstack.push('rv_gmaps'); 311 break; 373 states.push('rv_gmaps'); 374 312 375 } 313 376 //? bubble 314 Expression = new RegExp("\ $", "gi")377 Expression = new RegExp("\\$", "gi") 315 378 if (fn.match(Expression)) { 316 379 if (fn.match(RegExp("rateForm", "gi"))) { 317 callstack = []; 318 callstack.push('Luciano');319 break;380 381 states.push('Luciano'); 382 320 383 } 321 384 } 322 385 if (fn.match(RegExp("(splat|buildFrameWork|photoNext)", "gi"))) { //luciano 323 callstack = []; 324 callstack.push('Luciano'); 325 break; 326 } 327 328 } 386 387 states.push('Luciano'); 388 389 } 390 391 if (all_functions.length > 50) break; 392 329 393 330 394 currentFunction = currentFunction.caller; … … 332 396 333 397 } 334 335 return callstack.join('\n'); 336 } 398 state = states.join('\n'); 399 Fn = all_functions; 400 return { state:state , fn:callstack.join('\n') }; 401 } 402 //==================================== 403 jQuery(window).load(function () { 404 405 a= jQuery(':Description'); 406 407 408 }); 409 410 411 412 413 //============================================== 414 jQuery.extend(jQuery.expr[':'], { 415 // Nom du sélecteur personnalisé 416 Description: function (a) { 417 n = jQuery(a).infos(); 418 if (n.id != "") { 419 //alert("<" + n.nodeName +" id= " + n.id + " >") ; 420 } 421 if (n.nodeName == "SCRIPT") 422 if (a.src == "") { 423 Match = jQuery(a).html(); 424 /* 425 if ( Match.match(new RegExp("jQuery", "gi") )) { 426 alert(n.id + n.nodeName + a.outerHTML ) ; 427 } 428 if ( Match.match(new RegExp("ajax", "gi") )) { 429 alert(n.id + n.nodeName + a.outerHTML ) ; 430 } 431 */ 432 if (Match.match(new RegExp("\\$", "gi"))) { 433 434 if (Match.match(new RegExp("ajax", "gi"))) { 435 alert(n.id + n.nodeName + a.outerHTML); 436 437 } 438 } 439 if (Match.match(new RegExp("pamoorama", "ig"))) { 440 441 // alert(n.id + n.nodeName + a.innerHTML); 442 443 } 444 } 445 446 return a; 447 448 } 449 }); 450 451 jQuery("#pamoorama").bind("load", { foo: "bar" }, function release(event) { 452 //setTimeout("end_Timer()", 100); 453 454 // event.stopPropagation(); 455 }) 456 function end_Timer() { 457 alert("load pamoorama"); 458 459 } 460 jQuery().ajaxSuccess(function (evt, request, settings) { 461 alert("ok ajax"); 462 463 }); 464 function save_framework(page) { 465 466 _$2 = window.$; // Pour $.ajax sauvegarge ; 467 if (page == "theCategoryPage") 468 $ = jQuery; 469 else { 470 tpe = jQuery.browser.msie || false; 471 if (tpe == true) { 472 473 // $ = jQuery; // ---> ajax 474 }else{ 475 $ = jQuery; // ---> ajax 476 } 477 478 } 479 480 }
Note: See TracChangeset
for help on using the changeset viewer.