The code is like this (in Javascript):
1) On every chat entry: Push it into a javascript array. If the array is 30, knock the last one off.
2) If keypress (specifically the up key)
[new part: also check for focus] pull out the most recent thing in the array and change an index variable to allow for cycling through the chat array.
3) Same thing but for down and the index variable goes the other way. |