Pārlūkot izejas kodu

moving loading scripts to head, counter buttons monospace

Herbert Vojčík 11 gadi atpakaļ
vecāks
revīzija
d3f35c9326
2 mainītis faili ar 51 papildinājumiem un 48 dzēšanām
  1. 27 24
      example-counter/counter.html
  2. 24 24
      example-todo/todo.html

+ 27 - 24
example-counter/counter.html

@@ -6,35 +6,38 @@
         [data-trap] {
             display: none
         }
+        button {
+            font-family: monospace;
+        }
     </style>
     <script src="../bower_components/amber/support/amber.js"></script>
     <script type='text/javascript' src='../bower_components/amber/support/requirejs/require.min.js'></script>
+    <script type="text/javascript">
+        var blackboard;
+        require.config({
+            paths: {
+                'gh_herby_trapped': '../js',
+                'gh_herby_trapped_counter': 'js',
+                'gh_herby_trapped_counter/_source': 'st'
+            }
+        });
+        require(
+                ["amber/devel",
+                    "gh_herby_trapped/Trapped-Processors", "gh_herby_trapped_counter/Trapped-Counter" ],
+                function (smalltalk) {
+                    smalltalk.defaultAmdNamespace = 'gh_herby_trapped_todo';
+                    smalltalk.initialize();
+
+                    $(function () {
+                        smalltalk.Browser._openOn_(smalltalk.App);
+                        blackboard = smalltalk.App._new();
+                        smalltalk.Trapped._start_([blackboard]);
+                    });
+                }
+        );
+    </script>
 </head>
 <body>
-<script type="text/javascript">
-    var AppEntity;
-    require.config({
-        paths: {
-            'gh_herby_trapped': '../js',
-            'gh_herby_trapped_counter': 'js',
-            'gh_herby_trapped_counter/_source': 'st'
-        }
-    });
-    require(
-            ["amber/devel",
-                "gh_herby_trapped/Trapped-Processors", "gh_herby_trapped_counter/Trapped-Counter" ],
-            function (smalltalk) {
-                smalltalk.defaultAmdNamespace = 'gh_herby_trapped_todo';
-                smalltalk.initialize();
-
-                $(function () {
-                    smalltalk.Browser._openOn_(smalltalk.App);
-                    AppEntity = smalltalk.App._new();
-                    smalltalk.Trapped._start_([AppEntity]);
-                });
-            }
-    );
-</script>
 <h2 data-trap="App #value"></h2>
 <button data-trap="App: (signal increment) whenClicked">++</button>
 <button data-trap="App: (signal decrement) whenClicked">--</button>

+ 24 - 24
example-todo/todo.html

@@ -10,32 +10,32 @@
     <script src="../bower_components/amber/support/amber.js"></script>
     <script type='text/javascript' src='../bower_components/amber/support/requirejs/require.min.js'></script>
     <link rel="stylesheet" href="todo.css"/>
+    <script type="text/javascript">
+        var blackboard;
+        require.config({
+            paths: {
+                'gh_herby_trapped': '../js',
+                'gh_herby_trapped_todo': 'js',
+                'gh_herby_trapped_todo/_source': 'st'
+            }
+        });
+        require(
+                ["amber/devel",
+                    "gh_herby_trapped/Trapped-Processors", "gh_herby_trapped_todo/Trapped-Todo" ],
+                function (smalltalk) {
+                    smalltalk.defaultAmdNamespace = 'gh_herby_trapped_todo';
+                    smalltalk.initialize();
+
+                    $(function () {
+                        smalltalk.Browser._openOn_(smalltalk.App);
+                        blackboard = smalltalk.App._new();
+                        smalltalk.Trapped._start_([blackboard]);
+                    });
+                }
+        );
+    </script>
 </head>
 <body>
-<script type="text/javascript">
-    var AppEntity;
-    require.config({
-        paths: {
-            'gh_herby_trapped': '../js',
-            'gh_herby_trapped_todo': 'js',
-            'gh_herby_trapped_todo/_source': 'st'
-        }
-    });
-    require(
-            ["amber/devel",
-                "gh_herby_trapped/Trapped-Processors", "gh_herby_trapped_todo/Trapped-Todo" ],
-            function (smalltalk) {
-                smalltalk.defaultAmdNamespace = 'gh_herby_trapped_todo';
-                smalltalk.initialize();
-
-                $(function () {
-                    smalltalk.Browser._openOn_(smalltalk.App);
-                    AppEntity = smalltalk.App._new();
-                    smalltalk.Trapped._start_([AppEntity]);
-                });
-            }
-    );
-</script>
 <h2 data-trap="#title"></h2>
 
 <div data-trap=": (guardContents (#todos #notNil))">