Skip to content

Commit 6cfe2af

Browse files
authored
Merge pull request #221 from ba-st/event-dispatcher-pullup
Event dispatcher pullup
2 parents f61ad09 + 4a6ff2a commit 6cfe2af

11 files changed

+16
-63
lines changed

.project

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2-
'srcDirectory' : 'source'
2+
'srcDirectory' : 'source',
3+
'tags': [ 'Buenos Aires Smalltalk' ]
34
}

source/Willow-Core-Tests/CombinedWebInteractionInterpreterTest.class.st

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@ CombinedWebInteractionInterpreterTest >> testShowLoadingNotificationDisplayingAp
704704
self
705705
assert: html
706706
equals:
707-
'<button id="button-id2" type="button">Ok</button><button id="button-id4" type="button">Cancel</button><script type="text/javascript">$("#button-id2").click(function(event){$("#willow-notification-section").html("<div class=\"willow\">Loading...<\/div>");Willow.callServer({"complete":function(){$("#willow-notification-section").html("")},"url":"/","data":"1"})});$("#button-id4").click(function(event){$("#willow-notification-section").html("<div class=\"willow\">Loading...<\/div>");Willow.callServer({"complete":function(){$("#willow-notification-section").html("")},"url":"/","data":"3"})});</script>'
707+
'<button id="button-id2" type="button">Ok</button><button id="button-id4" type="button">Cancel</button><script type="text/javascript">$("#button-id2").click(function(event){$("#willow-notification-section").html("<div class=\"willow\">Loading...</div>");Willow.callServer({"complete":function(){$("#willow-notification-section").html("")},"url":"/","data":"1"})});$("#button-id4").click(function(event){$("#willow-notification-section").html("<div class=\"willow\">Loading...</div>");Willow.callServer({"complete":function(){$("#willow-notification-section").html("")},"url":"/","data":"3"})});</script>'
708708
]
709709

710710
{ #category : 'tests - Configuring - DOM' }
@@ -723,7 +723,7 @@ CombinedWebInteractionInterpreterTest >> testShowLoadingNotificationStyledAsAll
723723
self
724724
assert: html
725725
equals:
726-
'<button id="button-id2" type="button">Ok</button><button id="button-id4" type="button">Cancel</button><script type="text/javascript">$("#button-id2").click(function(event){$("#willow-notification-section").html("<div>Loading...<\/div>");Willow.callServer({"complete":function(){$("#willow-notification-section").html("")},"url":"/","data":"1"})});$("#button-id4").click(function(event){$("#willow-notification-section").html("<div>Loading...<\/div>");Willow.callServer({"complete":function(){$("#willow-notification-section").html("")},"url":"/","data":"3"})});</script>'
726+
'<button id="button-id2" type="button">Ok</button><button id="button-id4" type="button">Cancel</button><script type="text/javascript">$("#button-id2").click(function(event){$("#willow-notification-section").html("<div>Loading...</div>");Willow.callServer({"complete":function(){$("#willow-notification-section").html("")},"url":"/","data":"1"})});$("#button-id4").click(function(event){$("#willow-notification-section").html("<div>Loading...</div>");Willow.callServer({"complete":function(){$("#willow-notification-section").html("")},"url":"/","data":"3"})});</script>'
727727
]
728728

729729
{ #category : 'tests - Configuring - DOM' }

source/Willow-Core-Tests/DialogOpeningCommandTest.class.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ DialogOpeningCommandTest >> testModelLoadingInstructions [
3737
self
3838
assert: html
3939
equals:
40-
'<a id="a-id1"></a><script type="text/javascript">$("#a-id1").click(function(){$("#willow-dialog-section").append("<dialog open><\/dialog>")});</script>'
40+
'<a id="a-id1"></a><script type="text/javascript">$("#a-id1").click(function(){$("#willow-dialog-section").append("<dialog open></dialog>")});</script>'
4141
]
4242

4343
{ #category : 'tests-accessing' }

source/Willow-Core-Tests/LoadingNotificationCommandTest.class.st

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ LoadingNotificationCommandTest >> testPriorityActions [
5757
self
5858
assert: html
5959
equals:
60-
'<a id="a-id1"></a><script type="text/javascript">$("#a-id1").click(function(){$("#willow-notification-section").html("<div>Loading...<\/div>");$.ajax({"complete":function(){$("#willow-notification-section").html("")}})});</script>'
60+
'<a id="a-id1"></a><script type="text/javascript">$("#a-id1").click(function(){$("#willow-notification-section").html("<div>Loading...</div>");$.ajax({"complete":function(){$("#willow-notification-section").html("")}})});</script>'
6161
]
6262

6363
{ #category : 'tests-accessing' }
@@ -74,7 +74,7 @@ LoadingNotificationCommandTest >> testPriorityActionsWithCustomView [
7474
self
7575
assert: html
7676
equals:
77-
'<a id="a-id1"></a><script type="text/javascript">$("#a-id1").click(function(){$("#willow-notification-section").html("<div class=\"willow-loading\"><span>Processing...<\/span><\/div>");$.ajax({"complete":function(){$("#willow-notification-section").html("")}})});</script>'
77+
'<a id="a-id1"></a><script type="text/javascript">$("#a-id1").click(function(){$("#willow-notification-section").html("<div class=\"willow-loading\"><span>Processing...</span></div>");$.ajax({"complete":function(){$("#willow-notification-section").html("")}})});</script>'
7878
]
7979

8080
{ #category : 'tests-testing' }

source/Willow-Core-Tests/PeriodicallyRenderedWebViewTest.class.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,5 +96,5 @@ PeriodicallyRenderedWebViewTest >> testScriptToRefreshAndRenderContentOn [
9696
self
9797
assert: html
9898
equals:
99-
'<div id="id3"></div><script type="text/javascript">$("#id3").html("Count: 2<br/><script type=\"text/javascript\">$.ajax({\"url\":\"/\",\"data\":\"2\"});<\/script>");</script>'
99+
'<div id="id3"></div><script type="text/javascript">$("#id3").html("Count: 2<br/>\x3Cscript type=\"text/javascript\">$.ajax({\"url\":\"/\",\"data\":\"2\"});\x3C/script>");</script>'
100100
]

source/Willow-Core-Tests/RenderingCommandTest.class.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ RenderingCommandTest >> testModelLoadingInstructions [
4141
self
4242
assert: html
4343
equals:
44-
'<a id="id3"></a><script type="text/javascript">$("#id3").click(function(){$("#container-id1").html("<span>Test<\/span>")});</script>'
44+
'<a id="id3"></a><script type="text/javascript">$("#id3").click(function(){$("#container-id1").html("<span>Test</span>")});</script>'
4545
]
4646

4747
{ #category : 'tests-accessing' }

source/Willow-Core-Tests/TemporarilyDisablingCommandTest.class.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ TemporarilyDisablingCommandTest >> testPriorityActions [
3535
self
3636
assert: html
3737
equals:
38-
'<a id="a-id1"></a><script type="text/javascript">$("#a-id1").click(function(){if(componentToDisable.attr("data-willow-events-disabled")!=="disabled"){componentToDisable.attr("data-willow-events-disabled","disabled").addClass("willow-disabled-component").attr("data-original-html",componentToDisable.html()).attr("disabled",true).html("<span class=\"willow-loading\"><\/span>");$.ajax({"complete":function(){componentToDisable.removeAttr("data-willow-events-disabled").attr("disabled",false).removeClass("willow-disabled-component").html(componentToDisable.attr("data-original-html"))}})}});</script>'
38+
'<a id="a-id1"></a><script type="text/javascript">$("#a-id1").click(function(){if(componentToDisable.attr("data-willow-events-disabled")!=="disabled"){componentToDisable.attr("data-willow-events-disabled","disabled").addClass("willow-disabled-component").attr("data-original-html",componentToDisable.html()).attr("disabled",true).html("<span class=\"willow-loading\"></span>");$.ajax({"complete":function(){componentToDisable.removeAttr("data-willow-events-disabled").attr("disabled",false).removeClass("willow-disabled-component").html(componentToDisable.attr("data-original-html"))}})}});</script>'
3939
]
4040

4141
{ #category : 'tests-testing' }

source/Willow-Core-Tests/WebInteractionInterpreterTest.class.st

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,7 @@ WebInteractionInterpreterTest >> testShowLoadingNotificationDisplayingApplying [
753753
self
754754
assert: html
755755
equals:
756-
'<input id="input-id2" type="text"/><script type="text/javascript">$("#input-id2").change(function(event){$("#willow-notification-section").html("<div class=\"willow\">Loading...<\/div>");Willow.callServer({"complete":function(){$("#willow-notification-section").html("")},"url":"/","data":"1"})});</script>'
756+
'<input id="input-id2" type="text"/><script type="text/javascript">$("#input-id2").change(function(event){$("#willow-notification-section").html("<div class=\"willow\">Loading...</div>");Willow.callServer({"complete":function(){$("#willow-notification-section").html("")},"url":"/","data":"1"})});</script>'
757757
]
758758

759759
{ #category : 'tests - Configuring - DOM' }
@@ -769,7 +769,7 @@ WebInteractionInterpreterTest >> testShowLoadingNotificationStyledAsAll [
769769
self
770770
assert: html
771771
equals:
772-
'<input id="input-id2" type="text"/><script type="text/javascript">$("#input-id2").change(function(event){$("#willow-notification-section").html("<div class=\"willow\">Loading...<\/div>");Willow.callServer({"complete":function(){$("#willow-notification-section").html("")},"url":"/","data":"1"})});</script>'
772+
'<input id="input-id2" type="text"/><script type="text/javascript">$("#input-id2").change(function(event){$("#willow-notification-section").html("<div class=\"willow\">Loading...</div>");Willow.callServer({"complete":function(){$("#willow-notification-section").html("")},"url":"/","data":"1"})});</script>'
773773
]
774774

775775
{ #category : 'tests - Configuring - DOM' }

source/Willow-Core/CombinedEventInterpreterDispatcher.class.st

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,6 @@ CombinedEventInterpreterDispatcher class >> combiningInterpretersOfAll: aWebView
2121
^ self combiningAll: ( aWebViewCollection collect: #on )
2222
]
2323

24-
{ #category : 'configuring' }
25-
CombinedEventInterpreterDispatcher >> change [
26-
27-
^ CombinedWebInteractionInterpreter combining: ( eventInterpreterDispatchers collect: #change )
28-
]
29-
30-
{ #category : 'configuring' }
31-
CombinedEventInterpreterDispatcher >> click [
32-
33-
^ CombinedWebInteractionInterpreter combining: ( eventInterpreterDispatchers collect: #click )
34-
]
35-
3624
{ #category : 'configuring' }
3725
CombinedEventInterpreterDispatcher >> eventNamed: anEventName [
3826

@@ -46,18 +34,6 @@ CombinedEventInterpreterDispatcher >> initializeCombiningAll: anEventInterpreter
4634
eventInterpreterDispatchers := anEventInterpreterDispatcherCollection
4735
]
4836

49-
{ #category : 'configuring' }
50-
CombinedEventInterpreterDispatcher >> keyUp [
51-
52-
^ CombinedWebInteractionInterpreter combining: ( eventInterpreterDispatchers collect: #keyUp )
53-
]
54-
55-
{ #category : 'configuring' }
56-
CombinedEventInterpreterDispatcher >> mouseOver [
57-
58-
^ CombinedWebInteractionInterpreter combining: ( eventInterpreterDispatchers collect: #mouseOver )
59-
]
60-
6137
{ #category : 'configuring' }
6238
CombinedEventInterpreterDispatcher >> trigger [
6339

source/Willow-Core/EventInterpreterDispatcher.class.st

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -70,18 +70,6 @@ EventInterpreterDispatcher >> applyTo: aComponent on: aCanvas [
7070
keysAndValuesDo: [ :event :interpreter | interpreter applyTo: aComponent on: aCanvas ]
7171
]
7272

73-
{ #category : 'configuring' }
74-
EventInterpreterDispatcher >> change [
75-
76-
^ self eventNamed: #change
77-
]
78-
79-
{ #category : 'configuring' }
80-
EventInterpreterDispatcher >> click [
81-
82-
^ self eventNamed: #click
83-
]
84-
8573
{ #category : 'configuring' }
8674
EventInterpreterDispatcher >> eventNamed: anEventName [
8775

@@ -96,18 +84,6 @@ EventInterpreterDispatcher >> initializeInterpretingByDefault: anEventName confi
9684
interpretersByEvent at: anEventName put: aWebInteractionInterpreter
9785
]
9886

99-
{ #category : 'configuring' }
100-
EventInterpreterDispatcher >> keyUp [
101-
102-
^ self eventNamed: #keyup
103-
]
104-
105-
{ #category : 'configuring' }
106-
EventInterpreterDispatcher >> mouseOver [
107-
108-
^ self eventNamed: #mouseover
109-
]
110-
11187
{ #category : 'configuring' }
11288
EventInterpreterDispatcher >> trigger [
11389

0 commit comments

Comments
 (0)