From f4dd93ad67fe317e042f55190a210f226a3590f6 Mon Sep 17 00:00:00 2001 From: Dan Rogers Date: Wed, 2 Jan 2013 17:41:07 -0800 Subject: [PATCH 1/2] Allow custom profiler.js path, which makes jQuery dependency optional. Signed-off-by: Dan Rogers --- laravel/profiling/template.blade.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/laravel/profiling/template.blade.php b/laravel/profiling/template.blade.php index 9c855b43..3404c52a 100755 --- a/laravel/profiling/template.blade.php +++ b/laravel/profiling/template.blade.php @@ -119,6 +119,10 @@ - - +@if (Config::get('application.profiler_js_src')) + +@else + + +@endif From 4e8b452b66821a8a799f2805a20a83b9db643d7b Mon Sep 17 00:00:00 2001 From: Dan Rogers Date: Thu, 3 Jan 2013 15:04:45 -0800 Subject: [PATCH 2/2] Use $.noConflict in profiler to allow multiple jQuery versions. Signed-off-by: Dan Rogers --- laravel/profiling/profiler.js | 51 +++++++++++++++------------- laravel/profiling/template.blade.php | 8 ++--- 2 files changed, 29 insertions(+), 30 deletions(-) diff --git a/laravel/profiling/profiler.js b/laravel/profiling/profiler.js index 8fc9fe3e..eab7a7b1 100755 --- a/laravel/profiling/profiler.js +++ b/laravel/profiling/profiler.js @@ -1,4 +1,9 @@ var anbu = { + // Sandbox a jQuery instance for the profiler. + jq: jQuery.noConflict(true) +}; + +anbu.jq.extend(anbu, { // BOUND ELEMENTS // ------------------------------------------------------------- @@ -6,20 +11,20 @@ var anbu = { // the DOM every time they are used. el: { - main: jQuery('.anbu'), - close: jQuery('#anbu-close'), - zoom: jQuery('#anbu-zoom'), - hide: jQuery('#anbu-hide'), - show: jQuery('#anbu-show'), - tab_pane: jQuery('.anbu-tab-pane'), - hidden_tab_pane: jQuery('.anbu-tab-pane:visible'), - tab: jQuery('.anbu-tab'), - tabs: jQuery('.anbu-tabs'), - tab_links: jQuery('.anbu-tabs a'), - window: jQuery('.anbu-window'), - closed_tabs: jQuery('#anbu-closed-tabs'), - open_tabs: jQuery('#anbu-open-tabs'), - content_area: jQuery('.anbu-content-area') + main: anbu.jq('.anbu'), + close: anbu.jq('#anbu-close'), + zoom: anbu.jq('#anbu-zoom'), + hide: anbu.jq('#anbu-hide'), + show: anbu.jq('#anbu-show'), + tab_pane: anbu.jq('.anbu-tab-pane'), + hidden_tab_pane: anbu.jq('.anbu-tab-pane:visible'), + tab: anbu.jq('.anbu-tab'), + tabs: anbu.jq('.anbu-tabs'), + tab_links: anbu.jq('.anbu-tabs a'), + window: anbu.jq('.anbu-window'), + closed_tabs: anbu.jq('#anbu-closed-tabs'), + open_tabs: anbu.jq('#anbu-open-tabs'), + content_area: anbu.jq('.anbu-content-area') }, // CLASS ATTRIBUTES @@ -30,7 +35,7 @@ var anbu = { is_zoomed: false, // initial height of content area - small_height: jQuery('.anbu-content-area').height(), + small_height: anbu.jq('.anbu-content-area').height(), // the name of the active tab css active_tab: 'anbu-active-tab', @@ -76,7 +81,7 @@ var anbu = { event.preventDefault(); }); anbu.el.tab.click(function(event) { - anbu.clicked_tab(jQuery(this)); + anbu.clicked_tab(anbu.jq(this)); event.preventDefault(); }); @@ -104,8 +109,8 @@ var anbu = { open_window: function(tab) { // can't directly assign this line, but it works - jQuery('.anbu-tab-pane:visible').fadeOut(200); - jQuery('.' + tab.attr(anbu.tab_data)).delay(220).fadeIn(300); + anbu.jq('.anbu-tab-pane:visible').fadeOut(200); + anbu.jq('.' + tab.attr(anbu.tab_data)).delay(220).fadeIn(300); anbu.el.tab_links.removeClass(anbu.active_tab); tab.addClass(anbu.active_tab); anbu.el.window.slideDown(300); @@ -172,13 +177,13 @@ var anbu = { // Toggle the zoomed mode of the top window. zoom: function() { - + var height; if (anbu.is_zoomed) { height = anbu.small_height; anbu.is_zoomed = false; } else { // the 6px is padding on the top of the window - height = (jQuery(window).height() - anbu.el.tabs.height() - 6) + 'px'; + height = (anbu.jq(window).height() - anbu.el.tabs.height() - 6) + 'px'; anbu.is_zoomed = true; } @@ -186,9 +191,7 @@ var anbu = { } -}; +}); // launch anbu on jquery dom ready -jQuery(document).ready(function() { - anbu.start(); -}); \ No newline at end of file +anbu.jq(anbu.start); \ No newline at end of file diff --git a/laravel/profiling/template.blade.php b/laravel/profiling/template.blade.php index 3404c52a..c03b50f1 100755 --- a/laravel/profiling/template.blade.php +++ b/laravel/profiling/template.blade.php @@ -119,10 +119,6 @@ -@if (Config::get('application.profiler_js_src')) - -@else - - -@endif + +