todo.html 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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(
  17. ["app", "trapped-todo/Trapped-Todo"],
  18. function (amber) {
  19. amber.initialize({
  20. //used for all new packages in IDE
  21. 'transport.defaultAmdNamespace': "trapped-todo"
  22. });
  23. require(["amber-ide-starter-dialog"], function (dlg) { dlg.start(); });
  24. $(function () {
  25. blackboard = amber.globals.App._new();
  26. amber.globals.Trapped._start_([blackboard]);
  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>