1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-07 15:16:44 +02:00

JS: Use let/const in spaghetti code

This commit is contained in:
Jakub Vrana
2025-03-20 08:40:15 +01:00
parent 0e21106e48
commit 101229043e
4 changed files with 16 additions and 17 deletions

View File

@@ -35,8 +35,8 @@ class AdminerSlugify {
if ($slug !== null) {
return "<input value='" . Adminer\h($value) . "' data-maxlength='$field[length]' size='40'$attrs>"
. Adminer\script("qsl('input').onchange = function () {
var find = '$this->from';
var repl = '$this->to';
const find = '$this->from';
const repl = '$this->to';
this.form['fields[$slug]'].value = this.value.toLowerCase()
.replace(new RegExp('[' + find + ']', 'g'), function (str) { return repl[find.indexOf(str)]; })
.replace(/[^a-z0-9_]+/g, '-')