counter.html 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <title>Trapped - Counter example</title>
  5. <style>
  6. [data-trap] {
  7. display: none
  8. }
  9. button {
  10. font-family: monospace;
  11. }
  12. </style>
  13. <meta name="author" content="Herbert Vojčík" />
  14. <script type='text/javascript' src='../the.js'></script>
  15. <script type="text/javascript">
  16. var blackboard;
  17. require.config({baseUrl: '..'});
  18. require(
  19. ["app", "trapped-counter/Trapped-Counter" ],
  20. function (amber) {
  21. amber.initialize({
  22. //used for all new packages in IDE
  23. 'transport.defaultAmdNamespace': "trapped-counter"
  24. });
  25. require(["amber-ide-starter-dialog"], function (dlg) { dlg.start(); });
  26. $(function () {
  27. blackboard = amber.globals.App._new();
  28. amber.globals.Trapped._start_([blackboard]);
  29. });
  30. }
  31. );
  32. </script>
  33. </head>
  34. <body>
  35. <h2 data-trap="App ~value"></h2>
  36. <button data-trap="App: (signal increment) whenClicked">++</button>
  37. <button data-trap="App: (signal decrement) whenClicked">--</button>
  38. </body>
  39. </html>