New patches: [unrevert anonymous**20050906050044] < > { hunk ./behavior.js 6 Release 2005-07-24 Copyright (C) 2005 H. Adam Mill II - Based on Behaviour v1.0 by Ben Nolan, June 2005. + Based on Behavior v1.0 by Ben Nolan, June 2005. Modifications: - Removed Simon Willison's getElementsBySelector() code. You can get the original at: hunk ./behavior.js 13 http://simon.incutio.com/archive/2003/03/25/getElementsBySelector - Added ability to pass in a dictionary of properties (usually events like onclick, onmouseover, etc) to apply to the matching selectors. If the property is onbehavior - then the associated function will be executed whenever Behaviour.apply() is called. + then the associated function will be executed whenever Behavior.apply() is called. This can be used as a sort of onload type event for elements. See 'Additional usage' in the usage section below. - Added support for multiple selectors seperated by commas within one selector string. hunk ./behavior.js 19 Description: - Uses css selectors to apply javascript behaviours to enable unobtrusive javascript + Uses css selectors to apply javascript behaviors to enable unobtrusive javascript in html documents. Usage: hunk ./behavior.js 51 }, '#elsewhere' : { // If an onbehavior property is specified then it will - // be executed when Behaviour.apply() is called. + // be executed when Behavior.apply() is called. onbehavior : function() { this.innerHTML = "I'm a " + this.tagName; } hunk ./behavior.js 63 } } }; - Behaviour.register(myrules); - // Call Behaviour.apply() to re-apply the rules (if you + Behavior.register(myrules); + // Call Behavior.apply() to re-apply the rules (if you // update the dom, etc). License: hunk ./behavior.js 76 (Original) http://ripcord.co.nz/behaviour/ */ -var Behaviour = { +var Behavior = { list : new Array, register : function(sheet){ hunk ./behavior.js 80 - Behaviour.list.push(sheet); + Behavior.list.push(sheet); }, start : function(){ hunk ./behavior.js 84 - Behaviour.addLoadEvent(function(){ - Behaviour.apply(); + Behavior.addLoadEvent(function(){ + Behavior.apply(); }); }, hunk ./behavior.js 90 apply : function(){ - for (h=0;sheet=Behaviour.list[h];h++){ + for (h=0;sheet=Behavior.list[h];h++){ for (selector in sheet){ if(selector.indexOf(',') > -1) { hunk ./behavior.js 135 } } -Behaviour.start(); +Behavior.start(); } Context: [Added Aredridel **20050904205338] Patch bundle hash: 3f1093eb7d6e2a01c6cf349e472e701323ad3914