Move whitespace to CSS

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1189 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana 2009-10-13 19:43:33 +00:00
parent 32d5b9ccb6
commit 50881f8942
4 changed files with 5 additions and 13 deletions

View file

@ -56,7 +56,7 @@ function select($result, $connection2 = null) {
} elseif (!strlen($val)) {
$val = " "; // some content to print a border
} else {
$val = whitespace(h($val));
$val = h($val);
if ($types[$key] == 254) {
$val = "<code>$val</code>";
}
@ -188,7 +188,7 @@ if ($type == "PROCEDURE") {
echo "&nbsp;<input type='image' name='drop_col[$i]' src='../adminer/static/cross.gif' alt='x' title='" . lang('Remove') . "' onclick='return !editing_remove_row(this);'>";
echo "&nbsp;<input type='image' name='up[$i]' src='../adminer/static/up.gif' alt='^' title='" . lang('Move up') . "'>";
echo "&nbsp;<input type='image' name='down[$i]' src='../adminer/static/down.gif' alt='v' title='" . lang('Move down') . "'>";
echo "\n\n";
echo "\n";
}
return $column_comments;
}

View file

@ -43,14 +43,6 @@ function h($string) {
return htmlspecialchars($string, ENT_QUOTES);
}
/** Convert text whitespace to HTML
* @param string
* @return string
*/
function whitespace($string) {
return nl2br(preg_replace('~(^| ) ~m', '\\1&nbsp;', str_replace("\t", " ", $string)));
}
/** Escape for TD
* @param string
* @return string

View file

@ -212,9 +212,9 @@ if (!$columns) {
if (!strlen($val)) {
$val = "&nbsp;";
} elseif (strlen($text_length) && ereg('text|blob', $field["type"]) && is_utf8($val)) {
$val = whitespace(shorten_utf8($val, max(0, intval($text_length)))); // usage of LEFT() would reduce traffic but complicate query
$val = shorten_utf8($val, max(0, intval($text_length))); // usage of LEFT() would reduce traffic but complicate query
} else {
$val = whitespace(h($val));
$val = h($val);
}
if (!$link) { // link related items

View file

@ -18,7 +18,7 @@ code { background: #eee; }
tr:hover td, tr:hover th { background: #ddf; }
.version { color: #777; font-size: 67%; }
.js .hidden { display: none; }
.nowrap { white-space: nowrap; }
.nowrap { white-space: pre; }
.wrap { white-space: normal; }
.error { color: red; background: #fee; }
.message { color: green; background: #efe; }