mirror of
https://github.com/vrana/adminer.git
synced 2025-08-07 07:06:45 +02:00
JS: Use let/const for globals
This commit is contained in:
@@ -484,7 +484,7 @@ class Adminer {
|
||||
echo "<input type='submit' value='" . lang('Select') . "'>";
|
||||
echo " <span id='noindex' title='" . lang('Full table scan') . "'></span>";
|
||||
echo "<script" . nonce() . ">\n";
|
||||
echo "var indexColumns = ";
|
||||
echo "const indexColumns = ";
|
||||
$columns = array();
|
||||
foreach ($indexes as $index) {
|
||||
$current_key = reset($index["columns"]);
|
||||
|
@@ -72,8 +72,8 @@ fQIDAQAB
|
||||
. (isset($_COOKIE["adminer_version"]) ? "" : ", onload: partial(verifyVersion, '$VERSION', '" . js_escape(ME) . "', '" . get_token() . "')") // $token may be empty in auth.inc.php
|
||||
. "});
|
||||
document.body.className = document.body.className.replace(/ nojs/, ' js');
|
||||
var offlineMessage = '" . js_escape(lang('You are offline.')) . "';
|
||||
var thousandsSeparator = '" . js_escape(lang(',')) . "';")
|
||||
const offlineMessage = '" . js_escape(lang('You are offline.')) . "';
|
||||
const thousandsSeparator = '" . js_escape(lang(',')) . "';")
|
||||
;
|
||||
echo "<div id='help' class='jush-" . JUSH . " jsonly hidden'></div>\n";
|
||||
echo script("mixin(qs('#help'), {onmouseover: function () { helpOpen = 1; }, onmouseout: helpMouseout});");
|
||||
|
@@ -974,7 +974,7 @@ function slow_query($query) {
|
||||
$connection2 = null;
|
||||
if (!$slow_query && support("kill") && is_object($connection2 = connect($adminer->credentials())) && ($db == "" || $connection2->select_db($db))) {
|
||||
$kill = $connection2->result(connection_id()); // MySQL and MySQLi can use thread_id but it's not in PDO_MySQL
|
||||
echo script("var timeout = setTimeout(function () { ajax('" . js_escape(ME) . "script=kill', function () {}, 'kill=$kill&token=$token'); }, 1000 * $timeout);");
|
||||
echo script("const timeout = setTimeout(function () { ajax('" . js_escape(ME) . "script=kill', function () {}, 'kill=$kill&token=$token'); }, 1000 * $timeout);");
|
||||
}
|
||||
ob_flush();
|
||||
flush();
|
||||
|
@@ -53,8 +53,8 @@ foreach (table_status('', true) as $table => $table_status) {
|
||||
<div id="schema" style="height: <?php echo $top; ?>em;">
|
||||
<script<?php echo nonce(); ?>>
|
||||
qs('#schema').onselectstart = function () { return false; };
|
||||
var tablePos = {<?php echo implode(",", $table_pos_js) . "\n"; ?>};
|
||||
var em = qs('#schema').offsetHeight / <?php echo $top; ?>;
|
||||
const tablePos = {<?php echo implode(",", $table_pos_js) . "\n"; ?>};
|
||||
const em = qs('#schema').offsetHeight / <?php echo $top; ?>;
|
||||
document.onmousemove = schemaMousemove;
|
||||
document.onmouseup = partialArg(schemaMouseup, '<?php echo js_escape(DB); ?>');
|
||||
</script>
|
||||
|
@@ -396,7 +396,7 @@ function editingMoveRow(up){
|
||||
return false;
|
||||
}
|
||||
|
||||
var lastType = '';
|
||||
let lastType = '';
|
||||
|
||||
/** Clear length and hide collation or unsigned
|
||||
* @this HTMLSelectElement
|
||||
|
@@ -10,8 +10,8 @@ class AdminerTablesFilter {
|
||||
function tablesPrint($tables) {
|
||||
?>
|
||||
<script<?php echo Adminer\nonce(); ?>>
|
||||
var tablesFilterTimeout = null;
|
||||
var tablesFilterValue = '';
|
||||
let tablesFilterTimeout = null;
|
||||
let tablesFilterValue = '';
|
||||
|
||||
function tablesFilter() {
|
||||
const value = qs('#filter-field').value.toLowerCase();
|
||||
|
Reference in New Issue
Block a user