%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2014 Best Practical Solutions, LLC
%# <sales@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
</%ONCE>
<%INIT>
my $arg = $m->dhandler_arg;
-my $path;
-if ( $arg =~ m{^(.*)-squished(\.[^\.]+)$} ) {
- $path = $m->current_comp->dir_path .'/'. $1 . $2;
+if ( $arg =~ m{(.*)-squished-[0-9a-f]{32}\.css$} ) {
+ my $style = $1;
+ my $squished = RT::Interface::Web::SquishedCSS( $style );
+ # Don't send Last-Modified since we don't handle If-Modified-Since
+ #$r->header_out( 'Last-Modified' => $squished->ModifiedTimeString );
+ $m->out( $squished->Content );
}
else {
return $m->decline;
}
-$squisher = new RT::CSS::Squish unless $squisher;
-$squisher->{'mason'} = $m;
-
-$m->out( $squisher->concatenate( $path ) );
-
-package RT::CSS::Squish;
-use CSS::Squish '0.06';
-use base qw(CSS::Squish);
-sub file_handle {
- my $self = shift;
- my $file = shift;
- my $content = $self->{'mason'}->scomp($file) || '';
- open my $fh, '<', \$content or die "$!";
- return $fh;
-}
-
</%INIT>