Skip to content

Commit ca078d9

Browse files
committed
Converging on 4px for border-radius.
Updating debug() to output a tiny bit more HTML so it can be made sexy.
1 parent 1c40a37 commit ca078d9

File tree

3 files changed

+38
-17
lines changed

3 files changed

+38
-17
lines changed

app/webroot/css/cake.generic.css

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,10 @@ table td.actions a {
209209
}
210210
.paging .prev {
211211
border-left: 1px solid #ccc;
212-
border-radius: 5px 0 0 5px;
212+
border-radius: 4px 0 0 4px;
213213
}
214214
.paging .next {
215-
border-radius: 0 5px 5px 0;
215+
border-radius: 0 4px 4px 0;
216216
}
217217
.paging .disabled {
218218
color: #ddd;
@@ -361,7 +361,7 @@ form .submit input[type=submit]:hover {
361361
/* Form errors */
362362
form .error {
363363
background: #FFDACC;
364-
border-radius: 5px;
364+
border-radius: 4px;
365365
font-weight: normal;
366366
}
367367
form .error-message {
@@ -500,9 +500,9 @@ input[type=submit],
500500
background-image: linear-gradient(top, #fefefe, #dcdcdc);
501501
color:#333;
502502
border:1px solid #bbb;
503-
-webkit-border-radius: 5px;
504-
-moz-border-radius: 5px;
505-
border-radius: 5px;
503+
-webkit-border-radius: 4px;
504+
-moz-border-radius: 4px;
505+
border-radius: 4px;
506506
text-decoration: none;
507507
text-shadow: #fff 0px 1px 0px;
508508
min-width: 0;
@@ -548,12 +548,31 @@ pre {
548548
padding: 15px;
549549
box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
550550
}
551+
.cake-debug-output {
552+
padding: 0;
553+
position: relative;
554+
}
555+
.cake-debug-output > span {
556+
position: absolute;
557+
top: 5px;
558+
right: 5px;
559+
background: rgba(255, 255, 255, 0.3);
560+
-moz-border-radius: 4px;
561+
-webkit-border-radius: 4px;
562+
border-radius: 4px;
563+
padding: 5px 6px;
564+
color: #000;
565+
display: block;
566+
float: left;
567+
box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.25), 0 1px 0 rgba(255, 255, 255, 0.5);
568+
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
569+
}
551570
.cake-debug,
552571
.cake-error {
553-
font-size: 120%;
554-
line-height: 140%;
555-
margin-top: 1em;
556-
position: relative;
572+
font-size: 16px;
573+
line-height: 20px;
574+
margin-top: 24px;
575+
clear: both;
557576
}
558577
.cake-error > a {
559578
text-shadow: none;
@@ -567,7 +586,7 @@ pre {
567586
line-height: 140%;
568587
overflow: auto;
569588
position: relative;
570-
border-radius: 5px;
589+
border-radius: 4px;
571590
}
572591
.cake-stack-trace a {
573592
text-shadow: none;

lib/Cake/Test/Case/BasicsTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -677,23 +677,23 @@ public function testDebug() {
677677
$pattern = '/(.+?Test(\/|\\\)Case(\/|\\\)BasicsTest\.php|';
678678
$pattern .= preg_quote(substr(__FILE__, 1), '/') . ')';
679679
$pattern .= '.*line.*' . (__LINE__ - 4) . '.*this-is-a-test.*/s';
680-
$this->assertPattern($pattern, $result);
680+
$this->assertRegExp($pattern, $result);
681681

682682
ob_start();
683683
debug('<div>this-is-a-test</div>', true);
684684
$result = ob_get_clean();
685685
$pattern = '/(.+?Test(\/|\\\)Case(\/|\\\)BasicsTest\.php|';
686686
$pattern .= preg_quote(substr(__FILE__, 1), '/') . ')';
687-
$pattern .= '.*line.*' . (__LINE__ - 4) . '.*&lt;div&gt;this-is-a-test&lt;\/div&gt;.*/s';
688-
$this->assertPattern($pattern, $result);
687+
$pattern .= '.*line.*' . (__LINE__ -4) . '.*&lt;div&gt;this-is-a-test&lt;\/div&gt;.*/s';
688+
$this->assertRegExp($pattern, $result);
689689

690690
ob_start();
691691
debug('<div>this-is-a-test</div>', false);
692692
$result = ob_get_clean();
693693
$pattern = '/(.+?Test(\/|\\\)Case(\/|\\\)BasicsTest\.php|';
694694
$pattern .= preg_quote(substr(__FILE__, 1), '/') . ')';
695695
$pattern .= '.*line.*' . (__LINE__ - 4) . '.*\<div\>this-is-a-test\<\/div\>.*/s';
696-
$this->assertPattern($pattern, $result);
696+
$this->assertRegExp($pattern, $result);
697697
}
698698

699699
/**

lib/Cake/basics.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,12 @@ function debug($var = false, $showHtml = null, $showFrom = true) {
8282
$line = $calledFrom[0]['line'];
8383
}
8484
$html = <<<HTML
85-
<strong>%s</strong> (line <strong>%s</strong>)
85+
<div class="cake-debug-output">
86+
<span><strong>%s</strong> (line <strong>%s</strong>)</span>
8687
<pre class="cake-debug">
8788
%s
8889
</pre>
90+
</div>
8991
HTML;
9092
$text = <<<TEXT
9193
@@ -104,7 +106,7 @@ function debug($var = false, $showHtml = null, $showFrom = true) {
104106
}
105107
$var = print_r($var, true);
106108
if ($showHtml) {
107-
$var = str_replace(array('<', '>'), array('&lt;', '&gt;'), $var);
109+
$var = htmlentities($var);
108110
}
109111
printf($template, $file, $line, $var);
110112
}

0 commit comments

Comments
 (0)