I don't understand why MochiKit team says somewhere (http://
trac.mochikit.com/wiki/StyleGuide) not to use aliases and short names
while enabling them by default. I personally don't like short names
and particularly the aliases `$` and `$$`. In my opinion, only fully
qualified names should be available on default inclusion of MochiKit.
If someone wants aliases and globally exported name, that should be
configurable.
Another interesting thing developers should bring to the MochiKit is
JQuery style chaining of calls on a special DOM like object. I did
some work but only MochiKit core developers can do better...
MochiKit.DOMSelector = function(query, context) {
...
}
MochiKit.DOMSelector.prototype = {
__init__ : function(query, context) {
...
},
// Iter methods
forEach : function(callback) {
....
return this;
}
filter : function(callback) {
...
return this;
},
map : function(callback) {
...
return this;
},
...
// DOM methods
addClass : function(className){
...
return this;
},
removeClass : function(className){
...
return this;
},
attr: function(name){
...
return this;
},
...
// Access methods
index : function() {},
size : function(){},
get : function(num) {
// return an array of all matched DOM elements
if (num) {
return this.elements[num];
}
return this.elements
},
// And lots more...
}
and of course one handy function with short name ;) to get the
DOMSelector...
MochiKit.get = function(query, context) {
return new MochiKit.DOMSelector(query, context);
}
What you think?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"MochiKit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---