| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #import('dart:html'); | 5 import 'dart:html'; |
| 6 | 6 |
| 7 void run() { | 7 void run() { |
| 8 // Get user script. | 8 // Get user script. |
| 9 final textarea = document.query('#code'); | 9 final textarea = document.query('#code'); |
| 10 final text = textarea.value; | 10 final text = textarea.value; |
| 11 | 11 |
| 12 // Clear previous output. | 12 // Clear previous output. |
| 13 final output = document.query('#output'); | 13 final output = document.query('#output'); |
| 14 output.innerHTML = ''; | 14 output.innerHTML = ''; |
| 15 | 15 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 27 </body> | 27 </body> |
| 28 </html> | 28 </html> |
| 29 '''; | 29 '''; |
| 30 output.nodes.add(iframe); | 30 output.nodes.add(iframe); |
| 31 } | 31 } |
| 32 | 32 |
| 33 void main() { | 33 void main() { |
| 34 final button = document.query('#button'); | 34 final button = document.query('#button'); |
| 35 button.on.click.add((e) => run(), false); | 35 button.on.click.add((e) => run(), false); |
| 36 } | 36 } |
| OLD | NEW |