diff options
| author | Rob Hudson | 2009-03-22 23:41:15 -0700 |
|---|---|---|
| committer | Rob Hudson | 2009-03-22 23:41:15 -0700 |
| commit | ea1f9430ddb58f28b50cc702f9eb2612f19e308d (patch) | |
| tree | aef0b7d047c6beebdd87887dd6790ba5bc8f76f0 /debug_toolbar/media/toolbar.min.js | |
| parent | bc8691de49618a41fc57f54420a921b1c8a7c4ff (diff) | |
| download | django-debug-toolbar-ea1f9430ddb58f28b50cc702f9eb2612f19e308d.tar.bz2 | |
Add fix so jQuery doesn't conflict with other Javascript libraries.
I think I finally got this one working. The saving of the temporary variable has to happen *before* jQuery loads, or else jQuery has already stomped on the '$' variable that another library might have used. This patch moves the temporary saving of this variable the HTML template so it tucks it aside before jQuery loads and puts it back after we're done. Tested and works with jQuery, mootools, and prototype.
Diffstat (limited to 'debug_toolbar/media/toolbar.min.js')
| -rw-r--r-- | debug_toolbar/media/toolbar.min.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/debug_toolbar/media/toolbar.min.js b/debug_toolbar/media/toolbar.min.js index 4c967f8..7f8658f 100644 --- a/debug_toolbar/media/toolbar.min.js +++ b/debug_toolbar/media/toolbar.min.js @@ -1 +1 @@ -var _$=window.$;$j=jQuery.noConflict();jQuery(function(){var a="dj_debug_panel";$j.djDebug=function(c,b){$j.djDebug.init()};$j.extend($j.djDebug,{init:function(){var b=null;$j("#djDebugPanelList li a").click(function(){if(!this.className){return false}b=$j("#djDebug #"+this.className);if(b.is(":visible")){$j(document).trigger("close.djDebug")}else{$j(".panelContent").hide();b.show();$j.djDebug.open()}return false});$j("#djDebug a.close").click(function(){$j(document).trigger("close.djDebug");return false});$j("#djDebug a.remoteCall").click(function(){$j("#djDebugWindow").load(this.href,{},function(){$j("#djDebugWindow a.back").click(function(){$j(this).parent().hide();return false})});$j("#djDebugWindow").show();return false});$j("#djDebugTemplatePanel a.djTemplateShowContext").click(function(){$j.djDebug.toggle_content($j(this).parent().next());return false});$j("#djDebugSQLPanel a.djSQLShowStacktrace").click(function(){$j.djDebug.toggle_content($j(this).parent().next());return false});$j("#djHideToolBarButton").click(function(){$j.djDebug.hide_toolbar(true);return false});$j("#djShowToolBarButton").click(function(){$j.djDebug.show_toolbar();return false});if($j.cookie(a)){$j.djDebug.hide_toolbar(false)}else{$j("#djDebugToolbar").show()}},open:function(){$j(document).bind("keydown.djDebug",function(b){if(b.keyCode==27){$j.djDebug.close()}})},toggle_content:function(b){if(b.is(":visible")){b.hide()}else{b.show()}},close:function(){$j(document).trigger("close.djDebug");return false},hide_toolbar:function(b){$j("#djDebugToolbar").hide("fast");$j("#djDebugToolbarHandle").show();if(b){$j.cookie(a,"hide",{path:"/",expires:10})}},show_toolbar:function(){$j("#djDebugToolbarHandle").hide();$j("#djDebugToolbar").show("fast");$j.cookie(a,null,{path:"/",expires:-1})}});$j(document).bind("close.djDebug",function(){$j(document).unbind("keydown.djDebug");$j(".panelContent").hide()})});jQuery(function(){jQuery.djDebug()});$=_$;jQuery.cookie=function(b,j,m){if(typeof j!="undefined"){m=m||{};if(j===null){j="";m.expires=-1}var e="";if(m.expires&&(typeof m.expires=="number"||m.expires.toUTCString)){var f;if(typeof m.expires=="number"){f=new Date();f.setTime(f.getTime()+(m.expires*24*60*60*1000))}else{f=m.expires}e="; expires="+f.toUTCString()}var l=m.path?"; path="+(m.path):"";var g=m.domain?"; domain="+(m.domain):"";var a=m.secure?"; secure":"";document.cookie=[b,"=",encodeURIComponent(j),e,l,g,a].join("")}else{var d=null;if(document.cookie&&document.cookie!=""){var k=document.cookie.split(";");for(var h=0;h<k.length;h++){var c=jQuery.trim(k[h]);if(c.substring(0,b.length+1)==(b+"=")){d=decodeURIComponent(c.substring(b.length+1));break}}}return d}};
\ No newline at end of file +jQuery.noConflict();jQuery(function(b){var a="dj_debug_panel";b.djDebug=function(d,c){b.djDebug.init()};b.extend(b.djDebug,{init:function(){var c=null;b("#djDebugPanelList li a").click(function(){if(!this.className){return false}c=b("#djDebug #"+this.className);if(c.is(":visible")){b(document).trigger("close.djDebug")}else{b(".panelContent").hide();c.show();b.djDebug.open()}return false});b("#djDebug a.close").click(function(){b(document).trigger("close.djDebug");return false});b("#djDebug a.remoteCall").click(function(){b("#djDebugWindow").load(this.href,{},function(){b("#djDebugWindow a.back").click(function(){b(this).parent().hide();return false})});b("#djDebugWindow").show();return false});b("#djDebugTemplatePanel a.djTemplateShowContext").click(function(){b.djDebug.toggle_content(b(this).parent().next());return false});b("#djDebugSQLPanel a.djSQLShowStacktrace").click(function(){b.djDebug.toggle_content(b(this).parent().next());return false});b("#djHideToolBarButton").click(function(){b.djDebug.hide_toolbar(true);return false});b("#djShowToolBarButton").click(function(){b.djDebug.show_toolbar();return false});if(b.cookie(a)){b.djDebug.hide_toolbar(false)}else{b("#djDebugToolbar").show()}},open:function(){b(document).bind("keydown.djDebug",function(c){if(c.keyCode==27){b.djDebug.close()}})},toggle_content:function(c){if(c.is(":visible")){c.hide()}else{c.show()}},close:function(){b(document).trigger("close.djDebug");return false},hide_toolbar:function(c){b("#djDebugToolbar").hide("fast");b(document).trigger("close.djDebug");b("#djDebugToolbarHandle").show();if(c){b.cookie(a,"hide",{path:"/",expires:10})}},show_toolbar:function(){b("#djDebugToolbarHandle").hide();b("#djDebugToolbar").show("fast");b.cookie(a,null,{path:"/",expires:-1})}});b(document).bind("close.djDebug",function(){b(document).unbind("keydown.djDebug");b(".panelContent").hide()})});jQuery(function(){jQuery.djDebug()});jQuery.cookie=function(b,j,m){if(typeof j!="undefined"){m=m||{};if(j===null){j="";m.expires=-1}var e="";if(m.expires&&(typeof m.expires=="number"||m.expires.toUTCString)){var f;if(typeof m.expires=="number"){f=new Date();f.setTime(f.getTime()+(m.expires*24*60*60*1000))}else{f=m.expires}e="; expires="+f.toUTCString()}var l=m.path?"; path="+(m.path):"";var g=m.domain?"; domain="+(m.domain):"";var a=m.secure?"; secure":"";document.cookie=[b,"=",encodeURIComponent(j),e,l,g,a].join("")}else{var d=null;if(document.cookie&&document.cookie!=""){var k=document.cookie.split(";");for(var h=0;h<k.length;h++){var c=jQuery.trim(k[h]);if(c.substring(0,b.length+1)==(b+"=")){d=decodeURIComponent(c.substring(b.length+1));break}}}return d}};
\ No newline at end of file |
