summaryrefslogtreecommitdiff
path: root/framework/Web/Javascripts/TJavaScript.php
diff options
context:
space:
mode:
authorctrlaltca@gmail.com <>2011-09-20 09:35:40 +0000
committerctrlaltca@gmail.com <>2011-09-20 09:35:40 +0000
commit8dcab11beafb1a04b514a3beacc6113f29450d3c (patch)
tree408a41fdf9e54dd0075759c67843a0c7ffc103b4 /framework/Web/Javascripts/TJavaScript.php
parent026421ecddb050a7156b228c329e13de5f0f160d (diff)
patch for #363: dropping clientscripts.php
Diffstat (limited to 'framework/Web/Javascripts/TJavaScript.php')
-rw-r--r--framework/Web/Javascripts/TJavaScript.php12
1 files changed, 12 insertions, 0 deletions
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);
+ }
}