write_file "static/css/$theme.css", CSS::Minifier::XS::minify $css;
}
- my $js;
- $js .= read_file $_ for <js/*.js>;
- write_file 'static/js.js', JavaScript::Minifier::XS::minify $js;
+ if (-f 'compiler.jar') {
+ system java => -jar => 'compiler.jar', qw,-O SIMPLE --create_source_map static/js.map --js_output_file static/js.js --language_in ECMASCRIPT5_STRICT --source_map_location_mapping js/|/static/js/,, <js/*>;
+ my $js = read_file 'static/js.js';
+ write_file 'static/js.js', '//# sourceMappingURL=/static/js.map', "\n", $js;
+ system 'cp', '-rp', 'js', 'static/';
+ } else {
+ my $js;
+ $js .= read_file $_ for <js/*.js>;
+ write_file 'static/js.js', JavaScript::Minifier::XS::minify $js;
+ }
+
+package
+ Local::CSS::SpriteMaker;
+
+use parent qw/CSS::SpriteMaker/;
+
+sub _get_stylesheet_string {
+ my $self = shift;
+ my @ret = split "\n", $self->SUPER::_get_stylesheet_string(@_);
+ shift @ret;
+ @ret = sort @ret;
+ unshift @ret, <<EOF;
+a.logo {
+ background-image: url("https://static.mindcoding.ro/static/logos.png");
+ background-repeat: no-repeat;
+ display: inline-block;
+ vertical-align: middle;
+}
+EOF
+ join "\n", @ret;
+}