This project is archived and is in readonly mode.

#271 ✓invalid

Namespace for MooTools

Reported by Roland | July 28th, 2008 @ 09:41 PM | in 2.0 (closed)

** Never mind I should have searched First **

Many other popular JS frameworks such as jQuery, Dojo, Yahoo, etc. try to keep the majority of code contained inside a object. This is good for obvious reasons. I whipped together a quick version of the MooTools core code which follows this paradigm. It would be easy to create a translation layer for backwards compatibility. And converter code to work with these name changes shouldn't cause much trouble.

In the attached code, I everything except native extensions was moved to the MooTools object. I assigned the variable M to point to the MooTools object to keep the size down. The dollar sign was renamed to M$, and double dollar is M$$. I tried a couple thing with FireBug and it mostly seemed to be working.

This kind of change would make it easier for existing projects to switch over and adopt MooTools from other libraries. It would also allow people who want plug-ins based on MooTools to run with plug-ins that already use other JS Libraries which may collide otherwise.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Shared Ticket Bins

People watching this ticket