From 310c2f98a9e520d82a8ea1a2b4c04c521743c304 Mon Sep 17 00:00:00 2001 From: Florin Patan Date: Sat, 15 Sep 2012 16:31:44 +0300 Subject: [PATCH] [2.2][WebProfilerBundle] Added minimize option to Web Profiler panels --- .../Controller/ProfilerController.php | 1 + .../Resources/public/css/profiler.css | 40 +++++++-- .../public/images/profiler/left-arrow.png | Bin 0 -> 1001 bytes .../public/images/profiler/right-arrow.png | Bin 0 -> 1001 bytes .../Resources/views/Collector/time.html.twig | 11 ++- .../Resources/views/Profiler/admin.html.twig | 2 +- .../views/Profiler/base_js.html.twig | 32 ++++++- .../Resources/views/Profiler/header.html.twig | 2 +- .../Resources/views/Profiler/layout.html.twig | 78 ++++++++++++++++++ .../Resources/views/Profiler/search.html.twig | 2 +- .../views/Profiler/toolbar.html.twig | 24 +++++- .../views/Profiler/toolbar_js.html.twig | 14 ++++ .../views/Profiler/toolbar_style.html.twig | 62 ++++++++++++-- 13 files changed, 243 insertions(+), 25 deletions(-) create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/profiler/left-arrow.png create mode 100644 src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/profiler/right-arrow.png diff --git a/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php b/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php index 3eebc7791475..b67e1fbe63cb 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php +++ b/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php @@ -186,6 +186,7 @@ public function toolbarAction(Request $request, $token, $position = null) 'profile' => $profile, 'templates' => $this->getTemplateManager()->getTemplates($profile), 'profiler_url' => $url, + 'token' => $token, )); } diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/public/css/profiler.css b/src/Symfony/Bundle/WebProfilerBundle/Resources/public/css/profiler.css index 8381a9a7b1ca..734826baa65f 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/public/css/profiler.css +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/public/css/profiler.css @@ -104,13 +104,14 @@ abbr { #content { padding: 0 50px; - margin: 0 auto; + margin: 0 auto 20px; font-family: Arial, Helvetica, sans-serif; min-width: 970px; + } #header { - padding: 30px 30px 20px; + padding: 20px 30px 20px; } #header h1 { @@ -131,6 +132,7 @@ abbr { padding-bottom: 0; display: block; background-color: #f6f6f6; + z-index: 10000; } #menu_profiler li a { @@ -144,9 +146,9 @@ abbr { #menu_profiler li a span.label { display: block; - padding: 20px 20px 16px 65px; - min-height: 24px; - _height: 24px; + padding: 20px 0px 16px 65px; + min-height: 16px; + overflow: hidden; } #menu_profiler li a span.icon { @@ -186,7 +188,7 @@ abbr { #collector_content { margin-left: 250px; - padding: 40px 50px; + padding: 30px 40px 40px; } #navigation { @@ -235,8 +237,9 @@ li { #resume { background-color: #f6f6f6; border-bottom: 1px solid #dfdfdf; - padding: 10px 50px; - margin-left: 210px; + padding: 18px 10px 0px; + margin-left: 250px; + height: 34px; color: #313131; font-size: 12px; -moz-border-radius-topright: 16px; @@ -284,7 +287,9 @@ table th.value { } .sf-exceptionreset .block_exception_detected .text_exception { - width: 520px; + left: 10px; + right: 10px; + width: 95%; } .sf-exceptionreset .block_exception_detected .illustration_exception { @@ -488,3 +493,20 @@ td.main, td.menu { border: 1px solid #999; border-width: 1px 0; } + +.collapsed-menu-parents #resume, +.collapsed-menu-parents #collector_content { + margin-left: 60px !important; +} + +.collapsed-menu { + width: 60px !important; +} + +.collapsed-menu span :not(.icon) { + display: none !important; +} + +.collapsed-menu span.icon img { + display: inline !important; +} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/profiler/left-arrow.png b/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/profiler/left-arrow.png new file mode 100644 index 0000000000000000000000000000000000000000..1c63f0919bd228b3a5f91330cd46a2f8774ceabd GIT binary patch literal 1001 zcmVI3MnFyh>-ewR#sL}C=@;y ziA4QYtMxX%3TF!D8w`e%Ua$A!!otE9CNs&&$r+c)Waljw%RRb3up)SHa4_F&Huv~^ zz9Z?Zp;Rh0n@py2Wo2a{#^9l$p$#1!9ghQnz}`#}NGulH1_lN+xctr}t8=@$x~^vm zC2e+gR*9v$hRe07!2Fh$mPU`qbCAXT2kCxvxm+Q9&-2h^GXy-&6<-Jt2|>D>q$p&9Cod3L+KBpeR& zQ$P=;10~Jx_vgFa?gFxfso?BjFepng)&l4Q3Um{~T_(_Y!&1uP%s4m;R+pV(oDr}C z6#w=j)Iq# z_!+iviA3@vFE4K{-Y*U&K!0gzsh8nXyOIRnO*f#pxY&b04vYvDOg?;5C=_p4xYl1d zq5+|it~2_)BKDokKztgF<`IswMV9beh&SjuVQoV-H8oGk9I)c>;;N93)VZB zDHM-)rm3mPj7tYe-c%I`aiTrY;m*#^(|vt?61G6{c#THmSDj9GGiIqyXn{%1C4fpH z^~lJG78T|$oYjm|Ao00000NkvXXu0mjfq3p}1 literal 0 HcmV?d00001 diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/profiler/right-arrow.png b/src/Symfony/Bundle/WebProfilerBundle/Resources/public/images/profiler/right-arrow.png new file mode 100644 index 0000000000000000000000000000000000000000..bc6166272eb952cfeabe589d5a6e7ba69c10b1bd GIT binary patch literal 1001 zcmV z&dwe|r&?D#*aRH~oFVohgdWj)krH21|~ zaUfMNO{G#bI-SlNfj~e+M8I^VQaNa~T3dD^dWAyaQ@vh) z9)=rR;sSGBdQVT!1p?5QM8OarCt=rZC|;6*b4(`FHJr6BO-xKk!CoN>pP!$qOy@f;@HfwL_Z%Nd+C~?#u+wI;*;N}y-?}9m%Y*H{7q)kpv zmc*DbFclt!kVKXs_#=Sxk}Hh)`8SxsV9-c_L!cIbEyaF-n>Y?emGo{I z3+1WN9Dc>fNX&1M$PI(kquQK_%Sjv(n+Jy9>eK3?2dh)kFBk(uOP_q)@mk^ z0ci?_Vj7?yVCYFyxzMw>R##V#%Ve@IJJr-dBd{cuN*}<`9N&>(w}zZ==;-Ls*45Rm zr3wYVdb_&1P*Irzt>HETpo1XU=;-K0olch*4u?rYo0^)wwzs$6fg$qidr*K#>yrs8 z2Awb(jg4BZ_AuBCBEX`eqD|;DP37g~<8b-{#SLhkOqaPA6&uh|Q0>gj%rS$(uph*7 zI2=?=dlRmxs93M8taN}-O1?%e1EE;?zMb|K)m1j=0H`D?)aG)b;4`7WPUCPm8_^W` zjG7J5Cy*t+SftX>r-M*#=S1_J6@4P;_=&0>DnQWy@+AYN`t3x)lv~n^?Ak}$F98Ms X>*aOuJKrDw00000NkvXXu0mjfh)3Nk literal 0 HcmV?d00001 diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig index d283182720f1..f4179792ffba 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig @@ -134,7 +134,7 @@ "use strict"; var _drawingColors = {{ colors|json_encode|raw }}, - _storagePrefix = 'sf2/profiler/timeline', + _storagePrefix = 'timeline/', _threshold = 1, _requests = requests, _maxRequestTime = maxRequestTime; @@ -353,7 +353,7 @@ }; this.getThreshold = function() { - var threshold = localStorage.getItem(_storagePrefix + '/threshold'); + var threshold = Sfjs.getPreference(_storagePrefix + 'threshold'); if (threshold === null) { return _threshold; @@ -368,7 +368,7 @@ { _threshold = threshold; - localStorage.setItem(_storagePrefix + '/threshold', threshold); + Sfjs.setPreference(_storagePrefix + 'threshold', threshold); return this; }; @@ -423,6 +423,11 @@ elementThresholdControl.onclick = canvasAutoUpdateOnThresholdChange; elementThresholdControl.onchange = canvasAutoUpdateOnThresholdChange; elementThresholdControl.onkeyup = canvasAutoUpdateOnThresholdChange; + + window.setTimeout(function() { + canvasAutoUpdateOnThresholdChange(null); + }, 50); + //]]> {% endblock %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/admin.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/admin.html.twig index 2488af415722..8989115b2b49 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/admin.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/admin.html.twig @@ -1,4 +1,4 @@ -