From 266d83215db4c9cc31072c7035f051f3fa7504fd Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Fri, 18 Mar 2011 15:03:41 +0100 Subject: [PATCH] Hide JS only elements with disabled JavaScript --- adminer/create.inc.php | 2 +- adminer/include/design.inc.php | 2 +- adminer/include/functions.inc.php | 2 +- adminer/select.inc.php | 2 +- adminer/static/default.css | 2 +- adminer/static/functions.js | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/adminer/create.inc.php b/adminer/create.inc.php index f56e15a3..a292ce27 100644 --- a/adminer/create.inc.php +++ b/adminer/create.inc.php @@ -161,7 +161,7 @@ foreach ($engines as $engine) {

: "> - + ' : ''); ?>

diff --git a/adminer/include/design.inc.php b/adminer/include/design.inc.php index 159eb8a7..f380fcef 100644 --- a/adminer/include/design.inc.php +++ b/adminer/include/design.inc.php @@ -28,7 +28,7 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") { -');" onload="bodyLoad('server_info, 0, 3) : ""); ?>');"> +');" onload="bodyLoad('server_info, 0, 3) : ""); ?>');"> diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php index 59060016..5e0525d9 100644 --- a/adminer/include/functions.inc.php +++ b/adminer/include/functions.inc.php @@ -91,7 +91,7 @@ function nl_br($string) { function checkbox($name, $value, $checked, $label = "", $onclick = "") { static $id = 0; $id++; - $return = ""; + $return = ""; return ($label != "" ? "" : $return); } diff --git a/adminer/select.inc.php b/adminer/select.inc.php index 00ee9e77..5e3aa5fe 100644 --- a/adminer/select.inc.php +++ b/adminer/select.inc.php @@ -394,7 +394,7 @@ if (!$columns) { if (!information_schema(DB)) { ?>

- + diff --git a/adminer/static/default.css b/adminer/static/default.css index c6cdbc1c..52f2f3f4 100644 --- a/adminer/static/default.css +++ b/adminer/static/default.css @@ -20,7 +20,7 @@ code { background: #eee; } tr:hover td, tr:hover th { background: #ddf; } pre { margin: 1em 0 0; } .version { color: #777; font-size: 67%; } -.js .hidden { display: none; } +.js .hidden, .nojs .jsonly { display: none; } .nowrap td, .nowrap th, td.nowrap { white-space: pre; } .wrap td { white-space: normal; } .error { color: red; background: #fee; } diff --git a/adminer/static/functions.js b/adminer/static/functions.js index 829a7569..be66f96d 100644 --- a/adminer/static/functions.js +++ b/adminer/static/functions.js @@ -1,5 +1,5 @@ // to hide elements displayed by JavaScript -document.body.className += ' js'; +document.body.className = document.body.className.replace(/(^|\s)nojs(\s|$)/, '$1js$2'); /** Toggle visibility * @param string