Permalink
Browse files

Use the debug toolbar's jQuery if we don't already have one. Closes: G…

…H-1

Signed-off-by: Chris Lamb <chris@playfire.com>
  • Loading branch information...
1 parent 0db2c45 commit 448dd299f45f329300879e8c1727846423b233f2 @lamby lamby committed Jul 8, 2011
Showing with 17 additions and 0 deletions.
  1. +17 −0 debug_toolbar_user_panel/templates/debug_toolbar_user_panel/panel.html
@@ -1,4 +1,20 @@
<script language="javascript">
+(function(window, document, version, callback) {
+ var j, d;
+ var loaded = false;
+ if (!(j = window.jQuery) || version > j.fn.jquery || callback(j)) {
+ var script = document.createElement("script");
+ script.type = "text/javascript";
+ script.src = DEBUG_TOOLBAR_MEDIA_URL + "js/jquery.js";
+ script.onload = script.onreadystatechange = function() {
+ if (!loaded && (!(d = this.readyState) || d == "loaded" || d == "complete")) {
+ callback((j = window.jQuery).noConflict(1));
+ j(script).remove();
+ }
+ };
+ document.documentElement.childNodes[0].appendChild(script)
+ }
+})(window, document, "1.3", function($) {
$('#djDebug .djDebugUserPanel').click(function () {
var target = $('#djDebugUserPanel div.target');
@@ -9,6 +25,7 @@
target.load('{% url debug-userpanel %}?next=' + escape(location.href));
});
+});
</script>
<style type="text/css">

0 comments on commit 448dd29

Please sign in to comment.