OLD | NEW |
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.ui; | 5 library trydart.ui; |
6 | 6 |
7 import 'dart:html'; | 7 import 'dart:html'; |
8 | 8 |
9 import 'dart:async' show | 9 import 'dart:async' show |
10 Future, | 10 Future, |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 buildUI() { | 97 buildUI() { |
98 interaction = new InteractionManager(); | 98 interaction = new InteractionManager(); |
99 | 99 |
100 CompilationUnit.onChanged.listen(interaction.onCompilationUnitChanged); | 100 CompilationUnit.onChanged.listen(interaction.onCompilationUnitChanged); |
101 | 101 |
102 window.localStorage['currentSample'] = '$currentSample'; | 102 window.localStorage['currentSample'] = '$currentSample'; |
103 | 103 |
104 buildCode(interaction); | 104 buildCode(interaction); |
105 | 105 |
106 (mainEditorPane = new DivElement()) | 106 (mainEditorPane = new DivElement()) |
107 ..classes.add('well') | 107 ..classes.addAll(['well', 'mainEditorPane']) |
108 ..style.backgroundColor = currentTheme.background.color | 108 ..style.backgroundColor = currentTheme.background.color |
109 ..style.color = currentTheme.foreground.color | 109 ..style.color = currentTheme.foreground.color |
110 ..style.overflow = 'visible' | |
111 ..style.whiteSpace = 'pre' | |
112 ..style.font = codeFont | 110 ..style.font = codeFont |
113 ..spellcheck = false; | 111 ..spellcheck = false; |
114 | 112 |
115 mainEditorPane | 113 mainEditorPane |
116 ..contentEditable = 'true' | 114 ..contentEditable = 'true' |
117 ..onKeyDown.listen(interaction.onKeyUp) | 115 ..onKeyDown.listen(interaction.onKeyUp) |
118 ..onInput.listen(interaction.onInput); | 116 ..onInput.listen(interaction.onInput); |
119 | 117 |
120 document.onSelectionChange.listen(interaction.onSelectionChange); | 118 document.onSelectionChange.listen(interaction.onSelectionChange); |
121 | 119 |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 window.localStorage['compilationPaused'] = '$compilationPaused'; | 482 window.localStorage['compilationPaused'] = '$compilationPaused'; |
485 window.localStorage['codeFont'] = '$codeFont'; | 483 window.localStorage['codeFont'] = '$codeFont'; |
486 | 484 |
487 dialog.style.height = '0px'; | 485 dialog.style.height = '0px'; |
488 } | 486 } |
489 form.onSubmit.listen(onSubmit); | 487 form.onSubmit.listen(onSubmit); |
490 | 488 |
491 var doneButton = document.getElementById('settings-done'); | 489 var doneButton = document.getElementById('settings-done'); |
492 doneButton.onClick.listen(onSubmit); | 490 doneButton.onClick.listen(onSubmit); |
493 } | 491 } |
OLD | NEW |