Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(366)

Side by Side Diff: samples/playground/playground.dart

Issue 11418075: Dartifying members. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixing menuelement.compact exclusion. Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « samples/isolate_html/isolate_sample.dart ('k') | samples/playground/playground.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
16 // Run user script in new iframe. 16 // Run user script in new iframe.
17 final iframe = new IFrameElement(); 17 final iframe = new IFrameElement();
18 iframe.height = '200'; 18 iframe.height = '200';
19 iframe.width = '100%'; 19 iframe.width = '100%';
20 iframe.src = '''data:text/html, 20 iframe.src = '''data:text/html,
21 <html> 21 <html>
22 <body> 22 <body>
23 <script type="application/dart"> 23 <script type="application/dart">
24 ${text.replaceAll('\n', '%0A')} 24 ${text.replaceAll('\n', '%0A')}
25 </script> 25 </script>
26 <script>window.navigator.webkitStartDart();</script> 26 <script>window.navigator.webkitStartDart();</script>
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 }
OLDNEW
« no previous file with comments | « samples/isolate_html/isolate_sample.dart ('k') | samples/playground/playground.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698