Standalone package for WABuilder / WAHtmlCanvas ?

"H. Hirzel" <[email protected]>
Newsgroups gmane.comp.lang.smalltalk.squeak.seaside
Message-ID <CAGQxfVhv0NQPs1MWy8yqzsQ9+YGixGOJymmmHyw_TFME=mBo2Q@mail.gmail.com>
Hello

Is there a ConfigurationOf ... file which loads what is needed to run
WABuilder with WAHtmlCanvas  [1] stand-alone (no need other Seaside
package loaded)  to generate HTML Seaside style?

If not which packages of the Seaside distribution would I need to load manually?

Recently there was a request on the Pharo list for this.

Thank you in advance.

Hannes


------------------------------------------------
[1]

 WAObject subclass: #WABuilder
	instanceVariableNames: 'fullDocument rootBlock rootClass
documentClass scriptGeneratorClass rendererClass codec actionUrl
resourceUrl'
	classVariableNames: ''
	poolDictionaries: ''
	category: 'Seaside-Core-Rendering'



This is a convenience class which provides a result of a rendering
operation as a string. It is expected to be used like this:

 WAHtmlCanvas builder render: [ :html |
	html anchor
		url: 'htttp://www.seaside.st';
		with: 'Seaside Homepage' ]


..................

WABuilderCanvasTest has more examples.


testBody
	| actual |
	actual := WAHtmlCanvas builder render: [ :html |
		html unorderedList: [
			html listItem: 'an item' ] ].
	self assert: actual = '<ul><li>an item</li></ul>'


testFullDocument
	| actual |
	actual := WAHtmlCanvas builder fullDocument: true; render: [ :html |
		html unorderedList: [
			html listItem: 'an item' ] ].
	self assert: actual = '<html><head><title></title></head><body
onload="onLoad()"><ul><li>an item</li></ul><script
type="text/javascript">function onLoad(){};</script></body></html>'


testFullDocumentWithBlock
	| actual |
	actual := WAHtmlCanvas builder fullDocument: true;
		rootBlock: [ :root |
			root title: 'title'.
			root stylesheet add: 'body{font-size:12px;}'.
			root javascript add: 'alert("loaded")' ];
		render: [ :html |
			html unorderedList: [
				html listItem: 'an item' ] ].
	self assert: actual =  '<html><head><title>title</title><style
type="text/css">body{font-size:12px;}</style><script
type="text/javascript">alert("loaded")</script></head><body
onload="onLoad()"><ul><li>an item</li></ul><script
type="text/javascript">function onLoad(){};</script></body></html>'
_______________________________________________
seaside mailing list
[email protected]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.