How nice it plays DA with other frameworks? I am trying to obtain a
namespaced version because in some cases might interfere with other
functions form other frameworks.
I removed the
this.applyMethod.call(window, "$", this.$);
this.applyMethod.call(window, "$$", this.$$);
but still remains some methods added to the dom, like window.addEvent,
that might interfere with other ( mootools for example )
Is possible to make it purely namespaced?
thanks
--
You received this message because you are subscribed to the Google Groups "DOMAssistant" group.
To post to this group, send email to domass...@googlegroups.com.
To unsubscribe from this group, send email to domassistant...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/domassistant?hl=en.
Chenghong
On Jan 26, 5:29 am, Dan Tamas <dan.ta...@gmail.com> wrote:
> yeah, seems clear (let's see whan i'll try to implement it :D )
> thanks
> --
> Regards,
> Dan Tamashttp://kroppr.rborn.infohttp://www.rborn.info
>
> On 25 Jan 2010, at 21:57, Robert Nyman wrote:
>
>
>
> > Well, the parts you mentioned needs to be attended to. Perhaps it
> > might be an option to use the closure of the core object and a
> > method in there to access a private variable, declared at the
> > beginning.
>
> > Does that make sense? Is it a good pointer to start?
>
> > Also, Cheng Hong developing DOMAssistant now might have some ideas
> > how to achieve this compliance.
>
> > Good luck!
>
> > Best regards,
> > Robert
>
> > On Mon, Jan 25, 2010 at 9:51 PM, Dan Tamas <dan.ta...@gmail.com>
> > wrote:
> > Thanks for your reply
> > any ideas?
> > basically i would like to get rid of document and window methods
> > pollution
>
> > but if i do something like DomAssistant.window = window
>
> > a DomAssistant.window.myFunct = function(){} will be found in
> > window.myFunct too :(
>
> > --
> > Regards,
> > Dan Tamas
> >http://kroppr.rborn.info
> >http://www.rborn.info
>
> > On 25 Jan 2010, at 21:44, Robert Nyman wrote:
>
> >> Hi,
>
> >> I used to be part of developing DOMAssistant, but I'm not anymore.
> >> Off the top of my head, though, I would say that generally you
> >> could probably make it work, but there are some minor kinks to work
> >> out (like the ones you mention).
>
> >> Best regards,
> >> Robert
>
DOMAssistant.$(window) or DOMAssistant.$(window);
of course I think in this case the functions cannot be chained
anymore( and I believe this is the main issue )
Let me know what you think
--
Regards,
Dan Tamas
http://kroppr.rborn.info
http://www.rborn.info
Just call
DOMAssistant.harmonize();
first thing after including the DOMAssistant script. Let me know what
you think =)
Chenghong
On Jan 26, 8:00 pm, Dan Tamas <dan.ta...@gmail.com> wrote:
> Well, I think the only way is to remove any stuff that is polluting
> the window and the document, add an event "DOMLoaded" similar to
> DOMReady
> and avoid to attach methods if somebody makes
>
> DOMAssistant.$(window) or DOMAssistant.$(window);
>
> of course I think in this case the functions cannot be chained
> anymore( and I believe this is the main issue )
>
> Let me know what you think
>
> --
> Regards,
> Dan Tamashttp://kroppr.rborn.infohttp://www.rborn.info
there are some issues still with addEvent for example
considering we harmonized it, we will have to do this to get the element
DOMAssistant.$('#_the_id')
but if we do this:
DOMAssistant.$(window)
We will have window.addEvent that will overwrite the addEvent function
of mootools.
Until now I only added DOMAssistant.DOMLoad.DOMLoaded() that acts when
the page is fully loaded
DOMLoaded : function() {
for (var i=0, il=arguments.length, funcRef; i<il; i++) {
funcRef = arguments[i];
if (!funcRef.DOMLoaded && !addedStrings[funcRef]) {
if (typeof funcRef === "string") {
addedStrings[funcRef] = true;
funcRef = new Function(funcRef);
}
funcRef.DOMLoaded = true;
// functionsToCall.push(funcRef);
if ( DOMAssistant.isIE ) {
window.attachEvent('onload',funcRef);
}
else {
window.addEventListener('load',funcRef,false);
}
}
}
},
this in DOMAssistant.DOMLoad
and at the end of the file.
DOMAssistant.DOMLoaded = DOMAssistant.DOMLoad.DOMLoaded;
I am thinking on something like
DOMAssistant.Window that will be some sort of proxy for the window
variable, and will be responsible to allow stuff like
DOMAssistant.$(window).addEvent
without actually adding the addEvent method to the window.
Also with DOMAssistant.Document
What about some dimensions? :D
like $(id).getSize, etc ?
--
Regards,
Dan Tamas
http://kroppr.rborn.info
http://www.rborn.info
Just wondering, under what circumstances would you need to mix
libraries in this way?
Chenghong
You can include the domload function I made if you wish :)
--
Regards,
Dan Tamas
http://kroppr.rborn.info
http://www.rborn.info