| 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_ref_element; | 5 library script_ref_element; |
| 6 | 6 |
| 7 import 'dart:html'; | 7 import 'dart:html'; |
| 8 import 'dart:async'; | 8 import 'dart:async'; |
| 9 import 'package:observatory/models.dart' as M show IsolateRef, ScriptRef; | 9 import 'package:observatory/models.dart' as M show IsolateRef, ScriptRef; |
| 10 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart'; | 10 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart'; |
| 11 import 'package:observatory/src/elements/helpers/tag.dart'; | 11 import 'package:observatory/src/elements/helpers/tag.dart'; |
| 12 import 'package:observatory/src/elements/helpers/uris.dart'; | 12 import 'package:observatory/src/elements/helpers/uris.dart'; |
| 13 | 13 |
| 14 class ScriptRefElement extends HtmlElement implements Renderable { | 14 class ScriptRefElement extends HtmlElement implements Renderable { |
| 15 static const tag = const Tag<ScriptRefElement>('script-ref-wrapped'); | 15 static const tag = const Tag<ScriptRefElement>('script-ref'); |
| 16 | 16 |
| 17 RenderingScheduler _r; | 17 RenderingScheduler _r; |
| 18 | 18 |
| 19 Stream<RenderedEvent<ScriptRefElement>> get onRendered => _r.onRendered; | 19 Stream<RenderedEvent<ScriptRefElement>> get onRendered => _r.onRendered; |
| 20 | 20 |
| 21 | 21 |
| 22 M.IsolateRef _isolate; | 22 M.IsolateRef _isolate; |
| 23 M.ScriptRef _script; | 23 M.ScriptRef _script; |
| 24 | 24 |
| 25 M.IsolateRef get isolate => _isolate; | 25 M.IsolateRef get isolate => _isolate; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 52 } | 52 } |
| 53 | 53 |
| 54 void render() { | 54 void render() { |
| 55 children = [ | 55 children = [ |
| 56 new AnchorElement(href: Uris.inspect(isolate, object: script)) | 56 new AnchorElement(href: Uris.inspect(isolate, object: script)) |
| 57 ..title = script.uri | 57 ..title = script.uri |
| 58 ..text = script.uri.split('/').last | 58 ..text = script.uri.split('/').last |
| 59 ]; | 59 ]; |
| 60 } | 60 } |
| 61 } | 61 } |
| OLD | NEW |