1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-12 01:24:17 +02:00

Move inline event handlers to <script>

This commit is contained in:
Jakub Vrana
2018-01-12 16:29:18 +01:00
parent 068ee71bf7
commit 35b1db6974
5 changed files with 13 additions and 9 deletions

View File

@@ -53,14 +53,13 @@ foreach (table_status('', true) as $table => $table_status) {
var tablePos = {<?php echo implode(",", $table_pos_js) . "\n"; ?>};
var em = qs('#schema').offsetHeight / <?php echo $top; ?>;
document.onmousemove = schemaMousemove;
document.onmouseup = function (ev) {
schemaMouseup(ev, '<?php echo js_escape(DB); ?>');
};
document.onmouseup = partialArg(schemaMouseup, '<?php echo js_escape(DB); ?>');
</script>
<?php
foreach ($schema as $name => $table) {
echo "<div class='table' style='top: " . $table["pos"][0] . "em; left: " . $table["pos"][1] . "em;' onmousedown='schemaMousedown.call(this, event);'>";
echo "<div class='table' style='top: " . $table["pos"][0] . "em; left: " . $table["pos"][1] . "em;'>";
echo '<a href="' . h(ME) . 'table=' . urlencode($name) . '"><b>' . h($name) . "</b></a>";
echo script("qsl('div').onmousedown = schemaMousedown;");
foreach ($table["fields"] as $field) {
$val = '<span' . type_class($field["type"]) . ' title="' . h($field["full_type"] . ($field["null"] ? " NULL" : '')) . '">' . h($field["field"]) . '</span>';