From ca078d9a258ce0ba6513f7515fc39f56ad11dc92 Mon Sep 17 00:00:00 2001 From: mark_story Date: Fri, 2 Sep 2011 16:45:09 +0100 Subject: [PATCH] Converging on 4px for border-radius. Updating debug() to output a tiny bit more HTML so it can be made sexy. --- app/webroot/css/cake.generic.css | 41 ++++++++++++++++++++++--------- lib/Cake/Test/Case/BasicsTest.php | 8 +++--- lib/Cake/basics.php | 6 +++-- 3 files changed, 38 insertions(+), 17 deletions(-) diff --git a/app/webroot/css/cake.generic.css b/app/webroot/css/cake.generic.css index 473a188b9..ccbc264e1 100644 --- a/app/webroot/css/cake.generic.css +++ b/app/webroot/css/cake.generic.css @@ -209,10 +209,10 @@ table td.actions a { } .paging .prev { border-left: 1px solid #ccc; - border-radius: 5px 0 0 5px; + border-radius: 4px 0 0 4px; } .paging .next { - border-radius: 0 5px 5px 0; + border-radius: 0 4px 4px 0; } .paging .disabled { color: #ddd; @@ -361,7 +361,7 @@ form .submit input[type=submit]:hover { /* Form errors */ form .error { background: #FFDACC; - border-radius: 5px; + border-radius: 4px; font-weight: normal; } form .error-message { @@ -500,9 +500,9 @@ input[type=submit], background-image: linear-gradient(top, #fefefe, #dcdcdc); color:#333; border:1px solid #bbb; - -webkit-border-radius: 5px; - -moz-border-radius: 5px; - border-radius: 5px; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; text-decoration: none; text-shadow: #fff 0px 1px 0px; min-width: 0; @@ -548,12 +548,31 @@ pre { padding: 15px; box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3); } +.cake-debug-output { + padding: 0; + position: relative; +} +.cake-debug-output > span { + position: absolute; + top: 5px; + right: 5px; + background: rgba(255, 255, 255, 0.3); + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; + padding: 5px 6px; + color: #000; + display: block; + float: left; + box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.25), 0 1px 0 rgba(255, 255, 255, 0.5); + text-shadow: 0 1px 1px rgba(255, 255, 255, 0.8); +} .cake-debug, .cake-error { - font-size: 120%; - line-height: 140%; - margin-top: 1em; - position: relative; + font-size: 16px; + line-height: 20px; + margin-top: 24px; + clear: both; } .cake-error > a { text-shadow: none; @@ -567,7 +586,7 @@ pre { line-height: 140%; overflow: auto; position: relative; - border-radius: 5px; + border-radius: 4px; } .cake-stack-trace a { text-shadow: none; diff --git a/lib/Cake/Test/Case/BasicsTest.php b/lib/Cake/Test/Case/BasicsTest.php index 42bcd141a..2f095f4c9 100644 --- a/lib/Cake/Test/Case/BasicsTest.php +++ b/lib/Cake/Test/Case/BasicsTest.php @@ -677,15 +677,15 @@ class BasicsTest extends CakeTestCase { $pattern = '/(.+?Test(\/|\\\)Case(\/|\\\)BasicsTest\.php|'; $pattern .= preg_quote(substr(__FILE__, 1), '/') . ')'; $pattern .= '.*line.*' . (__LINE__ - 4) . '.*this-is-a-test.*/s'; - $this->assertPattern($pattern, $result); + $this->assertRegExp($pattern, $result); ob_start(); debug('
this-is-a-test
', true); $result = ob_get_clean(); $pattern = '/(.+?Test(\/|\\\)Case(\/|\\\)BasicsTest\.php|'; $pattern .= preg_quote(substr(__FILE__, 1), '/') . ')'; - $pattern .= '.*line.*' . (__LINE__ - 4) . '.*<div>this-is-a-test<\/div>.*/s'; - $this->assertPattern($pattern, $result); + $pattern .= '.*line.*' . (__LINE__ -4) . '.*<div>this-is-a-test<\/div>.*/s'; + $this->assertRegExp($pattern, $result); ob_start(); debug('
this-is-a-test
', false); @@ -693,7 +693,7 @@ class BasicsTest extends CakeTestCase { $pattern = '/(.+?Test(\/|\\\)Case(\/|\\\)BasicsTest\.php|'; $pattern .= preg_quote(substr(__FILE__, 1), '/') . ')'; $pattern .= '.*line.*' . (__LINE__ - 4) . '.*\this-is-a-test\<\/div\>.*/s'; - $this->assertPattern($pattern, $result); + $this->assertRegExp($pattern, $result); } /** diff --git a/lib/Cake/basics.php b/lib/Cake/basics.php index d639cc5c7..ac1e6c07a 100644 --- a/lib/Cake/basics.php +++ b/lib/Cake/basics.php @@ -82,10 +82,12 @@ function debug($var = false, $showHtml = null, $showFrom = true) { $line = $calledFrom[0]['line']; } $html = <<%s (line %s) +
+%s (line %s)
 %s
 
+
HTML; $text = <<'), array('<', '>'), $var); + $var = htmlentities($var); } printf($template, $file, $line, $var); }