]> git.joonet.de Git - adminer.git/commitdiff
Hide JS only elements with disabled JavaScript
authorJakub Vrana <jakub@vrana.cz>
Fri, 18 Mar 2011 14:03:41 +0000 (15:03 +0100)
committerJakub Vrana <jakub@vrana.cz>
Fri, 18 Mar 2011 14:03:41 +0000 (15:03 +0100)
adminer/create.inc.php
adminer/include/design.inc.php
adminer/include/functions.inc.php
adminer/select.inc.php
adminer/static/default.css
adminer/static/functions.js

index f56e15a3df6dda1e20ae50adc673d799b0123005..a292ce2794a7c056315ec8bcf6e9541ee241465f 100644 (file)
@@ -161,7 +161,7 @@ foreach ($engines as $engine) {
 </table>
 <p>
 <?php echo lang('Auto Increment'); ?>: <input name="Auto_increment" size="6" value="<?php echo h($row["Auto_increment"]); ?>">
-<label><input type="checkbox" onclick="columnShow(this.checked, 5);"><?php echo lang('Default values'); ?></label>
+<label><input type="checkbox" onclick="columnShow(this.checked, 5);" class="jsonly"><?php echo lang('Default values'); ?></label>
 <?php echo (support("comment") ? checkbox("", "", $comments, lang('Comment'), "columnShow(this.checked, 6); toggle('Comment'); if (this.checked) this.form['Comment'].focus();") . ' <input id="Comment" name="Comment" value="' . h($row["Comment"]) . '" maxlength="60"' . ($comments ? '' : ' class="hidden"') . '>' : ''); ?>
 <p>
 <input type="submit" value="<?php echo lang('Save'); ?>">
index 159eb8a7002a19e02ce48b659916cf9333a3aef0..f380fcefcb120908ac66efcd7a58af49eab5e63c 100644 (file)
@@ -28,7 +28,7 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
 <link rel="stylesheet" type="text/css" href="adminer.css">
 <?php } ?>
 
-<body class="<?php echo lang('ltr'); ?>" onclick="return bodyClick(event, '<?php echo js_escape(DB); ?>', '<?php echo js_escape($_GET["ns"]); ?>');" onload="bodyLoad('<?php echo (is_object($connection) ? substr($connection->server_info, 0, 3) : ""); ?>');<?php echo (isset($_COOKIE["adminer_version"]) ? "" : " verifyVersion('$protocol');"); ?>">
+<body class="<?php echo lang('ltr'); ?> nojs" onclick="return bodyClick(event, '<?php echo js_escape(DB); ?>', '<?php echo js_escape($_GET["ns"]); ?>');" onload="bodyLoad('<?php echo (is_object($connection) ? substr($connection->server_info, 0, 3) : ""); ?>');<?php echo (isset($_COOKIE["adminer_version"]) ? "" : " verifyVersion('$protocol');"); ?>">
 <script type="text/javascript">
 var areYouSure = '<?php echo lang('Are you sure?'); ?>';
 </script>
index 590600167434e7b84714e3280d8e9e590e8a08cc..5e0525d988551e7e22e371f915fec5adb970a05f 100644 (file)
@@ -91,7 +91,7 @@ function nl_br($string) {
 function checkbox($name, $value, $checked, $label = "", $onclick = "") {
        static $id = 0;
        $id++;
-       $return = "<input type='checkbox'" . ($name ? " name='$name' value='" . h($value) . "'" : "") . ($checked ? " checked" : "") . ($onclick ? " onclick=\"$onclick\"" : "") . " id='checkbox-$id'>";
+       $return = "<input type='checkbox'" . ($name ? " name='$name' value='" . h($value) . "'" : " class='jsonly'") . ($checked ? " checked" : "") . ($onclick ? " onclick=\"$onclick\"" : "") . " id='checkbox-$id'>";
        return ($label != "" ? "<label for='checkbox-$id'>$return" . h($label) . "</label>" : $return);
 }
 
index 00ee9e77c09e44baf5374e6d1f38d35c9fbb03ee..5e3aa5fe27e72bcfca28af31e208611ded55d605 100644 (file)
@@ -394,7 +394,7 @@ if (!$columns) {
                        if (!information_schema(DB)) {
                                ?>
 <fieldset><legend><?php echo lang('Edit'); ?></legend><div>
-<input type="submit" id="save" value="<?php echo lang('Save'); ?>" title="<?php echo lang('Double click on a value to modify it.'); ?>">
+<input type="submit" id="save" value="<?php echo lang('Save'); ?>" title="<?php echo lang('Double click on a value to modify it.'); ?>" class="jsonly">
 <input type="submit" name="edit" value="<?php echo lang('Edit'); ?>">
 <input type="submit" name="clone" value="<?php echo lang('Clone'); ?>">
 <input type="submit" name="delete" value="<?php echo lang('Delete'); ?>" onclick="return confirm('<?php echo lang('Are you sure?'); ?> (' + (this.form['all'].checked ? <?php echo $found_rows; ?> : formChecked(this, /check/)) + ')');">
index c6cdbc1cdd03bd9279b2b766b0528d758e6f73a0..52f2f3f413462d550e818727dbf696e930ea8cc3 100644 (file)
@@ -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; }
index 829a75691595f5c13b19d34b43d71cc85aeed2a8..be66f96d74e139b7fb87d6461aa6cf4c981e5b08 100644 (file)
@@ -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