Hi, thanks you...
My solution is to change the way Element native class created in
mootools so it won't send "window.Element" as a legacy:
var Element = new Native({
name: 'Element',
/*
* legacy: window.element **
*/
initialize: function(tag, props){
var konstructor = Element.Constructors.mooGet(tag);
if (konstructor) return konstructor(props);
if (typeof tag == 'string') return
document.newElement(tag, props);
return $el(tag).set(props);
},
afterImplement: function(key, value){
if (!Array[key]) Elements.implement(key,
Elements.multi(key));
Element.Prototype[key] = value;
}
});
In this way it should work line in Internet Explorer which hasn't the
window.Element property. In this way mootools only extend the element
with new methods but not copy the entire prototype of window.Element
to it.
I know that my problem is outside the scope of this user group, but i
change the way mootools is written and i want to know how are my
changes influence on the whole code - so asking the developers is the
best option for me because you know what every line of the code does.
Thanks a lot :)
On Oct 19, 10:23 pm, nutron <[EMAIL PROTECTED]> wrote:
> Hi nir,
>
> I'm not %100 certain of what your 2nd solution is but I can tell you that
> your problem's solution is not to use MooTools if you need your script to be
> this portable. We cannot offer you support on this because we don't have the
> time to figure out how to get MooTools to run in the same environment as
> Prototype. It's beyond the scope of our work.
>
> If it were me, I would avoid a framework entirely. I would create a
> namespaced object with methods that helped me do the things I needed to and
> nothing else. For instance, let's say your project was called "nir" I would
> have functions like this:
>
> NIR.addEvent(element, type, function)
> NIR.inject(element, where, target)
> NIR.request(url, options)
>
> etc.
>
> If you wanted to use a framework like MooTools, you could then have two
> accompanying scripts:
>
> One script would use MooTools and all the methods I mention above would just
> translate to MooTools:
>
> NIR.addEvent = function(element, type, function) {
> element.addEvent(type, function);
>
> };
>
> And the other script would use Prototype or no framework at all. Then
> clients could include whichever they wanted.
>
> I realize you have a deadline, so to speak, but you must also realize that
> the nature of your problem falls outside the scope of the kind support
> you're likely to find here, as we don't try to make MooTools play well with
> Prototype.
>
>
>
> Nir Tayeb wrote:
>
> > I know that, but i haven't time to rewrite the code - I'm from israel
> > and in one week I'm going to be a soldier in Israel Defense Force.
> > This is a task which I will remain to the developer who come after me.
> > But for now, i need a concrete answer - what is the influence of using
> > solution #2 ? will it work in FF/Safari like it work in Internet
> > Explorer?
>
> > thanks, nir.
>
> > On Oct 19, 8:58 pm, nutron <[EMAIL PROTECTED]> wrote:
> >> There is a simple answer:
> >> do not use a framework. Your code will work anywhere, though it won't be
> >> fun
> >> to write.
>
> >> On Sun, Oct 19, 2008 at 8:04 AM, Nir Tayeb <
> >> [EMAIL PROTECTED]<[EMAIL PROTECTED]>
>
> >> > wrote:
>
> >> > No, and i will never do this, my script need to work on almost any
> >> > site and it needs to be one version not depended on site specific code
> >> > (one site can use prototype and the other will use dojo - my code need
> >> > to be the same on both and work with both, for *example*).
>
> >> > I will very appreciate if someone answer on my original question
> >> > instead of messing around with the things i already done and change.
>
> >> > thanks, nir.
>
> >> > On Oct 17, 5:20 am, Garrick
> >> <[EMAIL
> >> PROTECTED]<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=1351926&i=0>>
> >> > wrote:
> >> > > The prototype syntax has similarities with MooTools. Have you tried
> >> > > modifying the syntax so it will work with prototype instead of
> >> > > renaming everything in MooTools?
>
> >> > ------------------------------
> >> > View message @
> >> >http://n2.nabble.com/Prototype-and-MooTools-on-the-same-page-tp133734...
> >> > To start a new topic under MooTools Users, email
>
> >> [EMAIL PROTECTED]<[EMAIL PROTECTED]>
> >> > To unsubscribe from MooTools Users, click here< (link removed) >.
>
> >> -----
> >> The MooTools Tutorial: http://www.mootorial.comwww.mootorial.com
> >> CNET Clientside: http://clientside.cnet.comclientside.cnet.com
> >> --
> >> View this message in
> >> context:http://n2.nabble.com/Prototype-and-MooTools-on-the-same-page-tp133734...
> >> Sent from the MooTools Users mailing list archive at Nabble.com.
>
> -----
> The MooTools Tutorial: http://www.mootorial.comwww.mootorial.com
> CNET Clientside: http://clientside.cnet.comclientside.cnet.com
> --
> View this message in
> context:http://n2.nabble.com/Prototype-and-MooTools-on-the-same-page-tp133734...
> Sent from the MooTools Users mailing list archive at Nabble.com.