Skip to content

Commit

Permalink
fixed bad regexp
Browse files Browse the repository at this point in the history
  • Loading branch information
David Furfero committed Sep 25, 2009
1 parent 8c94837 commit 68cd186
Showing 1 changed file with 64 additions and 65 deletions.
129 changes: 64 additions & 65 deletions many.html
Expand Up @@ -24,76 +24,75 @@
(function($) {
$(function() {

// var foo = $('div.test')
//
// // Bind callback to completion of each specified event
//
// // Works with DOM or custom events
//
// // Takes additional optional boolean true as first argument
// // to rebind events once all are completed
// .many(/* true, */ 'mouseover mouseout click', function(evt, originalEvt, idx, tot) {
// console.group(evt.type);
// console.dir({
// '0_evt': evt,
// '1_originalEvt': originalEvt,
// '2_idx': idx,
// '3_tot': tot
// });
// console.log($(this).text());
// $(this).css('background', 'yellow');
// console.groupEnd(evt.type);
// })
//
// // Bind callback to execution of any event
// .bind('many', {foo:'bar'}, function(evt, originalEvt, idx, tot) {
// console.group(evt.type);
// console.dir({
// '0_evt': evt,
// '1_originalEvt': originalEvt,
// '2_idx': idx,
// '3_tot': tot
// });
// console.log('something happened to "%s"', $(this).attr('id'));
// console.groupEnd(evt.type);
// })
//
// // Bind callback to first executed event
// .bind('many:1', function(evt, originalEvt, idx, tot) {
// console.group(evt.type);
// console.dir({
// '0_evt': evt,
// '1_originalEvt': originalEvt,
// '2_idx': idx,
// '3_tot': tot
// });
// console.log('one thing has happened to "%s"', $(this).attr('id'));
// $(this).css('background', 'orange');
// console.groupEnd(evt.type);
// })
//
// // Bind callback to second executed event
// .bind('many:2', function(evt, originalEvt, idx, tot) {
// console.group(evt.type);
// console.dir({
// '0_evt': evt,
// '1_originalEvt': originalEvt,
// '2_idx': idx,
// '3_tot': tot
// });
// console.log('two things have happened to "%s"', $(this).attr('id'));
// $(this).css('background', 'red');
// console.groupEnd(evt.type);
// });
var foo = $('div.test')

// Bind callback to completion of each specified event

// Works with DOM or custom events

// Takes additional optional boolean true as first argument
// to rebind events once all are completed
.many(/* true, */ 'mouseover mouseout click', function(evt, originalEvt, idx, tot) {
console.group(evt.type);
console.dir({
'0_evt': evt,
'1_originalEvt': originalEvt,
'2_idx': idx,
'3_tot': tot
});
console.log($(this).text());
$(this).css('background', 'yellow');
console.groupEnd(evt.type);
})

// Bind callback to execution of any event
.bind('many', {foo:'bar'}, function(evt, originalEvt, idx, tot) {
console.group(evt.type);
console.dir({
'0_evt': evt,
'1_originalEvt': originalEvt,
'2_idx': idx,
'3_tot': tot
});
console.log('something happened to "%s"', $(this).attr('id'));
console.groupEnd(evt.type);
})

// Bind callback to first executed event
.bind('many:1', function(evt, originalEvt, idx, tot) {
console.group(evt.type);
console.dir({
'0_evt': evt,
'1_originalEvt': originalEvt,
'2_idx': idx,
'3_tot': tot
});
console.log('one thing has happened to "%s"', $(this).attr('id'));
$(this).css('background', 'orange');
console.groupEnd(evt.type);
})

// Bind callback to second executed event
.bind('many:2', function(evt, originalEvt, idx, tot) {
console.group(evt.type);
console.dir({
'0_evt': evt,
'1_originalEvt': originalEvt,
'2_idx': idx,
'3_tot': tot
});
console.log('two things have happened to "%s"', $(this).attr('id'));
$(this).css('background', 'red');
console.groupEnd(evt.type);
});

var e = $({});

e.many('ns1:load ns2:load', function() {
$(document).many('ns1:load ns2:load', function() {
console.log('ns1:load ns2:load');
});

e.trigger('ns1:load');
e.trigger('ns2:load');
$(document).trigger('ns1:load');
$(document).trigger('ns2:load');

});
})(jQuery);
Expand Down

0 comments on commit 68cd186

Please sign in to comment.