Hi Fabio, Aaron Thanks a lot for your answers. Aaron, yes, my name is Dan I think I did not made myself very clear
I'll try to explain again As you see Kroppr is a commercial application. The way is built now allows me to use Mootools ( v1.11 ) with any other library, using iframes. This makes the script slow, as iframes are costly, and the code is a pain to maintain, not talking about the new features v1.2.3 has. Now i want to use Mootools v1.2.3 to get the $safe mode - so I can use this with any other library that uses $ - jquery, user made, etc In the case the client uses jquery, will be no problems, I tested it, with another script. My concern is what is happening if the user already has mootools in his site - any other version - of course 1.2.3 will not create problems. Will my script break his code ? Can I avoid this? Thanks a lot for your time. On Sep 9, 5:35 pm, Aaron Newton <[email protected]> wrote: > First, Fabio, no one needs to name $ to document.id to upgrade UNLESS they > have another script that's using $ (like jQuery). That's not the case here. > Dan (I think that's your name, forgive me if not), your site is running on a > *very* old version of MooTools. You'll need to upgrade. Upgrading is not a > painless process as the API for the framework has changed. I *think* you're > running a 1.0 version of MooTools; I can't tell, because back then we didn't > put the version number in the download. You'll need to download MooTools 1.2 > and replace your copy of MooTools with it. You'll then need to go through > your code and rewrite the portions of it that need to change. > > To help with this, you can use this compatibility layer: > > http://gist.github.com/128335 > > If you include this after mootools > 1.2 but before your code, it will post console warnings to you in > firebug in all the places you're using deprecated methods. You should > NOT leave this script in place in production. It's only there to help > you upgrade. > > Good luck. > > 2009/9/9 Fábio M. Costa <[email protected]> > > > > > You mean how can your script work with both versions? > > > What i usually do is something like this: > > > (function(){ > > var $ = document.id || $; > > > // use $ here and it will work fine with 1.2.x > > > })(); > > > At this example if the user has mootools 1.2.3 and jquery for example it > > will get the document.id from mootools. > > If he puts 1.2.2 and jquery it will get the dollar function from the last > > framework he've put on the page, i think. > > > This kind of make sure you'll have the mootools dollar function inside the > > closure (if you use 1.2.3 or greater) while making it work fine with 1.2.2 > > or smaller (if the user doesn't put another framework on the site). > > > -- > > Fábio Miranda Costa > > Solucione Sistemas > > Front-End Engineer > >http://meiocodigo.com > > > On Wed, Sep 9, 2009 at 5:02 AM, rborn <[email protected]> wrote: > > >> I want to upgrade Kroppr (http://kroppr.rborn.info) to mootools > >> 1.2.3. > >> This will allow me to simplify a lot the code, to be able to work with > >> other frameworks. > > >> My question is what is happening if the user already has a version of > >> mootools on it's page. How my script can break his, or in reverse > > >> On Sep 9, 12:30 am, Fábio M. Costa <[email protected]> wrote: > >> > If the developer uses 1.2.2 or smaller there will be no > >> > document.idfunction, you should use the $ function instead. > >> > If you want to use 1.2.3, just replace the old one with with 1.2.3. :S > >> > It looks like you didnt asked what you really want. > > >> > -- > >> > Fábio Miranda Costa > >> > Solucione Sistemas > >> > Front-End Engineerhttp://meiocodigo.com > > >> > On Tue, Sep 8, 2009 at 7:15 PM, hellspawn <[email protected]> wrote: > > >> > > Hi > >> > > I want to take advantage of the last moo version - the $ safe mode. > >> > > What is happening if the user has allready an older version of > >> > > mootools on it's site? > >> > > thanks
