Posts Tagged ‘code’

FireFox 3.5 is finally out

Tuesday, July 7th, 2009

get-firefox

So last week Mozilla released FireFox 3.5, which introduces some awesome new features, all of which can be found on the Mozilla release notes page.

The ones I’m most excited about are the newly supported CSS properties, improved JavaScript capabilities (through TraceMonkey), SVG features, and HTML 5 support.

Now we can do things like use downloadable fonts (goodbye sIFR!), specify border images, achieve amazing shadow and border effects, use the CANVAS tag, and it looks like they even included cross-domain XMLHTTPRequests.

How practical all this will become only time can tell. We know other browsers are including like features, so we can only hope developers will keep visitors and security in mind as they build applications.

Posted in Cool, Programming | 1 Comment »

YUI CustomEvent subscriptions

Sunday, August 10th, 2008

Recently at Ajaxian there was a post describing Custom Events and how they could be used to better structure an event-driven application by ’subscribing’ or ‘binding’ certain actions to an event. At Pint we use YUI as our main library, so I’ve ported the author’s example into a version that uses YUI.

Here is the code:

YAHOO.util.Event.onDOMReady(function() {
    document.body.event1 = new YAHOO.util.CustomEvent();
    YAHOO.util.Event.on('colorchange', 'change', function(e) {
        if (this.checked) document.body.event1.subscribe(changeColor);
        else document.body.event1.unsubscribe(changeColor);
    });
    YAHOO.util.Event.on('contentchange', 'change', function(e) {
        if (this.checked) document.body.event1.subscribe(changeContent);
        else document.body.event1.unsubscribe(changeContent);
        }
    });
    YAHOO.util.Event.on(document.getElementById('leftchoices').childNodes, 'click', function(e) {
        document.body.event1.fire(e);
    });
});

See example »

Posted in Programming | No Comments »