How to translate to amber

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

How to translate to amber

laci
How would you translate to amber the following JavaScript declaration:

searchoptions:{dataInit:function(el) {$(el).datepicker({dateFormat: "yy-mm-dd"});} }

I would think something like that:
#{'searchoptions' -> #{'dataInit' -> block}}

Can't get the block working.

My best bet was:
'searchoptions' -> #{'dataInit' -> [ :el | el datepicker: #{'dateFormat' -> 'yy-mm-dd'} ]}

I am getting though an error: [object HTMLInputElement] does not understand #datepicker:

#{'searchoptions' -> #{'dataInit' -> [ :el | console log: el ]} }
displays in the console an input element.

Thanks in advance.
Reply | Threaded
Open this post in threaded view
|

Re: How to translate to amber

Herby Vojčík


laci wrote:

> How would you translate to amber the following JavaScript declaration:
>
> searchoptions:{dataInit:function(el) {$(el).datepicker({dateFormat:
> "yy-mm-dd"});} }
>
> I would think something like that:
> #{'searchoptions' -> #{'dataInit' -> block}}
>
> Can't get the block working.
>
> My best bet was:
> 'searchoptions' -> #{'dataInit' -> [ :el | el datepicker:
> #{'dateFormat' ->
> 'yy-mm-dd'} ]}
[ :el | el asJQuery da... ]

The rest seems to be right.

Herby

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.


Reply | Threaded
Open this post in threaded view
|

Re: How to translate to amber

laci
Tried that too but got similar error message:

[object HTMLInputElement] does not understand #asJQuery

I will check with the latest master code.
Reply | Threaded
Open this post in threaded view
|

Re: How to translate to amber

Clément Béra
On recent amber version I tried and it worked calling :

JSObjectProxy>>asJQuery
<return jQuery(self['@jsObject'])>


2013/6/25 laci <[hidden email]>
Tried that too but got similar error message:

[object HTMLInputElement] does not understand #asJQuery

I will check with the latest master code.



--
View this message in context: http://forum.world.st/How-to-translate-to-amber-tp4694914p4694939.html
Sent from the Amber Smalltalk mailing list archive at Nabble.com.

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.





--
Clément Béra
Mate Virtual Machine Engineer
Bâtiment B 40, avenue Halley 59650 Villeneuve d'Ascq

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: How to translate to amber

laci
Works fine with the latest master build. Thanks for the replies.
Reply | Threaded
Open this post in threaded view
|

Re: How to translate to amber

Nicolas Petton
In reply to this post by Clément Béra
what about (untested):

asJQuery
^ window jQuery: jsObject


Cheers,
Nico

On Jun 25, 2013, at 9:25 AM, Clément Bera <[hidden email]> wrote:

On recent amber version I tried and it worked calling :

JSObjectProxy>>asJQuery
<return jQuery(self['@jsObject'])>


2013/6/25 laci <[hidden email]>
Tried that too but got similar error message:

[object HTMLInputElement] does not understand #asJQuery

I will check with the latest master code.



--
View this message in context: http://forum.world.st/How-to-translate-to-amber-tp4694914p4694939.html
Sent from the Amber Smalltalk mailing list archive at Nabble.com.

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.





--
Clément Béra
Mate Virtual Machine Engineer
Bâtiment B 40, avenue Halley 59650 Villeneuve d'Ascq

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 


--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: How to translate to amber

Herby Vojčík
I do not like explicit window much... I like

asJQuery
^ jQuery value: jsObject

more.
(and there is more of this - I mean smalltalkizable js methods).

Herby

Nicolas Petton wrote:

> what about (untested):
>
> asJQuery
> ^ window jQuery: jsObject
>
>
> Cheers,
> Nico
>
> On Jun 25, 2013, at 9:25 AM, Clément Bera <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>> On recent amber version I tried and it worked calling :
>>
>> JSObjectProxy>>asJQuery
>> <return jQuery(self['@jsObject'])>

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.


Reply | Threaded
Open this post in threaded view
|

Re: How to translate to amber

Nicolas Petton
I agree, I like it this way too.

Nico

On Jun 26, 2013, at 9:32 PM, Herby Vojčík <[hidden email]> wrote:

> I do not like explicit window much... I like
>
> asJQuery
> ^ jQuery value: jsObject
>
> more.
> (and there is more of this - I mean smalltalkizable js methods).
>
> Herby
>
> Nicolas Petton wrote:
>> what about (untested):
>>
>> asJQuery
>> ^ window jQuery: jsObject
>>
>>
>> Cheers,
>> Nico
>>
>> On Jun 25, 2013, at 9:25 AM, Clément Bera <[hidden email] <mailto:[hidden email]>> wrote:
>>
>>> On recent amber version I tried and it worked calling :
>>>
>>> JSObjectProxy>>asJQuery
>>> <return jQuery(self['@jsObject'])>
>
> --
> You received this message because you are subscribed to the Google Groups "amber-lang" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

--
Nicolas Petton
http://www.nicolas-petton.fr

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.