OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 /** | 5 /** |
6 * This giant file has pieces for compiling dart in the browser, injecting | 6 * This giant file has pieces for compiling dart in the browser, injecting |
7 * scripts into pages and a bunch of classes to build a simple dart editor. | 7 * scripts into pages and a bunch of classes to build a simple dart editor. |
8 * | 8 * |
9 * TODO(jimhug): Separate these pieces cleanly. | 9 * TODO(jimhug): Separate these pieces cleanly. |
10 */ | 10 */ |
11 | 11 |
12 #import('dart:dom'); | 12 #import('dart:dom_deprecated'); |
13 #import('../../frog/lang.dart'); | 13 #import('../../frog/lang.dart'); |
14 #import('../../frog/file_system_dom.dart'); | 14 #import('../../frog/file_system_dom.dart'); |
15 | 15 |
16 | 16 |
17 void main() { | 17 void main() { |
18 final systemPath = getRootPath(window) + '/../../frog'; | 18 final systemPath = getRootPath(window) + '/../../frog'; |
19 final userPath = getRootPath(window.parent); | 19 final userPath = getRootPath(window.parent); |
20 | 20 |
21 if (window !== window.parent) { | 21 if (window !== window.parent) { |
22 // I'm in an iframe - frogify my surrounding code unless dart is native. | 22 // I'm in an iframe - frogify my surrounding code unless dart is native. |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 options.addAll(flags); | 108 options.addAll(flags); |
109 options.add(DART_FILENAME); | 109 options.add(DART_FILENAME); |
110 parseOptions(systemPath, options, fs); | 110 parseOptions(systemPath, options, fs); |
111 initializeWorld(fs); | 111 initializeWorld(fs); |
112 } | 112 } |
113 | 113 |
114 final int LINE_HEIGHT = 22; // TODO(jimhug): This constant sucks. | 114 final int LINE_HEIGHT = 22; // TODO(jimhug): This constant sucks. |
115 final int CHAR_WIDTH = 8; // TODO(jimhug): See above. | 115 final int CHAR_WIDTH = 8; // TODO(jimhug): See above. |
116 | 116 |
117 final String CODE = ''' | 117 final String CODE = ''' |
118 #import("dart:dom"); | 118 #import("dart:dom_deprecated"); |
119 | 119 |
120 // This is an interesting field; | 120 // This is an interesting field; |
121 final int y = 22; | 121 final int y = 22; |
122 String name; | 122 String name; |
123 | 123 |
124 /** This is my main method. */ | 124 /** This is my main method. */ |
125 void main() { | 125 void main() { |
126 var element = document.createElement('div'); | 126 var element = document.createElement('div'); |
127 element.innerHTML = "Hello dom from Dart!"; | 127 element.innerHTML = "Hello dom from Dart!"; |
128 document.body.appendChild(element); | 128 document.body.appendChild(element); |
(...skipping 1486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1615 return Classification.KEYWORD; | 1615 return Classification.KEYWORD; |
1616 | 1616 |
1617 case TokenKind.WHITESPACE: | 1617 case TokenKind.WHITESPACE: |
1618 case TokenKind.END_OF_FILE: | 1618 case TokenKind.END_OF_FILE: |
1619 return Classification.NONE; | 1619 return Classification.NONE; |
1620 | 1620 |
1621 default: | 1621 default: |
1622 return Classification.NONE; | 1622 return Classification.NONE; |
1623 } | 1623 } |
1624 } | 1624 } |
OLD | NEW |