]> git.joonet.de Git - adminer.git/commitdiff
Move inline event handlers to <script>
authorJakub Vrana <jakub@vrana.cz>
Fri, 12 Jan 2018 15:51:45 +0000 (16:51 +0100)
committerJakub Vrana <jakub@vrana.cz>
Fri, 12 Jan 2018 16:11:29 +0000 (17:11 +0100)
adminer/dump.inc.php
adminer/include/design.inc.php
adminer/schema.inc.php

index db89798b4bec6fc93e1fc8579dcad64ff063d128..5be9218ef6c871066c1d77eb02fd75983f261636 100644 (file)
@@ -169,8 +169,8 @@ $prefixes = array();
 if (DB != "") {
        $checked = ($TABLE != "" ? "" : " checked");
        echo "<thead><tr>";
-       echo "<th style='text-align: left;'><label class='block'><input type='checkbox' id='check-tables'$checked onclick='formCheck.call(this, /^tables\\[/);'>" . lang('Tables') . "</label>";
-       echo "<th style='text-align: right;'><label class='block'>" . lang('Data') . "<input type='checkbox' id='check-data'$checked onclick='formCheck.call(this, /^data\\[/);'></label>";
+       echo "<th style='text-align: left;'><label class='block'><input type='checkbox' id='check-tables'$checked>" . lang('Tables') . "</label>" . script("qs('#check-tables').onclick = partial(formCheck, /^tables\\[/);", "");
+       echo "<th style='text-align: right;'><label class='block'>" . lang('Data') . "<input type='checkbox' id='check-data'$checked></label>" . script("qs('#check-data').onclick = partial(formCheck, /^data\\[/);", "");
        echo "</thead>\n";
 
        $views = "";
@@ -193,7 +193,10 @@ if (DB != "") {
        }
 
 } else {
-       echo "<thead><tr><th style='text-align: left;'><label class='block'><input type='checkbox' id='check-databases'" . ($TABLE == "" ? " checked" : "") . " onclick='formCheck.call(this, /^databases\\[/);'>" . lang('Database') . "</label></thead>\n";
+       echo "<thead><tr><th style='text-align: left;'>";
+       echo "<label class='block'><input type='checkbox' id='check-databases'" . ($TABLE == "" ? " checked" : "") . ">" . lang('Database') . "</label>";
+       echo script("qs('#check-databases').onclick = partial(formCheck, /^databases\\[/);", "");
+       echo "</thead>\n";
        $databases = $adminer->databases();
        if ($databases) {
                foreach ($databases as $db) {
index 3f4b8adac6ebfae0ca964b8490b56a8514a47ed3..02ba9265f025a36a9b14542437d63da0a20f3f8b 100644 (file)
@@ -32,8 +32,9 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
 <?php } ?>
 <?php } ?>
 
-<body class="<?php echo lang('ltr'); ?> nojs" onkeydown="bodyKeydown(event);" onclick="bodyClick(event);"<?php echo (isset($_COOKIE["adminer_version"]) ? "" : " onload=\"verifyVersion('$VERSION');\""); ?>>
+<body class="<?php echo lang('ltr'); ?> nojs">
 <script>
+mixin(document.body, {onkeydown: bodyKeydown, onclick: bodyClick<?php echo (isset($_COOKIE["adminer_version"]) ? "" : ", onload: partial(verifyVersion, '$VERSION')"); ?>});
 document.body.className = document.body.className.replace(/ nojs/, ' js');
 var offlineMessage = '<?php echo js_escape(lang('You are offline.')); ?>';
 </script>
index ecb8304d2e21ae7b08e8d6da76ce78f02fbd4a9d..dfb4c402b03a5dec5c2eab97f9f054d8f4d120e3 100644 (file)
@@ -48,8 +48,9 @@ foreach (table_status('', true) as $table => $table_status) {
 }
 
 ?>
-<div id="schema" style="height: <?php echo $top; ?>em;" onselectstart="return false;">
+<div id="schema" style="height: <?php echo $top; ?>em;">
 <script>
+qs('#schema').onselectstart = function () { return false; };
 var tablePos = {<?php echo implode(",", $table_pos_js) . "\n"; ?>};
 var em = qs('#schema').offsetHeight / <?php echo $top; ?>;
 document.onmousemove = schemaMousemove;