[Moo] Re: New element from html string

2009-09-02 Thread atwork8
Eneko Alonso wrote: > > > You pretty much had it but it is way more simple than that: > > > String.implement({ > >   toElement: function() { > >     return new Element('div', {html:this}).getFirst(); > >   } > > > }); > > > alert(&

[Moo] Re: Escape character in selector

2009-09-02 Thread atwork8
case > $$('span').filter(function (el) { > >   // > > > > }) > On Wed, Sep 2, 2009 at 4:30 PM, atwork8 wrote: > > > Hi, > > > How do you escape characters in a selector? I can't find any info in > > the docs e.g. > > > I am a span

[Moo] Re: New element from html string

2009-09-02 Thread atwork8
rt('hello'.toElement().get('id')); > alert('Mootools'.toElement().get('href')); > > I like it! > > On Tue, Sep 1, 2009 at 1:51 AM, atwork8 wrote: > > > Maybe String is a better place for it? > > > String.

[Moo] Escape character in selector

2009-09-02 Thread atwork8
Hi, How do you escape characters in a selector? I can't find any info in the docs e.g. I am a span alert($$('.someValue:anotherValue')[0].get('tag')); alert($$('.someValue\:anotherValue')[0].get('tag')); alert($$('.someValue\\:anotherValue')[0].get('tag')); alert($$('.someValue\3A anotherValue'

[Moo] Re: New element from html string

2009-09-01 Thread atwork8
Maybe String is a better place for it? String.implement({ toElement: (function() { var div = new Element('div'); return function() { div.set('html', this); return div.getFirst(); } })()

[Moo] Re: New element from html string

2009-09-01 Thread atwork8
r just: > > return new Element( 'div', { html: _str }); > > in constructor. > > On Aug 31, 7:49 pm, atwork8 wrote: > > > Hi, > > > I thought the Element constructor might accept an html string and > > return an element, but unfortunately it doesn&#x

[Moo] Re: New element from html string

2009-09-01 Thread atwork8
r just: > > return new Element( 'div', { html: _str }); > > in constructor. > > On Aug 31, 7:49 pm, atwork8 wrote: > > > Hi, > > > I thought the Element constructor might accept an html string and > > return an element, but unfortunately it doesn&#x

[Moo] New element from html string

2009-08-31 Thread atwork8
Hi, I thought the Element constructor might accept an html string and return an element, but unfortunately it doesn't. I tried to extend Element into itself so that I could add this functionality, but it doesn't seem to like that either. Are there currently any functions that return an element fr

[Moo] Re: wrap element's html

2009-08-28 Thread atwork8
you have the references for the node you want to adopt it will be almost > the same thing as set/get html. > > @atwork8, just testing, is "Please, shut the fuck up" rude for you? > > -- > Fábio Miranda Costa > Solucione Sistemas > Front-End Engineerhttp://mei

[Moo] Re: wrap element's html

2009-08-28 Thread atwork8
one liner) you could implement your own > method on element. > >     Element.implement({ >         wrapContent : function(el){ >             this.adopt($(el).getChildren()).inject(el); >         } >     }); > > usage: > > new Element('div',{ 'id'

[Moo] Re: wrap element's html

2009-08-27 Thread atwork8
he wrapper div in > > your html?" > > Sometimes you don't have full control over the html generation. > > @atwork8 I thought your tone was a bit rude especially when your asking for > help. A bit of diplomacy will get you farther. > > I would use adopt since it

[Moo] Re: wrap element's html

2009-08-27 Thread atwork8
d":"wrapper"}).set("html", > $(document.body).get("html")).inject($(document.body).empty()) > > You ask if what you showed is the best way?  For me...if it works then great > :) > > -Original Message- > From: atwork8 [mailto:atwo...@hotmail.c

[Moo] Re: wrap element's html

2009-08-27 Thread atwork8
@ksamdev - If there aren't really any benefits I think I'll stick with the shorter version. Thanks for your help. On Aug 27, 4:00 pm, ksamdev wrote: > @atwork8 > > No benefits. The result would be the same except that work is done > with DOM objects directly if you do thi

[Moo] Re: wrap element's html

2009-08-27 Thread atwork8
: > > var _div = new Element( 'div'); > var _body = $( document.body); > _body.getChildren().each( function( _item) { _div.grab( _item); }); > _body.adopt( _div); > > On Aug 27, 7:22 am, atwork8 wrote: > > > @ksamdev - Could you please read the problem.

[Moo] Re: wrap element's html

2009-08-27 Thread atwork8
@Fabio - I'm not being rude. I asked a simple question which you didn't read properly, I asked if you could read it again. The answer you provided is the opposite of what I asked.

[Moo] Re: wrap element's html

2009-08-27 Thread atwork8
@ksamdev - Could you please read the problem. The results are completely different. The solution I've provided generates this: body's html Fabio's generates: body's html

[Moo] Re: wrap element's html

2009-08-27 Thread atwork8
@Fabio - Could you please read the problem before providing an answer.

Re: Javascript Class Performance

2009-02-28 Thread atwork8
woops! there are 9 :o) On Feb 28, 9:30 pm, atwork8 wrote: > For anybody that is interested I've updated these tests and there are > now 8 implementations being compared: > >     * j3 Class - (projectcss.net) >     * jClass - (ejohn.org) >     * base2 Class - (dean.edwards

Re: Javascript Class Performance

2009-02-28 Thread atwork8
For anybody that is interested I've updated these tests and there are now 8 implementations being compared: * j3 Class - (projectcss.net) * jClass - (ejohn.org) * base2 Class - (dean.edwards.name) * mooTools Class - (mootools.net) * Prototype Class - (prototypejs.org) * Do

Javascript Class Performance

2009-02-25 Thread atwork8
I created this recently to test my own class implementation. Wasn't sure if it was of interest to anybody? I've posted it up anyway. It tests against mootools, prototype, jClass etc http://www.projectcss.net/inheritance/

IE Inheritance Bug?

2008-11-25 Thread atwork8
Hi all, I created a Parent class, and then a Child class that Extends Parent. If I give both classes a toString() method, the Child class always calls the Parent toString() method and not its own version. It works fine in firefox. I'm guessing it has something to do with the "DontEnum bug" worka

Re: MooTools 1.2.1 Released

2008-10-16 Thread atwork8
Congrats on the release!! :o)

Any Chance of adding Official F1 site to MooTools home page?

2008-10-06 Thread atwork8
Hi, The Official F1 site uses MooTools: http://www.formula1.com/ Not sure how big F1 is in the US but here in Europe it's a massive sport! Would be excellent for the MooTools profile, just a thought for any of the MooTools officials out there. Cheers :o)