Rob Gonda's Blog

jQuery 1.0.4 fixes 247 bugs

jQuery 1.0.4 it out; 247 bug fixes, plus a few nice additions... The Ajax libraries have been fully refactored plus there are a few new properties to the $.ajax method. Important note, $.get and $.post are deprecated in favor of the $.ajax function.
Also, check out the new jQuery API site. Thank you John!

jQuery Button Contest - Many Prizes!

To encourage people to promote the jQuery project and get as many people involved in the community as possible, jQuery is holding a contest to build a "Powered by jQuery" button.

The Rules:

  1. The contest will run until November 3rd. Winners will be announced November 5th.
  2. All entries must must be optimized for the web (8-bit PNG) and images should be no bigger than 173x31 (example).
  3. The jQuery team will have the right to the use the submissions anyway they wish. This will prevent any copyright issues in the future. The winner must also be able to provide a PSD (or AI) file so that the image can be maintained in the future.
  4. Prizes will be awarded for 1st, 2nd and 3rd place submissions.
  5. The general jQuery community will do the final voting, moderated by John Resig, creator of jQuery, and Rey Bango.
  6. You should make use of the jQuery hat logo in your button (you’re free to re-draw it, as necessary). If needed, here’s a raw PSD of the hat logo.

The Prizes:

  1. First Place Prize: Two Books - Ajax Design Patterns and John Resig’s upcoming Pro JavaScript Techniques
  2. Second Place Prize: One Book - Foundations of Ajax
  3. Third Place Prize: $10 Cash to a PayPal account of your choosing!

The prizes will be shipped anywhere in the world via regular post.

All submissions should be made in the comment section of this posting via a standard hyperlink. Make sure that you provide a valid email address when submitting your entry.

This is your chance to really help expand the jQuery community by creating a top notch button that will get a ton of exposure. Good luck to everyone!

jQuery 1.0.3 fixes 58 bugs

Another bug-fix release is ready for all to enjoy! It is highly recommended that you upgrade right away. As always, if you spot a bug, please add it to the bug tracker. jQuery 1.0.3 is featuring only bug fixes - leaving all API additions/changes/deletions until the next full release: jQuery 1.1.

Download now.

dhtml syntax showdown

just found this really nice blog entry showing different code techniques or styles to achieve the same purpose using various dhtml tool. The idea is the usual alternate row styles, written with DOM, YUI, Dojo, Mochikit, mootools, and jquery. I am a big jquery fan, and this may not be enough to convert you, but it should give you an idea of how easy the syntax is.

btw, I love one of the comments showing how to add hovers too... it's a beautiful toolkit.

$("tr:nth-child(odd)").addClass("odd");

$("tr:nth-child(odd)").hover(function(){
$(this).addClass("odd_over");
},function(){
$(this).addClass("odd_out");
});

$("tr:nth-child(even)").hover(function(){
$(this).addClass("even_over");
},function(){
$(this).addClass("even_out");

});

IE png auto-fix

It's well known that PNGs with an alpha layer will not work properly in IE unless you manually patch it and apply some filters. IE7 fixed that, but it's still beta, and even after it launches, you need to cater to all visitors. I reworked some code I found into a nice, painless, solution to automatically fix all pngs in IE.

// IE PNG FIX: correctly handle PNG transparency in Win IE 5.5 > 6.x
if(window.attachEvent && (parseFloat(navigator.appVersion.split("MSIE")[1])<7)){
window.onload = function(){   if (document.body.filters){
  var i=document.images.length; while(i--){   
    var img = document.images[i], imgName = img.src.toUpperCase();     
    if (imgName.substring(imgName.length-3, imgName.length) == "PNG"){ var
      imgID = (img.id) ? "id='" + img.id + "' " : "",       
      imgClass = (img.className) ? "class='" + img.className + "' " : "",
      imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' ",
      imgStyle = "display:inline-block;" + img.style.cssText;
      if (img.align == "left") image.align='left'; //imgStyle = "float:left;" + imgStyle       
z     if (img.align == "right")image.align='left'; //imgStyle = "float:right;"+ imgStyle       
      if (img.parentElement.href) imgStyle = "cursor:pointer;" + imgStyle       
      img.outerHTML=
        "<div style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
        + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
        + "(src=\'" + img.src + "\', sizingMethod='scale');\">"
} } } } };

All you need to do is to include this code in your file and all pngs with transparency will magically work. The catch -- not so much a catch -- is that it will fix your img tags. Background pngs will not be patched.

Don't you love IE?

Spreadsheet Dojo Widget

Marius Hanganu released a Spreadsheet Widget written in Dojo... it is pretty impressive, and pretty heavy at the same time. Dojo is incredibly powerful, but this widget max'ed out my CPU for about 30 seconds... not so impressive. You can view the demo here. If your browser does not respond just have patience... I know, I know, but it's still in beta, has some bugs, and hopefully will not have these performance issues once it hits 1.0.

Here's a list of features from the author's site.

Features
  • Based on Toolbar and TabContainer widgets
  • Keyboard cell navigation
  • Column, row resizing
  • Cell, column and row selection
  • Cell formatting (font, font size, bold, italic, underline, color, background color)
  • Sheet management (rename, delete, new)
  • Functions (22 math functions, 6 string functions)

Status


  • This widget is definitely not final and has several bugs
  • Tested with Firefox and IE only
  • On IE runs slower than Firefox
  • If it would be released as an independent piece of software it would be labelled as 0.7 version

Goals for "1.0" version:


  • Fix all remaining bugs related to column, row resizing and selection
  • Support cell presentation format (dates could be displayed as mm-dd-yyyy, numbers as xx.xx, etc)
  • Support for date functions
  • Post spreadsheet data in JSON format to be saved serverside
  • Improve validation

Script.aculo.us 1.6.2 Released

Script.aculo.us V1.6.2 (2006-08-15): Bug fix galore! was released yesterday. 

  • Fix a problem in the drag and drop logic if an reverting/drag ending draggable was initialized for a new drag (for example by clicking repeatedly) for all cases where the default start/revert/end-effects are used, fixes #4706 [thx tecM0]
  • Fix possible memory leaks with Draggables, fixes #3436 [thx aal]
  • Throw nicer errors when requires script.aculo.us libraries are not loaded, fixes #5339
  • Make slider handles work when not displayed initially by using CSS width/height, fixes #4011 [thx foysavas]
  • Update sortable functional test with onUpdate counter
  • Make more Element extensions unit tests work on Safari
  • Add the assertMatch unit test assertion for asserts with RegExps [thx Ian Tyndall]
  • Fix a problem with Effect.Move causing “jumping” elements because of very low float numbers in some situations
  • Fix a missing semicolon in dragdrop.js, fixes #5569 [thx mackalicious]
  • Fix a slight inaccuracy with Effect.Scale that could lead the scaling to be one pixel off
  • Be more prototypish with Effect.Transitions.linear
  • Make Effect.Scale recognize font sizes that use the pt unit, fixes #4136 [thx aljoscha]
  • Fix IE hack in Effect.Opacity, fixes #5444 [thx nicholas]
  • Fix IFRAME layout fix for IE and Autocompleter, fixes #5192 [thx tommy skaue]
  • Fix only option in onEmptyHover, fiex #5348 [thx glenn nilsson]
  • Fix Effect.BlindDown and SwitchOff handling of supplied callbacks, fixes #5089 [thx martinstrom]
  • Fix a problem with field focus on Ajax.InPlaceEditor and loading external text, fixes #4988, #5244 [thx rob]
  • Do not attempt to scroll if scrollspeed is 0/0, fixes #5035 [thx tomg]
  • Fix a problem with Sortable Tree serialization, fixes #4939, #4688, #4767 [thx Sammi Williams]
  • Fix an endless loop with sliders, fixes #3226, #4051, #4765 [thx jeff]
  • Make autocompleter work with update DIVs that have scrollbars, fixes #4782 [thx Tommy Skaue]
  • Corrected options parsing on switchoff effect, fixes #4710 [thx haldini]

JavaScript Model-View-Controller with Dojo toolkit

You probably know how I love design patterns and apply them all over CF ... You also know I love Dojo :) ... I just found this nice article showing how to apply MVC in JavaScript with Dojo. I don't extensively use JavaScript, but it's a nice implementation.

JSMin for ColdFusion

JSMin is a utility to compress JavaScript by removing unnecessary whitespace and comments. Unlike obfuscation, it doesn't rename any of your variables or functions, leaving the core functionality intact. Depending on amount of comments, this utility may save from 50-80% on file size. Here's a good Minification Vs. Obfuscation article.

Darryl Lyons released CFJSMin, a ColdFusion utility to compress JavaScripts. I'm not sure why would you want to compress your scripts from a server side scripting language instead of running a binary executable... I guess that if you have a source folder and production folder you could automate changes... CFJSMin also has the ability of taking several input files and save them all in a single compressed file. This is good for caching.

Darryl, if you're reading this, here's a request: I'd like the tool to read several JS files as input, but instead of writing a target file, I'd like the output in a variable.

In addition of compressing your files, take a look at gzip and real time data compression. Here's a good article on how to set your IIS to compression. For those who run apache, I know it's really easy, but I don't have the information handy.

Dojo 0.3.0 Now Available

Dojo 0.3.0 was released with many new features. Dojo must be the best JavaScript library, it really makes me think if I should rewrite some ColdFusion components to generate Dojo widgets and Ajax binding ... sounds like a great project too me, if you're interested drop me an email.

At the Ajax Experience, Alex demonstrated a new use of the Flash Platform with Ajax: storage! Flash has be ability of storing large amount of data local objects, which is something like a Flash Cookie. By default you can store 300k of persistent data, up to 500k. Dojo makes use of this storage transparently by using a 1px flash component ... really neat.


The latest release of Dojo has a slew of new features, including:

  • Less boilerplate when writing widgets
  • A new lightweight animation system that makes using and building animations dead simple
  • Tested, high-performance local storage engine
  • Cross-domain Ajax support and cross-domain package loading
  • The ability to bundle CSS as well as HTML in profile builds
  • Better performance
  • New widgets:
    • SortableTable
    • TitlePane
    • Form validation
    • Menus and menu bars
    • Google and Yahoo maps
  • And more than a hundred other bug fixes and improvements.

More Entries

This blog is running version 5.9.003. Contact Blog Owner