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 <
aa...@iminta.com> 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 <
fabiomco...@gmail.com>
>
>
>
> > 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 <
dan.ta...@gmail.com> wrote:
>
> >> I want to upgrade Kroppr (
http://kroppr.rborn.info) to mootools