diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..723ef36
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+.idea
\ No newline at end of file
diff --git a/adminer.css b/adminer.css
index 1711c38..e403e9a 100644
--- a/adminer.css
+++ b/adminer.css
@@ -325,6 +325,7 @@ input[name=logout]:hover {
.logout {
z-index:3;
+ position: fixed;
}
.js .column {
diff --git a/plugins/AdminerJsonColumn.php b/plugins/AdminerJsonColumn.php
index 71fb205..746182e 100644
--- a/plugins/AdminerJsonColumn.php
+++ b/plugins/AdminerJsonColumn.php
@@ -1,36 +1,50 @@
';
- foreach ($json as $key => $val) {
+ private function _buildTable($json)
+ {
+ echo '
';
+ foreach ($json as $key => $val)
+ {
echo '';
echo '| ' . h($key) . ' | ';
echo '';
- if (is_scalar($val) || $val === null) {
- if (is_bool($val)) {
+ if (is_scalar($val) || $val === null)
+ {
+ if (is_bool($val))
+ {
$val = $val ? 'true' : 'false';
- } elseif ($val === null) {
+ }
+ elseif ($val === null)
+ {
$val = 'null';
- } elseif (!is_numeric($val)) {
+ }
+ elseif (!is_numeric($val))
+ {
$val = '"' . h(addcslashes($val, "\r\n\"")) . '"';
}
echo '' . $val . '';
- } else {
+ }
+ else
+ {
$this->_buildTable($val);
}
echo ' | ';
@@ -39,10 +53,28 @@ class AdminerJsonColumn {
echo '
';
}
- function editInput($table, $field, $attrs, $value) {
+ function editInput($table, $field, $attrs, $value)
+ {
$json = $this->_testJson($value);
- if ($json !== $value) {
- $this->_buildTable($json);
+ if ($json !== $value)
+ {
+ $name = $field['field'];
+ ?>
+ show as table
+ = json_encode($json, JSON_PRETTY_PRINT); ?>
+
+ prepend = <<' + tds[i].newDate + '';
+ tds[i].innerHTML = tds[i].newDate;
+ tds[i].dateIsNew = true;
+
+ tds[i].addEventListener('click', function(event) {
+ this.innerHTML = (this.dateIsNew ? this.oldDate : this.newDate);
+ this.dateIsNew = !this.dateIsNew;
+ });
+ }
+ }
+});
+
+EOT;
+ }
+
+ function head()
+ {
+ echo script($this->prepend);
+ }
+}
\ No newline at end of file
diff --git a/plugins/AdminerReadableTableSize.php b/plugins/AdminerReadableTableSize.php
new file mode 100644
index 0000000..1c23fac
--- /dev/null
+++ b/plugins/AdminerReadableTableSize.php
@@ -0,0 +1,50 @@
+prepend = << 0) {
+ sized = AdminerReadableTableSizeConvert(bytes, 2);
+ }
+ row.title = row.title+' [' + row.innerText + ' Bytes]';
+ row.innerText = sized;
+ }
+}
+document.addEventListener('DOMContentLoaded', function(event) {
+ setTimeout(function() {
+ AdminerReadableTableSize('Data_length');
+ AdminerReadableTableSize('Index_length');
+ AdminerReadableTableSize('Data_free');
+ }, 500);
+});
+
+EOT;
+ }
+
+ function head()
+ {
+ echo script($this->prepend);
+ }
+
+}