Coming in YUI 3.1.0: Natively use YUI 3 Gallery Modules

This example, created by Dav Glass for the upcoming YUI 3.1.0 release, shows how to natively use a YUI 3 Gallery module from the YUI 3 use() statement.

It will load images from Flickr using Dav's YQL Query module in the YUI 3 Gallery. The example uses the experimental yui3.1.0pr2 build. Once the YUI seed file is on the page, this is the full script source to run the example:

YUI().use('node', 'gallery-yql', function(Y) {
    new Y.yql('select * from flickr.photos.search(50) where tags = "angelarch"', function(r) {
        if (r.query) {
            if (r.query.results) {
                var res = Y.one('#results');
                res.set('innerHTML', '');
                Y.each(r.query.results.photo, function(v) {
                    var img = '<img src="http:/'+'/static.flickr.com/' + v.server + '/' + v.id + '_' + v.secret + '_s.jpg">';
                    res.append('<a href="http://flickr.com/photos/' + v.owner + '/' + v.id + '" title="' + v.title + '">' + img + '</a>');
                });
            }
        }
    });
});
Loading photos from YQL, please wait...


ericmiraglia.com