Add namespacing method to Fuse
Reported by Joe Gornick | February 6th, 2009 @ 12:20 AM
Fuse.addNS = Fuse.prototype.addNS = function(path, parent) {
parent = parent || this.prototype && this || this.constructor;
var part, parts = path.split('.'), i = 0;
while (part = parts[i++]) {
if (parent[part]) {
parent = parent[part];
} else {
parent = parent[part] = Fuse.Class.create(parent, { });
parent.Plugin = parent.prototype;
}
}
return parent;
};
Fuse.addNS('Dom.NodeList').Plugin = (function() {
return { /* ... */ };
})();
Fuse.Dom.addNs('Form');
Comments and changes to this ticket
-
John-David Dalton July 3rd, 2009 @ 12:22 AM
- State changed from new to resolved
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
JavaScript frameworks share similar features and functionality such as DOM manipulation, event registration, and CSS selector engines. FuseJS attempts to incorporate the strengths of these frameworks into one stable, efficient, and optimized core JavaScript framework.