Scriptalizer.com updates: yuicompressor 2.4.1 and CSS combination/compression
Internet, Web Development, Javascript, CSSCouple quick notes on Scriptalizer.com:
I think it is cool that the app has quietly worked its way up to almost 40,000 KB of trimmed white space/carriage returns/etc (and even earned itself 18 diggs as of this post).
Today I rolled some updates out to the site. Scriptalizer uses the yuicompressor to do its minfication so I updated the jar to the lastest available version (2.4.1).
Now offering CSS combination and compression! There is an additional file upload element on the form now. Allowing you to upload multiple javascript and css files for combination and minification/compression.
Enjoy and PLEASE let me know if there is any odd behavior.
Thanks for reading!
AJL
Combine and compress your javascript files: Scriptalizer.com
ColdFusion, Internet, Web Development, JavascriptAfter creating a custom tag and minifier component (using YUICompressor) I decided it would be a pretty neat service to offer to everybody. Last night I scrounged up a website and called it Scriptalizer.com.
If you want to test what cf_scriptalizer does to your javascript before you actually use the tag, you can try out the generated script provided by Scriptalizer.com.
NOTE: All source files uploaded is immediately deleted once generated.
Problem: WAY too many javascript files. Solution: cf_scriptalizer
ColdFusion, Internet, Web Development, JavascriptWe all know JQuery is awesome right? That should be common knowledge by now. But, if you have ever created an app that makes use of several of the fantastic plugins available for JQuery, then you are going to end up with multiple
So, why is this a problem?
First of all, there is a little bit of bloat going on in this scenario. One could easily end up with over 200Kb of javascript in an assortment of these files. The other thing to consider is that the browser can only make so many concurrent connections to the web server (each external javascript file is one connection by the way) so add all of these files, a bunch of images, a couple .css files and we are making that user wait longer than really necessary.
Lets reduce the number of browser - to - server connections.
That seems easy enough. Instead of multiple external script calls:
<script type="text/javascript" src="/js/jquery/jquery.js"></script> <script type="text/javascript" src="/js/jquery/jquery.form.js"></script> <script type="text/javascript" src="/js/jquery/jquery.jqModal.js"></script> <script type="text/javascript" src="/js/jquery/jquery.history_remote.pack.js"></script>
We could combine them all into one big javascript file and reference it:
<script type="text/javascript" src="/js/myBigScript.js"></script>
Well what happens when you want to make a change to one of the source js files? Or you need to change the order of how the files are included? Or maybe the javascript files needed vary based off of where you are in your app and you don't want to include ALL of the files every time? Thats where I think I can help...
I have just recently (as in today) finished up a custom tag to do just that. For lack of a better name I called it
<cf_scriptalizer filePrefix="myscript" scriptalizerDirectory="/js" scriptFileList=" /js/jquery/jqModal.js, /js/jquery/jquery.js, /js/jquery/jquery.MultiFile.js, /js/jquery/jquery.blockUI.js, /js/jquery/jquery.corner.js, /js/jquery/jquery.form.js, /js/jquery/jquery.history_remote.pack.js, /js/jquery/jquery-dom.js " reload="true" >
- filePrefix (optional): prefix of the generated javascript file. "scriptalizer" by default
- scriptalizerDirectory: relative path to the desired output location
- scriptFileList: list of js files in the order you would include them
- reload (optional) - scriptalizer will inspect each js file for changes made since last access
More about reload: When/if you pass reload=true, <cf_scriptalizer>
Now that we have reduced the number of connections for external javascript files down to just one for this request, what can we do about reducing the size.
<cfset minifier = CreateObject("component","com.cfyuiminifier.cfYUIMinifier").init(path="/com/cfyuiminifier")/>
<cf_scriptalizer
filePrefix="myscript"
scriptalizerDirectory="/js"
scriptFileList="
/js/jquery/jqModal.js,
/js/jquery/jquery.js,
/js/jquery/jquery.MultiFile.js,
/js/jquery/jquery.blockUI.js,
/js/jquery/jquery.corner.js,
/js/jquery/jquery.form.js,
/js/jquery/jquery.history_remote.pack.js,
/js/jquery/jquery-dom.js
"
minifierObject = #minifier#
reload="true"
>As you can see, I am passing in the object "minifier" that contains the method minify() that accepts a string of all of the comibined javascript and returns a string of the minified javascript.
This additional component was abstracted from the custom tag itself just in case the user has some issue with YUICompressor or wants to implement his/her own solution to compress/clean/minify/etc the source javascript.
In this example, the combined jquery files resulted in a 123.1 KB javascript file (pre-minification). But, once cfyuiminifier.minify() was run on the source, we ended up with a combined javascript file that was only 79.7 KB!
CAVEATS:
I have not yet run this on any live sites.
This is brand new code from my scribble pad, so please be aware you may encounter some bugs!
This was developed on my Linux machine and haven't tested it anywhere outside of this environment.
DOWNLOADS:
If anybody has any specific requests for features, or would like to contribute please let me know. I wrote this in an attempt solve a specfic need for some applications I have been working on, and ended up with something I thought might be beneficial to others. Please report back with any successes (or failures) with this tool...I am very interested in hearing about your experience(s).
Flickr HDR Wallpaper pool
Internet, WallpapersI know I am a little "late to the party" on this topic, but I have recently discovered HDR (High Dynamic Range) images to use as wallpapers on my laptop. If you haven't ever heard of it, then you should definitely check it out.
high dynamic range imaging (HDRI) is a set of techniques that allows a greater dynamic range of exposures (the range of values between light and dark areas) than normal digital imaging techniques. The intention of HDRI is to accurately represent the wide range of intensity levels found in real scenes ranging from direct sunlight to shadows.
I came across a flickr pool devoted to these HDR wallpapers. Very cool!
Here is an example of one of my favorites:
Other sources for HDR wallpaper:
Hulu opens to the public March 12th!
General, Humor, InternetIn honor of Hulu.com officially opening up to the public (tomorrow), here is one of my favorite SNL clips.... PUNCHED!
Hulu.com has partnered with, among others, MGM and Sony to offer full-length television shows, clips, etc.
Create a custom pod with Sproutbuilder
ColdFusion, Internet, Technology, InstantSpot 2.0
Sproutbuilder is a new application that recently rolled out in a beta status. Basically it allows you to create widgets in a pretty nice Flex interface.
From their howitworks page:
Building a sprout is easy. Choose from dozens of pre-built templates or start from scratch. Drag-and-drop shapes, text, images, video, and more. Then add components such as slideshows, jukeboxes, and countdown clocks, as well as interactive services such as chat (Meebo), phone (Ribbit), fundraising (ChipIn), and more. Once you’ve got your content in place, use advanced editing and navigation tools to perfect your sprout.
Ultimately you end up with an embed code, like this
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="180" height="171" id="sUAAKe0cDAJqAatXf"><param name="wmode" value="transparent" /><param name="align" value="middle" /><param name="bgcolor" value="#ffffff" /><param /><param name="movie" value="http://farm.sproutbuilder.com/17661/load/UAAKe0cDAJqAatXf.swf" /><embed type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" src="http://farm.sproutbuilder.com/17661/load/UAAKe0cDAJqAatXf.swf" width="180" height="171" wmode="transparent" align="middle" bgcolor="#ffffff" /></object> <img style="visibility:hidden;width:0px;height:0px;" border=0 width=0 height=0 src="http://counters.gigya.com/wildfire/CIMP/Jmx*PTEyMDE3OTA5NTUxMDcmcHQ9MTIwMTc5MDk1NTY5MSZwPTEyMDc*MSZkPTE4MjgyJm49.jpg" />
Now, to add it to your InstantSpot site...gotta tie that in right :)
Log in to the control panel and click on the Widgets section.

Then, once you are there, you can click to add a pod, reorder, deactivate, etc...

Then, on to the end result...go look at your Spot.







Loading....