Converging on 4px for border-radius.

Updating debug() to output a tiny bit more HTML so it can be made sexy.
This commit is contained in:
mark_story 2011-09-02 16:45:09 +01:00
parent 1c40a37439
commit ca078d9a25
3 changed files with 38 additions and 17 deletions

View file

@ -209,10 +209,10 @@ table td.actions a {
} }
.paging .prev { .paging .prev {
border-left: 1px solid #ccc; border-left: 1px solid #ccc;
border-radius: 5px 0 0 5px; border-radius: 4px 0 0 4px;
} }
.paging .next { .paging .next {
border-radius: 0 5px 5px 0; border-radius: 0 4px 4px 0;
} }
.paging .disabled { .paging .disabled {
color: #ddd; color: #ddd;
@ -361,7 +361,7 @@ form .submit input[type=submit]:hover {
/* Form errors */ /* Form errors */
form .error { form .error {
background: #FFDACC; background: #FFDACC;
border-radius: 5px; border-radius: 4px;
font-weight: normal; font-weight: normal;
} }
form .error-message { form .error-message {
@ -500,9 +500,9 @@ input[type=submit],
background-image: linear-gradient(top, #fefefe, #dcdcdc); background-image: linear-gradient(top, #fefefe, #dcdcdc);
color:#333; color:#333;
border:1px solid #bbb; border:1px solid #bbb;
-webkit-border-radius: 5px; -webkit-border-radius: 4px;
-moz-border-radius: 5px; -moz-border-radius: 4px;
border-radius: 5px; border-radius: 4px;
text-decoration: none; text-decoration: none;
text-shadow: #fff 0px 1px 0px; text-shadow: #fff 0px 1px 0px;
min-width: 0; min-width: 0;
@ -548,12 +548,31 @@ pre {
padding: 15px; padding: 15px;
box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3); 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-debug,
.cake-error { .cake-error {
font-size: 120%; font-size: 16px;
line-height: 140%; line-height: 20px;
margin-top: 1em; margin-top: 24px;
position: relative; clear: both;
} }
.cake-error > a { .cake-error > a {
text-shadow: none; text-shadow: none;
@ -567,7 +586,7 @@ pre {
line-height: 140%; line-height: 140%;
overflow: auto; overflow: auto;
position: relative; position: relative;
border-radius: 5px; border-radius: 4px;
} }
.cake-stack-trace a { .cake-stack-trace a {
text-shadow: none; text-shadow: none;

View file

@ -677,15 +677,15 @@ class BasicsTest extends CakeTestCase {
$pattern = '/(.+?Test(\/|\\\)Case(\/|\\\)BasicsTest\.php|'; $pattern = '/(.+?Test(\/|\\\)Case(\/|\\\)BasicsTest\.php|';
$pattern .= preg_quote(substr(__FILE__, 1), '/') . ')'; $pattern .= preg_quote(substr(__FILE__, 1), '/') . ')';
$pattern .= '.*line.*' . (__LINE__ - 4) . '.*this-is-a-test.*/s'; $pattern .= '.*line.*' . (__LINE__ - 4) . '.*this-is-a-test.*/s';
$this->assertPattern($pattern, $result); $this->assertRegExp($pattern, $result);
ob_start(); ob_start();
debug('<div>this-is-a-test</div>', true); debug('<div>this-is-a-test</div>', true);
$result = ob_get_clean(); $result = ob_get_clean();
$pattern = '/(.+?Test(\/|\\\)Case(\/|\\\)BasicsTest\.php|'; $pattern = '/(.+?Test(\/|\\\)Case(\/|\\\)BasicsTest\.php|';
$pattern .= preg_quote(substr(__FILE__, 1), '/') . ')'; $pattern .= preg_quote(substr(__FILE__, 1), '/') . ')';
$pattern .= '.*line.*' . (__LINE__ - 4) . '.*&lt;div&gt;this-is-a-test&lt;\/div&gt;.*/s'; $pattern .= '.*line.*' . (__LINE__ -4) . '.*&lt;div&gt;this-is-a-test&lt;\/div&gt;.*/s';
$this->assertPattern($pattern, $result); $this->assertRegExp($pattern, $result);
ob_start(); ob_start();
debug('<div>this-is-a-test</div>', false); debug('<div>this-is-a-test</div>', false);
@ -693,7 +693,7 @@ class BasicsTest extends CakeTestCase {
$pattern = '/(.+?Test(\/|\\\)Case(\/|\\\)BasicsTest\.php|'; $pattern = '/(.+?Test(\/|\\\)Case(\/|\\\)BasicsTest\.php|';
$pattern .= preg_quote(substr(__FILE__, 1), '/') . ')'; $pattern .= preg_quote(substr(__FILE__, 1), '/') . ')';
$pattern .= '.*line.*' . (__LINE__ - 4) . '.*\<div\>this-is-a-test\<\/div\>.*/s'; $pattern .= '.*line.*' . (__LINE__ - 4) . '.*\<div\>this-is-a-test\<\/div\>.*/s';
$this->assertPattern($pattern, $result); $this->assertRegExp($pattern, $result);
} }
/** /**

View file

@ -82,10 +82,12 @@ function debug($var = false, $showHtml = null, $showFrom = true) {
$line = $calledFrom[0]['line']; $line = $calledFrom[0]['line'];
} }
$html = <<<HTML $html = <<<HTML
<strong>%s</strong> (line <strong>%s</strong>) <div class="cake-debug-output">
<span><strong>%s</strong> (line <strong>%s</strong>)</span>
<pre class="cake-debug"> <pre class="cake-debug">
%s %s
</pre> </pre>
</div>
HTML; HTML;
$text = <<<TEXT $text = <<<TEXT
@ -104,7 +106,7 @@ TEXT;
} }
$var = print_r($var, true); $var = print_r($var, true);
if ($showHtml) { if ($showHtml) {
$var = str_replace(array('<', '>'), array('&lt;', '&gt;'), $var); $var = htmlentities($var);
} }
printf($template, $file, $line, $var); printf($template, $file, $line, $var);
} }