[jQuery] Re: Follow me to best pratice in create plugin to jQuery

2007-07-25 Thread Dan G. Switzer, II
>Dan, thanks for your suggestion too. > >What´s the plugin does is clear and reset the value of the elements. >So, clearDefaultValue or resetDefaultValue are good suggestions. What >do you think about? Well I'm still not in love with it, "resetDefaultValue" might be more clear--as the goal is to

[jQuery] Re: Follow me to best pratice in create plugin to jQuery

2007-07-25 Thread Leandro Vieira Pinho
Dan, thanks for your suggestion too. What´s the plugin does is clear and reset the value of the elements. So, clearDefaultValue or resetDefaultValue are good suggestions. What do you think about? On Jul 25, 9:48 am, "Dan G. Switzer, II" <[EMAIL PROTECTED]> wrote: > Leandro, > > > > >That said,

[jQuery] Re: Follow me to best pratice in create plugin to jQuery

2007-07-25 Thread Leandro Vieira Pinho
Thanks Klaus, Your suggestions was incredible and amazing. Thanks a lot! These are good ideas to have in mind when create others plugins. I just add the filter function, couse the plugin will work just with input elements with the type text. So, I´ll have return this .filte

[jQuery] Re: Follow me to best pratice in create plugin to jQuery

2007-07-25 Thread Dan G. Switzer, II
Leandro, >That said, here's how I'd simplify the plugin: > >jQuery.fn.defaultValue = function() { > > function clearDefaultValue() { > var $$ = $(this); > if ($$.val() == this.defaultValue) { $(obj).val(''); } > } > function backDefaultValue() { > var $$ = $(th

[jQuery] Re: Follow me to best pratice in create plugin to jQuery

2007-07-25 Thread Klaus Hartl
Leandro Vieira Pinho wrote: Hi Guys, I know that already exist a plugin to manage a defaultValue of input elements. But I create another. I´m new with jQuery, principally in create plugins. So, I would like someone look the plugin code and tell me if it´s in a best practice. Thanks. The plugi