Browse files

Move whitespace to CSS

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1189 7c3ca157-0c34-0410-bff1-cbf682f78f5c
  • Loading branch information...
1 parent 32d5b9c commit 50881f894283f8b25c81d9d58c4d3c4726679db3 jakubvrana committed Oct 13, 2009
Showing with 5 additions and 13 deletions.
  1. +2 −2 adminer/include/editing.inc.php
  2. +0 −8 adminer/include/functions.inc.php
  3. +2 −2 adminer/select.inc.php
  4. +1 −1 adminer/static/default.css
View
4 adminer/include/editing.inc.php
@@ -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 @@ function edit_fields($fields, $collations, $type = "TABLE", $allowed = 0, $forei
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
8 adminer/include/functions.inc.php
@@ -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
4 adminer/select.inc.php
@@ -212,9 +212,9 @@
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
2 adminer/static/default.css
@@ -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; }

0 comments on commit 50881f8

Please sign in to comment.