Move inline event handlers to <script>

This commit is contained in:
Jakub Vrana 2018-01-12 13:54:08 +01:00
parent 22b4322710
commit d996b48cfa
5 changed files with 9 additions and 5 deletions

View file

@ -63,7 +63,8 @@ if ($adminer->homepage()) {
}
}
$doc_link = doc_link(array('sql' => 'show-table-status.html'));
echo "<table cellspacing='0' class='nowrap checkable' onclick='tableClick(event);' ondblclick='tableClick(event, true);'>\n";
echo "<table cellspacing='0' class='nowrap checkable'>\n";
echo "<script>mixin(qsl('table'), {onclick: tableClick, ondblclick: partialArg(tableClick, true)});</script>\n";
echo '<thead><tr class="wrap"><td><input id="check-all" type="checkbox" onclick="formCheck.call(this, /^(tables|views)\[/);" class="jsonly">';
echo '<th>' . lang('Table');
echo '<td>' . lang('Engine') . doc_link(array('sql' => 'storage-engines.html'));

View file

@ -960,7 +960,7 @@ bodyLoad('<?php echo (is_object($connection) ? substr($connection->server_info,
* @return null
*/
function tablesPrint($tables) {
echo "<ul id='tables' onmouseover='menuOver.call(this, event);' onmouseout='menuOut.call(this);'>\n";
echo "<ul id='tables'><script>mixin(qs('#tables'), {onmouseover: menuOver, onmouseout: menuOut});</script>\n";
foreach ($tables as $table => $status) {
echo '<li><a href="' . h(ME) . 'select=' . urlencode($table) . '"' . bold($_GET["select"] == $table || $_GET["edit"] == $table, "select") . ">" . lang('select') . "</a> ";
$name = $this->tableName($status);

View file

@ -29,7 +29,8 @@ function connect_error() {
$scheme = support("scheme");
$collations = collations();
echo "<form action='' method='post'>\n";
echo "<table cellspacing='0' class='checkable' onclick='tableClick(event);' ondblclick='tableClick(event, true);'>\n";
echo "<table cellspacing='0' class='checkable'>\n";
echo "<script>mixin(qsl('table'), {onclick: tableClick, ondblclick: partialArg(tableClick, true)});</script>\n";
echo "<thead><tr>"
. (support("database") ? "<td>&nbsp;" : "")
. "<th>" . lang('Database') . " - <a href='" . h(ME) . "refresh=1'>" . lang('Refresh') . "</a>"

View file

@ -13,7 +13,8 @@ page_header(lang('Process list'), $error);
?>
<form action="" method="post">
<table cellspacing="0" onclick="tableClick(event);" ondblclick="tableClick(event, true);" class="nowrap checkable">
<table cellspacing="0" class="nowrap checkable">
<script>mixin(qsl('table'), {onclick: tableClick, ondblclick: partialArg(tableClick, true)});</script>
<?php
// HTML valid because there is always at least one process
$i = -1;

View file

@ -7,7 +7,8 @@ if ($adminer->homepage()) {
if ($_POST["query"] != "") {
search_tables();
}
echo "<table cellspacing='0' class='nowrap checkable' onclick='tableClick(event);' ondblclick='tableClick(event, true);'>\n";
echo "<table cellspacing='0' class='nowrap checkable'>\n";
echo "<script>mixin(qsl('table'), {onclick: tableClick, ondblclick: partialArg(tableClick, true)});</script>\n";
echo '<thead><tr class="wrap"><td><input id="check-all" type="checkbox" onclick="formCheck.call(this, /^tables\[/);" class="jsonly"><th>' . lang('Table') . '<td>' . lang('Rows') . "</thead>\n";
foreach (table_status() as $table => $row) {