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

Unified Diff: sky/examples/terminal/index.sky

Issue 1019323002: Make the terminal demo able (to try) to connect to anything. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 9 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 | « no previous file | sky/examples/terminal/terminal.sky » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/examples/terminal/index.sky
diff --git a/sky/examples/terminal/index.sky b/sky/examples/terminal/index.sky
index 74d56221b968981cbf8e486e993ac34e17a66422..2244afcedb1793d078bc59b8233d9718494f211d 100644
--- a/sky/examples/terminal/index.sky
+++ b/sky/examples/terminal/index.sky
@@ -5,4 +5,22 @@
// found in the LICENSE file.
-->
<import src="terminal.sky" />
-<terminal url="mojo:echo_terminal" />
+<!--
+<terminal id="terminal" url="mojo:echo_terminal" />
+-->
+<terminal id="terminal" />
+<script>
+import 'dart:core';
+import 'dart:sky';
+
+main () {
+ var terminal = document.getElementById('terminal');
+ var params = Uri.parse(document.URL).queryParameters;
+ if (params.containsKey('url')) {
+ terminal.connect(params['url']);
+ } else {
+ terminal.putString('HALP: Add a "?url=<URL>" query.\n'
+ 'E.g., "?url=mojo:echo_terminal".\n');
+ }
+}
+</script>
« no previous file with comments | « no previous file | sky/examples/terminal/terminal.sky » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698