{"action":"created","comment":{"url":"https://api.github.com/repos/openstax/tutor-js/pulls/comments/34604909","id":34604909,"diff_hunk":"@@ -33,10 +40,47 @@ module.exports = React.createClass\n       <i className='fa fa-chevron-right'/>\n     </Router.Link>\n \n+  hasTargetHash: ->\n+    window.location.hash.length\n+\n+  # used by BookContentMixin\n+  shouldOpenNewTab: -> false\n+\n+  getTargetEl: ->\n+    targetSelector = window.location.hash\n+    pageEl = @getDOMNode()\n+    pageEl.querySelector(targetSelector)\n+\n+  scrollToTarget: (targetEl) ->\n+    targetPosition = @getTopPosition(targetEl)\n+    window.scrollTo(0, targetPosition)\n+\n+  triggerTargetHighlight: (targetEl) ->\n+    targetEl.classList.add('target')\n+    _.delay(->\n+      targetEl.classList.remove('target')\n+    , 1500)\n+\n+  componentDidMount: ->\n+    return unless @hasTargetHash()\n+\n+    targetEl = @getTargetEl()\n+    if targetEl?\n+      @scrollToTarget(targetEl)\n+      $imagesToLoad = $('img')\n+      imagesLoaded = 0\n+      $imagesToLoad.load(=>","path":"src/components/reference-book/page.cjsx","position":66,"original_position":66,"commit_id":"c8e47cb2214895d5faf34a3662a2bb52c4b5a1fe","original_commit_id":"c8e47cb2214895d5faf34a3662a2bb52c4b5a1fe","user":{"login":"philschatz","id":253202,"avatar_url":"https://avatars.githubusercontent.com/u/253202?v=3","gravatar_id":"","url":"https://api.github.com/users/philschatz","html_url":"https://github.com/philschatz","followers_url":"https://api.github.com/users/philschatz/followers","following_url":"https://api.github.com/users/philschatz/following{/other_user}","gists_url":"https://api.github.com/users/philschatz/gists{/gist_id}","starred_url":"https://api.github.com/users/philschatz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philschatz/subscriptions","organizations_url":"https://api.github.com/users/philschatz/orgs","repos_url":"https://api.github.com/users/philschatz/repos","events_url":"https://api.github.com/users/philschatz/events{/privacy}","received_events_url":"https://api.github.com/users/philschatz/received_events","type":"User","site_admin":false},"body":"I believe that works in IE9+","created_at":"2015-07-14T18:53:28Z","updated_at":"2015-07-14T18:53:28Z","html_url":"https://github.com/openstax/tutor-js/pull/468#discussion_r34604909","pull_request_url":"https://api.github.com/repos/openstax/tutor-js/pulls/468","_links":{"self":{"href":"https://api.github.com/repos/openstax/tutor-js/pulls/comments/34604909"},"html":{"href":"https://github.com/openstax/tutor-js/pull/468#discussion_r34604909"},"pull_request":{"href":"https://api.github.com/repos/openstax/tutor-js/pulls/468"}}},"pull_request":{"url":"https://api.github.com/repos/openstax/tutor-js/pulls/468","id":39634290,"html_url":"https://github.com/openstax/tutor-js/pull/468","diff_url":"https://github.com/openstax/tutor-js/pull/468.diff","patch_url":"https://github.com/openstax/tutor-js/pull/468.patch","issue_url":"https://api.github.com/repos/openstax/tutor-js/issues/468","number":468,"state":"open","locked":false,"title":"Handle iReading and reference book links","user":{"login":"pandafulmanda","id":2483873,"avatar_url":"https://avatars.githubusercontent.com/u/2483873?v=3","gravatar_id":"","url":"https://api.github.com/users/pandafulmanda","html_url":"https://github.com/pandafulmanda","followers_url":"https://api.github.com/users/pandafulmanda/followers","following_url":"https://api.github.com/users/pandafulmanda/following{/other_user}","gists_url":"https://api.github.com/users/pandafulmanda/gists{/gist_id}","starred_url":"https://api.github.com/users/pandafulmanda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pandafulmanda/subscriptions","organizations_url":"https://api.github.com/users/pandafulmanda/orgs","repos_url":"https://api.github.com/users/pandafulmanda/repos","events_url":"https://api.github.com/users/pandafulmanda/events{/privacy}","received_events_url":"https://api.github.com/users/pandafulmanda/received_events","type":"User","site_admin":false},"body":"Within page\r\n\r\n## Link text replacement, iReadings and Reference Book\r\n![screen shot 2015-07-10 at 6 56 08 pm](https://cloud.githubusercontent.com/assets/2483873/8631166/54bb2680-2736-11e5-8592-60467b3da95e.png)\r\n\r\n## Highlight Target Area\r\n![screen shot 2015-07-13 at 10 48 11 am](https://cloud.githubusercontent.com/assets/2483873/8653906/b167b444-294c-11e5-819f-d4f82e73738a.png)\r\n1.5 second yellow background, fades out to transparent\r\n\r\n## External Link\r\n![screen shot 2015-07-13 at 1 07 46 pm](https://cloud.githubusercontent.com/assets/2483873/8657305/81ba3e54-2962-11e5-9f0e-7afb842a4c80.png)\r\n\r\n## Link from iReading to figure in reference book not in reading\r\n![screen shot 2015-07-13 at 1 21 43 pm](https://cloud.githubusercontent.com/assets/2483873/8657334/ab0f0c6c-2962-11e5-9ed9-33fdf1c8822f.png)\r\nlinked as expected\r\n\r\nMerged after #472\r\n","created_at":"2015-07-09T22:14:46Z","updated_at":"2015-07-14T18:53:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0c2594538773ef128870b076a831d5be6d05573e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/openstax/tutor-js/pulls/468/commits","review_comments_url":"https://api.github.com/repos/openstax/tutor-js/pulls/468/comments","review_comment_url":"https://api.github.com/repos/openstax/tutor-js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openstax/tutor-js/issues/468/comments","statuses_url":"https://api.github.com/repos/openstax/tutor-js/statuses/c8e47cb2214895d5faf34a3662a2bb52c4b5a1fe","head":{"label":"openstax:feature/handle-links-readings","ref":"feature/handle-links-readings","sha":"c8e47cb2214895d5faf34a3662a2bb52c4b5a1fe","user":{"login":"openstax","id":3805549,"avatar_url":"https://avatars.githubusercontent.com/u/3805549?v=3","gravatar_id":"","url":"https://api.github.com/users/openstax","html_url":"https://github.com/openstax","followers_url":"https://api.github.com/users/openstax/followers","following_url":"https://api.github.com/users/openstax/following{/other_user}","gists_url":"https://api.github.com/users/openstax/gists{/gist_id}","starred_url":"https://api.github.com/users/openstax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openstax/subscriptions","organizations_url":"https://api.github.com/users/openstax/orgs","repos_url":"https://api.github.com/users/openstax/repos","events_url":"https://api.github.com/users/openstax/events{/privacy}","received_events_url":"https://api.github.com/users/openstax/received_events","type":"Organization","site_admin":false},"repo":{"id":24433756,"name":"tutor-js","full_name":"openstax/tutor-js","owner":{"login":"openstax","id":3805549,"avatar_url":"https://avatars.githubusercontent.com/u/3805549?v=3","gravatar_id":"","url":"https://api.github.com/users/openstax","html_url":"https://github.com/openstax","followers_url":"https://api.github.com/users/openstax/followers","following_url":"https://api.github.com/users/openstax/following{/other_user}","gists_url":"https://api.github.com/users/openstax/gists{/gist_id}","starred_url":"https://api.github.com/users/openstax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openstax/subscriptions","organizations_url":"https://api.github.com/users/openstax/orgs","repos_url":"https://api.github.com/users/openstax/repos","events_url":"https://api.github.com/users/openstax/events{/privacy}","received_events_url":"https://api.github.com/users/openstax/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openstax/tutor-js","description":":mortar_board: Javascript frontend for openstax tutor","fork":false,"url":"https://api.github.com/repos/openstax/tutor-js","forks_url":"https://api.github.com/repos/openstax/tutor-js/forks","keys_url":"https://api.github.com/repos/openstax/tutor-js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openstax/tutor-js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openstax/tutor-js/teams","hooks_url":"https://api.github.com/repos/openstax/tutor-js/hooks","issue_events_url":"https://api.github.com/repos/openstax/tutor-js/issues/events{/number}","events_url":"https://api.github.com/repos/openstax/tutor-js/events","assignees_url":"https://api.github.com/repos/openstax/tutor-js/assignees{/user}","branches_url":"https://api.github.com/repos/openstax/tutor-js/branches{/branch}","tags_url":"https://api.github.com/repos/openstax/tutor-js/tags","blobs_url":"https://api.github.com/repos/openstax/tutor-js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openstax/tutor-js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openstax/tutor-js/git/refs{/sha}","trees_url":"https://api.github.com/repos/openstax/tutor-js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openstax/tutor-js/statuses/{sha}","languages_url":"https://api.github.com/repos/openstax/tutor-js/languages","stargazers_url":"https://api.github.com/repos/openstax/tutor-js/stargazers","contributors_url":"https://api.github.com/repos/openstax/tutor-js/contributors","subscribers_url":"https://api.github.com/repos/openstax/tutor-js/subscribers","subscription_url":"https://api.github.com/repos/openstax/tutor-js/subscription","commits_url":"https://api.github.com/repos/openstax/tutor-js/commits{/sha}","git_commits_url":"https://api.github.com/repos/openstax/tutor-js/git/commits{/sha}","comments_url":"https://api.github.com/repos/openstax/tutor-js/comments{/number}","issue_comment_url":"https://api.github.com/repos/openstax/tutor-js/issues/comments{/number}","contents_url":"https://api.github.com/repos/openstax/tutor-js/contents/{+path}","compare_url":"https://api.github.com/repos/openstax/tutor-js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openstax/tutor-js/merges","archive_url":"https://api.github.com/repos/openstax/tutor-js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openstax/tutor-js/downloads","issues_url":"https://api.github.com/repos/openstax/tutor-js/issues{/number}","pulls_url":"https://api.github.com/repos/openstax/tutor-js/pulls{/number}","milestones_url":"https://api.github.com/repos/openstax/tutor-js/milestones{/number}","notifications_url":"https://api.github.com/repos/openstax/tutor-js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openstax/tutor-js/labels{/name}","releases_url":"https://api.github.com/repos/openstax/tutor-js/releases{/id}","created_at":"2014-09-24T21:42:26Z","updated_at":"2015-05-14T23:01:26Z","pushed_at":"2015-07-14T17:36:22Z","git_url":"git://github.com/openstax/tutor-js.git","ssh_url":"git@github.com:openstax/tutor-js.git","clone_url":"https://github.com/openstax/tutor-js.git","svn_url":"https://github.com/openstax/tutor-js","homepage":"","size":9579,"stargazers_count":1,"watchers_count":1,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":8,"forks":0,"open_issues":8,"watchers":1,"default_branch":"master"}},"base":{"label":"openstax:master","ref":"master","sha":"bbc685e8ace84886981f4b681a5459b2ac8e745f","user":{"login":"openstax","id":3805549,"avatar_url":"https://avatars.githubusercontent.com/u/3805549?v=3","gravatar_id":"","url":"https://api.github.com/users/openstax","html_url":"https://github.com/openstax","followers_url":"https://api.github.com/users/openstax/followers","following_url":"https://api.github.com/users/openstax/following{/other_user}","gists_url":"https://api.github.com/users/openstax/gists{/gist_id}","starred_url":"https://api.github.com/users/openstax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openstax/subscriptions","organizations_url":"https://api.github.com/users/openstax/orgs","repos_url":"https://api.github.com/users/openstax/repos","events_url":"https://api.github.com/users/openstax/events{/privacy}","received_events_url":"https://api.github.com/users/openstax/received_events","type":"Organization","site_admin":false},"repo":{"id":24433756,"name":"tutor-js","full_name":"openstax/tutor-js","owner":{"login":"openstax","id":3805549,"avatar_url":"https://avatars.githubusercontent.com/u/3805549?v=3","gravatar_id":"","url":"https://api.github.com/users/openstax","html_url":"https://github.com/openstax","followers_url":"https://api.github.com/users/openstax/followers","following_url":"https://api.github.com/users/openstax/following{/other_user}","gists_url":"https://api.github.com/users/openstax/gists{/gist_id}","starred_url":"https://api.github.com/users/openstax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openstax/subscriptions","organizations_url":"https://api.github.com/users/openstax/orgs","repos_url":"https://api.github.com/users/openstax/repos","events_url":"https://api.github.com/users/openstax/events{/privacy}","received_events_url":"https://api.github.com/users/openstax/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openstax/tutor-js","description":":mortar_board: Javascript frontend for openstax tutor","fork":false,"url":"https://api.github.com/repos/openstax/tutor-js","forks_url":"https://api.github.com/repos/openstax/tutor-js/forks","keys_url":"https://api.github.com/repos/openstax/tutor-js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openstax/tutor-js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openstax/tutor-js/teams","hooks_url":"https://api.github.com/repos/openstax/tutor-js/hooks","issue_events_url":"https://api.github.com/repos/openstax/tutor-js/issues/events{/number}","events_url":"https://api.github.com/repos/openstax/tutor-js/events","assignees_url":"https://api.github.com/repos/openstax/tutor-js/assignees{/user}","branches_url":"https://api.github.com/repos/openstax/tutor-js/branches{/branch}","tags_url":"https://api.github.com/repos/openstax/tutor-js/tags","blobs_url":"https://api.github.com/repos/openstax/tutor-js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openstax/tutor-js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openstax/tutor-js/git/refs{/sha}","trees_url":"https://api.github.com/repos/openstax/tutor-js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openstax/tutor-js/statuses/{sha}","languages_url":"https://api.github.com/repos/openstax/tutor-js/languages","stargazers_url":"https://api.github.com/repos/openstax/tutor-js/stargazers","contributors_url":"https://api.github.com/repos/openstax/tutor-js/contributors","subscribers_url":"https://api.github.com/repos/openstax/tutor-js/subscribers","subscription_url":"https://api.github.com/repos/openstax/tutor-js/subscription","commits_url":"https://api.github.com/repos/openstax/tutor-js/commits{/sha}","git_commits_url":"https://api.github.com/repos/openstax/tutor-js/git/commits{/sha}","comments_url":"https://api.github.com/repos/openstax/tutor-js/comments{/number}","issue_comment_url":"https://api.github.com/repos/openstax/tutor-js/issues/comments{/number}","contents_url":"https://api.github.com/repos/openstax/tutor-js/contents/{+path}","compare_url":"https://api.github.com/repos/openstax/tutor-js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openstax/tutor-js/merges","archive_url":"https://api.github.com/repos/openstax/tutor-js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openstax/tutor-js/downloads","issues_url":"https://api.github.com/repos/openstax/tutor-js/issues{/number}","pulls_url":"https://api.github.com/repos/openstax/tutor-js/pulls{/number}","milestones_url":"https://api.github.com/repos/openstax/tutor-js/milestones{/number}","notifications_url":"https://api.github.com/repos/openstax/tutor-js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openstax/tutor-js/labels{/name}","releases_url":"https://api.github.com/repos/openstax/tutor-js/releases{/id}","created_at":"2014-09-24T21:42:26Z","updated_at":"2015-05-14T23:01:26Z","pushed_at":"2015-07-14T17:36:22Z","git_url":"git://github.com/openstax/tutor-js.git","ssh_url":"git@github.com:openstax/tutor-js.git","clone_url":"https://github.com/openstax/tutor-js.git","svn_url":"https://github.com/openstax/tutor-js","homepage":"","size":9579,"stargazers_count":1,"watchers_count":1,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":8,"forks":0,"open_issues":8,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openstax/tutor-js/pulls/468"},"html":{"href":"https://github.com/openstax/tutor-js/pull/468"},"issue":{"href":"https://api.github.com/repos/openstax/tutor-js/issues/468"},"comments":{"href":"https://api.github.com/repos/openstax/tutor-js/issues/468/comments"},"review_comments":{"href":"https://api.github.com/repos/openstax/tutor-js/pulls/468/comments"},"review_comment":{"href":"https://api.github.com/repos/openstax/tutor-js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openstax/tutor-js/pulls/468/commits"},"statuses":{"href":"https://api.github.com/repos/openstax/tutor-js/statuses/c8e47cb2214895d5faf34a3662a2bb52c4b5a1fe"}}}}