zefer / combine Goto Github PK
View Code? Open in Web Editor NEWServes Combined & compressed js & css with caching, using ColdFusion
Serves Combined & compressed js & css with caching, using ColdFusion
I'm in process of integrating combine and it is a great tool! All of my css files have "@charset "utf-8"; declaration. Combined files keep multiple declarations as each file is added to combined file.
So far IE 7 & 8 and FF3.6 seem to ignore the extra declarations but Chrome and Safari ( on PC) don't like the first rule after each new declaration in middle of file. I can manually remove them but I also built a flag to write full links out for each css file for debugging purposes as well.
Any feedback greatly appreciated
Hi, I am having problems when trying to minify JS files that contain UTF-8 using JSMin from your combine.jar.
I've created a standalone version of your compressJsWithJSMin() method rather than the whole combine.cfc.
As a simple test I have the string "This is a test Франция" which results in the output "This is a test $@0=F8O"
I've tried setting a Charset string on the output toString() method but it makes no difference.
I realise that this isn't strictly an issue with your combine package but I hope you can forgive me for asking for help here.
I have a simple standalone example that demonstrates the issue;
<cfcontent type="text/html; charset=utf-8" />
<cfprocessingdirective pageEncoding="utf-8"/>
<html>
<head>
<title>JSMin UTF-8 test</title>
</head>
<body>
<cftry>
<cfscript>
testString = "This is a test Франция";
joInput = createObject("java","java.io.StringReader").init(testString);
joOutput = createObject("java","java.io.ByteArrayOutputStream").init();
javaloader = createObject('component','components.javaloader.JavaLoader').init([application.settings.localdir & "components/jsmin/combine.jar"]);
jJSMin = javaloader.create("com.magnoliabox.jsmin.JSMin").init(joInput, joOutput);
jJSMin.jsmin();
</cfscript>
<cfoutput><pre>
TestString:"#testString#"
Native:"#joOutput.toString()#"
UTF-8:"#joOutput.toString("UTF-8")#"
ISO-8859-1:"#joOutput.toString("ISO-8859-1")#"
US-ASCII:"#joOutput.toString("US-ASCII")#"
</pre></cfoutput>
<cfset joInput.close() />
<cfset joOutput.close() />
<cfcatch>
<cfdump var="#cfcatch#" />
</cfcatch>
</cftry>
</body>
</html>
I noticed any CSS with a media query was failing. After grabbing the latest yuicompressor things started working again.
Perhaps its time to update your libraries? :D
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.