Permalink
Browse files

Replace JSMin by JsShrink

  • Loading branch information...
1 parent a6f1078 commit bf4f0a1f9eb14497c5fde5acc13842d4af175171 @vrana vrana committed Mar 8, 2012
Showing with 10 additions and 19 deletions.
  1. +3 −3 .gitmodules
  2. +1 −1 adminer/file.inc.php
  3. +1 −0 changes.txt
  4. +4 −14 compile.php
  5. +1 −0 externals/JsShrink
  6. +0 −1 externals/jsmin-php
View
@@ -1,9 +1,6 @@
[submodule "jush"]
path = externals/jush
url = git://jush.git.sourceforge.net/gitroot/jush/jush
-[submodule "jsmin-php"]
- path = externals/jsmin-php
- url = git://github.com/rgrove/jsmin-php.git
[submodule "tinymce"]
path = externals/tinymce
url = git://github.com/tinymce/tinymce.git
@@ -16,3 +13,6 @@
[submodule "wymeditor"]
path = externals/wymeditor
url = git://github.com/wymeditor/wymeditor.git
+[submodule "JsShrink"]
+ path = externals/JsShrink
+ url = git://github.com/vrana/JsShrink.git
View
@@ -9,7 +9,7 @@
?>compile_file('../adminer/static/default.css', 'minify_css');<?php
} elseif ($_GET["file"] == "functions.js") {
header("Content-Type: text/javascript; charset=utf-8");
- ?>compile_file('../adminer/static/functions.js', 'JSMin::minify');compile_file('static/editing.js', 'JSMin::minify');<?php
+ ?>compile_file('../adminer/static/functions.js', 'jsShrink');compile_file('static/editing.js', 'jsShrink');<?php
} else {
header("Content-Type: image/gif");
switch ($_GET["file"]) {
View
@@ -1,4 +1,5 @@
Adminer 3.4.0-dev:
+Replace JSMin by better JavaScript minifier
Adminer 3.3.4 (released 2012-03-07):
Foreign keys default actions (bug #3397606)
View
@@ -1,21 +1,11 @@
<?php
error_reporting(6135); // errors and warnings
include dirname(__FILE__) . "/adminer/include/version.inc.php";
-include dirname(__FILE__) . "/externals/jsmin-php/jsmin.php";
+include dirname(__FILE__) . "/externals/JsShrink/jsShrink.php";
-if (!class_exists("JSMin")) {
- /** Simple JS minifier without full support for regex literals
- * @link http://pastebin.com/2Jc2swSr
- */
- class JSMin {
- /*private static*/ function callback($match) {
- $s = trim($match[0]);
- return ($s === "" ? "\n" : ($s[0] === "/" && ($s[1] === "*" || $s[1] === "/") ? "" : $s));
- }
-
- /*static*/ function minify($input) {
- return preg_replace_callback('~//[^\n]*|/\*.*?\*/|/(?!\s)(?:\\\\.|[^/\\\\])*/|\'(?:\\\\.|[^\'\\\\])*\'|"(?:\\\\.|[^"\\\\])*"|\s*[^0-9a-z_$\'"/\s]\s*|\s+~si', array('JSMin', 'callback'), $input);
- }
+if (!function_exists('jsShrink')) {
+ function jsShrink($code) {
+ return $code;
}
}
Submodule JsShrink added at 2298c3
Submodule jsmin-php deleted from 868939

0 comments on commit bf4f0a1

Please sign in to comment.