function onStartScriptElement($action,&$src,&$type) {
$url = parse_url($src);
- if( empty($url->scheme) && empty($url->host) && empty($url->query) && empty($url->fragment))
+ if( empty($url['scheme']) && empty($url['host']) && empty($url['query']) && empty($url['fragment']))
{
- $src = $this->minifyUrl($src);
+ if (strpos($src, 'plugins/') === 0 || strpos($src, 'local/') === 0) {
+ $src = $this->minifyUrl($src);
+ } else {
+ $src = $this->minifyUrl('js/'.$src);
+ }
}
}
&& is_null(common_config('theme', 'path'))
&& is_null(common_config('theme', 'server'));
$url = parse_url($src);
- if( empty($url->scheme) && empty($url->host) && empty($url->query) && empty($url->fragment))
+ if( empty($url['scheme']) && empty($url['host']) && empty($url['query']) && empty($url['fragment']))
{
if(!isset($theme)) {
$theme = common_config('site', 'theme');
require_once('Minify/CSS.php');
return Minify_CSS::minify($code,$options);
}
+
+ function onPluginVersion(&$versions)
+ {
+ $versions[] = array('name' => 'Minify',
+ 'version' => STATUSNET_VERSION,
+ 'author' => 'Craig Andrews',
+ 'homepage' => 'http://status.net/wiki/Plugin:Minify',
+ 'rawdescription' =>
+ _m('The Minify plugin minifies your CSS and Javascript, removing whitespace and comments.'));
+ return true;
+ }
}