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"]
|
||||
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
|
||||
|
|
|
@ -9,7 +9,7 @@ if ($_GET["file"] == "favicon.ico") {
|
|||
?>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"]) {
|
||||
|
|
|
@ -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)
|
||||
|
|
18
compile.php
18
compile.php
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
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