WAHtmlCanvas


Seaside-Canvas

Comment:



Hierarchy:

ProtoObject
Object
WACanvas
WAHtmlCanvas

Summary:

instance variables:

document

methods:

instance class
as yet unclassified encoding html html-generated as yet unclassified

Detail:

instance variables:

document
inferredType:
UndefinedObject

instance methods:

as yet unclassified
document

	self subclassResponsibility
tag: aString

	^ self brush: (WAGenericTag tag: aString)

encoding
encodeCharacter: aCharacter

	self html: ('&#', aCharacter asInteger asString, ';').  
html: aString

	self flush.
	self document text: aString asString
text: anObject

	self html: (WAAbstractHtmlBuilder encode: anObject)

html
heading: aBlock

	self heading: aBlock level: 1
heading: aBlock level: aNumber

	(self tag: 'h', aNumber asString) with: aBlock
space

	self html: ' '

html-generated
anchor

	^ self brush: WAAnchorTag new
blockquote

	^ self tag: 'blockquote'
blockquote: aBlock

	self blockquote with: aBlock
bold

	^ self tag: 'b'
bold: aBlock

	self bold with: aBlock
break

	^ self tag: 'br'
code

	^ self tag: 'code'
code: aBlock

	self code with: aBlock
div

	^ self tag: 'div'
div: aBlock

	self div with: aBlock
form

	^ self brush: WAFormTag new
form: aBlock

	self form with: aBlock
horizontalRule

	^ self tag: 'hr'
italic

	^ self tag: 'i'
italic: aBlock

	self italic with: aBlock
listItem

	^ self tag: 'li'
listItem: aBlock

	self listItem with: aBlock
paragraph

	^ self tag: 'p'
paragraph: aBlock

	self paragraph with: aBlock
preformatted

	^ self tag: 'pre'
preformatted: aBlock

	self preformatted with: aBlock
script

	^ self tag: 'script'
script: aBlock

	self script with: aBlock
small

	^ self tag: 'small'
small: aBlock

	self small with: aBlock
span

	^ self tag: 'span'
span: aBlock

	self span with: aBlock
table

	^ self tag: 'table'
table: aBlock

	self table with: aBlock
tableData

	^ self tag: 'td'
tableData: aBlock

	self tableData with: aBlock
tableRow

	^ self tag: 'tr'
tableRow: aBlock

	self tableRow with: aBlock
unorderedList

	^ self tag: 'ul'
unorderedList: aBlock

	self unorderedList with: aBlock

class methods:

as yet unclassified
generateTags

	self tags do:
		[:pair |
		self compile: pair second, '
	^ self ', (self patternFor: pair first)
			classified: 'html-generated'.
		pair size = 3 ifTrue:
			[self compile: pair third, ' aBlock
	self ', pair second, ' with: aBlock'
			classified: 'html-generated']]
patternFor: aString

	WATagBrush allSubclassesDo: [:ea | ea new tag = aString ifTrue: [^ 'brush: ', ea name, ' new']].
	^ 'tag: ', aString printString
tags

	"
	self generateTags
	"

	^ #(
		('a' anchor)
		
		('p' paragraph paragraph:)
		('div' div div:)
		('span' span span:)

		('blockquote' blockquote blockquote:)
		
		('code' code code:)
		('pre' preformatted preformatted:)
		('b' bold bold:)
		('i' italic italic:)
		('small' small small:)
						
		('ul' unorderedList unorderedList:)
		('li' listItem listItem:)
		
		('br' break)
		('hr' horizontalRule)
		
		('form' form form:)
		
		('table' table table:)
		('tr' tableRow tableRow:)
		('td' tableData tableData:)
		
		('script' script script:)
		)

^top


- made by Dandelion -