| 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 observatory_element; | 5 library observatory_element; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:html'; | 8 import 'dart:html'; |
| 9 import 'package:observatory/app.dart'; | 9 import 'package:observatory/app.dart'; |
| 10 import 'package:polymer/polymer.dart'; | 10 import 'package:polymer/polymer.dart'; |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 return; | 81 return; |
| 82 } | 82 } |
| 83 // Restart timer. | 83 // Restart timer. |
| 84 _pollTimer = new Timer(pollPeriod, _onPoll); | 84 _pollTimer = new Timer(pollPeriod, _onPoll); |
| 85 } | 85 } |
| 86 | 86 |
| 87 /// Utility method for handling on-click of <a> tags. Navigates | 87 /// Utility method for handling on-click of <a> tags. Navigates |
| 88 /// within the application using the [LocationManager]. | 88 /// within the application using the [LocationManager]. |
| 89 void goto(MouseEvent event, var detail, Element target) { | 89 void goto(MouseEvent event, var detail, Element target) { |
| 90 app.locationManager.onGoto(event, detail, target); | 90 app.locationManager.onGoto(event, detail, target); |
| 91 event.stopPropagation(); |
| 91 } | 92 } |
| 92 | 93 |
| 93 /// Create a link that can be consumed by [goto]. | 94 /// Create a link that can be consumed by [goto]. |
| 94 String gotoLink(String url) { | 95 String gotoLink(String url) { |
| 95 return app.locationManager.makeLink(url); | 96 return app.locationManager.makeLink(url); |
| 96 } | 97 } |
| 97 | 98 |
| 98 String formatTimePrecise(double time) => Utils.formatTimePrecise(time); | 99 String formatTimePrecise(double time) => Utils.formatTimePrecise(time); |
| 99 | 100 |
| 100 String formatTime(double time) => Utils.formatTime(time); | 101 String formatTime(double time) => Utils.formatTime(time); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 131 } else result.add(codeUnit); | 132 } else result.add(codeUnit); |
| 132 } | 133 } |
| 133 if (wasTruncated) { | 134 if (wasTruncated) { |
| 134 result.addAll("...".codeUnits); | 135 result.addAll("...".codeUnits); |
| 135 } else { | 136 } else { |
| 136 result.add("'".codeUnitAt(0)); | 137 result.add("'".codeUnitAt(0)); |
| 137 } | 138 } |
| 138 return new String.fromCharCodes(result); | 139 return new String.fromCharCodes(result); |
| 139 } | 140 } |
| 140 } | 141 } |
| OLD | NEW |