Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
79 additions
and
1 deletion.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
...omponentSupplierTest.class/instance/testDelayedViewShowingWhileEvaluatingThenRendering.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
tests-Supplying | ||
testDelayedViewShowingWhileEvaluatingThenRendering | ||
|
||
| supplier delayedView html | | ||
|
||
supplier := Html5ComponentSupplier new. | ||
|
||
delayedView := supplier delayedViewShowing: 'Loading...' whileEvaluating: [ ] thenRendering: 'Done!'. | ||
|
||
html := self render: delayedView. | ||
|
||
self | ||
assert: html | ||
equals: '<div id="Delayed-id1">Loading...</div><script type="text/javascript">Willow.callServer({"url":"/","data":"2"});</script>' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
I'm a web view showing a throbber while evaluating an action block and then rendering another view |
4 changes: 4 additions & 0 deletions
4
.../Willow.package/DelayedViewRenderer.class/class/showing.whileEvaluating.thenRendering..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
as yet unclassified | ||
showing: aThrobber whileEvaluating: aBlock thenRendering: aView | ||
|
||
^ self new initializeShowing: aThrobber whileEvaluating: aBlock thenRendering: aView |
10 changes: 10 additions & 0 deletions
10
...package/DelayedViewRenderer.class/instance/initializeInteractionToEvaluate.thenRender..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
initialization | ||
initializeInteractionToEvaluate: aBlock thenRender: aView | ||
|
||
interaction := WebComponentInteraction triggeredOnClick. | ||
interaction | ||
onTriggerExecute: | ||
(EvaluatingCommand | ||
for: [ aBlock value. | ||
self setCurrentViewTo: aView ]); | ||
onTriggerExecute: (RenderingCommand for: identifiedDelayedView) |
6 changes: 6 additions & 0 deletions
6
...ge/DelayedViewRenderer.class/instance/initializeShowing.whileEvaluating.thenRendering..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
initialization | ||
initializeShowing: aThrobber whileEvaluating: aBlock thenRendering: aView | ||
|
||
self setCurrentViewTo: aThrobber. | ||
identifiedDelayedView := IdentifiedWebView forDivNamed: 'Delayed' containing: [ :canvas | canvas render: currentView ]. | ||
self initializeInteractionToEvaluate: aBlock thenRender: aView |
7 changes: 7 additions & 0 deletions
7
source/Willow.package/DelayedViewRenderer.class/instance/renderContentOn..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
rendering | ||
renderContentOn: aCanvas | ||
|
||
aCanvas render: identifiedDelayedView. | ||
"This is way too hacky, but for now is the way to go" | ||
interaction prepareActions. | ||
aCanvas document addLoadScript: (interaction commandToExecuteOn: aCanvas) |
4 changes: 4 additions & 0 deletions
4
source/Willow.package/DelayedViewRenderer.class/instance/setCurrentViewTo..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
initialization | ||
setCurrentViewTo: aView | ||
|
||
currentView := aView |
11 changes: 11 additions & 0 deletions
11
source/Willow.package/DelayedViewRenderer.class/methodProperties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"instance" : { | ||
"renderContentOn:" : "GabrielOmarCotelli 8/8/2017 17:45", | ||
"setCurrentViewTo:" : "GabrielOmarCotelli 8/8/2017 17:45", | ||
"initializeInteractionToEvaluate:thenRender:" : "GabrielOmarCotelli 8/8/2017 17:45", | ||
"initializeShowing:whileEvaluating:thenRendering:" : "GabrielOmarCotelli 8/8/2017 17:50" | ||
}, | ||
"class" : { | ||
"showing:whileEvaluating:thenRendering:" : "GabrielOmarCotelli 8/8/2017 17:45" | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
source/Willow.package/DelayedViewRenderer.class/properties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"commentStamp" : "GabrielOmarCotelli 8/8/2017 17:46", | ||
"super" : "WAPresenter", | ||
"category" : "Willow-WebViews", | ||
"classinstvars" : [ ], | ||
"pools" : [ ], | ||
"classvars" : [ ], | ||
"instvars" : [ | ||
"identifiedDelayedView", | ||
"currentView", | ||
"interaction" | ||
], | ||
"name" : "DelayedViewRenderer", | ||
"type" : "normal" | ||
} |
4 changes: 4 additions & 0 deletions
4
...tendComponentSupplier.class/instance/delayedViewShowing.whileEvaluating.thenRendering..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Supplying | ||
delayedViewShowing: aThrobber whileEvaluating: aBlock thenRendering: aRenderable | ||
|
||
^ DelayedViewRenderer showing: aThrobber whileEvaluating: aBlock thenRendering: aRenderable |
1 change: 1 addition & 0 deletions
1
source/Willow.package/FrontendComponentSupplier.class/methodProperties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.