{"action":"created","comment":{"url":"https://api.github.com/repos/jes708/CodeGenius/pulls/comments/69349174","id":69349174,"diff_hunk":"@@ -0,0 +1,151 @@\n+'use strict'\n+\n+import React, {\n+  Component,\n+  PropTypes\n+} from 'react'\n+import RaisedButton from 'material-ui/RaisedButton'\n+import FlatButton from 'material-ui/FlatButton'\n+import FontIcon from 'material-ui/FontIcon'\n+import { connect } from 'react-redux';\n+import {\n+  Card,\n+  CardActions,\n+  CardHeader,\n+  CardText\n+} from 'material-ui/Card'\n+import {\n+  RadioButton,\n+  RadioButtonGroup\n+} from 'material-ui/RadioButton'\n+import Grade from '../../containers/Grade'\n+const _ = require('lodash');\n+import {annotation, selection, stopSelection, startSelection} from './actions';\n+// import store here //\n+\n+\n+/** fires \"selection\" event on mouseup */\n+export class AnnotationHandler extends Component{\n+  constructor(props){\n+    super(props);\n+    console.log(this.props);\n+    this.handleMouseUp = this.handleMouseUp.bind(this);\n+    this.handleMouseDown = this.handleMouseDown.bind(this);\n+    this.state = {\n+      annotationStyles: {\n+        position: 'absolute',\n+        left: -50,\n+        top: -50,\n+        opacity: 0\n+      }\n+    }\n+  }\n+  handleMouseUp (e){\n+    let _selection = window.getSelection()\n+    let selectionString = _selection.toString();\n+    console.log('this is the selected string:', selectionString);\n+    if(_selection.type == 'Range'){\n+      this.setState({\n+        annotationStyles: {\n+          left: e.clientX - 25,\n+          top: e.clientY - 55,\n+          position: 'absolute',\n+          transition: 'opacity 500ms ease-in',\n+          opacity: 1\n+        },\n+        selection: _selection,\n+        selectionString: _selection.toString()\n+      });\n+      this.props.dispatch(selection(_selection));\n+    }\n+  }\n+  handleMouseDown (e){\n+    let annotationState = _.cloneDeep(this.state.annotationStyles);\n+    annotationState.opacity = 0;\n+    this.setState({\n+      annotationStyles: annotationState\n+    });\n+  }\n+  componentWillReceiveProps(nextProps){\n+    this.setState({\n+      selectionString: nextProps.selectionString\n+    })\n+  }\n+  render (){\n+    return (\n+      <div>\n+        <div onMouseUp={this.handleMouseUp} onMouseDown={this.handleMouseDown}>\n+          {this.props.children}\n+        </div>\n+          <div style={this.state.annotationStyles} >\n+            <AnnotateContextMenu {...this.props} selection={this.state.selection}>\n+            </AnnotateContextMenu>\n+          </div>\n+        <pre>\n+          { this.state.selectionString || 'no selection to speak of...'}\n+        </pre>\n+      </div>\n+    )\n+  }\n+}\n+\n+/** fires 'annotation' event on click with selection detail information */\n+export class AnnotateContextMenu extends Component {\n+  constructor(props) {\n+    super(props);\n+    this.annotate = this.annotate.bind( this );\n+  }\n+  annotate( e ) {\n+    this.props.dispatch(annotation(this.props.selection))\n+  }\n+  render() {\n+    return (\n+        <RaisedButton onClick={this.annotate}\n+          label='Annotate'\n+          icon={<FontIcon className='fa fa-plus' />}","path":"browser/js/components/Comment/test.js","position":105,"original_position":105,"commit_id":"52e3b749a1404a4f43326430bc9e837555b536a3","original_commit_id":"52e3b749a1404a4f43326430bc9e837555b536a3","user":{"login":"khumphrey","id":16478938,"avatar_url":"https://avatars.githubusercontent.com/u/16478938?v=3","gravatar_id":"","url":"https://api.github.com/users/khumphrey","html_url":"https://github.com/khumphrey","followers_url":"https://api.github.com/users/khumphrey/followers","following_url":"https://api.github.com/users/khumphrey/following{/other_user}","gists_url":"https://api.github.com/users/khumphrey/gists{/gist_id}","starred_url":"https://api.github.com/users/khumphrey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/khumphrey/subscriptions","organizations_url":"https://api.github.com/users/khumphrey/orgs","repos_url":"https://api.github.com/users/khumphrey/repos","events_url":"https://api.github.com/users/khumphrey/events{/privacy}","received_events_url":"https://api.github.com/users/khumphrey/received_events","type":"User","site_admin":false},"body":"yes! CSS like this!","created_at":"2016-07-01T20:02:06Z","updated_at":"2016-07-01T20:02:06Z","html_url":"https://github.com/jes708/CodeGenius/pull/78#discussion_r69349174","pull_request_url":"https://api.github.com/repos/jes708/CodeGenius/pulls/78","_links":{"self":{"href":"https://api.github.com/repos/jes708/CodeGenius/pulls/comments/69349174"},"html":{"href":"https://github.com/jes708/CodeGenius/pull/78#discussion_r69349174"},"pull_request":{"href":"https://api.github.com/repos/jes708/CodeGenius/pulls/78"}}},"pull_request":{"url":"https://api.github.com/repos/jes708/CodeGenius/pulls/78","id":75900910,"html_url":"https://github.com/jes708/CodeGenius/pull/78","diff_url":"https://github.com/jes708/CodeGenius/pull/78.diff","patch_url":"https://github.com/jes708/CodeGenius/pull/78.patch","issue_url":"https://api.github.com/repos/jes708/CodeGenius/issues/78","number":78,"state":"open","locked":false,"title":"Comments and Grade Panel upgrades","user":{"login":"thejohnbackes","id":13596692,"avatar_url":"https://avatars.githubusercontent.com/u/13596692?v=3","gravatar_id":"","url":"https://api.github.com/users/thejohnbackes","html_url":"https://github.com/thejohnbackes","followers_url":"https://api.github.com/users/thejohnbackes/followers","following_url":"https://api.github.com/users/thejohnbackes/following{/other_user}","gists_url":"https://api.github.com/users/thejohnbackes/gists{/gist_id}","starred_url":"https://api.github.com/users/thejohnbackes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thejohnbackes/subscriptions","organizations_url":"https://api.github.com/users/thejohnbackes/orgs","repos_url":"https://api.github.com/users/thejohnbackes/repos","events_url":"https://api.github.com/users/thejohnbackes/events{/privacy}","received_events_url":"https://api.github.com/users/thejohnbackes/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-06-30T22:27:20Z","updated_at":"2016-07-01T20:02:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"eca56727143e6c2af39b699ca558badc823c2b6a","assignee":{"login":"jdhang","id":5394681,"avatar_url":"https://avatars.githubusercontent.com/u/5394681?v=3","gravatar_id":"","url":"https://api.github.com/users/jdhang","html_url":"https://github.com/jdhang","followers_url":"https://api.github.com/users/jdhang/followers","following_url":"https://api.github.com/users/jdhang/following{/other_user}","gists_url":"https://api.github.com/users/jdhang/gists{/gist_id}","starred_url":"https://api.github.com/users/jdhang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdhang/subscriptions","organizations_url":"https://api.github.com/users/jdhang/orgs","repos_url":"https://api.github.com/users/jdhang/repos","events_url":"https://api.github.com/users/jdhang/events{/privacy}","received_events_url":"https://api.github.com/users/jdhang/received_events","type":"User","site_admin":false},"assignees":[{"login":"jdhang","id":5394681,"avatar_url":"https://avatars.githubusercontent.com/u/5394681?v=3","gravatar_id":"","url":"https://api.github.com/users/jdhang","html_url":"https://github.com/jdhang","followers_url":"https://api.github.com/users/jdhang/followers","following_url":"https://api.github.com/users/jdhang/following{/other_user}","gists_url":"https://api.github.com/users/jdhang/gists{/gist_id}","starred_url":"https://api.github.com/users/jdhang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdhang/subscriptions","organizations_url":"https://api.github.com/users/jdhang/orgs","repos_url":"https://api.github.com/users/jdhang/repos","events_url":"https://api.github.com/users/jdhang/events{/privacy}","received_events_url":"https://api.github.com/users/jdhang/received_events","type":"User","site_admin":false},{"login":"jes708","id":16601510,"avatar_url":"https://avatars.githubusercontent.com/u/16601510?v=3","gravatar_id":"","url":"https://api.github.com/users/jes708","html_url":"https://github.com/jes708","followers_url":"https://api.github.com/users/jes708/followers","following_url":"https://api.github.com/users/jes708/following{/other_user}","gists_url":"https://api.github.com/users/jes708/gists{/gist_id}","starred_url":"https://api.github.com/users/jes708/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jes708/subscriptions","organizations_url":"https://api.github.com/users/jes708/orgs","repos_url":"https://api.github.com/users/jes708/repos","events_url":"https://api.github.com/users/jes708/events{/privacy}","received_events_url":"https://api.github.com/users/jes708/received_events","type":"User","site_admin":false},{"login":"jancodes","id":16806234,"avatar_url":"https://avatars.githubusercontent.com/u/16806234?v=3","gravatar_id":"","url":"https://api.github.com/users/jancodes","html_url":"https://github.com/jancodes","followers_url":"https://api.github.com/users/jancodes/followers","following_url":"https://api.github.com/users/jancodes/following{/other_user}","gists_url":"https://api.github.com/users/jancodes/gists{/gist_id}","starred_url":"https://api.github.com/users/jancodes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jancodes/subscriptions","organizations_url":"https://api.github.com/users/jancodes/orgs","repos_url":"https://api.github.com/users/jancodes/repos","events_url":"https://api.github.com/users/jancodes/events{/privacy}","received_events_url":"https://api.github.com/users/jancodes/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/jes708/CodeGenius/pulls/78/commits","review_comments_url":"https://api.github.com/repos/jes708/CodeGenius/pulls/78/comments","review_comment_url":"https://api.github.com/repos/jes708/CodeGenius/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jes708/CodeGenius/issues/78/comments","statuses_url":"https://api.github.com/repos/jes708/CodeGenius/statuses/52e3b749a1404a4f43326430bc9e837555b536a3","head":{"label":"jes708:comments","ref":"comments","sha":"52e3b749a1404a4f43326430bc9e837555b536a3","user":{"login":"jes708","id":16601510,"avatar_url":"https://avatars.githubusercontent.com/u/16601510?v=3","gravatar_id":"","url":"https://api.github.com/users/jes708","html_url":"https://github.com/jes708","followers_url":"https://api.github.com/users/jes708/followers","following_url":"https://api.github.com/users/jes708/following{/other_user}","gists_url":"https://api.github.com/users/jes708/gists{/gist_id}","starred_url":"https://api.github.com/users/jes708/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jes708/subscriptions","organizations_url":"https://api.github.com/users/jes708/orgs","repos_url":"https://api.github.com/users/jes708/repos","events_url":"https://api.github.com/users/jes708/events{/privacy}","received_events_url":"https://api.github.com/users/jes708/received_events","type":"User","site_admin":false},"repo":{"id":61665508,"name":"CodeGenius","full_name":"jes708/CodeGenius","owner":{"login":"jes708","id":16601510,"avatar_url":"https://avatars.githubusercontent.com/u/16601510?v=3","gravatar_id":"","url":"https://api.github.com/users/jes708","html_url":"https://github.com/jes708","followers_url":"https://api.github.com/users/jes708/followers","following_url":"https://api.github.com/users/jes708/following{/other_user}","gists_url":"https://api.github.com/users/jes708/gists{/gist_id}","starred_url":"https://api.github.com/users/jes708/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jes708/subscriptions","organizations_url":"https://api.github.com/users/jes708/orgs","repos_url":"https://api.github.com/users/jes708/repos","events_url":"https://api.github.com/users/jes708/events{/privacy}","received_events_url":"https://api.github.com/users/jes708/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jes708/CodeGenius","description":"","fork":false,"url":"https://api.github.com/repos/jes708/CodeGenius","forks_url":"https://api.github.com/repos/jes708/CodeGenius/forks","keys_url":"https://api.github.com/repos/jes708/CodeGenius/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jes708/CodeGenius/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jes708/CodeGenius/teams","hooks_url":"https://api.github.com/repos/jes708/CodeGenius/hooks","issue_events_url":"https://api.github.com/repos/jes708/CodeGenius/issues/events{/number}","events_url":"https://api.github.com/repos/jes708/CodeGenius/events","assignees_url":"https://api.github.com/repos/jes708/CodeGenius/assignees{/user}","branches_url":"https://api.github.com/repos/jes708/CodeGenius/branches{/branch}","tags_url":"https://api.github.com/repos/jes708/CodeGenius/tags","blobs_url":"https://api.github.com/repos/jes708/CodeGenius/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jes708/CodeGenius/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jes708/CodeGenius/git/refs{/sha}","trees_url":"https://api.github.com/repos/jes708/CodeGenius/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jes708/CodeGenius/statuses/{sha}","languages_url":"https://api.github.com/repos/jes708/CodeGenius/languages","stargazers_url":"https://api.github.com/repos/jes708/CodeGenius/stargazers","contributors_url":"https://api.github.com/repos/jes708/CodeGenius/contributors","subscribers_url":"https://api.github.com/repos/jes708/CodeGenius/subscribers","subscription_url":"https://api.github.com/repos/jes708/CodeGenius/subscription","commits_url":"https://api.github.com/repos/jes708/CodeGenius/commits{/sha}","git_commits_url":"https://api.github.com/repos/jes708/CodeGenius/git/commits{/sha}","comments_url":"https://api.github.com/repos/jes708/CodeGenius/comments{/number}","issue_comment_url":"https://api.github.com/repos/jes708/CodeGenius/issues/comments{/number}","contents_url":"https://api.github.com/repos/jes708/CodeGenius/contents/{+path}","compare_url":"https://api.github.com/repos/jes708/CodeGenius/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jes708/CodeGenius/merges","archive_url":"https://api.github.com/repos/jes708/CodeGenius/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jes708/CodeGenius/downloads","issues_url":"https://api.github.com/repos/jes708/CodeGenius/issues{/number}","pulls_url":"https://api.github.com/repos/jes708/CodeGenius/pulls{/number}","milestones_url":"https://api.github.com/repos/jes708/CodeGenius/milestones{/number}","notifications_url":"https://api.github.com/repos/jes708/CodeGenius/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jes708/CodeGenius/labels{/name}","releases_url":"https://api.github.com/repos/jes708/CodeGenius/releases{/id}","deployments_url":"https://api.github.com/repos/jes708/CodeGenius/deployments","created_at":"2016-06-21T20:37:11Z","updated_at":"2016-06-23T20:55:02Z","pushed_at":"2016-07-01T19:05:38Z","git_url":"git://github.com/jes708/CodeGenius.git","ssh_url":"git@github.com:jes708/CodeGenius.git","clone_url":"https://github.com/jes708/CodeGenius.git","svn_url":"https://github.com/jes708/CodeGenius","homepage":null,"size":53268,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":45,"forks":2,"open_issues":45,"watchers":1,"default_branch":"master"}},"base":{"label":"jes708:master","ref":"master","sha":"053d328ab3f7efa669cef929d4a6aca86449712a","user":{"login":"jes708","id":16601510,"avatar_url":"https://avatars.githubusercontent.com/u/16601510?v=3","gravatar_id":"","url":"https://api.github.com/users/jes708","html_url":"https://github.com/jes708","followers_url":"https://api.github.com/users/jes708/followers","following_url":"https://api.github.com/users/jes708/following{/other_user}","gists_url":"https://api.github.com/users/jes708/gists{/gist_id}","starred_url":"https://api.github.com/users/jes708/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jes708/subscriptions","organizations_url":"https://api.github.com/users/jes708/orgs","repos_url":"https://api.github.com/users/jes708/repos","events_url":"https://api.github.com/users/jes708/events{/privacy}","received_events_url":"https://api.github.com/users/jes708/received_events","type":"User","site_admin":false},"repo":{"id":61665508,"name":"CodeGenius","full_name":"jes708/CodeGenius","owner":{"login":"jes708","id":16601510,"avatar_url":"https://avatars.githubusercontent.com/u/16601510?v=3","gravatar_id":"","url":"https://api.github.com/users/jes708","html_url":"https://github.com/jes708","followers_url":"https://api.github.com/users/jes708/followers","following_url":"https://api.github.com/users/jes708/following{/other_user}","gists_url":"https://api.github.com/users/jes708/gists{/gist_id}","starred_url":"https://api.github.com/users/jes708/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jes708/subscriptions","organizations_url":"https://api.github.com/users/jes708/orgs","repos_url":"https://api.github.com/users/jes708/repos","events_url":"https://api.github.com/users/jes708/events{/privacy}","received_events_url":"https://api.github.com/users/jes708/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jes708/CodeGenius","description":"","fork":false,"url":"https://api.github.com/repos/jes708/CodeGenius","forks_url":"https://api.github.com/repos/jes708/CodeGenius/forks","keys_url":"https://api.github.com/repos/jes708/CodeGenius/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jes708/CodeGenius/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jes708/CodeGenius/teams","hooks_url":"https://api.github.com/repos/jes708/CodeGenius/hooks","issue_events_url":"https://api.github.com/repos/jes708/CodeGenius/issues/events{/number}","events_url":"https://api.github.com/repos/jes708/CodeGenius/events","assignees_url":"https://api.github.com/repos/jes708/CodeGenius/assignees{/user}","branches_url":"https://api.github.com/repos/jes708/CodeGenius/branches{/branch}","tags_url":"https://api.github.com/repos/jes708/CodeGenius/tags","blobs_url":"https://api.github.com/repos/jes708/CodeGenius/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jes708/CodeGenius/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jes708/CodeGenius/git/refs{/sha}","trees_url":"https://api.github.com/repos/jes708/CodeGenius/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jes708/CodeGenius/statuses/{sha}","languages_url":"https://api.github.com/repos/jes708/CodeGenius/languages","stargazers_url":"https://api.github.com/repos/jes708/CodeGenius/stargazers","contributors_url":"https://api.github.com/repos/jes708/CodeGenius/contributors","subscribers_url":"https://api.github.com/repos/jes708/CodeGenius/subscribers","subscription_url":"https://api.github.com/repos/jes708/CodeGenius/subscription","commits_url":"https://api.github.com/repos/jes708/CodeGenius/commits{/sha}","git_commits_url":"https://api.github.com/repos/jes708/CodeGenius/git/commits{/sha}","comments_url":"https://api.github.com/repos/jes708/CodeGenius/comments{/number}","issue_comment_url":"https://api.github.com/repos/jes708/CodeGenius/issues/comments{/number}","contents_url":"https://api.github.com/repos/jes708/CodeGenius/contents/{+path}","compare_url":"https://api.github.com/repos/jes708/CodeGenius/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jes708/CodeGenius/merges","archive_url":"https://api.github.com/repos/jes708/CodeGenius/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jes708/CodeGenius/downloads","issues_url":"https://api.github.com/repos/jes708/CodeGenius/issues{/number}","pulls_url":"https://api.github.com/repos/jes708/CodeGenius/pulls{/number}","milestones_url":"https://api.github.com/repos/jes708/CodeGenius/milestones{/number}","notifications_url":"https://api.github.com/repos/jes708/CodeGenius/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jes708/CodeGenius/labels{/name}","releases_url":"https://api.github.com/repos/jes708/CodeGenius/releases{/id}","deployments_url":"https://api.github.com/repos/jes708/CodeGenius/deployments","created_at":"2016-06-21T20:37:11Z","updated_at":"2016-06-23T20:55:02Z","pushed_at":"2016-07-01T19:05:38Z","git_url":"git://github.com/jes708/CodeGenius.git","ssh_url":"git@github.com:jes708/CodeGenius.git","clone_url":"https://github.com/jes708/CodeGenius.git","svn_url":"https://github.com/jes708/CodeGenius","homepage":null,"size":53268,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":45,"forks":2,"open_issues":45,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jes708/CodeGenius/pulls/78"},"html":{"href":"https://github.com/jes708/CodeGenius/pull/78"},"issue":{"href":"https://api.github.com/repos/jes708/CodeGenius/issues/78"},"comments":{"href":"https://api.github.com/repos/jes708/CodeGenius/issues/78/comments"},"review_comments":{"href":"https://api.github.com/repos/jes708/CodeGenius/pulls/78/comments"},"review_comment":{"href":"https://api.github.com/repos/jes708/CodeGenius/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jes708/CodeGenius/pulls/78/commits"},"statuses":{"href":"https://api.github.com/repos/jes708/CodeGenius/statuses/52e3b749a1404a4f43326430bc9e837555b536a3"}}}}
{"actor":{"display_login":"khumphrey"}}