summaryrefslogtreecommitdiff
path: root/framework/Web/Javascripts/TJavaScript.php
diff options
context:
space:
mode:
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);
+ }
}