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

Side by Side Diff: runtime/observatory/lib/src/elements/script_inset.dart

Issue 974153002: Restore highlighting for current position. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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 script_inset_element; 5 library script_inset_element;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:html'; 8 import 'dart:html';
9 import 'observatory_element.dart'; 9 import 'observatory_element.dart';
10 import 'package:observatory/service.dart'; 10 import 'package:observatory/service.dart';
11 import 'package:polymer/polymer.dart'; 11 import 'package:polymer/polymer.dart';
12 12
13 const nbsp = "\u00A0"; 13 const nbsp = "\u00A0";
14 14
15 class Annotation { 15 class Annotation {
16 int line; 16 int line;
17 int columnStart; 17 int columnStart;
18 int columnStop; 18 int columnStop;
19 String title; 19 String title;
20 20
21 void applyStyleTo(element) { 21 void applyStyleTo(element) {
22 element.style.color = "blue"; 22 element.classes.add("currentCol");
23 element.style.textDecoration = "underline";
24 element.title = title; 23 element.title = title;
25 } 24 }
26 } 25 }
27 26
28 /// Box with script source code in it. 27 /// Box with script source code in it.
29 @CustomTag('script-inset') 28 @CustomTag('script-inset')
30 class ScriptInsetElement extends ObservatoryElement { 29 class ScriptInsetElement extends ObservatoryElement {
31 @published Script script; 30 @published Script script;
32 31
33 /// Set the height to make the script inset scroll. Otherwise it 32 /// Set the height to make the script inset scroll. Otherwise it
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 235
237 return e; 236 return e;
238 } 237 }
239 238
240 Element lineSourceElement(ScriptLine line) { 239 Element lineSourceElement(ScriptLine line) {
241 var e = new DivElement(); 240 var e = new DivElement();
242 e.classes.add("sourceItem"); 241 e.classes.add("sourceItem");
243 242
244 if (line != null) { 243 if (line != null) {
245 if (line.line == currentLine) { 244 if (line.line == currentLine) {
246 e.classes.add("sourceItemCurrent"); 245 e.classes.add("currentLine");
247 } 246 }
248 247
249 e.id = makeLineId(line.line); 248 e.id = makeLineId(line.line);
250 249
251 var position = 0; 250 var position = 0;
252 consumeUntil(var stop) { 251 consumeUntil(var stop) {
253 if (stop <= position) { 252 if (stop <= position) {
254 return; // Empty gap between annotations/boundries. 253 return; // Empty gap between annotations/boundries.
255 } 254 }
256 var chunk = line.text.substring(position, stop); 255 var chunk = line.text.substring(position, stop);
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 } else { 292 } else {
294 // Existing breakpoint. Remove it. 293 // Existing breakpoint. Remove it.
295 line.script.isolate.removeBreakpoint(line.bpt).then((_) { 294 line.script.isolate.removeBreakpoint(line.bpt).then((_) {
296 busy = false; 295 busy = false;
297 }); 296 });
298 } 297 }
299 } 298 }
300 299
301 BreakpointToggleElement.created() : super.created(); 300 BreakpointToggleElement.created() : super.created();
302 } 301 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698