counter.html 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. <script src="../bower_components/amber/support/amber.js"></script>
  14. <script type='text/javascript' src='../bower_components/amber/support/requirejs/require.min.js'></script>
  15. <script type="text/javascript">
  16. var blackboard;
  17. require.config({
  18. paths: {
  19. 'gh_herby_trapped': '../js',
  20. 'gh_herby_trapped_counter': 'js',
  21. 'gh_herby_trapped_counter/_source': 'st'
  22. }
  23. });
  24. require(
  25. ["amber/devel",
  26. "gh_herby_trapped/Trapped-Processors", "gh_herby_trapped_counter/Trapped-Counter" ],
  27. function (smalltalk) {
  28. smalltalk.defaultAmdNamespace = 'gh_herby_trapped_todo';
  29. smalltalk.initialize();
  30. $(function () {
  31. smalltalk.Browser._openOn_(smalltalk.App);
  32. blackboard = smalltalk.App._new();
  33. smalltalk.Trapped._start_([blackboard]);
  34. });
  35. }
  36. );
  37. </script>
  38. </head>
  39. <body>
  40. <h2 data-trap="App #value"></h2>
  41. <button data-trap="App: (signal increment) whenClicked">++</button>
  42. <button data-trap="App: (signal decrement) whenClicked">--</button>
  43. </body>
  44. </html>