]> git.joonet.de Git - adminer.git/commitdiff
Move inline event handlers to <script>
authorJakub Vrana <jakub@vrana.cz>
Fri, 12 Jan 2018 12:54:08 +0000 (13:54 +0100)
committerJakub Vrana <jakub@vrana.cz>
Fri, 12 Jan 2018 16:09:41 +0000 (17:09 +0100)
adminer/db.inc.php
adminer/include/adminer.inc.php
adminer/include/connect.inc.php
adminer/processlist.inc.php
editor/db.inc.php

index 17fc29b1374729ff47d35163f39c6a311c6c23e4..deb5c2519fa14be8ee8d2b3d7b12580e366a2854 100644 (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'));
index 2456ea35dd06647b532ce5d573d7095c790cf7c0..99c8428076c66a0498c5c56252f1ca518a873376 100644 (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);
index 061475a1ef2434665156ede42f50c08825e7ba0e..4e91a6ba6925810598559604c3386bf9ea92f4aa 100644 (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>"
index 8f8e9638a609fb0894a7702c4d7700a62a5a7301..e2c0dc94beaf1da887096fef813c6213e2e9a84e 100644 (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;
index 087bf6cf2b838ddc87256cf9279ca456940f2f0f..3aa3c676d5b7314b07dd8127cc1829974aec16cf 100644 (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) {