{"action":"created","comment":{"url":"https://api.github.com/repos/Courseography/courseography/pulls/comments/41335243","id":41335243,"diff_hunk":"@@ -0,0 +1,78 @@\n+function openReactModal(courseCode) {\n+    'use strict';\n+    var courseName = getCourseTitle(courseCode);\n+    var formattedName = formatCourseName(courseCode);\n+    var courseVideoUrls = getCourseVideoUrls(formattedName);\n+    \n+    React.render(\n+        <ModalContent course={formattedName[0]} />,\n+        document.getElementById('modal-content-container')\n+    );\n+}\n+\n+var ModalContent = React.createClass({\n+    render: function() {\n+        return (\n+            <div>\n+                <Description course={this.props.course} />\n+            </div>\n+        );\n+    }\n+});\n+\n+var Description = React.createClass({\n+    getInitialState: function() {\n+        return {\n+            course: [],\n+            sessions: []\n+        };\n+    },\n+\n+    componentDidMount: function(){\n+        //This loads the course json\n+        $.ajax({\n+            url: 'course',\n+            data: {name: this.props.course},\n+            dataType: 'json',\n+            success: function(data) {\n+                if (this.isMounted()) {\n+                    this.setState({course: data});\n+                    //Not sure if there is a cleaner way to do this\n+                    //This is getting the session times\n+                    var lectures = data.fallSession.lectures\n+                                                   .concat(data.springSession.lectures)\n+                                                   .concat(data.yearSession.lectures);\n+                    var sessions = [];\n+                    $.each(lectures, function( index, value ) {\n+                        sessions.push(value.code + value.session + \"-\" + value.section +\": \" + value.timeStr);\n+                    });\n+                    this.setState({sessions: sessions});\n+                }\n+            }.bind(this),\n+            error: function(xhr, status, err) {\n+                console.error('course-info', status, err.toString());\n+            }.bind(this)\n+        });\n+    },\n+    \n+    render: function() {\n+        //have yet to add video URLs but need to ask David how it works\n+        return (\n+            <div>\n+                <p>{this.state.course.description}</p>\n+                <p><strong>Prerequisite: </strong>{this.state.course.prereqString}</p>\n+                <p><strong>Distribution Requirement Status: </strong>{this.state.course.distribution}</p>\n+                <p><strong>Breadth Requirement: </strong>{this.state.course.breadth}</p>\n+                <p><strong>Timetable: </strong></p>\n+                {this.state.sessions.map(function(session) {\n+                    return <p>{session}</p>;\n+                })}                                 \n+                <div id=\"course-video-div\">\n+                    <video id=\"course-video\" className=\"video-js vjs-default-skin\" controls=\"\" preload=\"auto\">\n+                        <source src={this.state.course.videoUrls} type=\"video/mp4\"/>","path":"public/js/common/react_modal.js","position":72,"original_position":72,"commit_id":"76f07463ffcc3192c66fff7fa6ce815818363822","original_commit_id":"76f07463ffcc3192c66fff7fa6ce815818363822","user":{"login":"david-yz-liu","id":3333115,"avatar_url":"https://avatars.githubusercontent.com/u/3333115?v=3","gravatar_id":"","url":"https://api.github.com/users/david-yz-liu","html_url":"https://github.com/david-yz-liu","followers_url":"https://api.github.com/users/david-yz-liu/followers","following_url":"https://api.github.com/users/david-yz-liu/following{/other_user}","gists_url":"https://api.github.com/users/david-yz-liu/gists{/gist_id}","starred_url":"https://api.github.com/users/david-yz-liu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/david-yz-liu/subscriptions","organizations_url":"https://api.github.com/users/david-yz-liu/orgs","repos_url":"https://api.github.com/users/david-yz-liu/repos","events_url":"https://api.github.com/users/david-yz-liu/events{/privacy}","received_events_url":"https://api.github.com/users/david-yz-liu/received_events","type":"User","site_admin":false},"body":"I believe `videoUrls` is a list; you'll need another `map`","created_at":"2015-10-06T23:18:48Z","updated_at":"2015-10-06T23:18:48Z","html_url":"https://github.com/Courseography/courseography/pull/719#discussion_r41335243","pull_request_url":"https://api.github.com/repos/Courseography/courseography/pulls/719","_links":{"self":{"href":"https://api.github.com/repos/Courseography/courseography/pulls/comments/41335243"},"html":{"href":"https://github.com/Courseography/courseography/pull/719#discussion_r41335243"},"pull_request":{"href":"https://api.github.com/repos/Courseography/courseography/pulls/719"}}},"pull_request":{"url":"https://api.github.com/repos/Courseography/courseography/pulls/719","id":46710513,"html_url":"https://github.com/Courseography/courseography/pull/719","diff_url":"https://github.com/Courseography/courseography/pull/719.diff","patch_url":"https://github.com/Courseography/courseography/pull/719.patch","issue_url":"https://api.github.com/repos/Courseography/courseography/issues/719","number":719,"state":"open","locked":false,"title":"Modal content done in React","user":{"login":"ryanfan","id":3655302,"avatar_url":"https://avatars.githubusercontent.com/u/3655302?v=3","gravatar_id":"","url":"https://api.github.com/users/ryanfan","html_url":"https://github.com/ryanfan","followers_url":"https://api.github.com/users/ryanfan/followers","following_url":"https://api.github.com/users/ryanfan/following{/other_user}","gists_url":"https://api.github.com/users/ryanfan/gists{/gist_id}","starred_url":"https://api.github.com/users/ryanfan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryanfan/subscriptions","organizations_url":"https://api.github.com/users/ryanfan/orgs","repos_url":"https://api.github.com/users/ryanfan/repos","events_url":"https://api.github.com/users/ryanfan/events{/privacy}","received_events_url":"https://api.github.com/users/ryanfan/received_events","type":"User","site_admin":false},"body":"The code currently just overwrites the content in `modal-content-container`.  It does not create the modal, even though it is name `openModal`\r\nTODO: Inserting video URLs.  I'm not sure where to pull the information for that.","created_at":"2015-10-03T18:30:17Z","updated_at":"2015-10-06T23:18:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7239d091c62db17276091fb78d3ce20ea8657203","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Courseography/courseography/pulls/719/commits","review_comments_url":"https://api.github.com/repos/Courseography/courseography/pulls/719/comments","review_comment_url":"https://api.github.com/repos/Courseography/courseography/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Courseography/courseography/issues/719/comments","statuses_url":"https://api.github.com/repos/Courseography/courseography/statuses/76f07463ffcc3192c66fff7fa6ce815818363822","head":{"label":"ryanfan:master","ref":"master","sha":"76f07463ffcc3192c66fff7fa6ce815818363822","user":{"login":"ryanfan","id":3655302,"avatar_url":"https://avatars.githubusercontent.com/u/3655302?v=3","gravatar_id":"","url":"https://api.github.com/users/ryanfan","html_url":"https://github.com/ryanfan","followers_url":"https://api.github.com/users/ryanfan/followers","following_url":"https://api.github.com/users/ryanfan/following{/other_user}","gists_url":"https://api.github.com/users/ryanfan/gists{/gist_id}","starred_url":"https://api.github.com/users/ryanfan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryanfan/subscriptions","organizations_url":"https://api.github.com/users/ryanfan/orgs","repos_url":"https://api.github.com/users/ryanfan/repos","events_url":"https://api.github.com/users/ryanfan/events{/privacy}","received_events_url":"https://api.github.com/users/ryanfan/received_events","type":"User","site_admin":false},"repo":{"id":42494714,"name":"courseography","full_name":"ryanfan/courseography","owner":{"login":"ryanfan","id":3655302,"avatar_url":"https://avatars.githubusercontent.com/u/3655302?v=3","gravatar_id":"","url":"https://api.github.com/users/ryanfan","html_url":"https://github.com/ryanfan","followers_url":"https://api.github.com/users/ryanfan/followers","following_url":"https://api.github.com/users/ryanfan/following{/other_user}","gists_url":"https://api.github.com/users/ryanfan/gists{/gist_id}","starred_url":"https://api.github.com/users/ryanfan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryanfan/subscriptions","organizations_url":"https://api.github.com/users/ryanfan/orgs","repos_url":"https://api.github.com/users/ryanfan/repos","events_url":"https://api.github.com/users/ryanfan/events{/privacy}","received_events_url":"https://api.github.com/users/ryanfan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ryanfan/courseography","description":"Courseography is a tool created by David Liu and Ian Stewart-Binks to guide students through their undergraduate careers.","fork":true,"url":"https://api.github.com/repos/ryanfan/courseography","forks_url":"https://api.github.com/repos/ryanfan/courseography/forks","keys_url":"https://api.github.com/repos/ryanfan/courseography/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ryanfan/courseography/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ryanfan/courseography/teams","hooks_url":"https://api.github.com/repos/ryanfan/courseography/hooks","issue_events_url":"https://api.github.com/repos/ryanfan/courseography/issues/events{/number}","events_url":"https://api.github.com/repos/ryanfan/courseography/events","assignees_url":"https://api.github.com/repos/ryanfan/courseography/assignees{/user}","branches_url":"https://api.github.com/repos/ryanfan/courseography/branches{/branch}","tags_url":"https://api.github.com/repos/ryanfan/courseography/tags","blobs_url":"https://api.github.com/repos/ryanfan/courseography/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ryanfan/courseography/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ryanfan/courseography/git/refs{/sha}","trees_url":"https://api.github.com/repos/ryanfan/courseography/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ryanfan/courseography/statuses/{sha}","languages_url":"https://api.github.com/repos/ryanfan/courseography/languages","stargazers_url":"https://api.github.com/repos/ryanfan/courseography/stargazers","contributors_url":"https://api.github.com/repos/ryanfan/courseography/contributors","subscribers_url":"https://api.github.com/repos/ryanfan/courseography/subscribers","subscription_url":"https://api.github.com/repos/ryanfan/courseography/subscription","commits_url":"https://api.github.com/repos/ryanfan/courseography/commits{/sha}","git_commits_url":"https://api.github.com/repos/ryanfan/courseography/git/commits{/sha}","comments_url":"https://api.github.com/repos/ryanfan/courseography/comments{/number}","issue_comment_url":"https://api.github.com/repos/ryanfan/courseography/issues/comments{/number}","contents_url":"https://api.github.com/repos/ryanfan/courseography/contents/{+path}","compare_url":"https://api.github.com/repos/ryanfan/courseography/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ryanfan/courseography/merges","archive_url":"https://api.github.com/repos/ryanfan/courseography/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ryanfan/courseography/downloads","issues_url":"https://api.github.com/repos/ryanfan/courseography/issues{/number}","pulls_url":"https://api.github.com/repos/ryanfan/courseography/pulls{/number}","milestones_url":"https://api.github.com/repos/ryanfan/courseography/milestones{/number}","notifications_url":"https://api.github.com/repos/ryanfan/courseography/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ryanfan/courseography/labels{/name}","releases_url":"https://api.github.com/repos/ryanfan/courseography/releases{/id}","created_at":"2015-09-15T04:15:37Z","updated_at":"2015-09-15T04:15:38Z","pushed_at":"2015-10-05T00:40:34Z","git_url":"git://github.com/ryanfan/courseography.git","ssh_url":"git@github.com:ryanfan/courseography.git","clone_url":"https://github.com/ryanfan/courseography.git","svn_url":"https://github.com/ryanfan/courseography","homepage":"","size":34706,"stargazers_count":0,"watchers_count":0,"language":"Haskell","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Courseography:master","ref":"master","sha":"d8e526a10d2c60ad43b86e7bc7ebe709b527eed6","user":{"login":"Courseography","id":9721671,"avatar_url":"https://avatars.githubusercontent.com/u/9721671?v=3","gravatar_id":"","url":"https://api.github.com/users/Courseography","html_url":"https://github.com/Courseography","followers_url":"https://api.github.com/users/Courseography/followers","following_url":"https://api.github.com/users/Courseography/following{/other_user}","gists_url":"https://api.github.com/users/Courseography/gists{/gist_id}","starred_url":"https://api.github.com/users/Courseography/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Courseography/subscriptions","organizations_url":"https://api.github.com/users/Courseography/orgs","repos_url":"https://api.github.com/users/Courseography/repos","events_url":"https://api.github.com/users/Courseography/events{/privacy}","received_events_url":"https://api.github.com/users/Courseography/received_events","type":"Organization","site_admin":false},"repo":{"id":16873349,"name":"courseography","full_name":"Courseography/courseography","owner":{"login":"Courseography","id":9721671,"avatar_url":"https://avatars.githubusercontent.com/u/9721671?v=3","gravatar_id":"","url":"https://api.github.com/users/Courseography","html_url":"https://github.com/Courseography","followers_url":"https://api.github.com/users/Courseography/followers","following_url":"https://api.github.com/users/Courseography/following{/other_user}","gists_url":"https://api.github.com/users/Courseography/gists{/gist_id}","starred_url":"https://api.github.com/users/Courseography/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Courseography/subscriptions","organizations_url":"https://api.github.com/users/Courseography/orgs","repos_url":"https://api.github.com/users/Courseography/repos","events_url":"https://api.github.com/users/Courseography/events{/privacy}","received_events_url":"https://api.github.com/users/Courseography/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Courseography/courseography","description":"Courseography is a tool created by David Liu and Ian Stewart-Binks to guide students through their undergraduate careers.","fork":false,"url":"https://api.github.com/repos/Courseography/courseography","forks_url":"https://api.github.com/repos/Courseography/courseography/forks","keys_url":"https://api.github.com/repos/Courseography/courseography/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Courseography/courseography/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Courseography/courseography/teams","hooks_url":"https://api.github.com/repos/Courseography/courseography/hooks","issue_events_url":"https://api.github.com/repos/Courseography/courseography/issues/events{/number}","events_url":"https://api.github.com/repos/Courseography/courseography/events","assignees_url":"https://api.github.com/repos/Courseography/courseography/assignees{/user}","branches_url":"https://api.github.com/repos/Courseography/courseography/branches{/branch}","tags_url":"https://api.github.com/repos/Courseography/courseography/tags","blobs_url":"https://api.github.com/repos/Courseography/courseography/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Courseography/courseography/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Courseography/courseography/git/refs{/sha}","trees_url":"https://api.github.com/repos/Courseography/courseography/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Courseography/courseography/statuses/{sha}","languages_url":"https://api.github.com/repos/Courseography/courseography/languages","stargazers_url":"https://api.github.com/repos/Courseography/courseography/stargazers","contributors_url":"https://api.github.com/repos/Courseography/courseography/contributors","subscribers_url":"https://api.github.com/repos/Courseography/courseography/subscribers","subscription_url":"https://api.github.com/repos/Courseography/courseography/subscription","commits_url":"https://api.github.com/repos/Courseography/courseography/commits{/sha}","git_commits_url":"https://api.github.com/repos/Courseography/courseography/git/commits{/sha}","comments_url":"https://api.github.com/repos/Courseography/courseography/comments{/number}","issue_comment_url":"https://api.github.com/repos/Courseography/courseography/issues/comments{/number}","contents_url":"https://api.github.com/repos/Courseography/courseography/contents/{+path}","compare_url":"https://api.github.com/repos/Courseography/courseography/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Courseography/courseography/merges","archive_url":"https://api.github.com/repos/Courseography/courseography/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Courseography/courseography/downloads","issues_url":"https://api.github.com/repos/Courseography/courseography/issues{/number}","pulls_url":"https://api.github.com/repos/Courseography/courseography/pulls{/number}","milestones_url":"https://api.github.com/repos/Courseography/courseography/milestones{/number}","notifications_url":"https://api.github.com/repos/Courseography/courseography/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Courseography/courseography/labels{/name}","releases_url":"https://api.github.com/repos/Courseography/courseography/releases{/id}","created_at":"2014-02-15T22:32:22Z","updated_at":"2015-10-06T20:29:53Z","pushed_at":"2015-10-06T22:03:14Z","git_url":"git://github.com/Courseography/courseography.git","ssh_url":"git@github.com:Courseography/courseography.git","clone_url":"https://github.com/Courseography/courseography.git","svn_url":"https://github.com/Courseography/courseography","homepage":"","size":42272,"stargazers_count":14,"watchers_count":14,"language":"Haskell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":25,"mirror_url":null,"open_issues_count":68,"forks":25,"open_issues":68,"watchers":14,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Courseography/courseography/pulls/719"},"html":{"href":"https://github.com/Courseography/courseography/pull/719"},"issue":{"href":"https://api.github.com/repos/Courseography/courseography/issues/719"},"comments":{"href":"https://api.github.com/repos/Courseography/courseography/issues/719/comments"},"review_comments":{"href":"https://api.github.com/repos/Courseography/courseography/pulls/719/comments"},"review_comment":{"href":"https://api.github.com/repos/Courseography/courseography/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Courseography/courseography/pulls/719/commits"},"statuses":{"href":"https://api.github.com/repos/Courseography/courseography/statuses/76f07463ffcc3192c66fff7fa6ce815818363822"}}}}