Skip to content

Commit

Permalink
Support for fused asynchronic and synchronic link views.
Browse files Browse the repository at this point in the history
  • Loading branch information
mtabacman committed Feb 19, 2018
1 parent a8cc3ae commit 35b1827
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@ tests-Supplying
testAsynchronicButtonLabeledApplying

self
assertRenderingOf: [ :supplier | supplier asynchronicButtonLabeled: 'Buy' applying: [ :anchor | anchor addClass bootstrap buttonPrimary ] ]
assertRenderingOf: [ :supplier |
supplier
asynchronicButtonLabeled: 'Buy'
applying: [ :anchor | anchor addClass bootstrap buttonPrimary ] ]
equals: '<button class="btn btn-primary" type="button">Buy</button>'
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
tests-Supplying
testSynchronicButtonLabeledApplying

self
assertRenderingOf: [ :supplier |
supplier
synchronicButtonLabeled: 'Buy'
applying: [ :link | link addClass bootstrap buttonPrimary ] ]
equals: '<button class="btn btn-primary" type="submit">Buy</button>'
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,17 @@ testRenderContentOn
inputGroup := BootstrapInputGroupWebView
wrapping: (supplier singleLineTextFieldApplying: [ :field | ])
between: (supplier inputGroupAddOnWrapping: 'http://')
and: (supplier inputGroupButtonWrapping: (supplier synchronicButtonLabeled: 'Go!' applying: [ :button | button addClass bootstrap buttonDefault ] evaluating: [ ]))
and:
(supplier
inputGroupButtonWrapping:
(supplier
synchronicButtonLabeled: 'Go!'
applying: [ :button | button addClass bootstrap buttonDefault ]))
applying: [ :group | ].

html := self render: inputGroup.

self
assert: html
equals:
'<div class="input-group"><span class="input-group-addon">http://</span><input value="" name="1" class="form-control" type="text"/><span class="input-group-btn"><button name="2" class="btn btn-default" type="submit">Go!</button></span></div>'
'<div class="input-group"><span class="input-group-addon">http://</span><input value="" name="1" class="form-control" type="text"/><span class="input-group-btn"><button class="btn btn-default" type="submit">Go!</button></span></div>'
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ testRenderContentOnWithCommands
| inputGroup html |

inputGroup := BootstrapInputGroupWebView
appending: (supplier inputGroupButtonWrapping: (supplier synchronicButtonLabeled: 'Go!' applying: [ :button | button addClass bootstrap buttonDefault ] evaluating: [ ]))
appending:
(supplier
inputGroupButtonWrapping:
(supplier
synchronicButtonLabeled: 'Go!'
applying: [ :button | button addClass bootstrap buttonDefault ]))
to: (supplier singleLineTextFieldApplying: [ :field | ])
applying: [ :group | group addClass bootstrap inputGroupSmall ].

Expand All @@ -13,4 +18,4 @@ testRenderContentOnWithCommands
self
assert: html
equals:
'<div class="input-group input-group-sm"><input value="" name="1" class="form-control" type="text"/><span class="input-group-btn"><button name="2" class="btn btn-default" type="submit">Go!</button></span></div>'
'<div class="input-group input-group-sm"><input value="" name="1" class="form-control" type="text"/><span class="input-group-btn"><button class="btn btn-default" type="submit">Go!</button></span></div>'
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
SystemOrganization addCategory: #'Willow-Bootstrap-Tests'!
SystemOrganization addCategory: 'Willow-Bootstrap-Tests-Applications'!
SystemOrganization addCategory: 'Willow-Bootstrap-Tests-Datepicker'!
SystemOrganization addCategory: 'Willow-Bootstrap-Tests-Frontend'!
SystemOrganization addCategory: 'Willow-Bootstrap-Tests-Libraries'!
SystemOrganization addCategory: 'Willow-Bootstrap-Tests-Plugins'!
SystemOrganization addCategory: 'Willow-Bootstrap-Tests-Select'!
SystemOrganization addCategory: 'Willow-Bootstrap-Tests-Typeahead'!
SystemOrganization addCategory: 'Willow-Bootstrap-Tests-WebInteraction'!
SystemOrganization addCategory: 'Willow-Bootstrap-Tests-WebViews'!
SystemOrganization addCategory: #'Willow-Bootstrap-Tests-Applications'!
SystemOrganization addCategory: #'Willow-Bootstrap-Tests-Datepicker'!
SystemOrganization addCategory: #'Willow-Bootstrap-Tests-Frontend'!
SystemOrganization addCategory: #'Willow-Bootstrap-Tests-Libraries'!
SystemOrganization addCategory: #'Willow-Bootstrap-Tests-Plugins'!
SystemOrganization addCategory: #'Willow-Bootstrap-Tests-Select'!
SystemOrganization addCategory: #'Willow-Bootstrap-Tests-Typeahead'!
SystemOrganization addCategory: #'Willow-Bootstrap-Tests-WebInteraction'!
SystemOrganization addCategory: #'Willow-Bootstrap-Tests-WebViews'!
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
Supplying
asynchronicLinkLabeled: aRenderable applying: aComponentCommand

^ AsynchronicLinkWebView labeled: aRenderable applying: aComponentCommand
| linkView |

linkView := LinkWebView labeled: aRenderable applying: aComponentCommand.
linkView onTrigger
executeOnClient: [ :script :canvas | script << canvas jQuery event preventDefault ].
^ linkView
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Supplying
synchronicButtonLabeled: aRenderable applying: aComponentCommand

^ SynchronicSubmitButtonWebView
labeled: aRenderable
applying: [ :field | field addClass bootstrap button + aComponentCommand ]

This file was deleted.

14 changes: 7 additions & 7 deletions source/Willow-Bootstrap.package/monticello.meta/categories.st
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
SystemOrganization addCategory: #'Willow-Bootstrap'!
SystemOrganization addCategory: 'Willow-Bootstrap-Datepicker'!
SystemOrganization addCategory: 'Willow-Bootstrap-Frontend'!
SystemOrganization addCategory: 'Willow-Bootstrap-Libraries'!
SystemOrganization addCategory: 'Willow-Bootstrap-Plugins'!
SystemOrganization addCategory: 'Willow-Bootstrap-Select'!
SystemOrganization addCategory: 'Willow-Bootstrap-Typeahead'!
SystemOrganization addCategory: 'Willow-Bootstrap-WebViews'!
SystemOrganization addCategory: #'Willow-Bootstrap-Datepicker'!
SystemOrganization addCategory: #'Willow-Bootstrap-Frontend'!
SystemOrganization addCategory: #'Willow-Bootstrap-Libraries'!
SystemOrganization addCategory: #'Willow-Bootstrap-Plugins'!
SystemOrganization addCategory: #'Willow-Bootstrap-Select'!
SystemOrganization addCategory: #'Willow-Bootstrap-Typeahead'!
SystemOrganization addCategory: #'Willow-Bootstrap-WebViews'!

0 comments on commit 35b1827

Please sign in to comment.