davepeck/appengine-go — pull request #15 by duncanexonsmith (2012-08-19 14:10:15+00:00)
Title: Linking to specific moves in the history

I've added linking from the chat to specific moves in the history.

- There's a new handler, ```HistoryMoveHandler```, that shares most of its code with ```HistoryHandler```. It takes an extra 'move' argument in the URL: ```/history/([-\w]+)/(0|[1-9]\d*)/```. The only difference is that the history is initialized to the specified move instead of the latest one. If the move doesn't exist, it just goes to the latest one.

- ```/service/get-historical-state/``` now reports the max move number. As a result, the history page will notice if a new move has been made, and update the ```(out of {{max}})``` text.

- The chat auto-linkifies any ```\B#(0|[1-9]\d*)\b``` to a link to that move in the history. For example, ```#5``` will go to the fifth move. However, the ```#4``` in ```abc#4``` will not match, which should protect funny URLs that get pasted into the chat.

- Each chat entry includes the move number before the name. This serves the practical purpose of anchoring the message to the move to which it refers. It's also pedagogical: users should pretty quickly discover how to make move links of their own.