JSMin Plugin

26 views
Skip to first unread message

Jeremy R DeYoung

unread,
May 20, 2012, 11:36:20 AM5/20/12
to ColdBox Platform
Luis,

I think there is a bug in the JSMin plugin. Whenever I compress CSS files with @media queries included, the JSMin java appears to remove spaces that are necessary in order for the browsers to display them correctly.

For example:

@media all and (min-width: 601px) and (max-width: 1000px) {

}

becomes

@media all and(min-width: 601px) and(max-width: 1000px) {}

Notice the and( in the compressed version.

There is a necessary space in order for it to render correctly.

I was able to fix this quickly by doing a replace in the JSMin.cfc right before the file is written starting at line 245

                        //@media query fix 
var sbString = sb.toString();
sbString = replacenocase(sbString,'and(','and (','all');

// Create concatenated file according to content.
tempFileName = hash(sbString, "MD5") & "." & listLast(compressedFiles[1],".");

//write out buffer
fileWrite(instance.cacheDiskLocation & "/" & tempFileName, trim( sbString ));
returnAsset = tempFileName;


- - - - - - - - - - - - - - - - - 
Jeremy R. DeYoung 
Phone:615.261.8201 
 
RantsFromAMadMan.com 

Luis Majano

unread,
May 21, 2012, 1:08:00 AM5/21/12
to col...@googlegroups.com
Jeremy can you post more samples on media queries please so I can add them to my test cases for the compiler.

Thanks

--
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
To post to this group, send email to col...@googlegroups.com
To unsubscribe from this group, send email to coldbox-u...@googlegroups.com
For more options, visit this group at http://groups-beta.google.com/group/coldbox
For News, visit http://blog.coldbox.org
For Documentation, visit http://wiki.coldbox.org

Jeremy R DeYoung

unread,
May 21, 2012, 7:15:31 PM5/21/12
to col...@googlegroups.com
Here is a whole bunch of examples  http://mediaqueri.es/ - I would think you could take one of the examples and run it against the JSMin.

or do you want me to build a template so you can test against?



- - - - - - - - - - - - - - - - - 
Jeremy R. DeYoung 
Phone:615.261.8201 
 
RantsFromAMadMan.com 



Reply all
Reply to author
Forward
0 new messages