From 8dcab11beafb1a04b514a3beacc6113f29450d3c Mon Sep 17 00:00:00 2001 From: "ctrlaltca@gmail.com" <> Date: Tue, 20 Sep 2011 09:35:40 +0000 Subject: patch for #363: dropping clientscripts.php --- framework/Web/Javascripts/TJavaScript.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'framework/Web/Javascripts/TJavaScript.php') diff --git a/framework/Web/Javascripts/TJavaScript.php b/framework/Web/Javascripts/TJavaScript.php index 2df16816..c492c197 100644 --- a/framework/Web/Javascripts/TJavaScript.php +++ b/framework/Web/Javascripts/TJavaScript.php @@ -266,5 +266,17 @@ class TJavaScript self::$_json = Prado::createComponent('System.Web.Javascripts.TJSON'); return self::$_json->decode($value); } + + /** + * Minimize the size of a javascript script. + * This method is based on Douglas Crockford's JSMin. + * @param string code that you want to minimzie + * @return minimized version of the code + */ + public static function JSMin($code) + { + include_once('jsmin.php'); + return JSMin::minify($code); + } } -- cgit v1.2.3