Christian Heilmann

You are currently browsing the archives for the YUI category.

Archive for the ‘YUI’ Category

Conjuring YUI from thin air

Saturday, August 2nd, 2008

I love the YUI loader as it is a great way of including the YUI on the fly. The coolest bits about it is that it gets the YUI components from the CDN and knows the dependencies so I don’t have to. So if I need the YUI for something, I don’t need extra SCRIPT nodes a maintainer has to include, just my SCRIPT. However, what we still need is including the YUI loader itself.

Unless… you use the YAHOO_config listener. This thing is older than both YUI get and YUI Loader and is an object method that gets called every time a YUI component is loaded. So why not load the YUI Loader using this?

One problem is that the YUI Loader doesn’t call the config listener saying it is a loader, but saying it is the get utility. Another issue is that it does not work to execute the Loader immediately after it called itself “get”. The workaround is to use a timeout.

Wrap all of that inside the YAHOO_config object and you’ll conjure the YUI out of thin air. The following example loads YUI Dom, YUI Event and alerts “done” once all is ready. Check it out here


YAHOO_config = function(){
var s = document.createElement(‘script’);
s.setAttribute(‘type’,’text/javascript’);
s.setAttribute(‘src’,’http://yui.yahooapis.com/2.5.2/’+
‘build/yuiloader/yuiloader-beta-min.js’);
document.getElementsByTagName(‘head’)[0].appendChild(s);
return{
listener:function(o){
if(o.name === ‘get’){
window.setTimeout(YAHOO_config.ready,1);
}

},
ready:function(){
var loader = new YAHOO.util.YUILoader();
var dependencies = [‘yahoo’,’dom’,’event’];
loader.require(dependencies);
loader.loadOptional = true;
loader.insert({
onSuccess:function(){
console.log(‘done!’);
}

});
}

};
}();

Thanks to Alex Liu to get the setTimeout trick.

My talk at GeekUp as video – the NorthCast recording is live

Tuesday, February 26th, 2008


screenshots of the video of my talk at GeekUp Leeds

The lovely chaps from Northcast have edited and uploaded the video of my talk at GeekUp Leeds about JavaScript and the YUI.

I especially like that they went through the whole story, right from me arriving handing over the schwag and being hugged by mysterious flatcapped Northern beauties, including the whole talk and the full Q&A session. The second part of the Q&A session is a bit on the rough side from a sound perspective but I guess the free beer consumed till then is to blame.

I hope this is useful to some, it was interesting for me to see what I talked about as the whole presentation was finished on the train and completely ad-libbed as it is.

Thanks again to GeekUp and the NorthCast people, good job and I am looking forward to more of this sort.

GeekUp Leeds talk about the YUI right when the new version (2.5) is out!

Wednesday, February 20th, 2008

I am right now sitting on the National Express train back from Leeds, UK heading for home and just finished a talk at GeekUp about the YUI and JavaScript. The slides are available on slideshare:

The GeekUp people also filmed the presentation and the long Q&A session, and I will try to get my hands on these recordings to see what I actually said as the 3 hour stint with 2.5 hour train rides was confusing.

Nevertheless I had a great time, got rid of the Schwag I didn’t want to carry back home and had some really good questions in the Q&A session. If you live in the north of the UK, make sure to check out GeekUp

Also make sure to check out the new 2.5 release of the YUI and the official blog post about it.

Step by Step – create feature walkthroughs for your web sites

Sunday, February 17th, 2008

There is a lot of software out there that allow you to create screencasts by recording what is happening on the screen. Some programs even allow you to annotate each step and tell people what needs to be done. The issue with most of this software is that the outcome are large video files and that users cannot interact with the system while the explanations are given.

Step by Step in action - a highlighted page element with an explanation in a panel

Step by Step is a JavaScript solution based on the YUI that allows you to script an annotated walk-trough of your web applications that happens directly on the application and does not require any video editing skills or large downloads.

What do you think?

Soon the YUI will be two years old, time for a bash, isn’t it?

Tuesday, February 12th, 2008

If you are in or around London on the 26th of February 2008, come to the De Hem’s pub in Covent Garden to celebrate two years of YUI. There’ll be cake, beers, videos from the YUI bash in the US, a quick update by me and schwag to take home.