1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-05 14:17:26 +02:00

JS: Add 'use strict'

This commit is contained in:
Jakub Vrana
2025-03-27 10:11:35 +01:00
parent 81ae16bce1
commit 0578b5c490
4 changed files with 8 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
// Adminer specific functions 'use strict'; // Adminer specific functions
/** Load syntax highlighting /** Load syntax highlighting
* @param string first three characters of database system version * @param string first three characters of database system version

View File

@@ -1,3 +1,4 @@
'use strict';
/** Get first element by selector /** Get first element by selector
* @param string * @param string

View File

@@ -213,6 +213,11 @@ function minify_css($file) {
} }
function minify_js($file) { function minify_js($file) {
$file = preg_replace_callback("~'use strict';~", function ($match) { // keep only the first one
static $count = 0;
$count++;
return ($count == 1 ? $match[0] : '');
}, $file);
if (function_exists('jsShrink')) { if (function_exists('jsShrink')) {
$file = jsShrink($file); $file = jsShrink($file);
} }

View File

@@ -1,4 +1,4 @@
// Editor specific functions 'use strict'; // Editor specific functions
function messagesPrint() { function messagesPrint() {
} }