Our Forums are now closed. Please go to our Google Mailing List for help. This site will remain open for historical purposes.
ColdBox Framework Forums Home | Profile | Search | Login | RSS

 pdf Print PDF   Previous Page  Page: 1   Next Page

Thread: JSMin 1.0
Created on: 01/07/10 10:41 AM Replies: 3
msmckellip


Joined: 12/16/08
Posts: 4
JSMin 1.0
01/07/10 10:41 AM

This is a great plugin. However, I have found one issue which will prevent us from using it. If you have multiple selectors such as:

.header #right a {
   color: #ffffff;
   display: block;
   text-decoration: none;
}

It will minify to this:

.header#right a{color:#ffffff;display:block;text-decoration:none;}

The space between the .header and #right selectors is removed, making it invalid. In checking several variations, it appears it only removes the space when the following selector starts with a . (period) or a # (pound) symbol. The space is kept correctly for others. Notice the "a" selector retained it's preceding space.

Otherwise, a great plugin. One nice enhancement wouyld be to also have the cached assets gzipped.

Thanks,
Michael McKellip
Link | Top | Bottom
lmajano
Veteran Master

Joined: 01/29/05
Posts: 1209
RE: JSMin 1.0
01/07/10 1:40 PM

Hi Michael,

I think the problem lies in that the minifier is mostly built for js, so there are some intricacies when dealing with css. This is another known issue now that I know about it, the other one I found was using negative margins. I think this has to do that these operators in JS can be used with no space and it minifies the space between them.

I will have to look at the java code and see if I can modify it in a way to treat js and css rules differently.

hmm, is there a java port for doing gzipped on the fly?
Luis Majano
Link | Top | Bottom
lmajano
Veteran Master

Joined: 01/29/05
Posts: 1209
RE: JSMin 1.0
01/07/10 4:54 PM

Ok, I had an epiphany of inspiration as I had to use it in a project right now, and updated the java processor to process css and js files differently.

So it now supports full css advanced selectors with correct compression. It also supports negative margins too.

Please give the new version a shot:

http://coldbox.org/index.cfm/forgebox/view/JSMin-Compressor
Luis Majano
Link | Top | Bottom
msmckellip


Joined: 12/16/08
Posts: 4
RE: JSMin 1.0
01/08/10 8:21 AM

Luis,

Your support is outstanding. The updated version works great. I have some ideas on the gzip feature. I will get back to you as soon as I can test them out.

Thanks again,
Michael
Link | Top | Bottom

Galleon Forums V1.7.008 was created by Raymond Camden