'
!
testNestedDIVsWithAttributes
"demonstrates how DIVs are nested and given attributes"
| s |
s := '#fixture' asSilk.
s := s DIV << ('id' -> 'container') << ('class' -> 'mySilkContainerClass').
s DIV << ('id' -> 'contentarea') << 'here comes the content'.
s := s DIV << ('id' -> 'toolbar') << ('class' -> 'myToolbarClass').
(s BUTTON: 'do something') on: 'click' bind: [Transcript show: 'button pressed'].
self assertBodyEndsWithOneOf: #(
'>sentinel
here comes the content
'
'>sentinel
here comes the content
'
)
!
testOnClickEvent
"#on:bind"
| s para |
s := '#fixture' asSilk.
para := s P: 'DOM'.
self timeout: 100.
(self async: [para on: 'click' bind:
["Test successful" self finished].
'#fixture p' asJQuery trigger: 'click'.
]) fork
! !