ProtoObjectObjectWAPresenterWAComponentSCBrowserHistoryView
| currentLocation | history |
| instance | class |
|---|---|
| accessing actions initialization rendering | instance creation |
| currentLocation |
|---|
| history |
|---|
| 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 |
| instance creation |
|---|
| forBrowser: aBrowser |
^ self new history: aBrowser history |