| OLD | NEW |
| 1 #!mojo mojo:sky_viewer | 1 #!mojo mojo:sky_viewer |
| 2 <!-- | 2 <!-- |
| 3 // Copyright 2015 The Chromium Authors. All rights reserved. | 3 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 4 // Use of this source code is governed by a BSD-style license that can be | 4 // Use of this source code is governed by a BSD-style license that can be |
| 5 // found in the LICENSE file. | 5 // found in the LICENSE file. |
| 6 --> | 6 --> |
| 7 <import src="terminal.sky" /> | 7 <import src="terminal.sky" /> |
| 8 <!-- | 8 <!-- |
| 9 <terminal id="terminal" url="mojo:echo_terminal" /> | 9 <terminal id="terminal" url="mojo:echo_terminal" /> |
| 10 --> | 10 --> |
| 11 <terminal id="terminal" /> | 11 <terminal id="terminal" /> |
| 12 <script> | 12 <script> |
| 13 import 'dart:core'; | 13 import 'dart:core'; |
| 14 import 'dart:sky'; | 14 import 'dart:sky'; |
| 15 | 15 |
| 16 main () { | 16 main () { |
| 17 var terminal = document.getElementById('terminal'); | 17 var terminal = document.getElementById('terminal'); |
| 18 var params = Uri.parse(document.URL).queryParameters; | 18 var params = Uri.parse(document.URL).queryParameters; |
| 19 if (params.containsKey('url')) { | 19 if (params.containsKey('url')) { |
| 20 terminal.connect(params['url']); | 20 terminal.connect(params['url']); |
| 21 } else { | 21 } else { |
| 22 terminal.putString('HALP: Add a "?url=<URL>" query.\n' | 22 terminal.putString('HALP: Add a "?url=<URL>" query.\n' |
| 23 'E.g., "?url=mojo:echo_terminal".\n'); | 23 'E.g., "?url=mojo:echo_terminal".\n'); |
| 24 } | 24 } |
| 25 } | 25 } |
| 26 </script> | 26 </script> |
| OLD | NEW |