counter.html 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <title>Trapped - Counter example</title>
  5. <style>
  6. [data-trap] {
  7. display: none
  8. }
  9. </style>
  10. <script src="../bower_components/amber/support/amber.js"></script>
  11. <script type='text/javascript' src='../bower_components/amber/support/requirejs/require.min.js'></script>
  12. </head>
  13. <body>
  14. <script type="text/javascript">
  15. var AppEntity;
  16. require.config({
  17. paths: {
  18. 'gh_herby_trapped': '../js',
  19. 'gh_herby_trapped_counter': 'js',
  20. 'gh_herby_trapped_counter/_source': 'st'
  21. }
  22. });
  23. require(
  24. ["amber/devel",
  25. "gh_herby_trapped/Trapped-Processors", "gh_herby_trapped_counter/Trapped-Counter" ],
  26. function (smalltalk) {
  27. smalltalk.defaultAmdNamespace = 'gh_herby_trapped_todo';
  28. smalltalk.initialize();
  29. $(function () {
  30. smalltalk.Browser._openOn_(smalltalk.App);
  31. AppEntity = smalltalk.App._new();
  32. smalltalk.Trapped._start_([AppEntity]);
  33. });
  34. }
  35. );
  36. </script>
  37. <h2 data-trap="App #value"></h2>
  38. <button data-trap="App: (signal increment) whenClicked">++</button>
  39. <button data-trap="App: (signal decrement) whenClicked">--</button>
  40. </body>
  41. </html>