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

Unified Diff: src/tests/site/gists/homepage_jw/web/main.dart

Issue 1319523005: Embed DartPad in the top part of homepage (Closed) Base URL: https://github.com/dart-lang/www.dartlang.org.git@master
Patch Set: remove 2nd dartpad Created 5 years, 4 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/tests/site/gists/homepage_jw/pubspec.yaml ('k') | src/tests/site/gists/homepage_jw_html/pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/tests/site/gists/homepage_jw/web/main.dart
diff --git a/src/tests/site/gists/homepage_jw/web/main.dart b/src/tests/site/gists/homepage_jw/web/main.dart
new file mode 100644
index 0000000000000000000000000000000000000000..6c3ce84a3b6f30ffb81897324e00ca4c61a0a369
--- /dev/null
+++ b/src/tests/site/gists/homepage_jw/web/main.dart
@@ -0,0 +1,19 @@
+import 'dart:html' show HttpRequest;
+
+main() async {
+ // Asychronously get text to display.
+ var lines = await getLines();
+
+ // If result is non-null, print it.
+ lines?.forEach((line) => print(line));
+}
+
+// Reads a file, returning its lines.
+getLines() async {
+ var jabber = await HttpRequest.getString(
+ 'https://www.dartlang.org/samples-files/jabberwocky.txt');
+ var lines = jabber.split('\n');
+ lines.retainWhere((line) =>
+ line.toLowerCase().contains('jabberwock'));
+ return lines;
+}
« no previous file with comments | « src/tests/site/gists/homepage_jw/pubspec.yaml ('k') | src/tests/site/gists/homepage_jw_html/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698