| 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 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 'dart:math'; | 9 import 'dart:math'; |
| 10 import 'observatory_element.dart'; | 10 import 'observatory_element.dart'; |
| 11 import 'nav_bar.dart'; | 11 import 'any_service_ref_wrapper.dart'; |
| 12 import 'service_ref.dart'; | |
| 13 import 'package:observatory/service.dart'; | 12 import 'package:observatory/service.dart'; |
| 14 import 'package:observatory/utils.dart'; | 13 import 'package:observatory/utils.dart'; |
| 15 import 'package:polymer/polymer.dart'; | 14 import 'package:polymer/polymer.dart'; |
| 16 import 'package:logging/logging.dart'; | 15 import 'package:logging/logging.dart'; |
| 17 | 16 |
| 18 const nbsp = "\u00A0"; | 17 const nbsp = "\u00A0"; |
| 19 | 18 |
| 20 void addInfoBox(Element content, Function infoBoxGenerator) { | 19 void addInfoBox(Element content, Function infoBoxGenerator) { |
| 21 var infoBox; | 20 var infoBox; |
| 22 var show = false; | 21 var show = false; |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 Element cell(content) { | 91 Element cell(content) { |
| 93 var e = new DivElement(); | 92 var e = new DivElement(); |
| 94 e.style.display = "table-cell"; | 93 e.style.display = "table-cell"; |
| 95 e.style.padding = "3px"; | 94 e.style.padding = "3px"; |
| 96 if (content is String) e.text = content; | 95 if (content is String) e.text = content; |
| 97 if (content is Element) e.children.add(content); | 96 if (content is Element) e.children.add(content); |
| 98 return e; | 97 return e; |
| 99 } | 98 } |
| 100 | 99 |
| 101 Element serviceRef(object) { | 100 Element serviceRef(object) { |
| 102 AnyServiceRefElement e = new Element.tag("any-service-ref"); | 101 AnyServiceRefElementWrapper e = new Element.tag("any-service-ref"); |
| 103 e.ref = object; | 102 e.ref = object; |
| 104 return e; | 103 return e; |
| 105 } | 104 } |
| 106 } | 105 } |
| 107 | 106 |
| 108 class CurrentExecutionAnnotation extends Annotation { | 107 class CurrentExecutionAnnotation extends Annotation { |
| 109 int priority = 0; // highest priority. | 108 int priority = 0; // highest priority. |
| 110 | 109 |
| 111 void applyStyleTo(element) { | 110 void applyStyleTo(element) { |
| 112 if (element == null) { | 111 if (element == null) { |
| (...skipping 864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 977 } | 976 } |
| 978 } | 977 } |
| 979 } | 978 } |
| 980 } | 979 } |
| 981 | 980 |
| 982 int _buttonTop(Element element) { | 981 int _buttonTop(Element element) { |
| 983 if (element == null) { | 982 if (element == null) { |
| 984 return 5; | 983 return 5; |
| 985 } | 984 } |
| 986 const padding = 5; | 985 const padding = 5; |
| 987 const navbarHeight = NavBarElement.height; | 986 // TODO (cbernaschina) check if this is needed. |
| 987 const navbarHeight = 40; |
| 988 var rect = getBoundingClientRect(); | 988 var rect = getBoundingClientRect(); |
| 989 var buttonHeight = element.clientHeight; | 989 var buttonHeight = element.clientHeight; |
| 990 return min(max(0, navbarHeight - rect.top) + padding, | 990 return min(max(0, navbarHeight - rect.top) + padding, |
| 991 rect.height - (buttonHeight + padding)); | 991 rect.height - (buttonHeight + padding)); |
| 992 } | 992 } |
| 993 | 993 |
| 994 RefreshButtonElement _newRefreshButton() { | 994 RefreshButtonElement _newRefreshButton() { |
| 995 var button = new Element.tag('refresh-button'); | 995 var button = new Element.tag('refresh-button'); |
| 996 button.style.position = 'absolute'; | 996 button.style.position = 'absolute'; |
| 997 button.style.display = 'inline-block'; | 997 button.style.display = 'inline-block'; |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1369 class SourceInsetElement extends PolymerElement { | 1369 class SourceInsetElement extends PolymerElement { |
| 1370 SourceInsetElement.created() : super.created(); | 1370 SourceInsetElement.created() : super.created(); |
| 1371 | 1371 |
| 1372 @published SourceLocation location; | 1372 @published SourceLocation location; |
| 1373 @published String height = null; | 1373 @published String height = null; |
| 1374 @published int currentPos; | 1374 @published int currentPos; |
| 1375 @published bool inDebuggerContext = false; | 1375 @published bool inDebuggerContext = false; |
| 1376 @published ObservableList variables; | 1376 @published ObservableList variables; |
| 1377 @published Element scroller; | 1377 @published Element scroller; |
| 1378 } | 1378 } |
| OLD | NEW |