Replace JSMin by JsShrink
This commit is contained in:
parent
a6f10787bb
commit
bf4f0a1f9e
6
.gitmodules
vendored
6
.gitmodules
vendored
|
@ -1,9 +1,6 @@
|
||||||
[submodule "jush"]
|
[submodule "jush"]
|
||||||
path = externals/jush
|
path = externals/jush
|
||||||
url = git://jush.git.sourceforge.net/gitroot/jush/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"]
|
[submodule "tinymce"]
|
||||||
path = externals/tinymce
|
path = externals/tinymce
|
||||||
url = git://github.com/tinymce/tinymce.git
|
url = git://github.com/tinymce/tinymce.git
|
||||||
|
@ -16,3 +13,6 @@
|
||||||
[submodule "wymeditor"]
|
[submodule "wymeditor"]
|
||||||
path = externals/wymeditor
|
path = externals/wymeditor
|
||||||
url = git://github.com/wymeditor/wymeditor.git
|
url = git://github.com/wymeditor/wymeditor.git
|
||||||
|
[submodule "JsShrink"]
|
||||||
|
path = externals/JsShrink
|
||||||
|
url = git://github.com/vrana/JsShrink.git
|
||||||
|
|
|
@ -9,7 +9,7 @@ if ($_GET["file"] == "favicon.ico") {
|
||||||
?>compile_file('../adminer/static/default.css', 'minify_css');<?php
|
?>compile_file('../adminer/static/default.css', 'minify_css');<?php
|
||||||
} elseif ($_GET["file"] == "functions.js") {
|
} elseif ($_GET["file"] == "functions.js") {
|
||||||
header("Content-Type: text/javascript; charset=utf-8");
|
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 {
|
} else {
|
||||||
header("Content-Type: image/gif");
|
header("Content-Type: image/gif");
|
||||||
switch ($_GET["file"]) {
|
switch ($_GET["file"]) {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
Adminer 3.4.0-dev:
|
Adminer 3.4.0-dev:
|
||||||
|
Replace JSMin by better JavaScript minifier
|
||||||
|
|
||||||
Adminer 3.3.4 (released 2012-03-07):
|
Adminer 3.3.4 (released 2012-03-07):
|
||||||
Foreign keys default actions (bug #3397606)
|
Foreign keys default actions (bug #3397606)
|
||||||
|
|
18
compile.php
18
compile.php
|
@ -1,21 +1,11 @@
|
||||||
<?php
|
<?php
|
||||||
error_reporting(6135); // errors and warnings
|
error_reporting(6135); // errors and warnings
|
||||||
include dirname(__FILE__) . "/adminer/include/version.inc.php";
|
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")) {
|
if (!function_exists('jsShrink')) {
|
||||||
/** Simple JS minifier without full support for regex literals
|
function jsShrink($code) {
|
||||||
* @link http://pastebin.com/2Jc2swSr
|
return $code;
|
||||||
*/
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
1
externals/JsShrink
vendored
Submodule
1
externals/JsShrink
vendored
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 2298c30f3f1fc35596b18044b5bff2fa4fb513fd
|
1
externals/jsmin-php
vendored
1
externals/jsmin-php
vendored
|
@ -1 +0,0 @@
|
||||||
Subproject commit 8689392dab23d80810a9360e667667c4ddb09579
|
|
Loading…
Reference in a new issue