twitterwall example

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

twitterwall example

laci
Can anybody explain how does the html block variable - marked bold - gets initialized in the following method of TwitterSearch. 

success: tweets
| playground table tr |
playground := '#playground' asJQuery.
playground empty.
 [:html
 html inspect.
table := html table.
table element id: 'twitterwall'.

tweets do: [ :tweet | 
          tr := html tr.
          table append: tr.
          Tweet openAt: tr with: tweet
        ]
] appendToJQuery: playground.
Reply | Threaded
Open this post in threaded view
|

Re: twitterwall example

fefr

On 05.08.2012, at 13:02, laci wrote:

Can anybody explain how does the html block variable - marked bold - gets initialized in the following method of TwitterSearch. 

success: tweets
| playground table tr |
playground := '#playground' asJQuery.
playground empty.
 [:html
 html inspect.
table := html table.
table element id: 'twitterwall'.

tweets do: [ :tweet | 
          tr := html tr.
          table append: tr.
          Tweet openAt: tr with: tweet
        ]
] appendToJQuery: playground.

appendToJQuery: is defined in BlockClosure as: 

appendToJQuery: aJQuery
    self value: (HTMLCanvas onJQuery: aJQuery)

In your snippet html is defined as HTMLCanvas onJQuery: playground . 

HTH, 

Felix
Reply | Threaded
Open this post in threaded view
|

Re: twitterwall example

laci
In reply to this post by laci
Thanks Felix. I have to remember that everything is an object in Smalltalk. Bit rusty.

2012. augusztus 5., vasárnap 13:02:01 UTC+2 időpontban laci a következőt írta:
Can anybody explain how does the html block variable - marked bold - gets initialized in the following method of TwitterSearch. 

success: tweets
| playground table tr |
playground := '#playground' asJQuery.
playground empty.
 [:html
 html inspect.
table := html table.
table element id: 'twitterwall'.

tweets do: [ :tweet | 
          tr := html tr.
          table append: tr.
          Tweet openAt: tr with: tweet
        ]
] appendToJQuery: playground.