update adminer and adapt plugins to new version
This commit is contained in:
parent
5659ab8524
commit
f66a311358
15 changed files with 1411 additions and 1975 deletions
37
adminer-plugins/AdminerReadableDates.php
Normal file
37
adminer-plugins/AdminerReadableDates.php
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
/** This plugin replaces UNIX timestamps with human-readable dates in your local format.
|
||||
* Mouse click on the date field reveals timestamp back.
|
||||
*
|
||||
* @link https://www.adminer.org/plugins/#use
|
||||
* @author Anonymous
|
||||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
|
||||
*/
|
||||
class AdminerReadableDates
|
||||
{
|
||||
/** @access protected */
|
||||
var $prepend;
|
||||
|
||||
function __construct()
|
||||
{
|
||||
$this->prepend = <<<EOT
|
||||
document.addEventListener('DOMContentLoaded', function(event) {
|
||||
var date = new Date();
|
||||
var tds = document.querySelectorAll('td[id^="val"]');
|
||||
for (var i = 0; i < tds.length; i++) {
|
||||
var text = tds[i].innerHTML.trim();
|
||||
if (text.match(/^\d{10}$/)) {
|
||||
date.setTime(parseInt(text) * 1000);
|
||||
tds[i].title = date.toLocaleString();
|
||||
}
|
||||
}
|
||||
});
|
||||
EOT;
|
||||
}
|
||||
|
||||
function head()
|
||||
{
|
||||
echo Adminer\script($this->prepend);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue