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

Side by Side Diff: dart/site/try/src/leap.dart

Issue 298273002: Share source code. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « dart/site/try/src/compilation.dart ('k') | dart/site/try/src/ui.dart » ('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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 library trydart.main; 5 library trydart.main;
6 6
7 import 'dart:html' show 7 import 'dart:html' show
8 HttpRequest, 8 HttpRequest,
9 LinkElement, 9 LinkElement,
10 querySelector, 10 querySelector,
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 try { 44 try {
45 new HttpRequest(); 45 new HttpRequest();
46 replyTo.send(HAS_NON_DOM_HTTP_REQUEST); 46 replyTo.send(HAS_NON_DOM_HTTP_REQUEST);
47 } catch (e, trace) { 47 } catch (e, trace) {
48 replyTo.send(NO_NON_DOM_HTTP_REQUEST); 48 replyTo.send(NO_NON_DOM_HTTP_REQUEST);
49 } 49 }
50 } 50 }
51 51
52 main() { 52 main() {
53 UserOption.storage = window.localStorage; 53 UserOption.storage = window.localStorage;
54 if (currentSource == null) { 54 Map<String, String> parameters =
55 Uri.parse('${window.location}').queryParameters;
56 String sourceParameter = parameters['source'];
57 if (sourceParameter != null) {
58 currentSource = sourceParameter;
59 } else if (currentSource == null) {
55 currentSource = EXAMPLE_HELLO; 60 currentSource = EXAMPLE_HELLO;
56 } 61 }
57 62
58 buildUI(); 63 buildUI();
59 spawnFunction(checkHttpRequest).first.then((reply) { 64 spawnFunction(checkHttpRequest).first.then((reply) {
60 ReceivePort port; 65 ReceivePort port;
61 if (reply == HAS_NON_DOM_HTTP_REQUEST) { 66 if (reply == HAS_NON_DOM_HTTP_REQUEST) {
62 port = spawnFunction(compilerIsolate); 67 port = spawnFunction(compilerIsolate);
63 } else { 68 } else {
64 port = spawnDomFunction(compilerIsolate); 69 port = spawnDomFunction(compilerIsolate);
(...skipping 16 matching lines...) Expand all
81 interaction.onMutation([], observer); 86 interaction.onMutation([], observer);
82 break; 87 break;
83 default: 88 default:
84 // TODO(ahe): Close [port]? 89 // TODO(ahe): Close [port]?
85 print('Unexpected message received: $message'); 90 print('Unexpected message received: $message');
86 break; 91 break;
87 } 92 }
88 }); 93 });
89 }); 94 });
90 } 95 }
OLDNEW
« no previous file with comments | « dart/site/try/src/compilation.dart ('k') | dart/site/try/src/ui.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698