]> git.joonet.de Git - adminer.git/commitdiff
JS: Add 'use strict'
authorJakub Vrana <jakub@vrana.cz>
Thu, 27 Mar 2025 09:11:35 +0000 (10:11 +0100)
committerJakub Vrana <jakub@vrana.cz>
Thu, 27 Mar 2025 09:27:46 +0000 (10:27 +0100)
adminer/static/editing.js
adminer/static/functions.js
compile.php
editor/static/editing.js

index 3a17c624bfbf6af7ebea5d86140b509ee268ef8c..847f1d454223c891ab24c946a8f50678aaee32c9 100644 (file)
@@ -1,4 +1,4 @@
-// Adminer specific functions
+'use strict'; // Adminer specific functions
 
 /** Load syntax highlighting
 * @param string first three characters of database system version
index bad2321c167cd72dd9b9d4d8f7d7914be5fb55e2..c2aa419b3a2d951f910cf98af107fde32fcb05ae 100644 (file)
@@ -1,3 +1,4 @@
+'use strict';
 
 /** Get first element by selector
 * @param string
index 7a8ac85c823436ca5c608678ef840225187702f2..64cd48fabd45fc1bfa903d10fa0d4c5ce480c40a 100755 (executable)
@@ -213,6 +213,11 @@ function minify_css($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')) {
                $file = jsShrink($file);
        }
index c7dcdcfd364d1d5bee522090f0c395d9cfb18247..5533c5ac9559be433701b922c3a347bf79abf162 100644 (file)
@@ -1,4 +1,4 @@
-// Editor specific functions
+'use strict'; // Editor specific functions
 
 function messagesPrint() {
 }