GitHub PullRequestReviewCommentEvent at 2014-04-25 06:41:46
Repository: route.dart
Actor: vicb
Payload: {"comment":{"url":"https://api.github.com/repos/angular/route.dart/pulls/comments/11984601","id":11984601,"diff_hunk":"@@ -0,0 +1,44 @@\n+library link_handler;\n+\n+import 'dart:html';\n+\n+import 'link_matcher.dart';\n+import 'client.dart';\n+\n+typedef String _HashNormalizer(String);\n+\n+abstract class LinkHandler<T extends Event> {\n+  void handle(T event);\n+}\n+\n+class DefaultLinkHandler<MouseEvent> extends LinkHandler {\n+\n+  RouterLinkMatcher _linkMatcher;\n+  Router _router;\n+  bool _useFragment;\n+  _HashNormalizer _normalizer;\n+  Window _window;\n+\n+\n+  DefaultLinkHandler(this._linkMatcher,\n+                     this._router,\n+                     this._useFragment,\n+                     this._window,\n+                     this._normalizer);\n+\n+  void handle(MouseEvent e) {\n+    Element anchor = e.target;\n+    while(anchor != null && anchor is! AnchorElement) {\n+      anchor = anchor.parent;\n+    };\n+    if (anchor == null) return;","path":"lib/link_handler.dart","position":34,"original_position":34,"commit_id":"51dc18803bb6322f65a16726833466512829967b","original_commit_id":"51dc18803bb6322f65a16726833466512829967b","user":{"login":"vicb","id":248818,"avatar_url":"https://avatars.githubusercontent.com/u/248818?","gravatar_id":"ca6e92a6fc51417b3749e68d26df1f29","url":"https://api.github.com/users/vicb","html_url":"https://github.com/vicb","followers_url":"https://api.github.com/users/vicb/followers","following_url":"https://api.github.com/users/vicb/following{/other_user}","gists_url":"https://api.github.com/users/vicb/gists{/gist_id}","starred_url":"https://api.github.com/users/vicb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vicb/subscriptions","organizations_url":"https://api.github.com/users/vicb/orgs","repos_url":"https://api.github.com/users/vicb/repos","events_url":"https://api.github.com/users/vicb/events{/privacy}","received_events_url":"https://api.github.com/users/vicb/received_events","type":"User","site_admin":false},"body":"Brainstorming: should those few lines be a private helper in the base class ? That's probably something that would be re-used with other strategies","created_at":"2014-04-25T06:41:46Z","updated_at":"2014-04-25T06:41:46Z","html_url":"https://github.com/angular/route.dart/pull/39#discussion_r11984601","pull_request_url":"https://api.github.com/repos/angular/route.dart/pulls/39","_links":{"self":{"href":"https://api.github.com/repos/angular/route.dart/pulls/comments/11984601"},"html":{"href":"https://github.com/angular/route.dart/pull/39#discussion_r11984601"},"pull_request":{"href":"https://api.github.com/repos/angular/route.dart/pulls/39"}}}}