diff --git a/repository/Seaside-HotwireTurbo-Core.package/WAComponent.extension/instance/turboShow..st b/repository/Seaside-HotwireTurbo-Core.package/WAComponent.extension/instance/turboShow..st index 0b471f62b..6ca01528b 100644 --- a/repository/Seaside-HotwireTurbo-Core.package/WAComponent.extension/instance/turboShow..st +++ b/repository/Seaside-HotwireTurbo-Core.package/WAComponent.extension/instance/turboShow..st @@ -1,5 +1,4 @@ *Seaside-HotwireTurbo-Core turboShow: aComponent - aComponent addDecoration: (WATurboFrame newWithId: self turboframeDecoration id). - ^ self show: aComponent + ^ self turboShow: aComponent onAnswer: [ :value | ] diff --git a/repository/Seaside-HotwireTurbo-Core.package/WAComponent.extension/instance/turboShow.onAnswer..st b/repository/Seaside-HotwireTurbo-Core.package/WAComponent.extension/instance/turboShow.onAnswer..st new file mode 100644 index 000000000..f10ed01c5 --- /dev/null +++ b/repository/Seaside-HotwireTurbo-Core.package/WAComponent.extension/instance/turboShow.onAnswer..st @@ -0,0 +1,5 @@ +*Seaside-HotwireTurbo-Core +turboShow: aComponent onAnswer: aBlock + + aComponent addDecoration: (WATurboFrame newWithId: self turboframeDecoration id). + ^ self show: aComponent onAnswer: aBlock diff --git a/repository/Seaside-Tests-HotwireTurbo.package/WAAllHotwiredFunctionalTests.class/instance/initializeTests.st b/repository/Seaside-Tests-HotwireTurbo.package/WAAllHotwiredFunctionalTests.class/instance/initializeTests.st index 1b9aad8a0..c3163b0f0 100644 --- a/repository/Seaside-Tests-HotwireTurbo.package/WAAllHotwiredFunctionalTests.class/instance/initializeTests.st +++ b/repository/Seaside-Tests-HotwireTurbo.package/WAAllHotwiredFunctionalTests.class/instance/initializeTests.st @@ -1,4 +1,5 @@ initialization initializeTests + classes := WAHotwiredFunctionalTest allSubclasses asSortedCollection: [ :a :b | a name < b name ]. current := WAValueHolder with: classes first new \ No newline at end of file diff --git a/repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboCalledTestComponent.class/instance/renderContentOn..st b/repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboCalledTestComponent.class/instance/renderContentOn..st deleted file mode 100644 index c397016a7..000000000 --- a/repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboCalledTestComponent.class/instance/renderContentOn..st +++ /dev/null @@ -1,11 +0,0 @@ -rendering -renderContentOn: html - - html paragraph: ('I am also wrapped in a turboframe. I display the counter {1}.' format: { count asString }). - html anchor - callback: [ self answer ]; - with: 'Clicking me should replace me with my caller'. - html break. - html anchor - callback: [ count := count + 1 ]; - with: 'Clicking me should only increment my counter.' \ No newline at end of file diff --git a/repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboCalledTestComponent.class/README.md b/repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboCounterTestComponent.class/README.md similarity index 100% rename from repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboCalledTestComponent.class/README.md rename to repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboCounterTestComponent.class/README.md diff --git a/repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboCounterTestComponent.class/instance/initialize.st b/repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboCounterTestComponent.class/instance/initialize.st new file mode 100644 index 000000000..08a22894e --- /dev/null +++ b/repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboCounterTestComponent.class/instance/initialize.st @@ -0,0 +1,5 @@ +initialization +initialize + + super initialize. + counter := 0 \ No newline at end of file diff --git a/repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboCounterTestComponent.class/instance/renderContentOn..st b/repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboCounterTestComponent.class/instance/renderContentOn..st new file mode 100644 index 000000000..82f28c456 --- /dev/null +++ b/repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboCounterTestComponent.class/instance/renderContentOn..st @@ -0,0 +1,9 @@ +rendering +renderContentOn: html + + html heading + level: 1; + with: counter. + html anchor + callback: [ self turboShow: (WAHotwireTurboEditableCounterTestComponent newWith: counter) onAnswer: [ :value | counter := value ] ]; + with: 'Edit' \ No newline at end of file diff --git a/repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboTestComponent.class/properties.json b/repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboCounterTestComponent.class/properties.json similarity index 68% rename from repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboTestComponent.class/properties.json rename to repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboCounterTestComponent.class/properties.json index abd647727..4006a66ea 100644 --- a/repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboTestComponent.class/properties.json +++ b/repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboCounterTestComponent.class/properties.json @@ -5,7 +5,9 @@ "classinstvars" : [ ], "pools" : [ ], "classvars" : [ ], - "instvars" : [ ], - "name" : "WAHotwireTurboTestComponent", + "instvars" : [ + "counter" + ], + "name" : "WAHotwireTurboCounterTestComponent", "type" : "normal" } \ No newline at end of file diff --git a/repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboTestComponent.class/README.md b/repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboEditableCounterTestComponent.class/README.md similarity index 100% rename from repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboTestComponent.class/README.md rename to repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboEditableCounterTestComponent.class/README.md diff --git a/repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboEditableCounterTestComponent.class/class/newWith..st b/repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboEditableCounterTestComponent.class/class/newWith..st new file mode 100644 index 000000000..8a009d679 --- /dev/null +++ b/repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboEditableCounterTestComponent.class/class/newWith..st @@ -0,0 +1,4 @@ +instance creation +newWith: aNumber + + ^ self new counter: aNumber \ No newline at end of file diff --git a/repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboEditableCounterTestComponent.class/instance/counter..st b/repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboEditableCounterTestComponent.class/instance/counter..st new file mode 100644 index 000000000..6e9d34aee --- /dev/null +++ b/repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboEditableCounterTestComponent.class/instance/counter..st @@ -0,0 +1,4 @@ +initialization +counter: aNumber + + count := aNumber \ No newline at end of file diff --git a/repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboCalledTestComponent.class/instance/initialize.st b/repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboEditableCounterTestComponent.class/instance/initialize.st similarity index 100% rename from repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboCalledTestComponent.class/instance/initialize.st rename to repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboEditableCounterTestComponent.class/instance/initialize.st diff --git a/repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboEditableCounterTestComponent.class/instance/renderContentOn..st b/repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboEditableCounterTestComponent.class/instance/renderContentOn..st new file mode 100644 index 000000000..6441e4bb1 --- /dev/null +++ b/repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboEditableCounterTestComponent.class/instance/renderContentOn..st @@ -0,0 +1,17 @@ +rendering +renderContentOn: html + + html heading + level: 1; + with: count. + html anchor + callback: [ count := count + 1 ]; + with: '++'. + html space. + html anchor + callback: [ count := count - 1 ]; + with: '--'. + html space. + html anchor + callback: [ self answer: count ]; + with: 'Close' \ No newline at end of file diff --git a/repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboCalledTestComponent.class/properties.json b/repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboEditableCounterTestComponent.class/properties.json similarity index 78% rename from repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboCalledTestComponent.class/properties.json rename to repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboEditableCounterTestComponent.class/properties.json index c4f458f01..daf9db8d9 100644 --- a/repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboCalledTestComponent.class/properties.json +++ b/repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboEditableCounterTestComponent.class/properties.json @@ -8,6 +8,6 @@ "instvars" : [ "count" ], - "name" : "WAHotwireTurboCalledTestComponent", + "name" : "WAHotwireTurboEditableCounterTestComponent", "type" : "normal" } \ No newline at end of file diff --git a/repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboFunctionalTest.class/instance/initialize.st b/repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboFunctionalTest.class/instance/initialize.st index 88869b09c..a71f725fe 100644 --- a/repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboFunctionalTest.class/instance/initialize.st +++ b/repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboFunctionalTest.class/instance/initialize.st @@ -2,5 +2,5 @@ initialization initialize super initialize. - comp1 := WAHotwireTurboTestComponent new addDecoration: WATurboFrame new; yourself. - comp2 := WAHotwireTurboTestComponent new addDecoration: WATurboFrame new; yourself. \ No newline at end of file + comp1 := WAHotwireTurboCounterTestComponent new addDecoration: WATurboFrame new; yourself. + comp2 := WAHotwireTurboCounterTestComponent new addDecoration: WATurboFrame new; yourself. \ No newline at end of file diff --git a/repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboFunctionalTest.class/instance/renderContentOn..st b/repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboFunctionalTest.class/instance/renderContentOn..st index 5c382e4f4..469fb9768 100644 --- a/repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboFunctionalTest.class/instance/renderContentOn..st +++ b/repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboFunctionalTest.class/instance/renderContentOn..st @@ -6,4 +6,4 @@ renderContentOn: html html paragraph: 'Both counters are wrapped as turbo frames. Clicking on an action (++ or --) in either one of the counters should only update the counter itself. The rest of the page should not have been updated.'. html render: comp1. - "html render: comp2" \ No newline at end of file + html render: comp2 \ No newline at end of file diff --git a/repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboTestComponent.class/instance/renderContentOn..st b/repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboTestComponent.class/instance/renderContentOn..st deleted file mode 100644 index 545ca6fd1..000000000 --- a/repository/Seaside-Tests-HotwireTurbo.package/WAHotwireTurboTestComponent.class/instance/renderContentOn..st +++ /dev/null @@ -1,7 +0,0 @@ -rendering -renderContentOn: html - - html paragraph: 'I am wrapped in a turboframe.'. - html anchor - callback: [ self turboCall: WAHotwireTurboCalledTestComponent new ]; - with: 'Clicking me should only update my surrounding turboframe.' \ No newline at end of file