summaryrefslogtreecommitdiff
path: root/rt/share/html/NoAuth/css/dhandler
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2012-07-08 22:45:58 -0700
committerIvan Kohler <ivan@freeside.biz>2012-07-08 22:45:58 -0700
commita6fe07e49e3fc12169e801b1ed6874c3a5bd8500 (patch)
treeb87a7e6f37da5c8e13eb4d4653cfc8ce9239d8f0 /rt/share/html/NoAuth/css/dhandler
parente27244386c346f459d1569db26344407a0372a05 (diff)
parent005424d0c899aa899f43f583a6c74deb13ea4be1 (diff)
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Conflicts: httemplate/misc/process/cancel_pkg.html
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>