diff --git a/source/BaselineOfWillow/BaselineOfWillow.class.st b/source/BaselineOfWillow/BaselineOfWillow.class.st index 4ee0b8a9..feb49765 100644 --- a/source/BaselineOfWillow/BaselineOfWillow.class.st +++ b/source/BaselineOfWillow/BaselineOfWillow.class.st @@ -36,7 +36,7 @@ BaselineOfWillow >> setUpDependencies: spec [ spec baseline: 'RenoirSt' with: [ spec - repository: 'github://ba-st/RenoirSt:v5/source'; + repository: 'github://ba-st/RenoirSt:v6/source'; loads: #('Deployment-Seaside-Extensions') ]. spec diff --git a/source/Willow-Tests/CombinedWebInteractionInterpreterTest.class.st b/source/Willow-Tests/CombinedWebInteractionInterpreterTest.class.st index bf77f408..30263375 100644 --- a/source/Willow-Tests/CombinedWebInteractionInterpreterTest.class.st +++ b/source/Willow-Tests/CombinedWebInteractionInterpreterTest.class.st @@ -8,7 +8,10 @@ Class { 'okButton', 'cancelButton' ], - #category : 'Willow-Tests-WebInteraction' + #pools : [ + 'Willow' + ], + #category : #'Willow-Tests-WebInteraction' } { #category : #initialization } @@ -32,7 +35,7 @@ CombinedWebInteractionInterpreterTest >> testAddCssClass [ | interpreter html | interpreter := CombinedWebInteractionInterpreter combiningInterpretersOf: self buttons. - interpreter addCssClass: WillowCssStyles willow. + interpreter addCssClass: Classification >> #willow. html := self renderUsing: [ :canvas | canvas @@ -49,7 +52,7 @@ CombinedWebInteractionInterpreterTest >> testAddCssClassToComponentsMatching [ | interpreter html | interpreter := CombinedWebInteractionInterpreter combiningInterpretersOf: self buttons. - interpreter addCssClass: WillowCssStyles willow toComponentsMatching: [ :canvas | canvas jQuery this ]. + interpreter addCssClass: Classification >> #willow toComponentsMatching: [ :canvas | canvas jQuery this ]. html := self renderUsing: [ :canvas | canvas @@ -68,7 +71,7 @@ CombinedWebInteractionInterpreterTest >> testChangeCssClassTo [ interpreter := CombinedWebInteractionInterpreter combiningInterpretersOf: self buttons. - interpreter changeCssClass: WillowCssStyles loading to: WillowCssStyles willow. + interpreter changeCssClass: Classification >> #loading to: Classification >> #willow. html := self renderUsing: [ :canvas | @@ -438,7 +441,7 @@ CombinedWebInteractionInterpreterTest >> testRemoveCssClassFromComponentsMatchin interpreter := CombinedWebInteractionInterpreter combiningInterpretersOf: self buttons. - interpreter removeCssClass: WillowCssStyles loading fromComponentsMatching: [ :canvas | canvas jQuery this ]. + interpreter removeCssClass: Classification >> #loading fromComponentsMatching: [ :canvas | canvas jQuery this ]. html := self renderUsing: [ :canvas | @@ -458,7 +461,7 @@ CombinedWebInteractionInterpreterTest >> testRemoveCssClassFromComponentsWithCla interpreter := CombinedWebInteractionInterpreter combiningInterpretersOf: self buttons. - interpreter removeCssClass: WillowCssStyles loading fromComponentsWithClass: WillowCssStyles willow. + interpreter removeCssClass: Classification >> #loading fromComponentsWithClass: Classification >> #willow. html := self renderUsing: [ :canvas | @@ -766,7 +769,7 @@ CombinedWebInteractionInterpreterTest >> testSubmitFormStyledAs [ interpreter := CombinedWebInteractionInterpreter combiningInterpretersOf: self buttons. - interpreter submitFormStyledAs: WillowCssStyles willow. + interpreter submitFormStyledAs: Classification >> #willow. html := self renderUsing: [ :canvas | canvas @@ -828,7 +831,7 @@ CombinedWebInteractionInterpreterTest >> testToggleCssClass [ interpreter := CombinedWebInteractionInterpreter combiningInterpretersOf: self buttons. - interpreter toggleCssClass: WillowCssStyles loading. + interpreter toggleCssClass: Classification >> #loading. html := self renderUsing: [ :canvas | @@ -848,7 +851,7 @@ CombinedWebInteractionInterpreterTest >> testToggleCssClassOn [ interpreter := CombinedWebInteractionInterpreter combiningInterpretersOf: self buttons. - interpreter toggleCssClass: WillowCssStyles willow on: (IdentifiedWebView forDivNamed: 'example' containing: [ ]). + interpreter toggleCssClass: Classification >> #willow on: (IdentifiedWebView forDivNamed: 'example' containing: [ ]). html := self @@ -869,7 +872,7 @@ CombinedWebInteractionInterpreterTest >> testToggleCssClassOnComponentsMatching interpreter := CombinedWebInteractionInterpreter combiningInterpretersOf: self buttons. - interpreter toggleCssClass: WillowCssStyles loading onComponentsMatching: [ :canvas | canvas jQuery this ]. + interpreter toggleCssClass: Classification >> #loading onComponentsMatching: [ :canvas | canvas jQuery this ]. html := self renderUsing: [ :canvas | diff --git a/source/Willow-Tests/FormSubmitCommandTest.class.st b/source/Willow-Tests/FormSubmitCommandTest.class.st index 65d8bde3..f56f07c0 100644 --- a/source/Willow-Tests/FormSubmitCommandTest.class.st +++ b/source/Willow-Tests/FormSubmitCommandTest.class.st @@ -7,7 +7,10 @@ Class { #instVars : [ 'command' ], - #category : 'Willow-Tests-WebInteraction' + #pools : [ + 'Willow' + ], + #category : #'Willow-Tests-WebInteraction' } { #category : #'tests-accessing' } @@ -36,7 +39,7 @@ FormSubmitCommandTest >> testModelLoadingActions [ anchor := canvas anchor. canvas ensureIdFor: anchor. - (FormSubmitCommand forFormStyledAs: WillowCssStyles willow) modelLoadingActions do: [ :action | action value: script value: canvas ]. + (FormSubmitCommand forFormStyledAs: Classification >> #willow) modelLoadingActions do: [ :action | action value: script value: canvas ]. anchor script: (canvas jQuery this onClick: script) ]. self assert: html equals: '' diff --git a/source/Willow-Tests/TemporarilyDisablingCommandTest.class.st b/source/Willow-Tests/TemporarilyDisablingCommandTest.class.st index d1ebafd6..9d10fa31 100644 --- a/source/Willow-Tests/TemporarilyDisablingCommandTest.class.st +++ b/source/Willow-Tests/TemporarilyDisablingCommandTest.class.st @@ -24,8 +24,7 @@ TemporarilyDisablingCommandTest >> testPriorityActions [ | command html | - command := TemporarilyDisablingCommand - transformingCurrentViewInto: [ :canvas | canvas span class: WillowCssStyles loading ]. + command := TemporarilyDisablingCommand transformingCurrentViewInto: [ :canvas | canvas span apply: [ :span | span addClass loading ] ]. html := self renderUsing: [ :canvas | | asynchronousCall anchor | @@ -53,8 +52,7 @@ TemporarilyDisablingCommandTest >> testServerIndependentActions [ | command html | - command := TemporarilyDisablingCommand - transformingCurrentViewInto: [ :canvas | canvas span class: WillowCssStyles loading ]. + command := TemporarilyDisablingCommand transformingCurrentViewInto: [ :canvas | canvas span apply: [ :span | span addClass loading ] ]. html := self renderUsing: [ :canvas | | script anchor | diff --git a/source/Willow-Tests/WebComponentCommandBuilderTest.class.st b/source/Willow-Tests/WebComponentCommandBuilderTest.class.st index ff026989..9ae3f4c2 100644 --- a/source/Willow-Tests/WebComponentCommandBuilderTest.class.st +++ b/source/Willow-Tests/WebComponentCommandBuilderTest.class.st @@ -273,9 +273,7 @@ WebComponentCommandBuilderTest >> testSetComponentStyleCommands [ | html | - html := self - apply: (self commandBuilder setStyleTo: [ :style | style background: CssSVGColors blue ]) - toComponentDefinedBy: [ :canvas | canvas div ]. + html := self apply: (self commandBuilder setStyleTo: [ :style :constants | style background: constants >> #colors >> #blue ]) toComponentDefinedBy: [ :canvas | canvas div ]. self assert: html equals: '
' ] diff --git a/source/Willow-Tests/WebComponentCommandToTableRowCommandAdapterTest.class.st b/source/Willow-Tests/WebComponentCommandToTableRowCommandAdapterTest.class.st index 94736a75..5b04e624 100644 --- a/source/Willow-Tests/WebComponentCommandToTableRowCommandAdapterTest.class.st +++ b/source/Willow-Tests/WebComponentCommandToTableRowCommandAdapterTest.class.st @@ -12,7 +12,7 @@ WebComponentCommandToTableRowCommandAdapterTest >> testApplyToForOn [ | html command | - command := (ComponentClassificationCommand toStyleWith: WillowCssStyles fadingNotification) asTableRowCommand. + command := [ :tableRow | tableRow addClass fadingNotification ] asTableRowCommand. html := self renderUsing: [ :canvas | | component | @@ -20,13 +20,5 @@ WebComponentCommandToTableRowCommandAdapterTest >> testApplyToForOn [ component := canvas tableRow. command applyTo: component for: 33 on: canvas ]. - self - assert: html - equals: - (String - streamContents: [ :stream | - stream - nextPutAll: '' ]) + self assert: html equals: '' ] diff --git a/source/Willow-Tests/WebInteractionInterpreterTest.class.st b/source/Willow-Tests/WebInteractionInterpreterTest.class.st index 8bc12423..e5fa0023 100644 --- a/source/Willow-Tests/WebInteractionInterpreterTest.class.st +++ b/source/Willow-Tests/WebInteractionInterpreterTest.class.st @@ -1,7 +1,10 @@ Class { #name : #WebInteractionInterpreterTest, #superclass : #WARenderingTest, - #category : 'Willow-Tests-WebInteraction' + #pools : [ + 'Willow' + ], + #category : #'Willow-Tests-WebInteraction' } { #category : #'test support' } @@ -21,7 +24,7 @@ WebInteractionInterpreterTest >> testAddCssClass [ | interpreter html | interpreter := WebInteractionInterpreter forClickOnComponent. - interpreter addCssClass: WillowCssStyles willow. + interpreter addCssClass: Classification >> #willow. html := self configureTextInputWith: interpreter. self assert: html @@ -34,7 +37,7 @@ WebInteractionInterpreterTest >> testAddCssClassToComponentsMatching [ | interpreter html | interpreter := WebInteractionInterpreter forClickOnComponent. - interpreter addCssClass: WillowCssStyles willow toComponentsMatching: [ :canvas | canvas jQuery class: 'aComponentByStyleName' ]. + interpreter addCssClass: Classification >> #willow toComponentsMatching: [ :canvas | canvas jQuery class: 'aComponentByStyleName' ]. html := self configureTextInputWith: interpreter. self assert: html @@ -48,8 +51,8 @@ WebInteractionInterpreterTest >> testChangeCssClassTo [ | interpreter html | interpreter := WebInteractionInterpreter forClickOnComponent. - interpreter changeCssClass: WillowCssStyles loading to: WillowCssStyles willow. - html := self apply: interpreter toComponentDefinedBy: [ :canvas | canvas textInput class: WillowCssStyles loading ]. + interpreter changeCssClass: Classification >> #loading to: Classification >> #willow. + html := self apply: interpreter toComponentDefinedBy: [ :canvas | canvas textInput apply: [ :input | input addClass loading ] ]. self assert: html equals: @@ -456,7 +459,7 @@ WebInteractionInterpreterTest >> testRemoveCssClassFromComponentsMatching [ | interpreter html | interpreter := WebInteractionInterpreter forClickOnComponent. - interpreter removeCssClass: WillowCssStyles willow fromComponentsMatching: [ :canvas | canvas jQuery class: 'aComponentByStyleName' ]. + interpreter removeCssClass: Classification >> #willow fromComponentsMatching: [ :canvas | canvas jQuery class: 'aComponentByStyleName' ]. html := self configureTextInputWith: interpreter. self assert: html @@ -470,17 +473,11 @@ WebInteractionInterpreterTest >> testRemoveCssClassFromComponentsWithClass [ | interpreter html | interpreter := WebInteractionInterpreter forClickOnComponent. - interpreter removeCssClass: WillowCssStyles loading fromComponentsWithClass: WillowCssStyles willow. - html := self - apply: interpreter - toComponentDefinedBy: [ :canvas | - canvas textInput - class: WillowCssStyles loading; - class: WillowCssStyles willow ]. + interpreter removeCssClass: Classification >> #loading fromComponentsWithClass: Classification >> #willow. + html := self apply: interpreter toComponentDefinedBy: [ :canvas | canvas textInput apply: [ :input | input addClass loading + input addClass willow ] ]. self assert: html - equals: - '' + equals: '' ] { #category : #'tests - Configuring - DOM' } @@ -787,19 +784,17 @@ WebInteractionInterpreterTest >> testSubmitFormStyledAs [ html := self renderUsing: [ :canvas | - | form anchor | + | anchor | - form := canvas form. - form class: WillowCssStyles willow. + canvas form apply: [ :form | form addClass willow ]. anchor := canvas anchor. anchor id: '16'. - interpreter submitFormStyledAs: WillowCssStyles willow. - interpreter applyTo: anchor on: canvas ]. + interpreter submitFormStyledAs: Classification >> #willow. + anchor interactUsing: interpreter ]. self assert: html - equals: - '
' + equals: '
' ] { #category : #'tests - Configuring - DOM' } @@ -852,12 +847,9 @@ WebInteractionInterpreterTest >> testToggleCssClass [ | interpreter html | interpreter := WebInteractionInterpreter forClickOnComponent. - interpreter toggleCssClass: WillowCssStyles loading. - html := self apply: interpreter toComponentDefinedBy: [ :canvas | canvas textInput class: WillowCssStyles loading ]. - self - assert: html - equals: - '' + interpreter toggleCssClass: Classification >> #loading. + html := self apply: interpreter toComponentDefinedBy: [ :canvas | canvas textInput apply: [ :input | input addClass loading ] ]. + self assert: html equals: '' ] { #category : #'tests - Configuring - CSS' } @@ -866,7 +858,7 @@ WebInteractionInterpreterTest >> testToggleCssClassOn [ | interpreter html | interpreter := WebInteractionInterpreter forClickOnComponent. - interpreter toggleCssClass: WillowCssStyles willow on: (IdentifiedWebView forDivNamed: 'example' containing: [ ]). + interpreter toggleCssClass: Classification >> #willow on: (IdentifiedWebView forDivNamed: 'example' containing: [ ]). html := self configureTextInputWith: interpreter. self assert: html @@ -880,7 +872,7 @@ WebInteractionInterpreterTest >> testToggleCssClassOnComponentsMatching [ | interpreter html | interpreter := WebInteractionInterpreter forClickOnComponent. - interpreter toggleCssClass: WillowCssStyles willow onComponentsMatching: [ :canvas | canvas jQuery class: 'aComponentByStyleName' ]. + interpreter toggleCssClass: Classification >> #willow onComponentsMatching: [ :canvas | canvas jQuery class: 'aComponentByStyleName' ]. html := self configureTextInputWith: interpreter. self assert: html diff --git a/source/Willow-Tests/WillowConstantsProviderTest.class.st b/source/Willow-Tests/WillowConstantsProviderTest.class.st index 4e046f6e..55508e93 100644 --- a/source/Willow-Tests/WillowConstantsProviderTest.class.st +++ b/source/Willow-Tests/WillowConstantsProviderTest.class.st @@ -13,7 +13,7 @@ WillowConstantsProviderTest >> testBlockExtension [ | html | html := self - apply: [ :anchor :constants | anchor addScript js: [ :canvas | canvas jQuery this onClick: (canvas jQuery id: constants willow dialogSectionName) clone ] ] asWebComponentCommand + apply: [ :anchor :constants | anchor addScript js: [ :canvas | canvas jQuery this onClick: (canvas jQuery id: constants >> #willow >> #dialogSectionName) clone ] ] asWebComponentCommand toComponentDefinedBy: [ :canvas | canvas anchor ]. self assert: html equals: '' @@ -24,7 +24,6 @@ WillowConstantsProviderTest >> testCssConstants [ [ :command :constants | self - assert: constants css inherit equals: CssConstants inherit; - assert: constants cssFonts allPetiteCaps equals: CssFontConstants allPetiteCaps; - assert: constants cssMediaQuery landscape equals: CssMediaQueryConstants landscape ] asWebComponentCommand + assert: constants >> #css >> #inherit equals: 'inherit'; + assert: constants >> #css >> #allPetiteCaps equals: 'all-petite-caps' ] asWebComponentCommand ] diff --git a/source/Willow-Tests/WillowJavascriptNamespaceTest.class.st b/source/Willow-Tests/WillowJavascriptNamespaceTest.class.st index d72a2868..3da05fa1 100644 --- a/source/Willow-Tests/WillowJavascriptNamespaceTest.class.st +++ b/source/Willow-Tests/WillowJavascriptNamespaceTest.class.st @@ -15,6 +15,18 @@ WillowJavascriptNamespaceTest >> testCallServerFunction [ equals: 'Willow.callServer' ] +{ #category : #'tests-printing' } +WillowJavascriptNamespaceTest >> testClassificationAccess [ + + self assert: Willow classification >> #loading equals: 'willow-loading' +] + +{ #category : #'tests-printing' } +WillowJavascriptNamespaceTest >> testConstantsAccess [ + + self assert: WillowJavascriptNamespace new constants >> #css >> #auto equals: 'auto' +] + { #category : #'tests-Accessing' } WillowJavascriptNamespaceTest >> testHandleAjaxErrorCallFunction [ diff --git a/source/Willow/AsynchronicButtonWebView.class.st b/source/Willow/AsynchronicButtonWebView.class.st index ef7d0e84..3a73b504 100644 --- a/source/Willow/AsynchronicButtonWebView.class.st +++ b/source/Willow/AsynchronicButtonWebView.class.st @@ -63,8 +63,7 @@ AsynchronicButtonWebView >> renderContentOn: aCanvas [ identifierAssigner withAssignedIdentifierDo: [ :id | pushButton id: id ]. pushButton value: label; - bePush. - - interactionInterpreter applyTo: pushButton on: aCanvas. - commandToComponent applyTo: pushButton on: aCanvas + bePush; + interactUsing: interactionInterpreter; + apply: commandToComponent ] diff --git a/source/Willow/BlockClosure.extension.st b/source/Willow/BlockClosure.extension.st index b3f4dd7f..e29cf0e6 100644 --- a/source/Willow/BlockClosure.extension.st +++ b/source/Willow/BlockClosure.extension.st @@ -9,5 +9,5 @@ BlockClosure >> asTableRowCommand [ { #category : #'*Willow' } BlockClosure >> asWebComponentCommand [ - ^ (self cull: WebComponentCommandBuilder new cull: WillowConstantsProvider new) ifNil: [ CompositeComponentCommand empty ] + ^ (self cull: WebComponentCommandBuilder new cull: Willow constants) ifNil: [ CompositeComponentCommand empty ] ] diff --git a/source/Willow/ComponentClassificationCommandBuilder.class.st b/source/Willow/ComponentClassificationCommandBuilder.class.st index 0124553c..17473a00 100644 --- a/source/Willow/ComponentClassificationCommandBuilder.class.st +++ b/source/Willow/ComponentClassificationCommandBuilder.class.st @@ -5,50 +5,53 @@ Class { #name : #ComponentClassificationCommandBuilder, #superclass : #GRObject, #instVars : [ - 'styleProviderBinding' + 'classificationNamespace' + ], + #pools : [ + 'Willow' ], #category : #'Willow-Frontend' } { #category : #private } -ComponentClassificationCommandBuilder >> commandStyledWith: aCssStyle [ +ComponentClassificationCommandBuilder >> commandStyledWith: aSymbol [ - ^ ComponentClassificationCommand toStyleWith: aCssStyle + ^ ComponentClassificationCommand toStyleWith: classificationNamespace >> aSymbol ] { #category : #Building } ComponentClassificationCommandBuilder >> dialogContainer [ - ^ self commandStyledWith: styleProviderBinding content dialogContainer + ^ self commandStyledWith: #dialogContainer ] { #category : #Building } ComponentClassificationCommandBuilder >> disabledComponent [ - ^ self commandStyledWith: styleProviderBinding content disabledComponent + ^ self commandStyledWith: #disabledComponent ] { #category : #Building } ComponentClassificationCommandBuilder >> fadingNotification [ - ^ self commandStyledWith: styleProviderBinding content fadingNotification + ^ self commandStyledWith: #fadingNotification ] { #category : #initialization } ComponentClassificationCommandBuilder >> initialize [ super initialize. - styleProviderBinding := Binding to: WillowCssStyles + classificationNamespace := Classification ] { #category : #Building } ComponentClassificationCommandBuilder >> loading [ - ^ self commandStyledWith: styleProviderBinding content loading + ^ self commandStyledWith: #loading ] { #category : #Building } ComponentClassificationCommandBuilder >> willow [ - ^ self commandStyledWith: styleProviderBinding content willow + ^ self commandStyledWith: #willow ] diff --git a/source/Willow/ComponentEnableStatusChangingCommand.class.st b/source/Willow/ComponentEnableStatusChangingCommand.class.st index c7aa5145..da9725cc 100644 --- a/source/Willow/ComponentEnableStatusChangingCommand.class.st +++ b/source/Willow/ComponentEnableStatusChangingCommand.class.st @@ -68,8 +68,9 @@ ComponentEnableStatusChangingCommand >> requiresSerialization [ { #category : #accessing } ComponentEnableStatusChangingCommand >> serverIndependentActions [ - ^Array with: [:aScript :aCanvas | - aScript << (componentProvider value: aCanvas) - propertyAt: WillowConstants disabledAttributeName - put: desiredStatus] + ^ Array + with: [ :aScript :aCanvas | + aScript << (componentProvider value: aCanvas) + propertyAt: Constants >> #willow >> #disabledAttributeName + put: desiredStatus ] ] diff --git a/source/Willow/DialogClosingCommand.class.st b/source/Willow/DialogClosingCommand.class.st index 0f92c15c..d7f13a87 100644 --- a/source/Willow/DialogClosingCommand.class.st +++ b/source/Willow/DialogClosingCommand.class.st @@ -48,7 +48,7 @@ DialogClosingCommand >> modelLoadingActions [ with: [ :aScript :aCanvas | aCanvas session componentSupplier addStatementsTo: aScript - toCloseDialogsIn: (aCanvas jQuery id: WillowConstants dialogSectionName) + toCloseDialogsIn: (aCanvas jQuery id: Constants >> #willow >> #dialogSectionName) matching: dialogSupplier on: aCanvas ] ] diff --git a/source/Willow/DialogOpener.class.st b/source/Willow/DialogOpener.class.st index 108361c9..bee12855 100644 --- a/source/Willow/DialogOpener.class.st +++ b/source/Willow/DialogOpener.class.st @@ -4,11 +4,15 @@ I help in opening dialogs. Useful outside of the DialogOpeningCommand. Class { #name : #DialogOpener, #superclass : #GRObject, + #pools : [ + 'Willow' + ], #category : #'Willow-WebInteraction' } { #category : #actions } DialogOpener >> open: aDialogView on: aCanvas [ - ^ (aCanvas jQuery id: WillowConstants dialogSectionName) append: [ :aSubCanvas | aSubCanvas render: aDialogView ] + ^ (aCanvas jQuery id: Constants >> #willow >> #dialogSectionName) + append: [ :aSubCanvas | aSubCanvas render: aDialogView ] ] diff --git a/source/Willow/DropDownListWebView.class.st b/source/Willow/DropDownListWebView.class.st index dd1d2dcb..7b130a12 100644 --- a/source/Willow/DropDownListWebView.class.st +++ b/source/Willow/DropDownListWebView.class.st @@ -25,7 +25,7 @@ DropDownListWebView class >> applying: aCommandToComponent [ { #category : #private } DropDownListWebView >> configure: select unselectingAllOn: aCanvas [ - ^ availableElements ifNotEmpty: [ DeselectAllOptionsCommand new applyTo: select on: aCanvas ] + ^ availableElements ifNotEmpty: [ select apply: DeselectAllOptionsCommand new ] ] { #category : #accessing } @@ -64,6 +64,7 @@ DropDownListWebView >> renderContentOn: aCanvas [ select callback: [ :element | self choose: element ]. identifierAssigner withAssignedIdentifierDo: [ :id | select id: id ]. chosenElementOptional withContentDo: [ :chosenElement | select selected: chosenElement ] ifUnused: [ self configure: select unselectingAllOn: aCanvas ]. - commandToComponent applyTo: select on: aCanvas. - interactionInterpreter applyTo: select on: aCanvas + select + apply: commandToComponent; + interactUsing: interactionInterpreter ] diff --git a/source/Willow/FieldSetWebView.class.st b/source/Willow/FieldSetWebView.class.st index 9920f1fc..4fbe25ff 100644 --- a/source/Willow/FieldSetWebView.class.st +++ b/source/Willow/FieldSetWebView.class.st @@ -35,15 +35,9 @@ FieldSetWebView >> initializeContaining: aWebView applying: aFieldSetCommand wit { #category : #rendering } FieldSetWebView >> renderContentOn: aCanvas [ - | fieldSet | - - fieldSet := aCanvas fieldSet. - fieldSetCommand applyTo: fieldSet on: aCanvas. - fieldSet - with: [ | legend | - - legend := aCanvas legend. - legendCommand applyTo: legend on: aCanvas. - legend with: title. + aCanvas fieldSet + with: [ + aCanvas legend with: title applying: legendCommand. aCanvas render: contentView ] + applying: fieldSetCommand ] diff --git a/source/Willow/FileDownloadAnchorWebView.class.st b/source/Willow/FileDownloadAnchorWebView.class.st index 3893e979..ff7a484a 100644 --- a/source/Willow/FileDownloadAnchorWebView.class.st +++ b/source/Willow/FileDownloadAnchorWebView.class.st @@ -32,18 +32,15 @@ FileDownloadAnchorWebView >> initializeLabeled: aLabel applying: aComponentComma { #category : #rendering } FileDownloadAnchorWebView >> renderContentOn: aCanvas [ - | anchor | - - anchor := aCanvas anchor. - anchor + aCanvas anchor callback: [ aCanvas requestContext respond: [ :response | | document | + document := documentProvider value. response contentType: document contentType; attachmentWithFileName: document fileName; - nextPutAll: document content ] ]. - commandToComponent applyTo: anchor on: aCanvas. - anchor with: label + nextPutAll: document content ] ]; + with: label applying: commandToComponent ] diff --git a/source/Willow/GenericContainerWebView.class.st b/source/Willow/GenericContainerWebView.class.st index 88c45095..46ec59b1 100644 --- a/source/Willow/GenericContainerWebView.class.st +++ b/source/Willow/GenericContainerWebView.class.st @@ -47,10 +47,7 @@ GenericContainerWebView >> onTrigger [ { #category : #rendering } GenericContainerWebView >> renderContentOn: aCanvas [ - | div | - - div := aCanvas div. - interactionInterpreter applyTo: div on: aCanvas. - commandToComponent applyTo: div on: aCanvas. - div with: contentProvider value + aCanvas div + interactUsing: interactionInterpreter; + with: contentProvider value applying: commandToComponent ] diff --git a/source/Willow/HeadingWebView.class.st b/source/Willow/HeadingWebView.class.st index 84d5034e..9d98e572 100644 --- a/source/Willow/HeadingWebView.class.st +++ b/source/Willow/HeadingWebView.class.st @@ -35,11 +35,7 @@ HeadingWebView >> initializeDisplaying: aHeadingText withLevel: aLevel applying: { #category : #rendering } HeadingWebView >> renderContentOn: aCanvas [ - | heading | - - heading := aCanvas heading. - commandToComponent applyTo: heading on: aCanvas. - heading + aCanvas heading level: level; - with: text + with: text applying: commandToComponent ] diff --git a/source/Willow/IdentifiedWebView.class.st b/source/Willow/IdentifiedWebView.class.st index 9789cbf4..e65fcc33 100644 --- a/source/Willow/IdentifiedWebView.class.st +++ b/source/Willow/IdentifiedWebView.class.st @@ -68,13 +68,7 @@ IdentifiedWebView class >> forFormNamed: aName containing: aView applying: aComp { #category : #'instance creation' } IdentifiedWebView class >> forLabeledFieldNamed: aName containing: aView [ - ^ self - forComponentBuiltUsing: [ :canvas | - canvas fieldSet - class: WillowCssStyles willow; - yourself ] - named: aName - containing: aView + ^ self forComponentBuiltUsing: [ :canvas | canvas fieldSet apply: [ :fieldSet | fieldSet addClass willow ] ] named: aName containing: aView ] { #category : #'instance creation' } @@ -133,9 +127,9 @@ IdentifiedWebView >> renderContentOn: aCanvas [ identifier := self identifyIn: aCanvas. containerComponent := self componentRenderedOn: aCanvas. "We need to set the id before applying the commands, because some command may require it" - containerComponent id: identifier. - commandToComponent applyTo: containerComponent on: aCanvas. - containerComponent with: view + containerComponent + id: identifier; + with: view applying: commandToComponent ] { #category : #accessing } diff --git a/source/Willow/ImageWebView.class.st b/source/Willow/ImageWebView.class.st index 2402d9ad..323ee8d1 100644 --- a/source/Willow/ImageWebView.class.st +++ b/source/Willow/ImageWebView.class.st @@ -41,18 +41,8 @@ ImageWebView >> onTrigger [ { #category : #rendering } ImageWebView >> renderContentOn: aCanvas [ - | component | - component := self renderImageOn: aCanvas. - interactionInterpreter applyTo: component on: aCanvas -] - -{ #category : #rendering } -ImageWebView >> renderImageOn: aCanvas [ - - | component | - - component := aCanvas image. - component url: imageLocation. - commandToComponent applyTo: component on: aCanvas. - ^ component + aCanvas image + url: imageLocation; + apply: commandToComponent; + interactUsing: interactionInterpreter ] diff --git a/source/Willow/JSObject.extension.st b/source/Willow/JSObject.extension.st index 742efc59..15cf17cc 100644 --- a/source/Willow/JSObject.extension.st +++ b/source/Willow/JSObject.extension.st @@ -1,5 +1,12 @@ Extension { #name : #JSObject } +{ #category : #'*Willow' } +JSObject >> constants [ + + "This method is intended to be private." + ^ Willow constants +] + { #category : #'*Willow' } JSObject >> willow [ diff --git a/source/Willow/LabeledWebView.class.st b/source/Willow/LabeledWebView.class.st index 840af4f9..3849dc92 100644 --- a/source/Willow/LabeledWebView.class.st +++ b/source/Willow/LabeledWebView.class.st @@ -47,12 +47,11 @@ LabeledWebView >> phrasingContent [ { #category : #rendering } LabeledWebView >> renderContentOn: aCanvas [ - | label fieldIdentifier | + | fieldIdentifier | fieldIdentifier := fieldWebView identifyIn: aCanvas. - label := aCanvas label for: fieldIdentifier. - commandToComponent applyTo: label on: aCanvas. - label with: self phrasingContent. - aCanvas render: self fieldWebView. - + aCanvas label + for: fieldIdentifier; + with: self phrasingContent applying: commandToComponent. + aCanvas render: self fieldWebView ] diff --git a/source/Willow/LinkWebView.class.st b/source/Willow/LinkWebView.class.st index 31a44d94..d7d3d849 100644 --- a/source/Willow/LinkWebView.class.st +++ b/source/Willow/LinkWebView.class.st @@ -53,10 +53,7 @@ LinkWebView >> onTrigger [ { #category : #rendering } LinkWebView >> renderContentOn: aCanvas [ - | anchor | - - anchor := aCanvas anchor. - interactionInterpreter applyTo: anchor on: aCanvas. - commandToComponent applyTo: anchor on: aCanvas. - anchor with: label + aCanvas anchor + interactUsing: interactionInterpreter; + with: label applying: commandToComponent ] diff --git a/source/Willow/ListItemWebView.class.st b/source/Willow/ListItemWebView.class.st index 5bf19ec5..255a3816 100644 --- a/source/Willow/ListItemWebView.class.st +++ b/source/Willow/ListItemWebView.class.st @@ -29,9 +29,5 @@ ListItemWebView >> initializeItemizing: anObject containedIn: aList applying: aC { #category : #rendering } ListItemWebView >> renderContentOn: aCanvas [ - | component | - - component := aCanvas listItem. - commandToComponent applyTo: component on: aCanvas. - component with: (list labelForOption: item) + aCanvas listItem with: (list labelForOption: item) applying: commandToComponent ] diff --git a/source/Willow/LoadingNotificationCommand.class.st b/source/Willow/LoadingNotificationCommand.class.st index e5b2556e..226c332e 100644 --- a/source/Willow/LoadingNotificationCommand.class.st +++ b/source/Willow/LoadingNotificationCommand.class.st @@ -25,7 +25,7 @@ LoadingNotificationCommand class >> onPageTopWithClasses: aCssClassCollection [ executing: (Array with: [ :aScript :aCanvas | - aScript << (aCanvas jQuery id: WillowConstants notificationSectionName) + aScript << (aCanvas jQuery id: Constants >> #willow >> #notificationSectionName) html: [ :aSubCanvas | aSubCanvas div classes: aCssClassCollection; @@ -33,7 +33,7 @@ LoadingNotificationCommand class >> onPageTopWithClasses: aCssClassCollection [ then: (Array with: [ :aScript :aCanvas | - aScript << (aCanvas jQuery id: WillowConstants notificationSectionName) + aScript << (aCanvas jQuery id: Constants >> #willow >> #notificationSectionName) html: [ :aSubCanvas | ] ]) ] diff --git a/source/Willow/MultipleSelectionListBoxWebView.class.st b/source/Willow/MultipleSelectionListBoxWebView.class.st index dd80c715..faf3f6a2 100644 --- a/source/Willow/MultipleSelectionListBoxWebView.class.st +++ b/source/Willow/MultipleSelectionListBoxWebView.class.st @@ -126,6 +126,7 @@ MultipleSelectionListBoxWebView >> renderContentOn: aCanvas [ callback: [ :elements | self chooseAllIn: elements ]; selected: chosenElements. identifierAssigner withAssignedIdentifierDo: [ :id | select id: id ]. - interactionInterpreter applyTo: select on: aCanvas. - commandToComponent applyTo: select on: aCanvas + select + interactUsing: interactionInterpreter; + apply: commandToComponent ] diff --git a/source/Willow/PhrasingContainerWebView.class.st b/source/Willow/PhrasingContainerWebView.class.st index 18a09107..fab9063d 100644 --- a/source/Willow/PhrasingContainerWebView.class.st +++ b/source/Willow/PhrasingContainerWebView.class.st @@ -49,10 +49,7 @@ PhrasingContainerWebView >> onTrigger [ { #category : #rendering } PhrasingContainerWebView >> renderContentOn: aCanvas [ - | span | - - span := aCanvas span. - interactionInterpreter applyTo: span on: aCanvas. - commandToComponent applyTo: span on: aCanvas. - span with: phrasingContentProvider value + aCanvas span + interactUsing: interactionInterpreter; + with: phrasingContentProvider value applying: commandToComponent ] diff --git a/source/Willow/RadioGroupWebView.class.st b/source/Willow/RadioGroupWebView.class.st index 7a41ddab..816583b6 100644 --- a/source/Willow/RadioGroupWebView.class.st +++ b/source/Willow/RadioGroupWebView.class.st @@ -67,12 +67,9 @@ RadioGroupWebView >> renderLabelContentFor: anElement on: aCanvas [ { #category : #'private-rendering' } RadioGroupWebView >> renderLabelFor: radioButtonId on: aCanvas with: aRenderable [ - | label | - - label := aCanvas label. - label for: radioButtonId. - labelCommand applyTo: label on: aCanvas. - label with: aRenderable + aCanvas label + for: radioButtonId; + with: aRenderable applying: labelCommand ] { #category : #'private-rendering' } @@ -84,11 +81,10 @@ RadioGroupWebView >> renderRadioButtonFor: anElement asPartOf: aRadioGroup on: a self renderLabelFor: radioButtonId on: aCanvas - with: [ | radioButton | - radioButton := aRadioGroup radioButton. - radioButton id: radioButtonId. - inputCommand applyTo: radioButton on: aCanvas. - interactionInterpreter applyTo: radioButton on: aCanvas. - radioButton value: anElement. + with: [ aRadioGroup radioButton + id: radioButtonId; + apply: inputCommand; + interactUsing: interactionInterpreter; + value: anElement. self renderLabelContentFor: anElement on: aCanvas ] ] diff --git a/source/Willow/ReflectiveCascadingStyleSheetBuilder.extension.st b/source/Willow/ReflectiveCascadingStyleSheetBuilder.extension.st new file mode 100644 index 00000000..69661666 --- /dev/null +++ b/source/Willow/ReflectiveCascadingStyleSheetBuilder.extension.st @@ -0,0 +1,7 @@ +Extension { #name : #ReflectiveCascadingStyleSheetBuilder } + +{ #category : #'*Willow' } +ReflectiveCascadingStyleSheetBuilder >> classification [ + + ^ Willow classification +] diff --git a/source/Willow/SingleSelectionListBoxWebView.class.st b/source/Willow/SingleSelectionListBoxWebView.class.st index b607c8d8..b049046c 100644 --- a/source/Willow/SingleSelectionListBoxWebView.class.st +++ b/source/Willow/SingleSelectionListBoxWebView.class.st @@ -29,7 +29,7 @@ SingleSelectionListBoxWebView class >> displayingAtOnce: aNumberOfElements apply { #category : #private } SingleSelectionListBoxWebView >> configure: select unselectingAllOn: aCanvas [ - ^ availableElements ifNotEmpty: [ DeselectAllOptionsCommand new applyTo: select on: aCanvas ] + ^ availableElements ifNotEmpty: [ select apply: DeselectAllOptionsCommand new ] ] { #category : #accessing } @@ -68,6 +68,7 @@ SingleSelectionListBoxWebView >> renderContentOn: aCanvas [ select callback: [ :element | self choose: element ]. identifierAssigner withAssignedIdentifierDo: [ :id | select id: id ]. chosenElementOptional withContentDo: [ :chosenElement | select selected: chosenElement ] ifUnused: [ self configure: select unselectingAllOn: aCanvas ]. - interactionInterpreter applyTo: select on: aCanvas. - commandToComponent applyTo: select on: aCanvas + select + interactUsing: interactionInterpreter; + apply: commandToComponent ] diff --git a/source/Willow/SynchronicSubmitButtonWebView.class.st b/source/Willow/SynchronicSubmitButtonWebView.class.st index f7a2921a..c970d8f3 100644 --- a/source/Willow/SynchronicSubmitButtonWebView.class.st +++ b/source/Willow/SynchronicSubmitButtonWebView.class.st @@ -61,8 +61,7 @@ SynchronicSubmitButtonWebView >> renderContentOn: aCanvas [ identifierAssigner withAssignedIdentifierDo: [ :id | submitButton id: id ]. submitButton callback: submitCallback; - value: label. - - interactionInterpreter applyTo: submitButton on: aCanvas. - commandToComponent applyTo: submitButton on: aCanvas + value: label; + interactUsing: interactionInterpreter; + apply: commandToComponent ] diff --git a/source/Willow/TableWebView.class.st b/source/Willow/TableWebView.class.st index 954c1808..69756b11 100644 --- a/source/Willow/TableWebView.class.st +++ b/source/Willow/TableWebView.class.st @@ -90,17 +90,13 @@ TableWebView >> onTrigger [ { #category : #rendering } TableWebView >> renderContentOn: aCanvas [ - | table | - - table := aCanvas table. - table id: (self identifyIn: aCanvas). - interactionInterpreter applyTo: table on: aCanvas. - commandToTable applyTo: table on: aCanvas. - - table + aCanvas table + id: (self identifyIn: aCanvas); + interactUsing: interactionInterpreter; with: [ aCanvas render: header. aCanvas tableBody: [ items doWithIndex: [ :item :index | self renderRowAt: index for: item on: aCanvas ] ]. aCanvas render: footer ] + applying: commandToTable ] { #category : #private } diff --git a/source/Willow/TableWebViewBuilder.class.st b/source/Willow/TableWebViewBuilder.class.st index 9461a6e1..3baa8843 100644 --- a/source/Willow/TableWebViewBuilder.class.st +++ b/source/Willow/TableWebViewBuilder.class.st @@ -24,6 +24,12 @@ TableWebViewBuilder >> addColumn: aMonadycBlock [ columnRenderers add: builder build ] +{ #category : #Configuring } +TableWebViewBuilder >> apply: aTableCommand [ + + tableCommand := tableCommand + aTableCommand +] + { #category : #Configuring } TableWebViewBuilder >> applyToEachRow: aRowCommand [ @@ -80,5 +86,5 @@ TableWebViewBuilder >> renderHeader [ { #category : #Configuring } TableWebViewBuilder >> styledWith: aCssClass [ - tableCommand := tableCommand + (ComponentClassificationCommand toStyleWith: aCssClass) + self apply: (ComponentClassificationCommand toStyleWith: aCssClass) ] diff --git a/source/Willow/TemporarilyDisablingCommand.class.st b/source/Willow/TemporarilyDisablingCommand.class.st index 927db54c..83a3f0a8 100644 --- a/source/Willow/TemporarilyDisablingCommand.class.st +++ b/source/Willow/TemporarilyDisablingCommand.class.st @@ -47,7 +47,8 @@ TemporarilyDisablingCommand >> componentToDisableOn: aCanvas [ { #category : #private } TemporarilyDisablingCommand >> disabledAttributeName [ - ^ WillowConstants disabledAttributeName + + ^ Constants >> #willow >> #disabledAttributeName ] { #category : #private } @@ -76,9 +77,9 @@ TemporarilyDisablingCommand >> priorityActions [ with: [ :anAsynchronousCall :aCanvas | anAsynchronousCall onComplete: - ((aCanvas jQuery class: WillowCssStyles disabledComponent) + ((aCanvas jQuery class: Classification >> #disabledComponent) attributeAt: self disabledAttributeName put: false; - removeClass: WillowCssStyles disabledComponent; + removeClass: Classification >> #disabledComponent; call: 'html' with: (aCanvas jQuery alias: self disabledComponentVariableName)) ] ] @@ -93,12 +94,11 @@ TemporarilyDisablingCommand >> serverIndependentActions [ ^ Array with: [ :script :canvas | - script - << ((self componentToDisableOn: canvas) html assignTo: self disabledComponentVariableName). + script << ((self componentToDisableOn: canvas) html assignTo: self disabledComponentVariableName). script << ((self componentToDisableOn: canvas) - addClass: WillowCssStyles disabledComponent; + addClass: Classification >> #disabledComponent; attributeAt: self disabledAttributeName put: true; html: viewWhileDisabled) ] ] diff --git a/source/Willow/TextFieldWebView.class.st b/source/Willow/TextFieldWebView.class.st index aa510792..082f1d52 100644 --- a/source/Willow/TextFieldWebView.class.st +++ b/source/Willow/TextFieldWebView.class.st @@ -116,6 +116,7 @@ TextFieldWebView >> renderContentOn: aCanvas [ callback: [ :aString | self changeContentsTo: aString ]. identifierAssigner withAssignedIdentifierDo: [ :id | component id: id ]. - commandToComponent applyTo: component on: aCanvas. - interactionInterpreter applyTo: component on: aCanvas + component + apply: commandToComponent; + interactUsing: interactionInterpreter ] diff --git a/source/Willow/UnorderedListWebView.class.st b/source/Willow/UnorderedListWebView.class.st index c9737270..a20ca574 100644 --- a/source/Willow/UnorderedListWebView.class.st +++ b/source/Willow/UnorderedListWebView.class.st @@ -59,7 +59,8 @@ UnorderedListWebView >> renderContentOn: aCanvas [ list := aCanvas unorderedList. "The order of the collaborations is relevant." identifierAssigner withAssignedIdentifierDo: [ :id | list id: id ]. - commandToList applyTo: list on: aCanvas. - interactionInterpreter applyTo: list on: aCanvas. - list with: [ elements do: [ :anElement | aCanvas render: (ListItemWebView itemizing: anElement containedIn: list applying: commandToItem) ] ] + list + apply: commandToList; + interactUsing: interactionInterpreter; + with: [ elements do: [ :anElement | aCanvas render: (ListItemWebView itemizing: anElement containedIn: list applying: commandToItem) ] ] ] diff --git a/source/Willow/WATagBrush.extension.st b/source/Willow/WATagBrush.extension.st new file mode 100644 index 00000000..b7823e3b --- /dev/null +++ b/source/Willow/WATagBrush.extension.st @@ -0,0 +1,21 @@ +Extension { #name : #WATagBrush } + +{ #category : #'*Willow' } +WATagBrush >> apply: aBlockOrComponentCommand [ + + aBlockOrComponentCommand asWebComponentCommand applyTo: self on: canvas +] + +{ #category : #'*Willow' } +WATagBrush >> interactUsing: anInteractionInterpreter [ + + anInteractionInterpreter applyTo: self on: canvas +] + +{ #category : #'*Willow' } +WATagBrush >> with: aRenderable applying: aBlockOrWebComponentCommand [ + + self + apply: aBlockOrWebComponentCommand; + with: aRenderable +] diff --git a/source/Willow/WebComponentCommand.class.st b/source/Willow/WebComponentCommand.class.st index d3224487..ccd285cd 100644 --- a/source/Willow/WebComponentCommand.class.st +++ b/source/Willow/WebComponentCommand.class.st @@ -4,6 +4,9 @@ Abstract for the component commands, each subclass should do a single change to Class { #name : #WebComponentCommand, #superclass : #GRObject, + #pools : [ + 'Willow' + ], #category : #'Willow-Frontend' } diff --git a/source/Willow/WebComponentCommandBuilder.class.st b/source/Willow/WebComponentCommandBuilder.class.st index b491a296..9dca38ca 100644 --- a/source/Willow/WebComponentCommandBuilder.class.st +++ b/source/Willow/WebComponentCommandBuilder.class.st @@ -140,9 +140,13 @@ WebComponentCommandBuilder >> setPlaceholderTo: aSuggestion [ ] { #category : #Building } -WebComponentCommandBuilder >> setStyleTo: aBlockClosure [ +WebComponentCommandBuilder >> setStyleTo: aDeclarationAction [ - ^ SetComponentStyleCommand setting: (aBlockClosure value: CssDeclarationBlock new) + | declarationBlock | + + declarationBlock := CssDeclarationBlock new. + aDeclarationAction cull: declarationBlock cull: RenoirSt constants. + ^ SetComponentStyleCommand setting: declarationBlock ] { #category : #Building } diff --git a/source/Willow/WebInteractionCommand.class.st b/source/Willow/WebInteractionCommand.class.st index 40662df6..dc568406 100644 --- a/source/Willow/WebInteractionCommand.class.st +++ b/source/Willow/WebInteractionCommand.class.st @@ -1,6 +1,9 @@ Class { #name : #WebInteractionCommand, #superclass : #Object, + #pools : [ + 'Willow' + ], #category : #'Willow-WebInteraction' } diff --git a/source/Willow/WebTableColumnRenderer.class.st b/source/Willow/WebTableColumnRenderer.class.st index 3316b140..11ea6589 100644 --- a/source/Willow/WebTableColumnRenderer.class.st +++ b/source/Willow/WebTableColumnRenderer.class.st @@ -41,31 +41,17 @@ WebTableColumnRenderer >> initializeTitled: aTitle applyingToEachCell: aCommandT { #category : #rendering } WebTableColumnRenderer >> renderCellAt: anIndex for: anItem on: aCanvas [ - | tableData | - - tableData := aCanvas tableData. - commandToCell applyTo: tableData on: aCanvas. - tableData with: (renderingCommand cull: anItem cull: anIndex) + aCanvas tableData with: (renderingCommand cull: anItem cull: anIndex) applying: commandToCell ] { #category : #rendering } WebTableColumnRenderer >> renderFooterCellSummarizing: tableContents on: aCanvas [ - | cell | - - cell := aCanvas tableData. - commandToCell applyTo: cell on: aCanvas. - commandToFooterCell applyTo: cell on: aCanvas. - cell with: (footerRenderingCommand cull: tableContents) + aCanvas tableData with: (footerRenderingCommand cull: tableContents) applying: commandToCell + commandToFooterCell ] { #category : #rendering } WebTableColumnRenderer >> renderHeadingOn: aCanvas [ - | heading | - - heading := aCanvas tableHeading. - commandToCell applyTo: heading on: aCanvas. - commandToHeading applyTo: heading on: aCanvas. - heading with: title + aCanvas tableHeading with: title applying: commandToCell + commandToHeading ] diff --git a/source/Willow/Willow.class.st b/source/Willow/Willow.class.st new file mode 100644 index 00000000..0f9e7c45 --- /dev/null +++ b/source/Willow/Willow.class.st @@ -0,0 +1,63 @@ +" +I'm a shared pool providing access to constants and classes defined by the lilbrary +" +Class { + #name : #Willow, + #superclass : #SharedPool, + #classVars : [ + 'Classification', + 'Constants' + ], + #pools : [ + 'RenoirSt' + ], + #category : #'Willow-Frontend' +} + +{ #category : #accessing } +Willow class >> classification [ + + ^ Classification +] + +{ #category : #accessing } +Willow class >> constants [ + + ^ Constants +] + +{ #category : #initialization } +Willow class >> initialize [ + + + self initializeConstants. + self initializeClasses +] + +{ #category : #'private - initialization' } +Willow class >> initializeClasses [ + + + Classification := Namespace new. + Classification + bind: #fadingNotification to: 'willow-fading-notification'; + bind: #loading to: 'willow-loading'; + bind: #dialogContainer to: 'willow-dialog-container'; + bind: #willow to: 'willow'; + bind: #disabledComponent to: 'willow-disabled-component' +] + +{ #category : #initialization } +Willow class >> initializeConstants [ + + + Constants := Namespace new. + Constants bind: #css to: CssConstants. + Constants bind: #willow to: Namespace new. + (Constants >> #willow) + bind: #callServerFunctionName to: 'callServer'; + bind: #disabledAttributeName to: 'disabled'; + bind: #handleAjaxErrorCallFunctionName to: 'handleAjaxErrorCall'; + bind: #notificationSectionName to: 'willow-notification-section'; + bind: #dialogSectionName to: 'willow-dialog-section' +] diff --git a/source/Willow/WillowApplication.class.st b/source/Willow/WillowApplication.class.st index bfd0f32e..05d8e22b 100644 --- a/source/Willow/WillowApplication.class.st +++ b/source/Willow/WillowApplication.class.st @@ -4,6 +4,9 @@ I'm a basic Willow application providing some guidance to the developers. Class { #name : #WillowApplication, #superclass : #WAComponent, + #pools : [ + 'Willow' + ], #category : #'Willow-Applications' } @@ -127,9 +130,9 @@ WillowApplication >> renderDialogAndNotificationSectionsOn: aCanvas [ "Render dialog and notification sections. These are needed for the dialog and notification support." aCanvas div - id: WillowConstants dialogSectionName; - class: WillowCssStyles dialogContainer. - aCanvas div id: WillowConstants notificationSectionName + id: Constants >> #willow >> #dialogSectionName; + apply: [ :div | div addClass dialogContainer ]. + aCanvas div id: Constants >> #willow >> #notificationSectionName ] { #category : #accessing } diff --git a/source/Willow/WillowComponentBuilder.class.st b/source/Willow/WillowComponentBuilder.class.st index 36b20042..9f96093f 100644 --- a/source/Willow/WillowComponentBuilder.class.st +++ b/source/Willow/WillowComponentBuilder.class.st @@ -4,6 +4,9 @@ I'm an abstract subclass for component builders Class { #name : #WillowComponentBuilder, #superclass : #GRObject, + #pools : [ + 'Willow' + ], #category : #'Willow-WebViews' } diff --git a/source/Willow/WillowConstants.class.st b/source/Willow/WillowConstants.class.st deleted file mode 100644 index 8c29d8b8..00000000 --- a/source/Willow/WillowConstants.class.st +++ /dev/null @@ -1,37 +0,0 @@ -" -I provide useful constants -" -Class { - #name : #WillowConstants, - #superclass : #Object, - #category : #'Willow-WebInteraction' -} - -{ #category : #Accessing } -WillowConstants class >> callServerFunctionName [ - - ^ 'callServer' -] - -{ #category : #'Accessing Well Known Ids' } -WillowConstants class >> dialogSectionName [ - - ^'willow-dialog-section' -] - -{ #category : #Accessing } -WillowConstants class >> disabledAttributeName [ - - ^ 'disabled' -] - -{ #category : #Accessing } -WillowConstants class >> handleAjaxErrorCallFunctionName [ - - ^ 'handleAjaxErrorCall' -] - -{ #category : #'Accessing Well Known Ids' } -WillowConstants class >> notificationSectionName [ - ^ 'willow-notification-section' -] diff --git a/source/Willow/WillowConstantsProvider.class.st b/source/Willow/WillowConstantsProvider.class.st deleted file mode 100644 index 88724aa6..00000000 --- a/source/Willow/WillowConstantsProvider.class.st +++ /dev/null @@ -1,32 +0,0 @@ -" -I'm an entry point providing access to several constants -" -Class { - #name : #WillowConstantsProvider, - #superclass : #GRObject, - #category : #'Willow-Frontend' -} - -{ #category : #Accessing } -WillowConstantsProvider >> css [ - - ^ CssConstants -] - -{ #category : #Accessing } -WillowConstantsProvider >> cssFonts [ - - ^ CssFontConstants -] - -{ #category : #Accessing } -WillowConstantsProvider >> cssMediaQuery [ - - ^ CssMediaQueryConstants -] - -{ #category : #Accessing } -WillowConstantsProvider >> willow [ - - ^ WillowConstants -] diff --git a/source/Willow/WillowCssStyles.class.st b/source/Willow/WillowCssStyles.class.st deleted file mode 100644 index 3dd54772..00000000 --- a/source/Willow/WillowCssStyles.class.st +++ /dev/null @@ -1,38 +0,0 @@ -" -All the Willow specific Css classes -" -Class { - #name : #WillowCssStyles, - #superclass : #Object, - #category : #'Willow-WebViews' -} - -{ #category : #'accessing - general' } -WillowCssStyles class >> dialogContainer [ - - ^'willow-dialog-container' -] - -{ #category : #'accessing - general' } -WillowCssStyles class >> disabledComponent [ - - ^'willow-disabled-component' -] - -{ #category : #'accessing - general' } -WillowCssStyles class >> fadingNotification [ - - ^'willow-fading-notification' -] - -{ #category : #'accessing - general' } -WillowCssStyles class >> loading [ - - ^'willow-loading' -] - -{ #category : #'accessing - general' } -WillowCssStyles class >> willow [ - - ^'willow' -] diff --git a/source/Willow/WillowJavascriptNamespace.class.st b/source/Willow/WillowJavascriptNamespace.class.st index 7f8b76ab..2d30c408 100644 --- a/source/Willow/WillowJavascriptNamespace.class.st +++ b/source/Willow/WillowJavascriptNamespace.class.st @@ -10,13 +10,13 @@ Class { { #category : #Accessing } WillowJavascriptNamespace >> callServerFunction [ - ^ self access: WillowConstants callServerFunctionName + ^ self access: self constants >> #willow >> #callServerFunctionName ] { #category : #Accessing } WillowJavascriptNamespace >> handleAjaxErrorCallFunction [ - ^ self access: WillowConstants handleAjaxErrorCallFunctionName + ^ self access: self constants >> #willow >> #handleAjaxErrorCallFunctionName ] { #category : #printing } diff --git a/source/Willow/WillowNamespaceFileMetadataLibrary.class.st b/source/Willow/WillowNamespaceFileMetadataLibrary.class.st index f88ff646..c07b588d 100644 --- a/source/Willow/WillowNamespaceFileMetadataLibrary.class.st +++ b/source/Willow/WillowNamespaceFileMetadataLibrary.class.st @@ -4,6 +4,9 @@ I'm a library providing some basic object used to define and access some utility Class { #name : #WillowNamespaceFileMetadataLibrary, #superclass : #WADeploymentAwareFileMetadataLibrary, + #pools : [ + 'Willow' + ], #category : #'Willow-Libraries' } @@ -123,9 +126,9 @@ WillowNamespaceFileMetadataLibrary >> willowDefaults [ ^ GRSmallDictionary new at: 'version' put: self version; - at: WillowConstants handleAjaxErrorCallFunctionName + at: Constants >> #willow >> #handleAjaxErrorCallFunctionName put: self defaultHandleAjaxErrorCallFunction; - at: WillowConstants callServerFunctionName put: self callServerFunction; + at: Constants >> #willow >> #callServerFunctionName put: self callServerFunction; yourself ] diff --git a/source/Willow/WillowServerCall.class.st b/source/Willow/WillowServerCall.class.st index 8ddc467a..576da1b0 100644 --- a/source/Willow/WillowServerCall.class.st +++ b/source/Willow/WillowServerCall.class.st @@ -19,5 +19,5 @@ WillowServerCall >> arguments [ { #category : #accessing } WillowServerCall >> method [ - ^ WillowConstants callServerFunctionName + ^ self constants >> #willow >> #callServerFunctionName ]