Sha256: 10750782d6ad60e02972e188e02c911727f1519d74bb0d860331421e76134dd3
Contents?: true
Size: 1.79 KB
Versions: 3
Compression:
Stored size: 1.79 KB
Contents
o_O.controller = { initialize: function(controller_name, controller){ var controller_name = controller_name.replace('Controller', '').toLowerCase(); var controller = controller; $(function(){ var events = 'click submit hover mouseover blur focus change dblclick keydown keypress keyup scroll' $('body').delegate('[data-bind]', events, function(event){ var binders = $(this).attr('data-bind').match(/[\+]?(\s+)?[^ :]?[: ]?[^ #]+[ #]+[^ ;]+[ ;]?/g); if(binders != null && binders.length > 0) { for(i = 0; i < binders.length; i++) { var rule = binders[i]; var parts = rule.match(/([\+])?(\s+)?(([^ :]+)([: ]+))?([^ #]+)[ #]+([^ ;]+)[ ;]?/); var default_bit = parts[1]; var this_action_event = parts[4]; if(this_action_event === undefined || this_action_event === '') { this_action_event = ($(this).is('form')) ? 'submit' : 'click'; } if(this_action_event === 'blur' && event.type == 'focusout') { this_action_event = 'focusout'; } if(this_action_event === 'focus' && event.type == 'focusin') { this_action_event = 'focusin'; } var this_controller_name = parts[6]; var this_action = parts[7]; if(this_controller_name == controller_name && this_action_event === event.type) { if(default_bit != '+') { controller[this_action].apply(this); return false; } else { return controller[this_action].apply(this); } } } } }) }); return controller; } }
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
eyeballs-0.5.17 | src/drivers/jquery/modules/o_O.controller.js |
eyeballs-0.5.16 | src/drivers/jquery/modules/o_O.controller.js |
eyeballs-0.5.15 | src/drivers/jquery/modules/o_O.controller.js |