WAHtmlRoot


Seaside-Document

Comment:



Hierarchy:

ProtoObject
Object
WAHtmlRoot

Summary:

instance variables:

bodyAttrs docType headAttrs headElements htmlAttrs scripts styles title

methods:

instance class
as yet unclassified as yet unclassified

Detail:

instance variables:

bodyAttrs
InitialValue:
a WAHtmlAttributes
inferredType:
WAHtmlAttributes
docType
InitialValue:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
inferredType:
String
headAttrs
InitialValue:
a WAHtmlAttributes
inferredType:
WAHtmlAttributes
headElements
InitialValue:
an OrderedCollection()
inferredType:
OrderedCollection
htmlAttrs
InitialValue:
a WAHtmlAttributes
inferredType:
WAHtmlAttributes
scripts
InitialValue:
an OrderedCollection()
inferredType:
OrderedCollection
styles
InitialValue:
an OrderedCollection()
inferredType:
OrderedCollection
title
InitialValue:
''
inferredType:
String

instance methods:

as yet unclassified
addHeadElement: anHtmlElement

	headElements add: anHtmlElement
addScript: aString

	(scripts includes: aString) ifFalse: [scripts add: aString]
addStyle: aString

	(styles includes: aString) ifFalse: [styles add: aString]
bodyAttributes

	^ bodyAttrs
docType

	^ docType
docType: aString

	docType _ aString
headAttributes

	^ headAttrs
htmlAttributes

	^ htmlAttrs
initialize

	htmlAttrs _ WAHtmlAttributes new.
	headAttrs _ WAHtmlAttributes new.
	bodyAttrs _ WAHtmlAttributes new.
	headElements _ OrderedCollection new.
	scripts _ OrderedCollection new.
	styles _ OrderedCollection new.
	docType _ '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'.
	title _ ''.
title

	^ title
title: aString

	title _ aString
writeHeadOn: aStream

	aStream nextPutAll: '<title>', title, '</title>'.
	styles do: [:ea | self writeStyle: ea on: aStream].
	scripts do: [:ea | self writeScript: ea on: aStream].
	headElements do: [:ea | ea writeOn: aStream]
writeOn: aStream

	aStream nextPutAll: docType.
	aStream nextPutAll: '<html'.
	htmlAttrs writeOn: aStream.
	aStream nextPutAll: '><head'.
	headAttrs writeOn: aStream.
	aStream nextPutAll: '>'.
	self writeHeadOn: aStream. 
	aStream nextPutAll: '</head><body'.
	bodyAttrs writeOn: aStream.
	aStream nextPutAll: '>'.
writeScript: aString on: aStream

	aStream
		nextPutAll: '<script type="text/javascript">';
		nextPutAll: aString;
		nextPutAll: '</script>'
writeStyle: aString on: aStream

	aStream
		nextPutAll: '<style>';
		nextPutAll: aString;
		nextPutAll: '</style>'

class methods:

as yet unclassified
new

	^ self basicNew initialize

^top


- made by Dandelion -