[Seaside] JSObject printOn:

Stan Shepherd stan.shepherd414 at gmail.com
Sun Dec 27 12:48:04 UTC 2009



Lukas Renggli wrote:
> 
> I renamed #printOn: and #printContentOn: to #javascriptOn: and
> #javascriptContentOn: in subclasses of JSObject with the latest commit
> series. All functional tests and examples continue to work. People
> that subclassed JSObject in external projects need to perform that
> renaming too, otherwise their code will break.
> 
> Lukas
> 
> 2009/12/24 Stan Shepherd <stan.shepherd414 at gmail.com>:
>>
>>
>> Stan Shepherd wrote:
>>>
>>>
>>> Lukas Renggli wrote:
>>>>
>>>> Also it makes it possible to use any objects (like strings themselves)
>>>> can be added as load scripts.
>>>>
>>> So would the following be a valid comment for #addLoadScript:?
>>>
>>>  addLoadScript: anObject
>>>       "anObject is any object which replies to #printOn: with valid
>>> javascript.
>>>       usually it will be a JSObject or a string.
>>>       example:
>>>       html document
>>>               addLoadScript: 'message()'.
>>>       will render:
>>>       <script type="text/javascript">/*<![CDATA[*/function
>>> onLoad(){message()}/*]]>*/</script>"
>>>
>>>         loadScripts := loadScripts copyWith: anObject.
>>>         ^ anObject
>>>
>>> Cheers,   ...Stan
>>>
>>>
>>
>>
>> Along the same lines,
>> WAScriptTag>>with: aString
>>        self attributes
>>                at: 'type'
>>                ifAbsentPut: [ 'text/javascript' ].
>>        super with:
>>                [ aString isNil ifFalse: [ self document nextPutAll:
>> aString greaseString
>> ] ]
>>
>> is called by
>> WAHtmlCanvas>>script: aBlock
>>        self script with: aBlock
>>
>> so the parameter changes from Block to String in the passing. Am I right
>> in
>> thinking aBlock should be aString?
>> ...Stan
>>
>>
> 
> -- 
> Lukas Renggli
> http://www.lukas-renggli.ch
> 
> 
> 

Thanks, that looks much clearer.
...Stan

-- 
View this message in context: http://n4.nabble.com/JSObject-printOn-tp976924p979402.html
Sent from the Squeak - Seaside mailing list archive at Nabble.com.


More information about the seaside mailing list