From Squeak3.9 on 5 September 2007 at 6:02:46 pm <version>SeasideAsync2.7-mb.72.mcz 5 September 2007 6:02:23 pm</version> <class> <name>WAAsyncComponent</name> <environment>Seaside</environment> <super>Seaside.WAComponent</super> <private>false</private> none <imports></imports> <category>SeasideAsync-Rendering</category> <attributes> <package>SeasideAsync-Rendering</package> </attributes> </class> <class> <name>WAAsyncHtmlRenderer</name> <environment>Seaside</environment> <super>Seaside.WAHtmlRenderer</super> <private>false</private> none <imports></imports> <category>SeasideAsync-Renderers</category> <attributes> <package>SeasideAsync-Renderers</package> </attributes> </class> <class> <name>WAAsyncRenderCanvas</name> <environment>Seaside</environment> <super>Seaside.WARenderCanvas</super> <private>false</private> none <imports></imports> <category>SeasideAsync-Renderers</category> <attributes> <package>SeasideAsync-Renderers</package> </attributes> </class> <class> <name>WAAsyncScripts</name> <environment>Seaside</environment> <super>Seaside.WAFileLibrary</super> <private>false</private> none <imports></imports> <category>SeasideAsync-Libraries</category> <attributes> <package>SeasideAsync-Libraries</package> </attributes> </class> <class> <name>WAAutoCompleteEntryField</name> <environment>Seaside</environment> <super>Seaside.WAAsyncComponent</super> <private>false</private> none callback selectedObject listHeight name listWidth stringsToObjects strings prefix selectedString <imports></imports> <category>SeasideAsync-Widgets</category> <attributes> <package>SeasideAsync-Widgets</package> </attributes> </class> <comment> Seaside.WAAutoCompleteEntryField
This widget is a contribution from Anthony Lander (anthony@etherealplanet.org)
</comment> <class> <name>WAAutoCompleteTest</name> <environment>Seaside</environment> <super>Seaside.WAAsyncComponent</super> <private>false</private> none autocomplete inputValue inputValueComplete selectedClass <imports></imports> <category>SeasideAsync-Tests</category> <attributes> <package>SeasideAsync-Tests</package> </attributes> </class> <class> <name>WACanvasFocusTest</name> <environment>Seaside</environment> <super>Seaside.WAAsyncComponent</super> <private>false</private> none log cbValue selected radioValue <imports></imports> <category>SeasideAsync-Tests</category> <attributes> <package>SeasideAsync-Tests</package> </attributes> </class> <class> <name>WACanvasLiveRequestTest</name> <environment>Seaside</environment> <super>Seaside.WAAsyncComponent</super> <private>false</private> none input1 input2 selection count bool country province city date booleans time multiSelected nSelection selectedCurrency selectedCountry <imports></imports> <category>SeasideAsync-Tests</category> <attributes> <package>SeasideAsync-Tests</package> </attributes> </class> <class> <name>WACanvasPeriodicLiveRequestTest</name> <environment>Seaside</environment> <super>Seaside.WAAsyncComponent</super> <private>false</private> none log <imports></imports> <category>SeasideAsync-Tests</category> <attributes> <package>SeasideAsync-Tests</package> </attributes> </class> <class> <name>WAClassBrowserDialogDecoration</name> <environment>Seaside</environment> <super>Seaside.WADecoration</super> <private>false</private> none <imports></imports> <category>SeasideAsync-Browser</category> <attributes> <package>SeasideAsync-Browser</package> </attributes> </class> <class> <name>WAClassBrowserPane</name> <environment>Seaside</environment> <super>Seaside.WAAsyncComponent</super> <private>false</private> none componentName main <imports></imports> <category>SeasideAsync-Browser</category> <attributes> <package>SeasideAsync-Browser</package> </attributes> </class> <class> <name>WAClassBrowserLeftPane</name> <environment>Seaside</environment> <super>Seaside.WAClassBrowserPane</super> <private>false</private> none <imports></imports> <category>SeasideAsync-Browser</category> <attributes> <package>SeasideAsync-Browser</package> </attributes> </class> <class> <name>WAClassBrowserRightPane</name> <environment>Seaside</environment> <super>Seaside.WAClassBrowserPane</super> <private>false</private> none <imports></imports> <category>SeasideAsync-Browser</category> <attributes> <package>SeasideAsync-Browser</package> </attributes> </class> <class> <name>WAClassBrowserSourcePane</name> <environment>Seaside</environment> <super>Seaside.WAClassBrowserPane</super> <private>false</private> none sourceCode <imports></imports> <category>SeasideAsync-Browser</category> <attributes> <package>SeasideAsync-Browser</package> </attributes> </class> <class> <name>WAFocusTest</name> <environment>Seaside</environment> <super>Seaside.WAAsyncComponent</super> <private>false</private> none log cbValue selected <imports></imports> <category>SeasideAsync-Tests</category> <attributes> <package>SeasideAsync-Tests</package> </attributes> </class> <class> <name>WAFullClassBrowser</name> <environment>Seaside</environment> <super>Seaside.WAAsyncComponent</super> <private>false</private> none leftComponents left rightComponents right bottom isReadOnly message browser contents <imports></imports> <category>SeasideAsync-Browser</category> <attributes> <package>SeasideAsync-Browser</package> </attributes> </class> <class> <name>WALiveActionCallback</name> <environment>Seaside</environment> <super>Seaside.WAActionCallback</super> <private>false</private> none rendererClass callbacks <imports></imports> <category>SeasideAsync-Rendering</category> <attributes> <package>SeasideAsync-Rendering</package> </attributes> </class> <comment> Seaside.WALiveActionCallback
This idea is from Radoslav Hodnicak (rh@4096.sk) Apparently the way LiveUpdate is built currently(SeasideAsync-mb.23), the live callbacks have a different session step (_k) than the rest of the page, i.e. a new continuation for each live callback. If you generate enough of them, then the original page gets pushed so far back in the history that it blows the cache. Rado's changes fix this problem by processing live callbacks in the same way normal callbacks are processed, instead of treating them as separate continuations. The changes are activated in WAHtmlRenderer and WARenderCanvas by sending #urlForLiveAction: rather than #urlForLiveRequest: The old behavior can be restored by sending #urlForLiveRequest: rather than #urlForLiveAction:
</comment> <class> <name>WALiveDateInput</name> <environment>Seaside</environment> <super>Seaside.WADateInput</super> <private>false</private> none <imports></imports> <category>SeasideAsync-Renderers</category> <attributes> <package>SeasideAsync-Renderers</package> </attributes> </class> <class> <name>WALiveEvent</name> <environment>Seaside</environment> <super>Core.Object</super> <private>false</private> none type when elementTagName elementId elementValue elementType <imports></imports> <category>SeasideAsync-Rendering</category> <attributes> <package>SeasideAsync-Rendering</package> </attributes> </class> <class> <name>WALiveRequestTest</name> <environment>Seaside</environment> <super>Seaside.WAAsyncComponent</super> <private>false</private> none input1 input2 input3 date selection count bool country province city booleans multiSelected <imports></imports> <category>SeasideAsync-Tests</category> <attributes> <package>SeasideAsync-Tests</package> </attributes> </class> <class> <name>WALiveTimeInput</name> <environment>Seaside</environment> <super>Seaside.WATimeInput</super> <private>false</private> none <imports></imports> <category>SeasideAsync-Renderers</category> <attributes> <package>SeasideAsync-Renderers</package> </attributes> </class> <class> <name>WAPeriodicLiveRequestTest</name> <environment>Seaside</environment> <super>Seaside.WAAsyncComponent</super> <private>false</private> none log <imports></imports> <category>SeasideAsync-Tests</category> <attributes> <package>SeasideAsync-Tests</package> </attributes> </class> <class> <name>WAPermissiveBrowser</name> <environment>Seaside</environment> <super>Browser</super> <private>false</private> none component <imports></imports> <category>SeasideAsync-Browser</category> <attributes> <package>SeasideAsync-Browser</package> </attributes> </class> <class> <name>WAUnknownVariable</name> <environment>Seaside</environment> <super>Error</super> <private>false</private> none varName <imports></imports> <category>SeasideAsync-Browser</category> <attributes> <package>SeasideAsync-Browser</package> </attributes> </class> <class> <name>WAXmlRoot</name> <environment>Seaside</environment> <super>Seaside.WAHtmlRoot</super> <private>false</private> none <imports></imports> <category>SeasideAsync-Rendering</category> <attributes> <package>SeasideAsync-Rendering</package> </attributes> </class> <class> <name>WAXmlStreamDocument</name> <environment>Seaside</environment> <super>Seaside.WAHtmlStreamDocument</super> <private>false</private> none <imports></imports> <category>SeasideAsync-Rendering</category> <attributes> <package>SeasideAsync-Rendering</package> </attributes> </class> <methods> Seaside.WABrowser class <category>*seasideAsync</category>
fullOnClass: aClass selector: aSelector "Substitute a more modern browser" ^Seaside.WAFullClassBrowser fullOnClass: aClass selector: aSelector
</methods> <methods> Seaside.WATagBrush <category>*seasideasync</category>
forEvent: aString callback: callback | uri | callback fixCallbackTemps. uri := canvas urlForLiveAction: [:event :renderer | callback numArgs = 0 ifTrue: [callback value] ifFalse: [callback numArgs = 1 ifTrue: [callback value: event] ifFalse: [callback value: event value: renderer]]]. self attributes at: aString append: 'liveEventTrackerUri(event,' , (canvas encode: uri asString) printString , ')' separator: ';'
</methods> <methods> Seaside.WATagBrush <category>*seasideasync</category>
onClickCallback: aBlock self forEvent: 'onclick' callback: aBlock
</methods> <methods> Seaside.WATagBrush <category>*seasideasync</category>
onFocusCallback: aBlock self forEvent: 'onfocus' callback: aBlock
</methods> <methods> Seaside.WATagBrush <category>*seasideasync</category>
refreshWith: liveBlock every: aDuration " I refresh myself every aDuration with aBlock. No overlapping executions will take place, the next refresh is only scheduled after the block finished executing " | uri id | id := self ensureId. liveBlock fixCallbackTemps. uri := canvas urlForLiveAction: [ :event :renderer | (renderer tag: self tag) id: id; with: [liveBlock value: event value: renderer].]. self session addLoadScript: 'timedUpdate(' , (canvas encode: uri asString) printString , ', ' , aDuration asMilliSeconds printString , ')'
</methods> <methods> Seaside.WASelectTag <category>*seasideasync</category>
liveCallback: liveBlock | uri id | id := self ensureId. liveBlock fixCallbackTemps. uri := canvas urlForLiveAction: [:event :h | | adjustedList values value | adjustedList := self isOptional ifTrue: [#(nil) , list] ifFalse: [list]. values := event value asArray collect: [:each | adjustedList at: each asInteger]. self isMultiple ifTrue: [liveBlock value: values value: h] ifFalse: [value := values isEmpty ifTrue: [nil] ifFalse: [values first]. liveBlock value: value value: h]]. self session addLoadScript: 'document.getElementById(' , id asString printString , ').onchange = liveSelect(' , id asString printString , ',' , (canvas encode: uri asString) printString , ')'
</methods> <methods> Seaside.WAAbstractTextAreaTag <category>*seasideasync</category>
liveCallback: liveBlock | uri id | id := self ensureId. liveBlock fixCallbackTemps. uri := canvas urlForLiveAction: [:event :h | liveBlock value: event value value: h]. self session addLoadScript: 'liveSearch(' , id asString printString , ',' , (canvas encode: uri asString) printString , ')'.
</methods> <methods> Seaside.WACheckboxTag <category>*seasideasync</category>
liveCallback: liveBlock | uri id | id := self ensureId. liveBlock fixCallbackTemps. uri := canvas urlForLiveAction: [:event :h | liveBlock value: event valueAsBoolean value: h]. self session addLoadScript: 'document.getElementById(' , id asString printString , ').onclick = liveCheck(' , id asString printString , ',' , (canvas encode: uri asString) printString , ')'
</methods> <methods> Seaside.WARadioButtonTag <category>*seasideasync</category>
liveCallback: liveBlock | uri id | id := self ensureId. liveBlock fixCallbackTemps. uri := canvas urlForLiveAction: [:event :h | liveBlock value: event valueAsBoolean value: h]. self session addLoadScript: 'document.getElementById(' , id asString printString , ').onclick = liveCheck(' , id asString printString , ',' , (canvas encode: uri asString) printString , ')'
</methods> <methods> Seaside.WASubmitButtonTag <category>*seasideasync</category>
liveCallback: liveBlock liveBlock fixCallbackTemps. self onClickCallback: [:event :h | liveBlock value: h]. self onClick: 'return false'
</methods> <methods> Seaside.WAAnchorTag <category>*seasideasync</category>
liveCallback: liveBlock liveBlock fixCallbackTemps. self onClickCallback: [:event :h | liveBlock value: h]. self onClick: 'return false'
</methods> <methods> Seaside.WACompound <category>*seasideasync</category>
hasLiveCallback ^self liveCallback notNil
</methods> <methods> Seaside.WACompound <category>*seasideasync</category>
liveCallback ^properties at: #liveCallback ifAbsent: [nil]
</methods> <methods> Seaside.WACompound <category>*seasideasync</category>
liveCallback: aBlock properties at: #liveCallback put: aBlock
</methods> <methods> Seaside.WACallbackRegistry <category>*seasideasync</category>
registerLiveActionCallback: aBlock renderer: aRenderer ^self storeCallback: (Seaside.WALiveActionCallback new block: aBlock; rendererClass: aRenderer class; callbacks: self)
</methods> <methods> Seaside.WARenderedHtmlRoot <category>*seasideasync</category>
scripts ^scripts
</methods> <methods> Seaside.WARequest <category>*SeasideAsync</category>
isLiveRequest ^ (self headerAt: 'x-requested-by') = 'SeasideAsync'
</methods> <methods> Seaside.WAAsyncComponent <category>rendering</category>
rendererClass ^WAAsyncHtmlRenderer
</methods> <methods> Seaside.WAAsyncHtmlRenderer <category>private</category>
forEvent: aString callback: callback | uri | callback fixCallbackTemps. uri := self urlForLiveAction: [:event :renderer | callback numArgs = 0 ifTrue: [callback value] ifFalse: [callback numArgs = 1 ifTrue: [callback value: event] ifFalse: [callback value: event value: renderer]]]. self attributes at: aString append: 'liveEventTrackerUri(event,' , (self class encode: uri asString) printString , ')' separator: ';'
</methods> <methods> Seaside.WAAsyncHtmlRenderer <category>public api</category>
refreshDivWith: liveBlock every: aDuration "Convenience method if you do not want/need to supply the css id of the refreshing div" self refreshDivNamed: self ensureId with: liveBlock every: aDuration
</methods> <methods> Seaside.WAAsyncHtmlRenderer <category>public api</category>
checkboxWithValue: aBoolean callback: callbackBlock liveCallback: liveBlock | uri id | id := self ensureId. self checkboxWithValue: aBoolean callback: callbackBlock. liveBlock fixCallbackTemps. uri := self urlForLiveAction: [:event :h | liveBlock value: event valueAsBoolean value: h]. self script: 'document.getElementById(' , id asString printString , ').onclick = liveCheck(' , id asString printString , ',' , (self class encode: uri asString) printString , ')'
</methods> <methods> Seaside.WAAsyncHtmlRenderer <category>public api</category>
refreshDivNamed: divName with: liveBlock every: aDuration self divNamed: divName with: [] refreshWith: liveBlock every: aDuration
</methods> <methods> Seaside.WAAsyncHtmlRenderer <category>public api</category>
onClickCallback: callback self forEvent: 'onclick' callback: callback
</methods> <methods> Seaside.WAAsyncHtmlRenderer <category>xml</category>
spaceEntity ^'&#160;'
</methods> <methods> Seaside.WAAsyncHtmlRenderer <category>public api</category>
textAreaWithCallback: callbackBlock liveCallback: liveBlock self textAreaWithValue: '' callback: callbackBlock liveCallback: liveBlock
</methods> <methods> Seaside.WAAsyncHtmlRenderer <category>public api</category>
selectFromList: aCollection selected: anObject callback: callbackBlock labels: labelsBlock liveCallback: liveBlock | uri id items isMultiple | id := self ensureId. items := aCollection asArray. isMultiple := (self attributes at: 'multiple') notNil. self selectFromList: items selected: anObject callback: callbackBlock labels: labelsBlock. liveBlock fixCallbackTemps. uri := self urlForLiveAction: [:event :h | | values value | values := event value asArray collect: [:each | items at: each asInteger]. isMultiple ifTrue: [liveBlock value: values value: h] ifFalse: [value := values isEmpty ifFalse: [values first]. liveBlock value: value value: h]]. self script: 'document.getElementById(' , id asString printString , ').onchange = liveSelect(' , id asString printString , ',' , (self class encode: uri asString) printString , ')'
</methods> <methods> Seaside.WAAsyncHtmlRenderer <category>public api</category>
selectFromList: aCollection selected: anObject callback: aBlock labels: labelBlock other: otherBlock label: aString | id other | id := 'id', self context advanceKey displayString. other := (self context nextKey asNumber + aCollection size + 1) displayString. self attributes onChange: 'if(this.value == ', other printString, ') {document.getElementById(', id printString, ').style.display = "inline"; document.getElementById(', id printString, ').focus()} else {document.getElementById(', id printString, ').style.display = "none"}'. self selectFromList: (aCollection asArray copyWith: aString) selected: anObject callback: [:v | v = aString ifFalse: [aBlock value: v]] labels: [:ea | ea = aString ifTrue: [aString] ifFalse: [labelBlock value: ea]]. self space. self cssId: id. self attributes style: 'display: none'. self textInputWithValue: nil callback: [:v | v ifNotNil: [otherBlock value: v]]
</methods> <methods> Seaside.WAAsyncHtmlRenderer <category>private</category>
urlForLiveAction: actionBlock | url | url := context actionUrl withParameter: (self callbacks registerLiveActionCallback: actionBlock renderer: self). ^url asString
</methods> <methods> Seaside.WAAsyncHtmlRenderer <category>public api</category>
radioButtonInGroup: radioGroupKey selected: aBoolean callback: callbackBlock liveCallback: liveBlock | uri id | id := self ensureId. self radioButtonInGroup: radioGroupKey selected: aBoolean callback: callbackBlock. liveBlock fixCallbackTemps. uri := self urlForLiveAction: [:event :h | liveBlock value: event valueAsBoolean value: h]. self script: 'document.getElementById(' , id asString printString , ').onclick = liveCheck(' , id asString printString , ',' , (self class encode: uri asString) printString , ')'
</methods> <methods> Seaside.WAAsyncHtmlRenderer <category>public api</category>
dateInputWithValue: aDate callback: aBlock liveCallback: liveBlock | day month year | aBlock fixCallbackTemps. day := aDate dayOfMonth. month := aDate monthIndex. year := aDate year. self selectFromList: (1 to: 12) selected: month callback: [:v | month := v] labels: [:ea | Date nameOfMonth: ea] liveCallback: [:v :h | month := v. liveBlock value: (self makeDateWithDay: day monthNumber: month year: year) value: h]. self space. (self attributes) at: 'size' put: 2; at: 'maxlength' put: 2. self textInputWithValue: day callback: [:v | day := v] liveCallback: [:v :h | day := v. liveBlock value: (self makeDateWithDay: day monthNumber: month year: year) value: h]. self space. (self attributes) at: 'size' put: 4; at: 'maxlength' put: 4. self textInputWithValue: year callback: [:v | year := v] liveCallback: [:v :h | year := v. liveBlock value: (self makeDateWithDay: day monthNumber: month year: year) value: h]. self hiddenInputWithCallback: [aBlock value: (self makeDateWithDay: day monthNumber: month year: year)]
</methods> <methods> Seaside.WAAsyncHtmlRenderer <category>private</category>
makeDateWithDay: day monthNumber: month year: year ^Date newDay: (day min: (Date daysInMonth: month forYear: year)) monthNumber: month year: year
</methods> <methods> Seaside.WAAsyncHtmlRenderer <category>public api</category>
textAreaWithValue: value callback: callbackBlock liveCallback: liveBlock | uri id liveCallback | id := self ensureId. self textAreaWithValue: value callback: callbackBlock. liveBlock fixCallbackTemps. liveCallback := self fromStringLiveConverterBlockFor: value callback: liveBlock. uri := self urlForLiveAction: liveCallback. self script: 'liveSearch(' , id asString printString , ',' , (self class encode: uri asString) printString , ')'.
</methods> <methods> Seaside.WAAsyncHtmlRenderer <category>public api</category>
divNamed: divName with: aBlock refreshWith: liveBlock every: aDuration self refreshElementNamed: divName createElementWith: #divNamed:with: with: aBlock refreshWith: liveBlock every: aDuration
</methods> <methods> Seaside.WAAsyncHtmlRenderer <category>public api</category>
refreshSpanNamed: spanName with: liveBlock every: aDuration self spanNamed: spanName with: [] refreshWith: liveBlock every: aDuration
</methods> <methods> Seaside.WAAsyncHtmlRenderer <category>public api</category>
anchorWithAction: actionBlock liveAction: liveBlock text: aString self anchorWithAction: actionBlock liveAction: liveBlock do: aString.
</methods> <methods> Seaside.WAAsyncHtmlRenderer <category>public api</category>
anchorWithAction: actionBlock liveAction: liveBlock do: aString | uri id | id := self ensureId. self anchorWithAction: actionBlock do: aString. liveBlock fixCallbackTemps. uri := self urlForLiveAction: [:event :h | liveBlock value: h]. self script: 'document.getElementById(' , id asString printString , ').onclick = liveUpdaterUri(' , (self class encode: uri asString) printString , ')'
</methods> <methods> Seaside.WAAsyncHtmlRenderer <category>public api</category>
textInputWithValue: value callback: callbackBlock liveCallback: liveBlock | uri id liveCallback | id := self ensureId. self textInputWithValue: value callback: callbackBlock. liveBlock fixCallbackTemps. liveCallback := self fromStringLiveConverterBlockFor: value callback: liveBlock. uri := self urlForLiveAction: liveCallback. self script: 'liveSearch(' , id asString printString , ',' , (self class encode: uri asString) printString , ')'.
</methods> <methods> Seaside.WAAsyncHtmlRenderer <category>public api</category>
textInputWithCallback: callbackBlock liveCallback: liveBlock self textInputWithValue: '' callback: callbackBlock liveCallback: liveBlock
</methods> <methods> Seaside.WAAsyncHtmlRenderer <category>public api</category>
spanNamed: spanName with: aBlock refreshWith: liveBlock every: aDuration self refreshElementNamed: spanName createElementWith: #spanNamed:with: with: aBlock refreshWith: liveBlock every: aDuration
</methods> <methods> Seaside.WAAsyncHtmlRenderer <category>public api</category>
submitButtonWithAction: actionBlock liveAction: liveBlock text: aString self attributeAt: 'value' put: aString. self submitButtonWithAction: actionBlock liveAction: liveBlock
</methods> <methods> Seaside.WAAsyncHtmlRenderer <category>public api</category>
refreshSpanWith: liveBlock every: aDuration "Convenience method if you do not want/need to supply the css id of the refreshing span" self refreshSpanNamed: self ensureId with: liveBlock every: aDuration
</methods> <methods> Seaside.WAAsyncHtmlRenderer <category>public api</category>
submitButtonWithAction: actionBlock liveAction: liveBlock | uri id | id := self ensureId. self submitButtonWithAction: actionBlock. liveBlock fixCallbackTemps. uri := self urlForLiveAction: [:event :h | liveBlock value: h]. self script: 'document.getElementById(' , id asString printString , ').onclick = liveUpdaterUri(' , (self class encode: uri asString) printString , ')'
</methods> <methods> Seaside.WAAsyncHtmlRenderer <category>public api</category>
refreshElementNamed: elementName createElementWith: aSymbol with: aBlock refreshWith: liveBlock every: aDuration "Private method to creates an element using aSymbol that executes and displays the result of liveBlock in intervals of aDuration. The interval starts at the end of execution: if liveBlock is time consuming, the next execution will happen aDuration later. No overlapping refreshes will occur. See #refreshDivWith:every: and refreshSpanWith:" | uri | self perform: aSymbol with: elementName with: aBlock. liveBlock fixCallbackTemps. uri := self urlForLiveAction: [ :event :h | event elementId: elementName. h perform: aSymbol with: elementName with: [liveBlock value: event value: h]]. WACurrentSession value addLoadScript: 'timedUpdate(' , (self class encode: uri asString) printString , ', ' , aDuration asMilliSeconds printString , ')'
</methods> <methods> Seaside.WAAsyncHtmlRenderer <category>private</category>
fromStringLiveConverterBlockFor: anObject callback: aBlock ^ [:event :h | | text | text := event value. aBlock value: ( [anObject convertSeasideString: text] on: Error do: [:e | text ] ) value: h ]
</methods> <methods> Seaside.WAAsyncHtmlRenderer <category>public api</category>
scrollbarWithHeight: heightNumber size: sizeNumber liveCallback: liveBlock | id uri | id := self ensureId. self attributeAt: 'style' put: 'position: relative; left: -3px; width: 19px; overflow: auto; height: ' , heightNumber displayString , 'px'. self div: [self attributeAt: 'style' put: 'width: 1px; height: ', sizeNumber displayString, 'px'. self div: '']. liveBlock fixCallbackTemps. uri := self urlForLiveAction: [:event :h | liveBlock value: event value asInteger value: h]. self script: 'document.getElementById(' , id asString printString , ').onscroll = liveScroll(' , id asString printString , ', ' , (self class encode: uri asString) printString , ')'
</methods> <methods> Seaside.WAAsyncHtmlRenderer <category>public api</category>
onFocusCallback: callback self forEvent: 'onfocus' callback: callback
</methods> <methods> Seaside.WAAsyncRenderCanvas <category>encoding</category>
encode: anObject ^ WAAsyncHtmlRenderer encode: anObject
</methods> <methods> Seaside.WAAsyncRenderCanvas <category>form-elements</category>
timeInput ^ self brush: WALiveTimeInput new
</methods> <methods> Seaside.WAAsyncRenderCanvas <category>form-elements</category>
dateInput ^ self brush: WALiveDateInput new
</methods> <methods> Seaside.WAAsyncRenderCanvas <category>private</category>
urlForLiveAction: actionBlock | url | url := context actionUrl withParameter: (self callbacks registerLiveActionCallback: actionBlock renderer: self). ^url asString
</methods> <methods> Seaside.WAAsyncRenderCanvas <category>xml</category>
spaceEntity ^'&#160;'
</methods> <methods> Seaside.WAAsyncScripts <category>scripts</category>
liveUpdateUtilitiesJs ^' function addParameter(uri, key, value) { // See http://xkr.us/articles/javascript/encode-compare/ var separator = "?"; if (uri.indexOf("?") >= 0) separator = "&"; return uri + separator + key + "=" + encodeURIComponent(value); } // Function below to instantiate an XMLHttpRequest object // Credits: http://jibbering.com/2002/4/httprequest.html // Credits: http://www.toutjavascript.com/savoir/xmlhttprequest.php3 function newHttpRequest() { var httpRequest = false; if(window.XMLHttpRequest) // Firefox, Mozilla, Safari httpRequest = new XMLHttpRequest(); else if(window.ActiveXObject) // Internet Explorer { try { httpRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { try { httpRequest = new ActiveXObject("Msxml2.XMLHTTP"); } catch (E) { httpRequest = false; } } } return httpRequest; } function setRequestHeaders(request) { request.setRequestHeader("X-Requested-With","XMLHttpRequest"); request.setRequestHeader("X-Requested-By","SeasideAsync"); request.setRequestHeader("Accept","text/html, application/xml, text/xml, */*"); } // Functions below to rebuild the xml string of an element function xmlString (element) { var xml = ""; for ( var x = 1 ; x <= element.childNodes.length ; x++ ) { var node = element.childNodes[x-1]; xml += outerXmlString(node); } return xml; } function outerXmlString (element) { if (!element.tagName) { var elementData = element.data; // Resolve entities var regex = new RegExp("<", "g"); elementData = elementData.replace(regex,"&lt;"); var regex = new RegExp(">", "g"); elementData = elementData.replace(regex,"&gt;"); return elementData; } var xml = "<" + element.tagName; for ( var x = 1 ; x <= element.attributes.length ; x++ ) { var attr = element.attributes[x-1]; xml += " " + attr.name + "=" + ''"'' + attr.value + ''"''; } xml += ">"; for ( var x = 1 ; x <= element.childNodes.length ; x++ ) { var node = element.childNodes[x-1]; xml += outerXmlString(node); } xml += "</" + element.tagName + ">"; return xml; } // Function below to get stable equivalent of document.getElementsByTagName("*") // Credits: http://www.siteexperts.com/tips/contents/ts16/page3.asp function getAllElements(document) { var elements = []; getElements(elements,document.childNodes[0]) return elements; } // Function below to recursively and deeply collect all sub-elements of an element // Credits: http://www.siteexperts.com/tips/contents/ts16/page3.asp function getElements(collection, element) { if (element == null) return; for ( var x = 1 ; x <= element.childNodes.length ; x++ ) { var node = element.childNodes[x-1]; if (node.nodeType == 1) { collection[collection.length] = node[x-1]; getElements(collection,element); } } } // Function below to detect if the id of any parent of an element is part of an array function includes(collection, element) { var parent = element.parentNode; while (parent.tagName) { var attributes = parent.attributes; if (attributes.length > 0) { for ( var ax = 1 ; ax <= attributes.length ; ax++ ) { var attr = attributes[ax-1]; var attrName = attr.name; if (attrName == "id") { for ( var x = 1 ; x <= collection.length ; x++ ) { if (collection[x-1] == attr.value) return true; } } } } parent = parent.parentNode; } return false; } // Get the text of the body element function bodyText(doc) { var elements = doc.getElementsByTagName("*"); if (elements.length == 0) { // IE does not support the above, use an alternative hard-coded technique elements = getAllElements(doc) } // Find html elements with the id= attribute for ( var x = 1 ; x <= elements.length ; x++ ) { var elem = elements[x-1]; if (elem.tagName == "BODY") { var body = xmlString(elem); } } return body; } function debug(aString) { var newDiv = document.createElement("div"); newDiv.setAttribute("style","position: relative; top: -1.5em; " + "font-size: 60%; font-family: Verdana; color: blue; " + "width: 100%; background-color: lightyellow"); var textNode = document.createTextNode(aString); newDiv.appendChild(textNode); document.body.appendChild(newDiv); } '
</methods> <methods> Seaside.WAAsyncScripts <category>scripts</category>
eventTrackingJs ^ ' var eventRequests = []; function liveEventTrackerUri(event, uri) { var target = (event.target) ? event.target : event.srcElement; var type = target.type; var value = target.value; if (type == "radio") value = target.checked; if (type == "checkbox") value = (value == "on"); uri = addParameter(uri, "timestamp", (new Date()).getTime().toString()); uri = addParameter(uri, "eventType", event.type); uri = addParameter(uri, "targetValue", value); uri = addParameter(uri, "targetType", type); uri = addParameter(uri, "tagName", target.tagName); uri = addParameter(uri, "id", target.id); // Cursor position ? var request = newHttpRequest(); if (!request) return false; request.onreadystatechange = processEventTracker; // Resolve xml entity before issuing the request var regex = new RegExp("&amp;", "g"); uri = uri.replace(regex,"&"); request.open("GET", uri, true); setRequestHeaders(request); request.send(null); eventRequests[eventRequests.length] = request; return false; } // Process state change of HTTP requests function processEventTracker() { var pendingEvents = []; for ( var rx = 1 ; rx <= eventRequests.length ; rx++ ) { var request = eventRequests[rx-1]; if (request.readyState == 4) { // debug (request.responseText); var doc = request.responseXML; var body = doc.getElementsByTagName("body")[0]; // Discard empty responses if (body.childNodes.length > 0) handleLiveResponse(request); } else { pendingEvents[pendingEvents.length] = request; } } if (eventRequests.length != pendingEvents.length) { eventRequests = pendingEvents; // debug ("Pending events " + eventRequests.length); } } '
</methods> <methods> Seaside.WAAsyncScripts <category>scripts</category>
ajaxJs ^ ' var requests = []; function liveUpdater(uriFunc, ret) { function xmlUpdater() { return sendHttpCallback(uriFunc(), ret); } return xmlUpdater; // Build and send HTTP request to Seaside function sendHttpCallback(uri, ret, respFunc) { var request = newHttpRequest(); if (!request) return ret; if (!respFunc) respFunc = processRequestChange; request.onreadystatechange = respFunc; // Resolve xml entity before issuing the request var uri = addParameter(uri, "timestamp", (new Date()).getTime().toString()); var regex = new RegExp("&amp;", "g"); uri = uri.replace(regex,"&"); request.open("GET", uri, true); setRequestHeaders(request); request.send(null); requests[requests.length] = request; // debug("GET " + uri); // debug ("Pending " + requests.length); return ret; } } // Process state change of HTTP requests function processRequestChange() { var pendingRequests = []; for ( var rx = 1 ; rx <= requests.length ; rx++ ) { var request = requests[rx-1]; if (request.readyState == 4) { if (request.responseText.length > 51) handleLiveResponse(request); } else { pendingRequests[pendingRequests.length] = request; } } if (requests.length != pendingRequests.length) { requests = pendingRequests // debug ("Pending " + requests.length); } } // Parse HTTP response from the Seaside live callbacks as XML and update the document function handleLiveResponse(request) { var doc = request.responseXML; var replacements = []; var anyReplacement = false; var anyScriptEvaluated = false; // debug("HTTP status " + request.status + " " + request.statusText); // debug(request.responseText); // debug(request.getAllResponseHeaders() ); if (doc != null) { var elements = doc.getElementsByTagName("*"); if (elements.length == 0) { // IE does not support the above, use an alternative hard-coded technique elements = getAllElements(doc) } // Find html elements with the id= attribute for ( var x = 1 ; x <= elements.length ; x++ ) { var elem = elements[x-1]; if (elem.tagName == "body") { var body = xmlString(elem); } var attributes = elem.attributes; if (attributes.length > 0) { for ( var ax = 1 ; ax <= attributes.length ; ax++ ) { var attr = attributes[ax-1]; var attrName = attr.name; if (attrName == "id") { // Find the html element in the document that has a matching id and replace it var docElement = document.getElementById(attr.value); if (docElement) { if (!includes(replacements,elem)) { // HTML is only updated with the parent at highest level // Resolve IE and Opera issue where <br></br> skips two lines var regex = new RegExp("<br></br>", "g"); var replacement = xmlString(elem).replace(regex,"<br/>"); try { docElement.innerHTML = replacement; anyReplacement = true; replacements[replacements.length] = attr.value; } catch (e) { // Some browsers (like Safari) have read-only elements // IE does not allow form elements for innerHTML } } } } } } } // Find html <script> elements and execute them for ( var x = 1 ; x <= elements.length ; x++ ) { var elem = elements[x-1]; if (elem.tagName == ''script'') { // debug("About to evaluate script"); // debug(xmlString(elem)); eval(xmlString(elem)); // debug("Evaluated"); anyScriptEvaluated = true; } } } if (!anyReplacement & !anyScriptEvaluated) { if ( body ) { // Here when XML could be parsed but was unproductive // Most probable reason : a bug in the live callback code alert("No replacement and no script evaluated, probable bug in your callback code.\n\n" + "See below the response produced by the callback code.\n\n" + request.responseText); // document.body.innerHTML = body; } else { // Here when XML could not be parsed // Most probable reason : response does not have an xml content // For instance : an exception in the live callback // So we replace the whole page with the whole response try { if (!request.responseText.length == 0) { document.body.innerHTML = request.responseText; } else { debug("HTTP code " + request.status + " " + request.statusText + " with no text in response!"); } } catch (e) { // In some cases of concurrency // readyState is 4, but there status is not available debug("HTTP response status not available although readyState is 4!"); debug(request.responseText); } } } } '
</methods> <methods> Seaside.WAAsyncScripts <category>accessing</category>
selectorsToInclude ^ #( ajaxJs eventTrackingJs liveUpdateJs liveUpdateUtilitiesJs )
</methods> <methods> Seaside.WAAsyncScripts <category>scripts</category>
liveUpdateJs ^ ' var nav; if (navigator.userAgent.indexOf("Safari") > 0) nav = "Safari"; else if (navigator.product == "Gecko") nav = "Gecko"; else nav = "IE"; function liveUpdaterUri(uri) { return liveUpdater(function() { return uri; } , false); } // Selection in a list box possibly with multiple selections, add the selected indexes to the callback function liveSelect(id, uri) { function constructUri() { var indexes = []; var options = document.getElementById(id).options; for ( var x = 1 ; x <= options.length ; x++ ) { if (options[x-1].selected) indexes[indexes.length+1] = x; } return addParameter(uri, "ms", indexes.toString()); } return liveUpdater(constructUri, false); } // Key stroke in an entry field, add the field value to the callback function liveSearch(id, uri) { function constructUri() { return addParameter(uri, "s", document.getElementById(id).value); } var updater = liveUpdater(constructUri, false); var last = document.getElementById(id).value; var timeout = false; function update() { if (last != document.getElementById(id).value) { last = document.getElementById(id).value; updater(); } } function start() { if (timeout) window.clearTimeout(timeout); timeout = window.setTimeout(update, 300); } if (navigator.userAgent.indexOf("Safari") > 0) document.getElementById(id).addEventListener("keydown",start,false); else if (navigator.product == "Gecko") document.getElementById(id).addEventListener("keypress",start,false); else document.getElementById(id).attachEvent("onkeydown",start); } // Click function liveClick(id, uri) { return liveUpdaterUri(uri); } // Click in a checkbox function liveCheck(id, uri) { function constructUri() { return addParameter(uri, "s", document.getElementById(id).checked); } return liveUpdater(constructUri); } function liveScroll(id, uri) { function constructUri() { return addParameter(uri, "s", document.getElementById(id).scrollTop.toString()); } var updater = liveUpdater(constructUri, false); var timeout = false; function start() { if (timeout) window.clearTimeout(timeout); timeout = window.setTimeout(updater, 100); } return start; } function timedUpdate(uri, milliSeconds) { var updater = liveUpdaterUri(uri, false); updater(); var again = "timedUpdate(\""+uri+"\","+milliSeconds+")"; setTimeout(again, milliSeconds); } '
</methods> <methods> Seaside.WAAutoCompleteEntryField <category>rendering</category>
renderSimpleDropDownOn: html | objectsToLabels | objectsToLabels := IdentityDictionary new. stringsToObjects keysAndValuesDo: [:label :object | objectsToLabels at: object put: label]. html cssClass: 'autocomplete'; divNamed: 'autocomplete' with: [html cssClass: 'label'; divNamed: 'L' with: [html text: name]. html cssClass: 'input'; divNamed: 'I' with: ["html attributes size: listWidth." html selectFromList: strings selected: strings first callback: [:l | selectedObject := stringsToObjects at: l. callback value: selectedObject]]]
</methods> <methods> Seaside.WAAutoCompleteEntryField <category>initialize-release</category>
initialize super initialize. stringsToObjects := Dictionary new. strings := #(). prefix := ''. selectedString := nil. selectedObject := nil. listHeight := 5. listWidth := 30.
</methods> <methods> Seaside.WAAutoCompleteEntryField <category>accessing</category>
name: aString name := aString
</methods> <methods> Seaside.WAAutoCompleteEntryField <category>accessing</category>
selectedObject: anObject string: aString prefix := selectedString := aString. selectedObject := anObject.
</methods> <methods> Seaside.WAAutoCompleteEntryField <category>rendering</category>
rendererClass "Intentionally using the classic API" ^WAAsyncHtmlRenderer
</methods> <methods> Seaside.WAAutoCompleteEntryField <category>accessing</category>
callback: aOneArgumentBlock "When a selection is made, aOneArgumentBlock is evaluated with the selected object" callback := aOneArgumentBlock
</methods> <methods> Seaside.WAAutoCompleteEntryField <category>accessing</category>
selectedObject ^selectedObject
</methods> <methods> Seaside.WAAutoCompleteEntryField <category>accessing</category>
numberOfItems ^stringsToObjects size
</methods> <methods> Seaside.WAAutoCompleteEntryField <category>accessing</category>
listWidth: numberOfCharacters listWidth := numberOfCharacters
</methods> <methods> Seaside.WAAutoCompleteEntryField <category>rendering</category>
renderAutoCompleteTextFieldOn: html html cssClass: 'autocomplete'; divNamed: 'autocomplete' with: [html cssClass: 'label'; divNamed: 'L' with: name. html cssClass: 'input'; divNamed: 'I' with: [html attributes width: listWidth em; at: #autocomplete put: 'off'. html textInputWithValue: prefix callback: [:v | prefix := v. callback value: selectedObject] liveCallback: [:v :h | prefix := v. selectedString := nil. self renderAutoCompleteSuggestionListOn: h]. self renderAutoCompleteSuggestionListOn: html]]
</methods> <methods> Seaside.WAAutoCompleteEntryField <category>rendering</category>
renderContentOn: html self numberOfItems > 30 ifTrue: [self renderAutoCompleteTextFieldOn: html] ifFalse: [self renderSimpleDropDownOn: html]
</methods> <methods> Seaside.WAAutoCompleteEntryField <category>accessing</category>
objects: objects strings: objectLabels strings := objectLabels. stringsToObjects := Dictionary new: objects size. objectLabels with: objects do: [:label :object | stringsToObjects at: label put: object]. prefix := ''. selectedString := nil. selectedObject := nil.
</methods> <methods> Seaside.WAAutoCompleteEntryField <category>css</category>
style ^' .autocomplete { width: 50em; font-family: Tahoma, Arial, Helvetica; font-size: 100%; } .autocomplete .label { width: 10em; float: left; text-align: right; font-weight: bold; } .autocomplete .input { float: left; margin-left: 1em; width: 30em; } .dropdown { overflow: hidden; border-width: 1px; border-style: solid; border-color: black; } .dropdown ul { list-style-type: none; margin: 0; padding: 0; } .dropdown ul li { clear: left; float: left; display: inline; width: 100%; line-height: 1.1em; } .dropdown ul li.selected { font-weight: bold; line-height: 1.1em; } .dropdown a { display: block; padding: 3px; width: 20em; background-color: #036; border-bottom: 1px solid #eee; } .dropdown a:link, .dropdown a:visited { color: #EEE; text-decoration: none; } .dropdown a:hover { background-color: #369; color: #fff; } '
</methods> <methods> Seaside.WAAutoCompleteEntryField <category>rendering</category>
renderAutoCompleteSuggestionListOn: html | labelsMatchingPrefix prefixPattern | html divNamed: 'D' with: [(prefix isEmptyOrNil not and: [selectedString isNil]) ifTrue: [prefixPattern := prefix asUppercase , '*'. labelsMatchingPrefix := (strings select: [:label | prefixPattern match: label asUppercase]) asSortedCollection asArray. labelsMatchingPrefix isEmpty ifTrue: [selectedString := ''. selectedObject := nil] ifFalse: [labelsMatchingPrefix size = 1 ifTrue: [prefix := selectedString := labelsMatchingPrefix first. selectedObject := stringsToObjects at: selectedString]. html divClass: 'dropdown' with: [html unorderedList: [(labelsMatchingPrefix copyFrom: 1 to: (labelsMatchingPrefix size min: listHeight)) do: [:label | html listItem: [html anchorWithAction: [] liveAction: [:h | selectedString := prefix := label. selectedObject := stringsToObjects at: label. callback value: selectedObject. self renderAutoCompleteTextFieldOn: h] text: label]]]]]]]
</methods> <methods> Seaside.WAAutoCompleteEntryField <category>accessing</category>
listHeight: numberOfLines listHeight := numberOfLines
</methods> <methods> Seaside.WAAutoCompleteTest <category>initialize-release</category>
initialize autocomplete := (WAAutoCompleteEntryField new) name: 'Choose a class:'; listHeight: 6; yourself
</methods> <methods> Seaside.WAAutoCompleteTest <category>rendering</category>
renderTextFieldOn: html html attributes addStyle: 'width: 15em'. html divNamed: #input with: [html cssId: #inputField. html textInputWithValue: inputValue callback: [:v | inputValue := v. inputValueComplete := true] liveCallback: [:v :h | inputValue := v. inputValueComplete := false. self renderAutoCompleteOn: h]]. self renderAutoCompleteOn: html
</methods> <methods> Seaside.WAAutoCompleteTest <category>css</category>
style ^' #input input { width: 100%; } #autoComplete select { background-color: lightyellow; width: 100%; } form { width: 60%; border: 1px solid green; padding: 5px; background-color: lightyellow; } '
</methods> <methods> Seaside.WAAutoCompleteTest <category>rendering</category>
renderAutoCompleteOn: html | selection | html divNamed: #autoComplete with: [(inputValue isEmptyOrNil not and: [inputValueComplete not]) ifTrue: [selection := self namelist detect: [:ea | (ea copyFrom: 1 to: (inputValue size min: ea size)) asUppercase = inputValue asUppercase] ifNone: [nil]. html attributes size: 3. html cssId: #autoCompleteSelect. html selectFromList: self namelist selected: selection callback: [:v | inputValue := v. inputValueComplete := true] labels: [:ea | ea] liveCallback: [:v :h | inputValue := v. inputValueComplete := true. self renderTextFieldOn: h]]]. html script: 'document.getElementById("autoComplete").style.width = document.getElementById("input").style.width'.
</methods> <methods> Seaside.WAAutoCompleteTest <category>rendering</category>
rendererClass "Intentionally using the classic API" ^WAAsyncHtmlRenderer
</methods> <methods> Seaside.WAAutoCompleteTest <category>rendering</category>
children ^Array with: autocomplete
</methods> <methods> Seaside.WAAutoCompleteTest <category>constants</category>
namelist ^#(Andrew Bengt Chuck Daniel Elmer Franz George Henry Isildur) , #(Jefferson Jeffrey Jeremy Jerry John Josuah Kleber Lewis Mike) , #( Nancy Oscar Peter Robert Roger Stephen Steven Tobias Vincent William)
</methods> <methods> Seaside.WAAutoCompleteTest <category>rendering</category>
renderContentOn: html | classes | html heading: 'AutoComplete Test (two different techniques)' level: 3; br. html form: [ html defaultAction: [self inform: inputValue]. self renderTextFieldOn: html. html submitButtonWithText: 'Go']. classes := (Object withAllSubclasses reject: [:e | e class = Metaclass]) asArray. autocomplete objects: classes strings: (classes collect: [:e | e name]). autocomplete callback: [:class | selectedClass := class]. html form: [ html text: 'You have selected: '; text: (selectedClass isNil ifTrue: ['Nothing'] ifFalse: [selectedClass name]);br;br. html render: autocomplete. html submitButtonWithAction: [] text: 'Go'].
</methods> <methods> Seaside.WACanvasFocusTest <category>rendering</category>
renderLogOn: html html paragraph: [html text: 'Before button was clicked, field with focus was:'; break; bold: log last key; break; text: 'At that time the field received the focus, its value was:'; break; bold: log last value]. html heading: 'Captured events' level: 5. log do: [:each | html text: each printString] separatedBy: [html break]. self clearLog.
</methods> <methods> Seaside.WACanvasFocusTest <category>initialization</category>
initialize self clearLog. cbValue := false. radioValue := false.
</methods> <methods> Seaside.WACanvasFocusTest <category>initialization</category>
clearLog log := OrderedCollection new.
</methods> <methods> Seaside.WACanvasFocusTest <category>rendering</category>
rendererClass ^ WAAsyncRenderCanvas
</methods> <methods> Seaside.WACanvasFocusTest <category>rendering</category>
renderContentOn: html | group | html form with: [ html textInput onFocusCallback: [:event | log add: 'Entry field' -> event value]; callback: [:v | ]. html select list: #( a b c ); onFocusCallback: [:event | log add: 'Select box' -> event value]; selected: selected. html checkbox onClickCallback: [:event | log add: 'Checkbox' -> event value]; value: cbValue; callback: [:v | cbValue := v]. html span style: 'border: 1px dashed grey'; with: [group := html radioGroup. html radioButton group: group; onFocusCallback: [:event | log add: 'radio(left)' -> event value]; "Does not work in Safari 2.0.4" selected: radioValue; callback: [:v | radioValue := false]. html radioButton group: group; onFocusCallback: [:event | log add: 'radio(right)' -> event value]; "Does not work in Safari 2.0.4" selected: radioValue not; callback: [:v | radioValue := true]. ]. html submitButton]. html div: 'Radio buttons do not work with Safari, because Safari does not support onclick for radio buttons'. log notEmpty ifTrue: [self renderLogOn: html]
</methods> <methods> Seaside.WACanvasLiveRequestTest <category>nested</category>
renderCitiesOn: html html span id: 'citySelector'; with: [(html select) list: self cityNames; selected: city; callback:[:f | city := f ]; labels: [:ea | ea ]]
</methods> <methods> Seaside.WACanvasLiveRequestTest <category>rendering</category>
renderRadioOn: html html form: [ html table: [ html tableRow: [ html tableData: 'Language'. html tableData: 'Yes'. html tableData: 'No']. booleans associationsDo: [:assoc | | group | html tableRow: [ group := html radioGroup. html tableData: assoc key. html tableData: [ (html radioButton) id: assoc key asString , '-on'; group: group; selected: assoc value; liveCallback: [:item :h | assoc value: true. h span id: 'radio'; with: booleans printString]]. html tableData: [ (html radioButton) id: assoc key asString , '-off'; group: group; selected: assoc value not; liveCallback: [:item :h | assoc value: false. h span id: 'radio'; with: booleans printString.]]. ]]. ]]
</methods> <methods> Seaside.WACanvasLiveRequestTest <category>initialization</category>
initialize count := 0. bool := false. input1 := String new. input2 := String new. multiSelected := #(0 7). self country: 'Argentina'. booleans := Dictionary new at: #English put: true; at: #Russian put: false; at: #Japanese put: false; yourself.
</methods> <methods> Seaside.WACanvasLiveRequestTest <category>nested</category>
province: anObject province := anObject. self city: self cityNames first.
</methods> <methods> Seaside.WACanvasLiveRequestTest <category>rendering</category>
renderInput2On: html html form: [html textArea value: input2; callback: [:v | input2 := v]; liveCallback: [:text :h | input2 := text. h div id: 'backward'; with: [h unorderedList: [input2 reverse do: [:c | h listItem: [h anchor callback: [self inform: c displayString]; text: c displayString]]]]. h span id: 'bwd'; with: 'Value entered= ' , input2 ]. html space. html span id: 'bwd'; with: 'Value entered= ' , input2 ].
</methods> <methods> Seaside.WACanvasLiveRequestTest <category>nested</category>
renderCountryListOn: html html span id: 'countryList'; with: [selectedCurrency notNil ifTrue: [selectedCurrency == #Euros ifTrue: [ html select list: #(Germany France Spain Italy Belgium Ireland Austria Luxemburg Netherlands); beOptional; optionalLabel: '<Select a ''country'' & watch>'; "May not contain angle brackets" selected: selectedCountry; labels: [:ea | ea displayString]; liveCallback: [:item :h | selectedCountry := item. self renderCountryStatusOn: h]. html space. self renderCountryStatusOn: html] ifFalse: [html text: 'This is not euro, cannot show euroland countries']]]
</methods> <methods> Seaside.WACanvasLiveRequestTest <category>nested</category>
city: anObject city := anObject.
</methods> <methods> Seaside.WACanvasLiveRequestTest <category>rendering</category>
renderMultiSelectOn: html html form: [html select list: #(0 1 2 3 4 5 6 7 8 9); beMultiple; selected: multiSelected; labels: [:ea | ea displayString ]; callback: [ :aCollection | multiSelected := aCollection ]; liveCallback: [:aCollection :h | multiSelected := aCollection. h span id: 'multiselect'; with: multiSelected. h span id: 'multisel'; with: 'Values selected= ' , multiSelected displayString ]. html space. html span id: 'multisel'; with: 'Values selected= ' , multiSelected displayString ].
</methods> <methods> Seaside.WACanvasLiveRequestTest <category>rendering</category>
renderListOn: html html form: [html select list: #(Horse Cat Dog Camel Cow Pterodactyl); beOptional; optionalLabel: '<select>'; selected: selection; labels: [:ea | ea displayString]; liveCallback: [:item :h | selection := item. "Update multiple areas of the document using one live callback" h span id: 'selection'; with: selection. h span id: 'sel'; with: 'Value selected= ' , selection displayString ]. html space. html span id: 'sel'; with: 'Value selected= ' , selection displayString ].
</methods> <methods> Seaside.WACanvasLiveRequestTest <category>nested</category>
cityNames province = 'Oranjestad' ifTrue: [^#( 'Casibari' 'Bubali') ]. province = 'Santa Cruz' ifTrue: [^#( 'Arikok' 'Yamonta') ]. province = 'Buenos Aires' ifTrue: [^#('La Plata' 'Azul')]. province = 'Cordoba' ifTrue: [^#('Alta Gracia' 'La Falda')]. province = 'California' ifTrue: [^#('Los Angeles' 'Monterey' 'San Jose' 'Santa Monica')]. province = 'Ohio' ifTrue: [^#('Cincinnati' 'Dayton' 'Clifton')]. ^#()
</methods> <methods> Seaside.WACanvasLiveRequestTest <category>rendering</category>
renderCheckBoxOn: html html form: [html checkbox value: bool; callback: [:v | bool := v]; liveCallback: [:item :h | bool := item. "Update multiple areas of the document using one live callback" h span id: 'checkbox'; with: (bool ifTrue: ['checked'] ifFalse: ['unchecked']). h span id: 'chk'; with: (bool ifTrue: ['checked'] ifFalse: ['unchecked']). ]. html space. html span id: 'chk'; with: (bool ifTrue: ['checked'] ifFalse: ['unchecked']). ].
</methods> <methods> Seaside.WACanvasLiveRequestTest <category>rendering</category>
renderAnchorOn: html html anchor callback: ["The live callback disables the regular callback" self error: 'Should not come here']; onClick: 'debug("Good that you clicked that link, thanks from a piece of Javascript.")'; liveCallback: [:h | "The live callback does not disable previous onclick" h span id: 'timestamp'; with: TimeStamp now. h span id: 'time'; with: Time now]; with: 'Show time'. html space. html span id: 'timestamp'; with: ''
</methods> <methods> Seaside.WACanvasLiveRequestTest <category>rendering</category>
renderContentOn: html self renderWarningOn: html. html table: [html tableRow: [html tableData: [self renderInput1On: html. self renderInput2On: html. self renderDateInputOn: html. self renderTimeInputOn: html. self renderListOn: html. self renderMultiSelectOn: html. self renderCheckBoxOn: html. self renderRadioOn: html. self renderAnchorOn: html. html break. self renderButtonOn: html]. html tableData: [html heading: 'Forward' level: 3. html div id: 'forward'; with: ''. html heading: 'Backward' level: 3. html div id: 'backward'; with: ''. html heading: 'Date' level: 3. html div id: 'date'; with: ''. html heading: 'Time' level: 3. html div id: 'xtime'; with: ''. html heading: 'Selection' level: 3. html span id: 'selection'; with: ''. html heading: 'Multiple Selection' level: 3. html span id: 'multiselect'; with: ''. html heading: 'Checkbox' level: 3. html span id: 'checkbox'; with: ''. html heading: 'Radio buttons' level: 3. html span id: 'radio'; with: booleans printString. html heading: 'Time' level: 3. html span id: 'time'; with: '']]]. html heading: 'Nested live callbacks' level: 3. self renderCountriesOn: html. self renderCurrenciesOn: html. self renderWarningOn: html
</methods> <methods> Seaside.WACanvasLiveRequestTest <category>rendering</category>
renderDateInputOn: html html form: [html dateInput value: date; liveCallback: [:value :h | date := value. h div id: 'date'; with: date. h span id: 'dat'; with: 'Value entered= ' , date displayString. ]. html space. html span id: 'dat'; with: 'Value entered= ' , date displayString. ].
</methods> <methods> Seaside.WACanvasLiveRequestTest <category>nested</category>
renderCountriesOn: html (html select) list: #( 'Argentina' 'Aruba' 'USA' ); selected: country; callback: [:f | country := f]; labels: [:ea | ea ]; liveCallback: [:anObject :h | country := anObject. province := self provinceNames first. city := self cityNames first. self renderProvincesOn: h]. self renderProvincesOn: html.
</methods> <methods> Seaside.WACanvasLiveRequestTest <category>nested</category>
provinceNames country = 'Aruba' ifTrue: [^#('Oranjestad' 'Santa Cruz')]. country = 'Argentina' ifTrue: [^#( 'Buenos Aires' 'Cordoba')]. country = 'USA' ifTrue: [^#( 'Ohio' 'California')]. ^#()
</methods> <methods> Seaside.WACanvasLiveRequestTest <category>rendering</category>
renderInput1On: html html form: [html textInput value: input1; callback: [:v | input1 := v]; liveCallback: [:text :h | input1 := text. "Update multiple areas of the document using one live callback" h div id: 'forward'; with: [h unorderedList: [input1 do: [:c | h listItem: [h anchor callback: [self inform: c displayString]; text: c displayString]]]]. h span id: 'fwd'; with: [h text: 'Value entered= ' , input1. h script: 'debug("javascript in a live callback ' , input1 , ' ");'] ]. html space. html span id: 'fwd'; with:'Value entered= ' , input1. html break. html text: 'Above: Javascript attached= debug("Javascript in a live callback xxx ");' ].
</methods> <methods> Seaside.WACanvasLiveRequestTest <category>rendering</category>
renderButtonOn: html html form: [html submitButton callback: ["The live callback disables the regular callback" self error: 'Should not come here']; "The live callback does not disable previous onclick" onClick: 'debug("Good that you clicked that button, thanks from a piece of Javascript.")'; liveCallback: [:h | h span id: 'timestamp-button'; with: TimeStamp now. h span id: 'time'; with: Time now]; text: 'Show time'; "The live callback disables any subsequent onclick" onClick: 'debug("This should not display")' ]. html space. html span id: 'timestamp-button'; with: ''
</methods> <methods> Seaside.WACanvasLiveRequestTest <category>nested</category>
country: anObject country := anObject. self province: self provinceNames first.
</methods> <methods> Seaside.WACanvasLiveRequestTest <category>rendering</category>
rendererClass ^ WAAsyncRenderCanvas
</methods> <methods> Seaside.WACanvasLiveRequestTest <category>rendering</category>
renderTimeInputOn: html html form: [html timeInput value: time; liveCallback: [:value :h | time := value. h div id: 'xtime'; with: time. h span id: 'tim'; with: 'Value entered= ' , time displayString. ]. html space. html span id: 'tim'; with: 'Value entered= ' , time displayString. ].
</methods> <methods> Seaside.WACanvasLiveRequestTest <category>nested</category>
renderCountryStatusOn: html html span id: 'countryStatus'; with: [selectedCountry notNil ifTrue: [html text: 'That''s correct, ' , selectedCountry displayString , ' uses Euros']].
</methods> <methods> Seaside.WACanvasLiveRequestTest <category>nested</category>
renderCurrenciesOn: html html form: [html select list: #(Euros Dollars Yens); beOptional; optionalLabel: '<select a currency>'; selected: selectedCurrency; labels: [:ea | ea displayString]; liveCallback: [:item :h | selectedCurrency := item. self renderCountryListOn: h]. html space. self renderCountryListOn: html]
</methods> <methods> Seaside.WACanvasLiveRequestTest <category>nested</category>
renderProvincesOn: html html span id: 'provinceSelector'; with: [(html select) list: self provinceNames; selected: province; callback: [:f | province := f]; labels: [:ea | ea ]; liveCallback: [:anObject :h | province := anObject. city := self cityNames first. self renderCitiesOn: h]]. self renderCitiesOn: html.
</methods> <methods> Seaside.WACanvasLiveRequestTest <category>rendering</category>
renderWarningOn: html "The #insert: method was not available in 2.6a1" (html respondsTo: #insert:) ifFalse: [html heading: 'Warning : Canvas rendering is unfinished in this release' level: 2]
</methods> <methods> Seaside.WACanvasPeriodicLiveRequestTest <category>rendering</category>
rendererClass ^ WAAsyncRenderCanvas
</methods> <methods> Seaside.WACanvasPeriodicLiveRequestTest <category>rendering</category>
renderContentOn: html | liveUpdateBlock | liveUpdateBlock := [ :event :h | h text: Time now printString]. html table with: [ html tableRow with: [ html tableData with: 'Current Time in default div:'. html tableData with: [ " Anonymous div. " html div refreshWith: liveUpdateBlock every: 3 seconds. ] ]. html tableRow with: [ html tableData with: 'Current Time in default span:'. html tableData with: [ " Anonymous span. " html span refreshWith: liveUpdateBlock every: 5 seconds. ] ]. html tableRow with: [ html tableData with: 'Current Time in named div:'. html tableData with: [ " Named div " html div id: 'livediv'; refreshWith: liveUpdateBlock every: 1 seconds. ] ]. html tableRow with: [ html tableData with: 'Current Time in named span:'. html tableData with: [ " Named span " html span id: 'livespan'; refreshWith: liveUpdateBlock every: 2 seconds. ] ] ]
</methods> <methods> Seaside.WAClassBrowserDialogDecoration <category>rendering</category>
renderContentOn: html self renderOwnerOn: html
</methods> <methods> Seaside.WAClassBrowserDialogDecoration <category>rendering</category>
style ^' div#lightbox { background-color: #edfced; border: 1px solid #e8a400; padding: 2em; width: 50%; font-family: Verdana; } div#lightbox h3 { font-weight: normal; font-size: 80%; } '
</methods> <methods> Seaside.WAClassBrowserDialogDecoration <category>rendering</category>
updateRoot: anHtmlRoot | save | (self session application libraries includes: SULibrary) ifFalse: ["Naughty, dirty, awful hack to make sure SULibrary javascripts are all inserted at the beginning" save := OrderedCollection new. [anHtmlRoot scripts isEmpty] whileFalse: [save add: anHtmlRoot scripts removeFirst]. SULibrary default updateRoot: anHtmlRoot. anHtmlRoot scripts addAll: save]. super updateRoot: anHtmlRoot.
</methods> <methods> Seaside.WAClassBrowserLeftPane <category>rendering</category>
renderPackagesOn: html (html div) id: 'packages'; with: [ self renderPackagesListOn: html ].
</methods> <methods> Seaside.WAClassBrowserLeftPane <category>rendering</category>
renderPackagesListOn: html (html select) size: self listSize; id: 'packageList'; selected: self package; list: self packages; liveCallback: [:value :renderer | main selectPackage: value on: renderer].
</methods> <methods> Seaside.WAClassBrowserLeftPane <category>rendering</category>
renderClassesListOn: html (html select) size: self listSize; id: 'classList'; selected: self selectedClass; list: self classes; liveCallback: [:value :renderer | main selectClass: value on: renderer].
</methods> <methods> Seaside.WAClassBrowserLeftPane <category>rendering</category>
renderContentOn: html self renderPackagesOn: html. self renderClassesOn: html.
</methods> <methods> Seaside.WAClassBrowserLeftPane <category>rendering</category>
renderClassesOn: html (html div) id: 'classes'; with: [ self renderClassesListOn: html ]
</methods> <methods> Seaside.WAClassBrowserPane <category>delegation</category>
packages ^self main packages
</methods> <methods> Seaside.WAClassBrowserPane <category>accessing</category>
componentName: anObject "Set the value of componentName" componentName := anObject
</methods> <methods> Seaside.WAClassBrowserPane <category>accessing</category>
componentName "Answer the value of componentName" ^ componentName
</methods> <methods> Seaside.WAClassBrowserPane <category>accessing</category>
main: anObject "Set the value of main" main := anObject
</methods> <methods> Seaside.WAClassBrowserPane <category>accessing</category>
main "Answer the value of main" ^ main
</methods> <methods> Seaside.WAClassBrowserPane <category>delegation</category>
selectedClass ^self main selectedClass
</methods> <methods> Seaside.WAClassBrowserPane <category>delegation</category>
sourceCode ^self main sourceCode
</methods> <methods> Seaside.WAClassBrowserPane <category>delegation</category>
canSaveSourceCode ^self main canSaveSourceCode
</methods> <methods> Seaside.WAClassBrowserPane <category>delegation</category>
sourceTitle ^self main sourceTitle
</methods> <methods> Seaside.WAClassBrowserPane <category>delegation</category>
canRenameSourceCode ^self main canRenameSourceCode
</methods> <methods> Seaside.WAClassBrowserPane <category>delegation</category>
listSize ^self main listSize
</methods> <methods> Seaside.WAClassBrowserPane <category>delegation</category>
selectors ^self main selectors
</methods> <methods> Seaside.WAClassBrowserPane <category>delegation</category>
protocol ^self main protocol
</methods> <methods> Seaside.WAClassBrowserPane <category>delegation</category>
selectedClass: anObject ^self main selectedClass: anObject
</methods> <methods> Seaside.WAClassBrowserPane <category>delegation</category>
classes ^self main classes
</methods> <methods> Seaside.WAClassBrowserPane <category>delegation</category>
isReadOnly ^self main isReadOnly
</methods> <methods> Seaside.WAClassBrowserPane <category>rendering</category>
rendererClass ^WAAsyncRenderCanvas
</methods> <methods> Seaside.WAClassBrowserPane <category>delegation</category>
package: anObject ^self main package: anObject
</methods> <methods> Seaside.WAClassBrowserPane <category>delegation</category>
selector: anObject ^self main selector: anObject
</methods> <methods> Seaside.WAClassBrowserPane <category>delegation</category>
isReadOnly: aBoolean ^self main isReadOnly: aBoolean
</methods> <methods> Seaside.WAClassBrowserPane <category>delegation</category>
package ^self main package
</methods> <methods> Seaside.WAClassBrowserPane <category>delegation</category>
templateSourceCode ^self main templateSourceCode
</methods> <methods> Seaside.WAClassBrowserPane <category>delegation</category>
selector ^self main selector
</methods> <methods> Seaside.WAClassBrowserPane <category>delegation</category>
protocols ^self main protocols
</methods> <methods> Seaside.WAClassBrowserPane <category>delegation</category>
canRemoveSourceCode ^self main canRemoveSourceCode
</methods> <methods> Seaside.WAClassBrowserPane <category>delegation</category>
protocol: anObject ^self main protocol: anObject
</methods> <methods> Seaside.WAClassBrowserPane <category>delegation</category>
pause ^self main pause
</methods> <methods> Seaside.WAClassBrowserRightPane <category>rendering</category>
renderProtocolsListOn: html (html select) size: self listSize; id: 'protocolList'; selected: self protocol; list: self protocols; liveCallback: [:value :renderer | main selectProtocol: value on: renderer]
</methods> <methods> Seaside.WAClassBrowserRightPane <category>rendering</category>
renderSelectorsOn: html (html div) id: 'selectors'; with: [ self renderSelectorsListOn: html ]
</methods> <methods> Seaside.WAClassBrowserRightPane <category>rendering</category>
renderContentOn: html self renderProtocolsOn: html. self renderSelectorsOn: html.
</methods> <methods> Seaside.WAClassBrowserRightPane <category>rendering</category>
renderProtocolsOn: html (html div) id: 'protocols'; with: [ self renderProtocolsListOn: html ].
</methods> <methods> Seaside.WAClassBrowserRightPane <category>rendering</category>
renderSelectorsListOn: html (html select) size: self listSize; id: 'selectorList'; selected: self selector; list: self selectors; liveCallback: [:value :renderer | main selectSelector: value on: renderer]
</methods> <methods> Seaside.WAClassBrowserSourcePane <category>rendering</category>
renderSaveButtonOn: html self canSaveSourceCode ifTrue: [(html submitButton) addShortcut: 'Ctrl-S'; addShortcut: 'Ctrl-s'; callback: [main saveSourceCode: sourceCode]; text: 'Accept (Ctrl-S)']
</methods> <methods> Seaside.WAClassBrowserSourcePane <category>button text</category>
renameButtonText ^'Rename this ' , self main renameText , ' (Ctrl-R)'
</methods> <methods> Seaside.WAClassBrowserSourcePane <category>rendering</category>
renderReadOnlySourceOn: html | stream lines | lines := OrderedCollection new. stream := sourceCode readStream. [stream atEnd] whileFalse: [lines add: stream nextLine]. lines := lines readStream. html bold: lines next. [lines atEnd] whileFalse: [html break. stream := lines next readStream. [stream atEnd] whileFalse: [stream peek == Character tab ifTrue: [html space: 3. stream next] ifFalse: [html text: stream upToEnd]]]
</methods> <methods> Seaside.WAClassBrowserSourcePane <category>rendering</category>
renderSourceOn: html (html div) id: 'source'; with: [self renderSourceCodeOn: html]
</methods> <methods> Seaside.WAClassBrowserSourcePane <category>rendering</category>
renderSourceCodeOn: html sourceCode := self sourceCode ifNil: [^html space]. self isReadOnly ifTrue: [^self renderReadOnlySourceOn: html]. self renderMessageOn: html. html form: [(html textArea) id: #contents; callback: [:v | sourceCode := v]; value: sourceCode. self renderSaveButtonOn: html. self renderRenameButtonOn: html. self renderRemoveButtonOn: html.]
</methods> <methods> Seaside.WAClassBrowserSourcePane <category>rendering</category>
renderRemoveButtonOn: html self canRemoveSourceCode ifTrue: [(html submitButton) addShortcut: 'Ctrl-X'; addShortcut: 'Ctrl-x'; callback: [main removeSourceCode]; text: self removeButtonText]
</methods> <methods> Seaside.WAClassBrowserSourcePane <category>rendering</category>
renderRenameButtonOn: html self canRenameSourceCode ifTrue: [(html submitButton) addShortcut: 'Ctrl-R'; addShortcut: 'Ctrl-r'; callback: [main renameSourceCode]; text: self renameButtonText]
</methods> <methods> Seaside.WAClassBrowserSourcePane <category>button text</category>
saveButtonText ^'Accept (Ctrl-S)'
</methods> <methods> Seaside.WAClassBrowserSourcePane <category>button text</category>
removeButtonText ^'Remove this ' , self main removeText , ' (Ctrl-X)'
</methods> <methods> Seaside.WAClassBrowserSourcePane <category>rendering</category>
renderContentOn: html self renderSourceOn: html
</methods> <methods> Seaside.WAClassBrowserSourcePane <category>rendering</category>
renderMessageOn: html main message notNil ifTrue: [(html div) id: 'message'; with: main message] ifFalse: [(html div) id: 'title'; with: self sourceTitle]
</methods> <methods> Seaside.WAFocusTest <category>rendering</category>
renderLogOn: html html paragraph: [html text: 'Before button was clicked, field with focus was:'; break; bold: log last key; break; text: 'At that time the field received the focus, its value was:'; break; bold: log last value]. html heading: 'Captured events' level: 5. log do: [:each | html text: each printString] separatedBy: [html break]. self clearLog.
</methods> <methods> Seaside.WAFocusTest <category>initialization</category>
initialize self clearLog. cbValue := false.
</methods> <methods> Seaside.WAFocusTest <category>actions</category>
clearLog log := OrderedCollection new.
</methods> <methods> Seaside.WAFocusTest <category>rendering</category>
rendererClass "Intentionally using the classic API" ^WAAsyncHtmlRenderer
</methods> <methods> Seaside.WAFocusTest <category>rendering</category>
renderContentOn: html html form: [html onFocusCallback: [:event | log add: 'Entry field' -> event value]. html textInputWithCallback: [:v | ]. html onFocusCallback: [:event | log add: 'Select box' -> event value]. html selectFromList: #( a b c ) selected: selected callback: [:v | selected := v ]. html onClickCallback: [:event | log add: 'Checkbox' -> event value]. html checkboxWithValue: cbValue callback: [:v | cbValue := v]. html submitButton]. log notEmpty ifTrue: [self renderLogOn: html]
</methods> <methods> Seaside.WAFullClassBrowser <category>ajax updates</category>
updateSourceOn: html self pause. self bottomComponent renderSourceOn: html.
</methods> <methods> Seaside.WAFullClassBrowser <category>lightbox</category>
request: requestString label: labelString default: initialString ^ self lightbox: ((WAInputDialog new label: labelString; default: initialString; yourself) addMessage: requestString; yourself)
</methods> <methods> Seaside.WAFullClassBrowser <category>model</category>
removeText self selector notNil ifTrue: [^'method']. self protocol notNil ifTrue: [^'method category']. self selectedClass notNil ifTrue: [^'class'].
</methods> <methods> Seaside.WAFullClassBrowser <category>browser callbacks</category>
update: aSymbol aSymbol == #contents ifTrue: ["Here when the source pane has changed" message := nil. self contents: self browser contents]
</methods> <methods> Seaside.WAFullClassBrowser <category>accessing</category>
message: anObject "Set the value of message" message := anObject
</methods> <methods> Seaside.WAFullClassBrowser <category>accessing</category>
rightComponents "Answer the value of rightComponents" ^ rightComponents
</methods> <methods> Seaside.WAFullClassBrowser <category>model</category>
sourceTitle self selector notNil ifTrue: [^self selectedClass asString , ' >> ' , self selector]. self protocol notNil ifTrue: [^self selectedClass asString , ' >> template for new method']. self selectedClass notNil ifTrue: [^self selectedClass asString , ' class definition']. self package notNil ifTrue: [^'Template for new class definition']. ^nil
</methods> <methods> Seaside.WAFullClassBrowser <category>model</category>
selectedClass: anObject ^self browser classListIndex: (self classes indexOf: anObject)
</methods> <methods> Seaside.WAFullClassBrowser <category>accessing</category>
isReadOnly "Answer the value of isReadOnly" ^ isReadOnly
</methods> <methods> Seaside.WAFullClassBrowser <category>accessing</category>
contents: anObject "Set the value of contents" contents := anObject
</methods> <methods> Seaside.WAFullClassBrowser <category>accessing</category>
browser: anObject "Set the value of browser" browser := anObject
</methods> <methods> Seaside.WAFullClassBrowser <category>accessing</category>
leftComponents: anObject "Set the value of leftComponents" leftComponents := anObject
</methods> <methods> Seaside.WAFullClassBrowser <category>ajax updates</category>
selectProtocol: aProtocol on: aRenderer self protocol: aProtocol. self updateSelectorsOn: aRenderer.
</methods> <methods> Seaside.WAFullClassBrowser <category>accessing</category>
bottom: anObject "Set the value of bottom" bottom := anObject
</methods> <methods> Seaside.WAFullClassBrowser <category>model</category>
protocols ^self browser messageCategoryList
</methods> <methods> Seaside.WAFullClassBrowser <category>ajax updates</category>
updateSelectorsOn: html self pause. self rightComponent renderSelectorsOn: html. self updateSourceOn: html.
</methods> <methods> Seaside.WAFullClassBrowser <category>model</category>
selector self browser messageListIndex = 0 ifTrue: [^nil]. ^self selectors at: self browser messageListIndex
</methods> <methods> Seaside.WAFullClassBrowser <category>private</category>
pause "Activate this code to demo ajax interactivity" "(Delay forSeconds: 1) wait."
</methods> <methods> Seaside.WAFullClassBrowser <category>accessing</category>
right: anObject "Set the value of right" right := anObject. self right = 'Class' ifTrue: [self browser indicateClassMessages] ifFalse: [self browser indicateInstanceMessages].
</methods> <methods> Seaside.WAFullClassBrowser <category>ajax updates</category>
selectClass: aClass on: aRenderer self selectedClass: aClass. self updateProtocolsOn: aRenderer.
</methods> <methods> Seaside.WAFullClassBrowser <category>model</category>
packages ^self browser systemCategoryList
</methods> <methods> Seaside.WAFullClassBrowser <category>browser callbacks</category>
selectionInterval ^1 to: 1
</methods> <methods> Seaside.WAFullClassBrowser <category>accessing</category>
bottom "Answer the value of bottom" ^ bottom
</methods> <methods> Seaside.WAFullClassBrowser <category>accessing</category>
right "Answer the value of right" ^ right
</methods> <methods> Seaside.WAFullClassBrowser <category>lightbox</category>
confirm: aString ^self lightbox: (WAYesOrNoDialog new addMessage: aString; yourself)
</methods> <methods> Seaside.WAFullClassBrowser <category>model</category>
selectors self protocol isNil ifTrue: [^Array new]. ^self browser messageList
</methods> <methods> Seaside.WAFullClassBrowser <category>model</category>
canRemoveSourceCode "May remove classes with this tool" ^self selectedClass notNil.
</methods> <methods> Seaside.WAFullClassBrowser <category>rendering</category>
renderRightOptionsOn: html (html unorderedList) list: self rightOptions; selected: self right; callback: [:v | self right: v]
</methods> <methods> Seaside.WAFullClassBrowser <category>actions</category>
renameSourceCode ^self browser renameCategory
</methods> <methods> Seaside.WAFullClassBrowser <category>accessing</category>
rightComponents: anObject "Set the value of rightComponents" rightComponents := anObject
</methods> <methods> Seaside.WAFullClassBrowser <category>ajax updates</category>
selectPackage: aPackage on: aRenderer self package: aPackage. self updateClassesOn: aRenderer.
</methods> <methods> Seaside.WAFullClassBrowser <category>initialize-release</category>
initialize super initialize. self browser: WAPermissiveBrowser new. self browser component: self. self browser addDependent: self. self contents: self browser contents. isReadOnly := false. leftComponents := (Dictionary new) at: 'Categories' put: WAClassBrowserLeftPane new; yourself. self left: 'Categories'. rightComponents := (Dictionary new) at: 'Instance' put: WAClassBrowserRightPane new; at: 'Class' put: WAClassBrowserRightPane new; yourself. self right: 'Instance'. bottom := WAClassBrowserSourcePane new.
</methods> <methods> Seaside.WAFullClassBrowser <category>rendering</category>
renderLeftOptionsOn: html (html unorderedList) list: self leftOptions; selected: self left; callback: [:v | self left: v]
</methods> <methods> Seaside.WAFullClassBrowser <category>ajax updates</category>
updateProtocolsOn: html self pause. self rightComponent renderProtocolsOn: html. self updateSelectorsOn: html.
</methods> <methods> Seaside.WAFullClassBrowser <category>model</category>
sourceCode ^self contents
</methods> <methods> Seaside.WAFullClassBrowser <category>browser callbacks</category>
bindingOf: aString "Here when an unknown variable is used in a method" (WAUnknownVariable new) varName: aString; signal
</methods> <methods> Seaside.WAFullClassBrowser <category>accessing</category>
contents "Answer the value of contents" ^ contents
</methods> <methods> Seaside.WAFullClassBrowser <category>rendering</category>
renderContentOn: html (html div) id: 'class-browser'; with: [(html div) id: 'left'; with: [(html div) class: 'nav-options'; id: 'left-options'; with: [self renderLeftOptionsOn: html]. html render: self leftComponent]. (html div) id: 'right'; with: [(html div) class: 'nav-options'; id: 'right-options'; with: [self renderRightOptionsOn: html]. html render: self rightComponent]. html div class: 'clear'. html render: self bottomComponent].
</methods> <methods> Seaside.WAFullClassBrowser <category>model</category>
canRenameSourceCode "May rename a method category" ^self protocol notNil.
</methods> <methods> Seaside.WAFullClassBrowser <category>constants</category>
listSize ^15
</methods> <methods> Seaside.WAFullClassBrowser <category>model</category>
protocol self browser messageCategoryListIndex = 0 ifTrue: [^nil]. ^self protocols at: self browser messageCategoryListIndex
</methods> <methods> Seaside.WAFullClassBrowser <category>navigation</category>
rightComponent ^(rightComponents at: self right) main: self; componentName: self right; yourself
</methods> <methods> Seaside.WAFullClassBrowser <category>ajax updates</category>
updateClassesOn: html self pause. self leftComponent renderClassesOn: html. self updateProtocolsOn: html.
</methods> <methods> Seaside.WAFullClassBrowser <category>accessing</category>
left "Answer the value of left" ^ left
</methods> <methods> Seaside.WAFullClassBrowser <category>navigation</category>
rightOptions ^rightComponents keys
</methods> <methods> Seaside.WAFullClassBrowser <category>lightbox</category>
inform: aString self lightbox: (WAFormDialog new addMessage: aString; yourself)
</methods> <methods> Seaside.WAFullClassBrowser <category>rendering</category>
children ^Array with: self leftComponent with: self rightComponent with: self bottomComponent
</methods> <methods> Seaside.WAFullClassBrowser <category>lightbox</category>
lightbox: aComponent ^(self class superclass canUnderstand: #lightbox:) ifTrue: [super lightbox: (aComponent addDecoration: WAClassBrowserDialogDecoration new; yourself)] ifFalse: [self call: aComponent].
</methods> <methods> Seaside.WAFullClassBrowser <category>actions</category>
saveSourceCode: aString | saveProtocol saveSelector saveMessage | SeasidePlatformSupport ensureAuthorInitials: [self request: 'Please enter your initials:']. message := nil. saveProtocol := self protocol. saveSelector := self selector. [self browser contents: aString notifying: self] on: WAUnknownVariable do: [:error | message := error messageText]. saveMessage := message. self protocol: saveProtocol. self selector: saveSelector. self contents: aString. message := saveMessage
</methods> <methods> Seaside.WAFullClassBrowser <category>accessing</category>
text ^ Text fromString: ''
</methods> <methods> Seaside.WAFullClassBrowser <category>model</category>
selector: anObject ^self browser messageListIndex: (self selectors indexOf: anObject)
</methods> <methods> Seaside.WAFullClassBrowser <category>rendering</category>
updateRoot: anHtmlRoot super updateRoot: anHtmlRoot. (self session application libraries includes: WAAsyncScripts) ifFalse: [WAAsyncScripts default updateRoot: anHtmlRoot]
</methods> <methods> Seaside.WAFullClassBrowser <category>ajax updates</category>
selectSelector: aSelector on: aRenderer self selector: aSelector. self updateSourceOn: aRenderer.
</methods> <methods> Seaside.WAFullClassBrowser <category>rendering</category>
style ^ ' div#class-browser { font-family: Verdana; } div#left, div#right { float: left; width: 49.9%; } div#packages, div#classes, div#protocols, div#selectors { float: left; width: 49.9%; } div.clear { clear: both; height: 1em; } div#packages select, div#classes select, div#protocols select, div#selectors select { width: 100%; } div#source { padding: 1em; border: 1px solid #dddddd; background-color: #f5f5f5; } textarea#contents { width: 100%; height: 20em; margin-top: 1em; margin-bottom: 1em; } div#message, div#title { font-weight: bold; } div#message { color: red; } div.nav-options { border-bottom : 1px solid #ccc; margin : 0; padding-bottom : 19px; padding-left : 10px; } div.nav-options ul, div.nav-options li { display : inline; list-style-type : none; margin : 0; padding : 0; } div.nav-options a:link, div.nav-options a:visited { background : #E8EBF0; border : 1px solid #ccc; color : #666; float : left; font-size : small; font-weight : normal; line-height : 14px; margin-right : 8px; padding : 2px 10px 2px 10px; text-decoration : none; } div.nav-options a:link.active, div.nav-options a:visited.active { background : #fff; border-bottom : 1px solid #fff; color : #000; } div.nav-options ul a:hover { color : #f00; } div.nav-options .option-selected a { background : #fff; border-bottom : 1px solid #fff; color : #000; } '
</methods> <methods> Seaside.WAFullClassBrowser <category>initialize-release</category>
setClass: aClass selector: aSymbol self browser setClass: aClass selector: aSymbol.
</methods> <methods> Seaside.WAFullClassBrowser <category>accessing</category>
browser "Answer the value of browser" ^ browser
</methods> <methods> Seaside.WAFullClassBrowser <category>initialize-release</category>
initialRequest: aRequest | theClass | aRequest fields at: 'class' ifPresent: [:className | Smalltalk at: className asSymbol ifPresent: [:class | theClass := (aRequest fields includesKey: 'meta') ifTrue: [class class] ifFalse: [class]. self setClass: theClass selector: nil. aRequest fields at: 'method' ifPresent: [:selector | self setClass: theClass selector: selector asSymbol]]]
</methods> <methods> Seaside.WAFullClassBrowser <category>accessing</category>
left: anObject "Set the value of left" left := anObject
</methods> <methods> Seaside.WAFullClassBrowser <category>accessing</category>
leftComponents "Answer the value of leftComponents" ^ leftComponents
</methods> <methods> Seaside.WAFullClassBrowser <category>accessing</category>
message "Answer the value of message" ^ message
</methods> <methods> Seaside.WAFullClassBrowser <category>browser callbacks</category>
notify: aString at: location in: sourceStream "Here when there was a compile error" message := aString allButLast: 3
</methods> <methods> Seaside.WAFullClassBrowser <category>model</category>
selectedClass self browser classListIndex = 0 ifTrue: [^nil]. ^self classes at: self browser classListIndex
</methods> <methods> Seaside.WAFullClassBrowser <category>model</category>
canSaveSourceCode "Can save new classes with this tool" ^self package notNil
</methods> <methods> Seaside.WAFullClassBrowser <category>navigation</category>
bottomComponent ^bottom main: self; yourself
</methods> <methods> Seaside.WAFullClassBrowser <category>actions</category>
removeSourceCode self selector notNil ifTrue: [^self browser removeMessage]. self protocol notNil ifTrue: [^self browser removeMessageCategory]. self selectedClass notNil ifTrue: [^self browser removeClass].
</methods> <methods> Seaside.WAFullClassBrowser <category>model</category>
classes ^self browser classList
</methods> <methods> Seaside.WAFullClassBrowser <category>model</category>
renameText self protocol notNil ifTrue: [^'method category'].
</methods> <methods> Seaside.WAFullClassBrowser <category>rendering</category>
rendererClass ^WAAsyncRenderCanvas
</methods> <methods> Seaside.WAFullClassBrowser <category>accessing</category>
model "Polymorphism with WABrowser" ^self browser
</methods> <methods> Seaside.WAFullClassBrowser <category>model</category>
package: anObject ^self browser systemCategoryListIndex: (self packages indexOf: anObject)
</methods> <methods> Seaside.WAFullClassBrowser <category>accessing</category>
isReadOnly: anObject "Set the value of isReadOnly" isReadOnly := anObject
</methods> <methods> Seaside.WAFullClassBrowser <category>model</category>
package self browser systemCategoryListIndex = 0 ifTrue: [^nil]. ^self packages at: self browser systemCategoryListIndex
</methods> <methods> Seaside.WAFullClassBrowser <category>model</category>
protocol: anObject ^self browser messageCategoryListIndex: (self protocols indexOf: anObject)
</methods> <methods> Seaside.WAFullClassBrowser <category>navigation</category>
leftComponent ^(leftComponents at: self left) main: self; componentName: self left; yourself
</methods> <methods> Seaside.WAFullClassBrowser <category>navigation</category>
leftOptions ^leftComponents keys
</methods> <methods> Seaside.WALiveActionCallback <category>responding</category>
evaluateWithArgument: argument | currentSession request response renderer document event | currentSession := WACurrentSession value. request := currentSession currentRequest. event := WALiveEvent newFromRequest: request. response := WAResponse new. response contentType: 'text/xml; charset=utf-8'. renderer := self rendererClass context: context copy callbacks: self callbacks. document := WAXmlStreamDocument new stream: response stream. renderer context document: document. block value: event value: renderer. document close. currentSession returnResponse: response
</methods> <methods> Seaside.WALiveActionCallback <category>testing</category>
isEnabled ^ true
</methods> <methods> Seaside.WALiveActionCallback <category>accessing</category>
callbacks ^callbacks
</methods> <methods> Seaside.WALiveActionCallback <category>accessing</category>
rendererClass ^rendererClass
</methods> <methods> Seaside.WALiveActionCallback <category>accessing</category>
callbacks: anObject callbacks := anObject
</methods> <methods> Seaside.WALiveActionCallback <category>accessing</category>
rendererClass: anObject rendererClass := anObject
</methods> <methods> Seaside.WALiveDateInput <category>private callbacks</category>
addYearCallbackToBrush: aBrush super addYearCallbackToBrush: aBrush. self hasLiveCallback ifFalse: [^self]. aBrush liveCallback: [:y :renderer | self year: y. self liveCallback value: self setValueWithNewDate value: renderer].
</methods> <methods> Seaside.WALiveDateInput <category>private callbacks</category>
addDayCallbackToBrush: aBrush super addDayCallbackToBrush: aBrush. self hasLiveCallback ifFalse: [^self]. aBrush liveCallback: [:d :renderer | self day: d. self liveCallback value: self setValueWithNewDate value: renderer].
</methods> <methods> Seaside.WALiveDateInput <category>private callbacks</category>
addMonthCallbackToBrush: aBrush super addMonthCallbackToBrush: aBrush. self hasLiveCallback ifFalse: [^self]. aBrush liveCallback: [:m :renderer | self month: m. self liveCallback value: self setValueWithNewDate value: renderer].
</methods> <methods> Seaside.WALiveEvent <category>accessing</category>
elementTagName ^ elementTagName
</methods> <methods> Seaside.WALiveEvent <category>accessing</category>
elementType ^ elementType
</methods> <methods> Seaside.WALiveEvent <category>services</category>
valueAsBoolean ^elementValue = 'true'
</methods> <methods> Seaside.WALiveEvent <category>accessing</category>
elementId: id ^ elementId := id
</methods> <methods> Seaside.WALiveEvent <category>accessing</category>
type ^ type
</methods> <methods> Seaside.WALiveEvent <category>initialization</category>
fromRequest: aRequest aRequest isLiveRequest ifFalse: [^self error: 'Not a live request']. when := aRequest at: 'timestamp'. (aRequest includesKey: 's') ifTrue: "Live callback" [elementValue := aRequest at: 's']. (aRequest includesKey: 'ms') ifTrue: "Live callback multi-select" [elementValue := (aRequest at: 'ms') findTokens: ',']. (aRequest includesKey: 'eventType') ifTrue: "Event tracking" [type := aRequest at: 'eventType'. elementType := aRequest at: 'targetType'. elementTagName := aRequest at: 'tagName'. elementId := aRequest at: 'id'. elementValue := aRequest at: 'targetValue'].
</methods> <methods> Seaside.WALiveEvent <category>accessing</category>
when ^ when
</methods> <methods> Seaside.WALiveEvent <category>accessing</category>
elementId ^ elementId
</methods> <methods> Seaside.WALiveEvent <category>services</category>
value type = 'check' ifTrue: [^self valueAsBoolean]. ^elementValue.
</methods> <methods> Seaside.WALiveEvent <category>accessing</category>
elementValue ^ elementValue
</methods> <methods> Seaside.WALiveRequestTest <category>rendering</category>
renderCitiesOn: html html spanNamed: 'citySelector' with: [html selectFromList: self cityNames selected: city callback:[:f | city := f ] labels: [:ea | ea ]]
</methods> <methods> Seaside.WALiveRequestTest <category>initialization</category>
initialize count := 0. bool := false. input1 := String new. input2 := String new. input3 := 42. multiSelected := #(0 7). date := Date today. self country: 'Argentina'. booleans := Dictionary new at: #English put: true; at: #Russian put: false; at: #Japanese put: false; yourself.
</methods> <methods> Seaside.WALiveRequestTest <category>rendering</category>
renderRadioOn: html html form: [ html table: [ html tableRow: [ html tableData: 'Language'. html tableData: 'Yes'. html tableData: 'No']. booleans associationsDo: [:assoc | | group | html tableRow: [ group := html radioGroup. html tableData: assoc key. html tableData: [ html cssId: assoc key asString , '-on'. html radioButtonInGroup: group selected: assoc value callback: [assoc value: true] liveCallback: [:item :h | assoc value: true. h spanNamed: 'radio' with: booleans printString]]. html tableData: [ html cssId: assoc key asString , '-off'. html radioButtonInGroup: group selected: assoc value not callback: [assoc value: false] liveCallback: [:item :h | assoc value: false. h spanNamed: 'radio' with: booleans printString]]. ]]. ]]
</methods> <methods> Seaside.WALiveRequestTest <category>accessing</category>
province: anObject province := anObject. self city: self cityNames first.
</methods> <methods> Seaside.WALiveRequestTest <category>accessing</category>
city: anObject city := anObject.
</methods> <methods> Seaside.WALiveRequestTest <category>rendering</category>
renderInput2On: html html form: [html textAreaWithValue: input2 callback: [:v | input2 := v] liveCallback: [:text :h | input2 := text. "Update multiple areas of the document using one live callback" h divNamed: 'backward' with: [h list: input2 reverse do: [:c | h anchorWithAction: [self inform: c asString] text: c asString]]. h spanNamed: 'bwd' with: 'Value entered= ' , input2. ]. html space. html spanNamed: 'bwd' with: 'Value entered= ' , input2. ].
</methods> <methods> Seaside.WALiveRequestTest <category>rendering</category>
renderMultiSelectOn: html html form: [html attributeAt: 'multiple' put: true. html selectFromList: #(0 1 2 3 4 5 6 7 8 9) selected: multiSelected callback: [ :aCollection | multiSelected := aCollection ] labels: [:ea | ea displayString] liveCallback: [:aCollection :h | multiSelected := aCollection. "Update multiple areas of the document using one live callback" h spanNamed: 'multiselect' with: multiSelected. h spanNamed: 'multisel' with: 'Values selected= ' , multiSelected displayString ]. html space. html spanNamed: 'multisel' with: 'Values selected= ' , multiSelected displayString ].
</methods> <methods> Seaside.WALiveRequestTest <category>rendering</category>
renderListOn: html html form: [html selectFromList: #(red blue green) selected: selection callback: [:v | selection := v] labels: [:ea | ea asString] liveCallback: [:item :h | selection := item. "Update multiple areas of the document using one live callback" self renderStyle: selection on: h. h spanNamed: 'selection' with: item. h spanNamed: 'sel' with: 'Value selected= ' , selection displayString. ]. html space. html spanNamed: 'sel' with: 'Value selected= ' , selection displayString. ].
</methods> <methods> Seaside.WALiveRequestTest <category>accessing</category>
cityNames province = 'Oranjestad' ifTrue: [^#( 'Casibari' 'Bubali') ]. province = 'Santa Cruz' ifTrue: [^#( 'Arikok' 'Yamonta') ]. province = 'Buenos Aires' ifTrue: [^#('La Plata' 'Azul')]. province = 'Cordoba' ifTrue: [^#('Alta Gracia' 'La Falda')]. province = 'Florida' ifTrue: [^#('Orlando' 'Miami')]. province = 'California' ifTrue: [^#('Cupertino' 'Santa Barbara' 'Monterey')]. ^#()
</methods> <methods> Seaside.WALiveRequestTest <category>rendering</category>
renderCheckBoxOn: html html form: [html checkboxWithValue: bool callback: [:v | bool := v ] liveCallback: [:item :h | bool := item. "Update multiple areas of the document using one live callback" h spanNamed: 'checkbox' with: (bool ifTrue: ['checked'] ifFalse: ['unchecked']). h spanNamed: 'chk' with: (bool ifTrue: ['checked'] ifFalse: ['unchecked']). ]. html space. html spanNamed: 'chk' with: (bool ifTrue: ['checked'] ifFalse: ['unchecked']). ].
</methods> <methods> Seaside.WALiveRequestTest <category>rendering</category>
renderUnproductiveOn: html html form: [html break. html checkboxWithValue: bool callback: [:v | bool := v ] liveCallback: [:item :h | bool := item. h span: 'This span element has no id'. h cssId: 'unmatched-id'. h span: 'This span element has an unmatched id'. ]. html text: 'Unproductive callback, i.e. no contribution to the page'. ].
</methods> <methods> Seaside.WALiveRequestTest <category>rendering</category>
renderContentOn: html html table: [html tableRowWith: [self renderInput1On: html. self renderInput2On: html. self renderInput3On: html. self renderDateInputOn: html. self renderListOn: html. self renderMultiSelectOn: html. self renderCheckBoxOn: html. self renderRadioOn: html. self renderAnchorOn: html. html break. self renderButtonOn: html. html break. html anchorWithAction: [self error: 'Should not come here'] liveAction: [:h | h spanNamed: 'time' with: 1 / 0] text: 'Live error'. html break; break. html scrollbarWithHeight: 100 size: 1000 liveCallback: [:n :h | h spanNamed: 'scroll' with: n]] with: [html heading: 'Forward' level: 3. html divNamed: 'forward' with: ''. html heading: 'Backward' level: 3. html divNamed: 'backward' with: ''. html heading: 'Number' level: 3. html divNamed: 'number' with: ''. html heading: 'Date' level: 3. html divNamed: 'date' with: ''. html heading: 'Selection' level: 3. html spanNamed: 'selection' with: ''. html heading: 'Multi Selection' level: 3. html spanNamed: 'multiselect' with: ''. html heading: 'Check box' level: 3. html spanNamed: 'checkbox' with: (bool ifTrue: ['checked'] ifFalse: ['unchecked']). html heading: 'Radio buttons' level: 3. html spanNamed: 'radio' with: booleans printString. html heading: 'Time' level: 3. html spanNamed: 'time' with: ''. html heading: 'Scrollbar' level: 3. html spanNamed: 'scroll' with: '']]. html heading: 'Nested live callbacks' level: 3. self renderCountriesOn: html. self renderStyle: nil on: html. html break. self renderUnproductiveOn: html
</methods> <methods> Seaside.WALiveRequestTest <category>rendering</category>
renderAnchorOn: html "The live callback disablea all other onclick" html attributeAt: 'onclick' put: 'debug("This will not display, sorry")'. html anchorWithAction: ["The live callback disables the regular callback" self error: 'Should not come here, please debug me !'] liveAction: [:h | h spanNamed: 'timestamp' with: TimeStamp now. h spanNamed: 'time' with: Time now] text: 'Show time'. html space. html spanNamed: 'timestamp' with: ''.
</methods> <methods> Seaside.WALiveRequestTest <category>rendering</category>
renderDateInputOn: html html form: [html dateInputWithValue: date callback: [:value | date := value] liveCallback: [:value :h | date := value. h divNamed: 'date' with: date. h spanNamed: 'dat' with: 'Value entered= ' , date displayString. ]. html space. html spanNamed: 'dat' with: 'Value entered= ' , date displayString. ].
</methods> <methods> Seaside.WALiveRequestTest <category>rendering</category>
renderCountriesOn: html html selectFromList: #( 'Argentina' 'Aruba' 'USA' ) selected: country callback: [:f | country := f] labels: [:ea | ea ] liveCallback: [:anObject :h | country := anObject. province := self provinceNames first. city := self cityNames first. self renderProvincesOn: h]. self renderProvincesOn: html.
</methods> <methods> Seaside.WALiveRequestTest <category>accessing</category>
provinceNames country = 'Aruba' ifTrue: [^#('Oranjestad' 'Santa Cruz')]. country = 'Argentina' ifTrue: [^#( 'Buenos Aires' 'Cordoba')]. country = 'USA' ifTrue: [^#( 'California' 'Florida')]. ^#()
</methods> <methods> Seaside.WALiveRequestTest <category>rendering</category>
renderInput1On: html html form: [html textInputWithValue: input1 callback: [:v | input1 := v] liveCallback: [:text :h | input1 := text. "Update multiple areas of the document using one live callback" h divNamed: 'forward' with: [h list: input1 do: [:c | h anchorWithAction: [self inform: c asString] text: c asString]]. h spanNamed: 'fwd' with: [h text: 'Value entered= ' , input1. h script: 'debug("Javascript in a live callback ' , input1 , ' ");']. ]. html space. html spanNamed: 'fwd' with: 'Value entered= ' , input1. html break. html text: 'Above: Javascript attached= debug("javascript in a live callback xxx ");'. ].
</methods> <methods> Seaside.WALiveRequestTest <category>rendering</category>
renderButtonOn: html html form: ["The live callback disablea all other onclick" html attributeAt: 'onclick' put: 'debug("This will not display, sorry")'. html submitButtonWithAction: ["The live callback disables the regular callback" self error: 'Should not come here, please debug me !'] liveAction: [:h | h spanNamed: 'timestamp-button' with: TimeStamp now. h spanNamed: 'time' with: Time now] text: 'Show time']. html space. html spanNamed: 'timestamp-button' with: ''
</methods> <methods> Seaside.WALiveRequestTest <category>accessing</category>
country: anObject country := anObject. self province: self provinceNames first.
</methods> <methods> Seaside.WALiveRequestTest <category>rendering</category>
rendererClass "Intentionally using the classic API" ^WAAsyncHtmlRenderer
</methods> <methods> Seaside.WALiveRequestTest <category>rendering</category>
renderInput3On: html html form: [html textInputWithValue: input3 callback: [:v | input3 := v] liveCallback: [:value :h | input3 := value. "Update multiple areas of the document using one live callback" h divNamed: 'number' with: input3. h spanNamed: 'nbr' with: 'Value entered= ' , input3 asString. ]. html space. html spanNamed: 'nbr' with: 'Value entered= ' , input3 asString. ].
</methods> <methods> Seaside.WALiveRequestTest <category>rendering</category>
renderProvincesOn: html html spanNamed: 'provinceSelector' with: [html selectFromList: self provinceNames selected: province callback: [:f | province := f] labels: [:ea | ea ] liveCallback: [:anObject :h | province := anObject. city := self cityNames first. self renderCitiesOn: h]]. self renderCitiesOn: html.
</methods> <methods> Seaside.WALiveRequestTest <category>rendering</category>
renderStyle: aString on: html | color | color := aString ifNil: ['red']. html attributes id: 'style-1'. html tag: 'style' do:'#sel {color:' , color , ';}'. html attributes id: 'style-2'. html tag: 'style' do: '#selection {color:' , color , ';}'.
</methods> <methods> Seaside.WALiveTimeInput <category>private callbacks</category>
addHoursCallbackToBrush: aBrush super addHoursCallbackToBrush: aBrush. self hasLiveCallback ifFalse: [^self]. aBrush liveCallback: [:h :renderer | self hours: h. self liveCallback value: self setValueWithNewTime value: renderer].
</methods> <methods> Seaside.WALiveTimeInput <category>private callbacks</category>
addMinutesCallbackToBrush: aBrush super addMinutesCallbackToBrush: aBrush. self hasLiveCallback ifFalse: [^self]. aBrush liveCallback: [:m :renderer | self minutes: m. self liveCallback value: self setValueWithNewTime value: renderer].
</methods> <methods> Seaside.WALiveTimeInput <category>private callbacks</category>
addSecondsCallbackToBrush: aBrush super addSecondsCallbackToBrush: aBrush. self hasLiveCallback ifFalse: [^self]. aBrush liveCallback: [:s :renderer | self seconds: s. self liveCallback value: self setValueWithNewTime value: renderer].
</methods> <methods> Seaside.WAPeriodicLiveRequestTest <category>rendering</category>
renderLogOn: html html withLineBreaks: log contents
</methods> <methods> Seaside.WAPeriodicLiveRequestTest <category>initialize</category>
initialize log := String new writeStream.
</methods> <methods> Seaside.WAPeriodicLiveRequestTest <category>rendering</category>
renderRefreshedElementsOn: html | liveUpdateBlock | liveUpdateBlock := [ :event :h | log nextPutAll: 'Timed log at ' , Time now printString , ' for ' , event elementId; cr; nextPut: Character lf. h text: Time now printString]. html table: [ html tableRowWith: [html text: 'Current Time in default div:'] with: [log nextPutAll: 'Default div id=' , html peekNextId; cr; nextPut: Character lf. html refreshDivWith: liveUpdateBlock every: 2 seconds]; tableRowWith: [html text: 'Current Time in named div:'] with: [log nextPutAll: 'Named div id=myLiveDiv'; cr; nextPut: Character lf. html refreshDivNamed: 'myLiveDiv' with: liveUpdateBlock every: 3 seconds]; tableRowWith: [html text: 'Current Time in default span:'] with: [log nextPutAll: 'Default span id=' , html peekNextId; cr; nextPut: Character lf. html refreshSpanWith: liveUpdateBlock every: 5 seconds]. ].
</methods> <methods> Seaside.WAPeriodicLiveRequestTest <category>rendering</category>
rendererClass "Intentionally using the classic API" ^WAAsyncHtmlRenderer
</methods> <methods> Seaside.WAPeriodicLiveRequestTest <category>rendering</category>
renderRefreshedLogOn: html html heading: 'Refreshed log' level: 3. html divNamed: 'log' with: [self renderLogOn: html] refreshWith: [ :event :h | h break. self renderLogOn: h] every: 5 seconds
</methods> <methods> Seaside.WAPeriodicLiveRequestTest <category>rendering</category>
renderContentOn: html self renderRefreshedElementsOn: html. self renderRefreshedLogOn: html.
</methods> <methods> Seaside.WAPermissiveBrowser <category>accessing</category>
systemNavigation
</methods> <methods> Seaside.WAPermissiveBrowser <category>confirm</category>
confirm: aString ^self component confirm: aString
</methods> <methods> Seaside.WAPermissiveBrowser <category>accessing</category>
component ^ component
</methods> <methods> Seaside.WAPermissiveBrowser <category>accessing</category>
component: anObject component := anObject
</methods> <methods> Seaside.WAPermissiveBrowser <category>confirm</category>
confirmRemovalOf: aSelector on: aClass ^1
</methods> <methods> Seaside.WAPermissiveBrowser <category>confirm</category>
request: aString initialAnswer: anotherString ^self component request: aString default: anotherString
</methods> <methods> Seaside.WAUnknownVariable <category>accessing</category>
varName: anObject "Set the value of varName" varName := anObject
</methods> <methods> Seaside.WAUnknownVariable <category>accessing</category>
messageText "Return an exception's message text." ^'Undefined variable ' , varName printString
</methods> <methods> Seaside.WAUnknownVariable <category>accessing</category>
varName "Answer the value of varName" ^ varName
</methods> <methods> Seaside.WAXmlRoot <category>constants</category>
contentType ^'text/xml'
</methods> <methods> Seaside.WAXmlRoot <category>constants</category>
writeOn: aStream aStream nextPutAll: '<?xml version="1.0" encoding="'; nextPutAll: self charSet; nextPutAll: '"?><body'. bodyAttrs writeOn: aStream. aStream nextPutAll: '>'.
</methods> <methods> Seaside.WAXmlStreamDocument <category>public</category>
close self writeLoadScripts. self bodyStream nextPutAll: '</body>'.
</methods> <methods> Seaside.WAXmlStreamDocument <category>public</category>
writeLoadScripts | session renderer aStream | session := WACurrentSession value. (session isNil or: [ session onLoadScripts isEmpty ]) ifTrue: [ ^ self ]. renderer := WAStaticHtmlCanvas document: self. aStream := (String new: 200) writeStream. session onLoadScripts do: [ :each | aStream nextPutAll: each displayString ] separatedBy: [ aStream nextPut: $; ]. renderer script: aStream contents. session clearLoadScripts
</methods> <methods> Seaside.WAAsyncComponent class <category>registration</category>
registerAsAuthenticatedApplication: appName ^(super registerAsAuthenticatedApplication: appName) addLibrary: WAAsyncScripts; yourself
</methods> <methods> Seaside.WAAsyncComponent class <category>registration</category>
registerAsApplication: appName ^(super registerAsApplication: appName) addLibrary: WAAsyncScripts; yourself
</methods> <methods> Seaside.WAAutoCompleteTest class <category>class initialization</category>
initialize self registerAsApplication: 'tests/async/classic/autocomplete'
</methods> <methods> Seaside.WACanvasFocusTest class <category>initialization</category>
initialize self registerAsApplication: 'tests/async/canvas/focuscapture'.
</methods> <methods> Seaside.WACanvasLiveRequestTest class <category>initialization</category>
initialize self registerAsApplication: 'tests/async/canvas/livetests'.
</methods> <methods> Seaside.WACanvasLiveRequestTest class <category>testing</category>
canBeRoot ^ true
</methods> <methods> Seaside.WACanvasPeriodicLiveRequestTest class <category>class initialization</category>
initialize self registerAsApplication: 'tests/async/canvas/periodictests'.
</methods> <methods> Seaside.WAFocusTest class <category>initialization</category>
initialize self registerAsApplication: 'tests/async/classic/focuscapture'
</methods> <methods> Seaside.WAFullClassBrowser class <category>instance creation</category>
fullOnClass: aClass ^self fullOnClass: aClass selector: nil
</methods> <methods> Seaside.WAFullClassBrowser class <category>class initialization</category>
initialize self registerAsApplication: 'tools/classbrowser'
</methods> <methods> Seaside.WAFullClassBrowser class <category>instance creation</category>
fullOnClass: aClass selector: aSelector ^(self new) setClass: aClass selector: aSelector; yourself
</methods> <methods> Seaside.WAFullClassBrowser class <category>testing</category>
canBeRoot ^true
</methods> <methods> Seaside.WAFullClassBrowser class <category>accessing</category>
description ^'Ajax Smalltalk class browser (four panes)'
</methods> <methods> Seaside.WALiveEvent class <category>as yet unclassified</category>
newFromRequest: aRequest ^self new fromRequest: aRequest
</methods> <methods> Seaside.WALiveEvent class <category>initialization</category>
initialize (self respondsTo: #convertSeasideString:) ifFalse: [self error: 'This version of SeasideAsync requires Seaside 2.6b1 or better'].
</methods> <methods> Seaside.WALiveRequestTest class <category>initialization</category>
initialize self registerAsApplication: 'tests/async/classic/livetests'
</methods> <methods> Seaside.WALiveRequestTest class <category>testing</category>
canBeRoot ^ true
</methods> <methods> Seaside.WAPeriodicLiveRequestTest class <category>class initialization</category>
initialize self registerAsApplication: 'tests/async/classic/periodictests'
</methods> <methods> Seaside.WAXmlStreamDocument class <category>instance creation</category>
new ^ self root: self newRoot
</methods> <methods> Seaside.WAXmlStreamDocument class <category>instance creation</category>
newRoot ^ self rootClass new
</methods> <methods> Seaside.WAXmlStreamDocument class <category>instance creation</category>
rootClass ^WAXmlRoot
</methods> <initialize> Seaside.WAAutoCompleteTest </initialize> <initialize> Seaside.WACanvasFocusTest </initialize> <initialize> Seaside.WACanvasLiveRequestTest </initialize> <initialize> Seaside.WACanvasPeriodicLiveRequestTest </initialize> <initialize> Seaside.WAFocusTest </initialize> <initialize> Seaside.WAFullClassBrowser </initialize> <initialize> Seaside.WALiveEvent </initialize> <initialize> Seaside.WALiveRequestTest </initialize> <initialize> Seaside.WAPeriodicLiveRequestTest </initialize>