summaryrefslogtreecommitdiff
path: root/rt/share/html/NoAuth/css/dhandler
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2012-07-02 14:24:21 -0700
committerIvan Kohler <ivan@freeside.biz>2012-07-02 14:24:21 -0700
commit85e677b86fc37c54e6de2b06340351a28f5a5916 (patch)
tree11148e2c292bd1a43b7cf6c2f5212a6ca8b03e75 /rt/share/html/NoAuth/css/dhandler
parente5ab051ccdb7637d8dd2f0ed9b4fe9aaaf1d1100 (diff)
parent92aedddd3684167abb60cd3f1d77bbc156c592e6 (diff)
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Diffstat (limited to 'rt/share/html/NoAuth/css/dhandler')
-rw-r--r--rt/share/html/NoAuth/css/dhandler27
1 files changed, 7 insertions, 20 deletions
diff --git a/rt/share/html/NoAuth/css/dhandler b/rt/share/html/NoAuth/css/dhandler
index 2472a9ff7..8e887b9a2 100644
--- a/rt/share/html/NoAuth/css/dhandler
+++ b/rt/share/html/NoAuth/css/dhandler
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC
%# <sales@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -50,28 +50,15 @@ my $squisher;
</%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>