todo.html 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <!doctype html>
  2. <html data-trap="App: path">
  3. <head>
  4. <title data-trap="#title"></title>
  5. <style>
  6. [data-trap] {
  7. display: none
  8. }
  9. </style>
  10. <script src="../bower_components/amber/support/amber.js"></script>
  11. <script type='text/javascript' src='../bower_components/amber/support/requirejs/require.min.js'></script>
  12. <link rel="stylesheet" href="todo.css"/>
  13. <script type="text/javascript">
  14. var blackboard;
  15. require.config({
  16. paths: {
  17. 'gh_herby_trapped': '../js',
  18. 'gh_herby_trapped_todo': 'js',
  19. 'gh_herby_trapped_todo/_source': 'st'
  20. }
  21. });
  22. require(
  23. ["amber/devel",
  24. "gh_herby_trapped/Trapped-Processors", "gh_herby_trapped_todo/Trapped-Todo" ],
  25. function (smalltalk) {
  26. smalltalk.defaultAmdNamespace = 'gh_herby_trapped_todo';
  27. smalltalk.initialize();
  28. $(function () {
  29. smalltalk.Browser._openOn_(smalltalk.App);
  30. blackboard = smalltalk.App._new();
  31. smalltalk.Trapped._start_([blackboard]);
  32. });
  33. }
  34. );
  35. </script>
  36. </head>
  37. <body>
  38. <h2 data-trap="#title"></h2>
  39. <div data-trap=": (guardContents (#todos #notNil))">
  40. <span data-trap="#remaining"></span> of <span data-trap="#todos #size"></span> remaning
  41. [ <a href="" data-trap=": (signal archive) whenClicked">archive</a> ]
  42. <ul><ins data-trap="#todos: loopContents">
  43. <li>
  44. <input type="checkbox" data-trap="done: inputChecked" />
  45. <span data-trap="done: (replace ^ with ^done-) (attr class). text" ></span>
  46. </li>
  47. </ins></ul>
  48. <form data-trap=": (signal addTodo) whenSubmitted">
  49. <input type="text" data-trap="#todoText: inputValue" size="30" placeholder="add new todo here"/>
  50. <input type="submit" class="btn-primary" value="add"/>
  51. </form>
  52. </div>
  53. <p data-trap=": (guardContents (#todos #isNil))">Loading (fake 2 sec pause)...</p>
  54. </body>
  55. </html>