d4f85910579f62260db7d61c5203ac0a4edac8fdRyan Grovevar Y = YUI({filters: {'event-valuechange': 'debug'}}).use('event-valuechange', 'node-event-delegate', function (Y) {
817fd44279e274b210f7f29c8080c1f2d121f4f8Ryan Grove var form = Y.one('#container'),
817fd44279e274b210f7f29c8080c1f2d121f4f8Ryan Grove events = [];
817fd44279e274b210f7f29c8080c1f2d121f4f8Ryan Grove function subscribe() {
817fd44279e274b210f7f29c8080c1f2d121f4f8Ryan Grove events.push(form.delegate('valuechange', function (e) {
817fd44279e274b210f7f29c8080c1f2d121f4f8Ryan Grove Y.log('#' + e.currentTarget.get('id') + ' .odd: "' + e.prevVal + '" -> "' + e.newVal + '"');
817fd44279e274b210f7f29c8080c1f2d121f4f8Ryan Grove }, '.odd'));
817fd44279e274b210f7f29c8080c1f2d121f4f8Ryan Grove events.push(form.delegate('valuechange', function (e) {
817fd44279e274b210f7f29c8080c1f2d121f4f8Ryan Grove Y.log('#' + e.currentTarget.get('id') + ' .even: "' + e.prevVal + '" -> "' + e.newVal + '"');
817fd44279e274b210f7f29c8080c1f2d121f4f8Ryan Grove }, '.even'));
817fd44279e274b210f7f29c8080c1f2d121f4f8Ryan Grove events.push(form.delegate('valuechange', function (e) {
817fd44279e274b210f7f29c8080c1f2d121f4f8Ryan Grove Y.log('#' + e.currentTarget.get('id') + ' function: "' + e.prevVal + '" -> "' + e.newVal + '"');
817fd44279e274b210f7f29c8080c1f2d121f4f8Ryan Grove }, function (node) {
817fd44279e274b210f7f29c8080c1f2d121f4f8Ryan Grove return node.getAttribute('type') === 'text';
817fd44279e274b210f7f29c8080c1f2d121f4f8Ryan Grove function unsubscribe() {
817fd44279e274b210f7f29c8080c1f2d121f4f8Ryan Grove Y.Array.each(events, function (e) {
817fd44279e274b210f7f29c8080c1f2d121f4f8Ryan Grove events = [];
817fd44279e274b210f7f29c8080c1f2d121f4f8Ryan Grove Y.one('#subscribe').on('click', subscribe);
817fd44279e274b210f7f29c8080c1f2d121f4f8Ryan Grove Y.one('#unsubscribe').on('click', unsubscribe);
817fd44279e274b210f7f29c8080c1f2d121f4f8Ryan Grove subscribe();