The plan from here: TicTacToe, as simple as possible.
Next, I am going to create a sample TicTacToe template to demonstrate how easily one can develop applications over TwoWayWeb.
It should be this easy:
- Make a new, empty template. Call it tictactoe.html.
- Include the 4 necesary Javascript files. (We plan to bring this down to 1).
- Create a 3x3 table, with some ID ("TicTacToeBoard").
- In each cell, make a DIV with the attribute twoway="true".
- For now, make their styles all "background: yellow; width: 100em; height: 100em;"
- Alternately:
- Define a create_first_element function, to create one DIV in each cell of the table.
- Tell the server about each one by calling "TwoWay.watch( element );"
- Load a page with that template, and marvel at your 3x3 grid of boxes.
- Open that page in another browser, and change the color of one box with FireBug or something. Watch the change appear on your other browser.
- Add a method that cycles an element's innerHTML between X, O and [blank].
- Attach that method to the ONCLICK of each DIV.
- Point a friend at some page with your new template, and play!
Other plans:
- Reduce the 4-script include in barebones to a single script.
- Make debug() create its own debugging DIV if necessary.
- Make a logging function, and have it do the same.
- Update all instances of "if (LOGGING)".
- Add a --onescript option to Launch2way.py, to match the new feature in 2way
- Possibly add a main() to 2way.py that the launcher can call with profiling, rather than invoking a new Python process.
- Move most of the Python sources to py/ or something, to clean up the directory.
- Make a short note that explains what each file does.
- Let each page "know" about a preferred viewing template.
- Refactor saver.py (waaay down there on the list).
- Look into using SvnX or something for easier SVN access on OS X.
2 Comments:
http://www.aaronsw.com/2002/diff/
HTMLDiff.py might be an interesting way to handle what happens when two people edit the same note simultaneously.
it might also be a good tool for creating an interleaved chat note that synthesises two individual notes
this would make a good template....
http://www.quirksmode.org/dom/cms.html
Post a Comment
<< Home