todo.html 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <!doctype html>
  2. <html data-trap="TrappedTodo: path">
  3. <head>
  4. <title data-trap="~title"></title>
  5. <style>
  6. [data-trap] {
  7. display: none
  8. }
  9. </style>
  10. <meta name="author" content="Herbert Vojčík"/>
  11. <link rel="stylesheet" href="todo.css"/>
  12. <script type='text/javascript' src='../the.js'></script>
  13. <script type="text/javascript">
  14. var blackboard;
  15. require.config({baseUrl: '..'});
  16. require(["app", "trapped-todo/Trapped-Todo"], function (amberPromise) {
  17. Promise.resolve(amberPromise).then(function (amber) {
  18. amber.initialize({
  19. //used for all new packages in IDE
  20. 'transport.defaultAmdNamespace': "trapped-todo"
  21. }).then(function () {
  22. require(["amber-ide-starter-dialog"], function (dlg) { dlg.start(); });
  23. $(function () {
  24. amber.globals.TodoApp._start();
  25. });
  26. });
  27. });
  28. });
  29. </script>
  30. </head>
  31. <body>
  32. <h2 data-trap="~title"></h2>
  33. <div data-trap=": (guard (~todos ~notNil)) xontent" data-xontent>
  34. <span data-trap="~remaining"></span> of <span data-trap="~todos ~size"></span> remaning
  35. [ <a href="" data-trap=": (signal archive) whenClicked">archive</a> ]
  36. <ul>
  37. <script type="application/x-beacon" data-trap="~todos: loopZ xontent" data-xontent="until end"></script>
  38. <li>
  39. <label>
  40. <input type="checkbox" data-trap="done: inputChecked"/>
  41. <span data-trap="done: (replace ^ with ^done-) (attr class). text"></span>
  42. </label>
  43. </li>
  44. </ul>
  45. <form data-trap=": (signal addTodo) whenSubmitted">
  46. <input type="text" data-trap="~todoText: inputValue" size="30" placeholder="add new todo here"/>
  47. <input type="submit" class="btn-primary" value="add"/>
  48. </form>
  49. </div>
  50. <p data-trap=": (guard (~todos ~isNil)) xontent" data-xontent>Loading (fake 2 sec pause)...</p>
  51. </body>
  52. </html>