SCBrowserHistoryView


SeasideTesting-TestRunner

Comment:



Hierarchy:

ProtoObject
Object
WAPresenter
WAComponent
SCBrowserHistoryView

Summary:

instance variables:

currentLocation history

methods:

instance class
accessing actions initialization rendering instance creation

Detail:

instance variables:

currentLocation
history

instance methods:

accessing
history: h
 
	history _ h.
	currentLocation _ h size

actions
nextPage

	currentLocation _ currentLocation + 1 min: history size
previousPage

	currentLocation _ currentLocation - 1 max: 1

initialization
initialize

	super initialize.
	currentLocation _ 1

rendering
onlyBodyOf: aString
 
	| rs result |
	rs _ aString readStream.
	rs upToAll: '<body>'.
	result _ rs upToAll: '</body>'.
	^ result
renderContentOn: html
 
	html heading: 'Test view replay page ' , currentLocation printString , ' of ' , history size printString level: 2.
	html
		anchorWithAction: [self answer]
		text: 'close'.
	html space.
	currentLocation > 1
		ifTrue: [html
				anchorWithAction: [self previousPage]
				text: '<<'].
	html text: '--'.
	currentLocation < history size
		ifTrue: [html
				anchorWithAction: [self nextPage]
				text: '>>'].
	html break; hr.
	self renderCurrentResponseOn: html.
renderCurrentResponseOn: html
 
	| item |
	currentLocation = 0 ifTrue: [^nil].
	item := history at: currentLocation.
	html
		html: (self onlyBodyOf: item value fullStringContents)
renderRequestOn: html
 
	"Doesn't currently work. Not called."
	html heading: 'This page was sumitted with: '.
	html break.
	html text: (history at: currentLocation) key stream contents

class methods:

instance creation
forBrowser: aBrowser
 
	^ self new history: aBrowser history

^top


- made by Dandelion -