todo.html 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. <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. blackboard = amber.globals.App._new();
  25. amber.globals.Trapped._start_([blackboard]);
  26. });
  27. });
  28. });
  29. });
  30. </script>
  31. </head>
  32. <body>
  33. <h2 data-trap="~title"></h2>
  34. <div data-trap=": (guard (~todos ~notNil)) xontent" data-xontent>
  35. <span data-trap="~remaining"></span> of <span data-trap="~todos ~size"></span> remaning
  36. [ <a href="" data-trap=": (signal archive) whenClicked">archive</a> ]
  37. <ul>
  38. <script type="application/x-beacon" data-trap="~todos: loopZ xontent" data-xontent="until end"></script>
  39. <li>
  40. <label>
  41. <input type="checkbox" data-trap="done: inputChecked"/>
  42. <span data-trap="done: (replace ^ with ^done-) (attr class). text"></span>
  43. </label>
  44. </li>
  45. </ul>
  46. <form data-trap=": (signal addTodo) whenSubmitted">
  47. <input type="text" data-trap="~todoText: inputValue" size="30" placeholder="add new todo here"/>
  48. <input type="submit" class="btn-primary" value="add"/>
  49. </form>
  50. </div>
  51. <p data-trap=": (guard (~todos ~isNil)) xontent" data-xontent>Loading (fake 2 sec pause)...</p>
  52. </body>
  53. </html>