{"action":"created","comment":{"url":"https://api.github.com/repos/codalab/codalab/pulls/comments/42338330","id":42338330,"diff_hunk":"@@ -148,28 +152,26 @@ var Worksheet = React.createClass({\n           $(\"#raw-textarea\").focus();\n         }\n     },\n-    toggleActionBar: function(){\n-        this.setState({showActionBar:!this.state.showActionBar});\n+    toggleActionBar: function() {\n+        this.setState({showActionBar: !this.state.showActionBar});\n     },\n-    showActionBar: function(){\n-        this.setState({showActionBar:true});\n+    showActionBar: function() {\n+        this.setState({showActionBar: true});\n     },\n-    hideActionBar: function(){\n-        this.setState({showActionBar:false});\n+    hideActionBar: function() {\n+        this.setState({showActionBar: false});\n     },\n-    refreshWorksheet: function(){\n+    refreshWorksheet: function() {\n         $('#update_progress').show();\n-        this.setState({updating:true});\n+        this.setState({updating: true});\n         ws_obj.fetch({\n-            success: function(data){\n-                // console.log(\"fetch_and_update success\");\n-                // console.log(\"%c--------------------------------------------------------------\", \"color: Green; font-size:15px;\");\n-                if(this.isMounted()){\n+            success: function(data) {\n+                if (this.isMounted()) {\n                     this.refs.list.setState({worksheet: ws_obj.getState()});","path":"codalab/apps/web/static/js/worksheet/worksheet_interface.js","position":171,"original_position":171,"commit_id":"0bef6777ac329a03dd0beab8e7f08dc965d4913c","original_commit_id":"3058d6e8ca7c7690c1450a5c5973d98c512f5054","user":{"login":"percyliang","id":435384,"avatar_url":"https://avatars.githubusercontent.com/u/435384?v=3","gravatar_id":"","url":"https://api.github.com/users/percyliang","html_url":"https://github.com/percyliang","followers_url":"https://api.github.com/users/percyliang/followers","following_url":"https://api.github.com/users/percyliang/following{/other_user}","gists_url":"https://api.github.com/users/percyliang/gists{/gist_id}","starred_url":"https://api.github.com/users/percyliang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/percyliang/subscriptions","organizations_url":"https://api.github.com/users/percyliang/orgs","repos_url":"https://api.github.com/users/percyliang/repos","events_url":"https://api.github.com/users/percyliang/events{/privacy}","received_events_url":"https://api.github.com/users/percyliang/received_events","type":"User","site_admin":false},"body":"Agreed - we should probably rely less on jquery, which is an easy crutch.\n\nOn Sun, Oct 18, 2015 at 11:00 PM, Pujun Bhatnagar <notifications@github.com>\nwrote:\n\n> In codalab/apps/web/static/js/worksheet/worksheet_interface.js\n> <https://github.com/codalab/codalab/pull/1342#discussion_r42338206>:\n>\n> >          ws_obj.fetch({\n> > -            success: function(data){\n> > -                // console.log(\"fetch_and_update success\");\n> > -                // console.log(\"%c--------------------------------------------------------------\", \"color: Green; font-size:15px;\");\n> > -                if(this.isMounted()){\n> > +            success: function(data) {\n> > +                if (this.isMounted()) {\n> >                      this.refs.list.setState({worksheet: ws_obj.getState()});\n>\n> The changes look good. [image: :+1:]\n>\n> One comment on the React way of doing things though. Technically, since\n> React creates a virtual DOM to figure out which part of the actual DOM need\n> to be updated, all the JQuery code should not be a part of our component\n> class. Components should just be accessing the data passed in the parent in\n> this.props and changing its state by modifying this.state. For all the\n> JQuery commands, we should ideally just have the logic and the variables\n> checking things need to be shown or hidden and when the data would change,\n> the logic described by the components render and ComponentDidMount method\n> would help create the virtualDOM that would update the div state itself.\n> But that would require major restructuring of code and creation of more\n> components that handle the error and other JQuery logic.\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/codalab/codalab/pull/1342/files#r42338206>.\n>\n","created_at":"2015-10-19T06:04:31Z","updated_at":"2015-10-19T06:04:31Z","html_url":"https://github.com/codalab/codalab/pull/1342#discussion_r42338330","pull_request_url":"https://api.github.com/repos/codalab/codalab/pulls/1342","_links":{"self":{"href":"https://api.github.com/repos/codalab/codalab/pulls/comments/42338330"},"html":{"href":"https://github.com/codalab/codalab/pull/1342#discussion_r42338330"},"pull_request":{"href":"https://api.github.com/repos/codalab/codalab/pulls/1342"}}},"pull_request":{"url":"https://api.github.com/repos/codalab/codalab/pulls/1342","id":47979535,"html_url":"https://github.com/codalab/codalab/pull/1342","diff_url":"https://github.com/codalab/codalab/pull/1342.diff","patch_url":"https://github.com/codalab/codalab/pull/1342.patch","issue_url":"https://api.github.com/repos/codalab/codalab/issues/1342","number":1342,"state":"open","locked":false,"title":"Go over the entire worksheets codebase and do general clean up","user":{"login":"percyliang","id":435384,"avatar_url":"https://avatars.githubusercontent.com/u/435384?v=3","gravatar_id":"","url":"https://api.github.com/users/percyliang","html_url":"https://github.com/percyliang","followers_url":"https://api.github.com/users/percyliang/followers","following_url":"https://api.github.com/users/percyliang/following{/other_user}","gists_url":"https://api.github.com/users/percyliang/gists{/gist_id}","starred_url":"https://api.github.com/users/percyliang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/percyliang/subscriptions","organizations_url":"https://api.github.com/users/percyliang/orgs","repos_url":"https://api.github.com/users/percyliang/repos","events_url":"https://api.github.com/users/percyliang/events{/privacy}","received_events_url":"https://api.github.com/users/percyliang/received_events","type":"User","site_admin":false},"body":"- created file with structural overview of worksheets code (worksheets-structure.txt)\r\n- write basic documentation for each file\r\n- deleted unused files (e.g., old crufty non-React interface code)\r\n- delete some of the editing code for worksheets\r\n- minor tweaks (e.g., changing title for bundle details)\r\n\r\n@kashizui @pbhatnagar3 Please take a look and more importantly, test it!  Hopefully this will make the worksheet code more manageable and not break anything.\r\n","created_at":"2015-10-17T04:50:50Z","updated_at":"2015-10-19T06:04:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b0fc6eb0d168b820051f51cc7179cad048c75338","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/codalab/codalab/pulls/1342/commits","review_comments_url":"https://api.github.com/repos/codalab/codalab/pulls/1342/comments","review_comment_url":"https://api.github.com/repos/codalab/codalab/pulls/comments{/number}","comments_url":"https://api.github.com/repos/codalab/codalab/issues/1342/comments","statuses_url":"https://api.github.com/repos/codalab/codalab/statuses/0bef6777ac329a03dd0beab8e7f08dc965d4913c","head":{"label":"codalab:feature/ws-cleanup","ref":"feature/ws-cleanup","sha":"0bef6777ac329a03dd0beab8e7f08dc965d4913c","user":{"login":"codalab","id":4633552,"avatar_url":"https://avatars.githubusercontent.com/u/4633552?v=3","gravatar_id":"","url":"https://api.github.com/users/codalab","html_url":"https://github.com/codalab","followers_url":"https://api.github.com/users/codalab/followers","following_url":"https://api.github.com/users/codalab/following{/other_user}","gists_url":"https://api.github.com/users/codalab/gists{/gist_id}","starred_url":"https://api.github.com/users/codalab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codalab/subscriptions","organizations_url":"https://api.github.com/users/codalab/orgs","repos_url":"https://api.github.com/users/codalab/repos","events_url":"https://api.github.com/users/codalab/events{/privacy}","received_events_url":"https://api.github.com/users/codalab/received_events","type":"User","site_admin":false},"repo":{"id":10556194,"name":"codalab","full_name":"codalab/codalab","owner":{"login":"codalab","id":4633552,"avatar_url":"https://avatars.githubusercontent.com/u/4633552?v=3","gravatar_id":"","url":"https://api.github.com/users/codalab","html_url":"https://github.com/codalab","followers_url":"https://api.github.com/users/codalab/followers","following_url":"https://api.github.com/users/codalab/following{/other_user}","gists_url":"https://api.github.com/users/codalab/gists{/gist_id}","starred_url":"https://api.github.com/users/codalab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codalab/subscriptions","organizations_url":"https://api.github.com/users/codalab/orgs","repos_url":"https://api.github.com/users/codalab/repos","events_url":"https://api.github.com/users/codalab/events{/privacy}","received_events_url":"https://api.github.com/users/codalab/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/codalab/codalab","description":"CodaLab Project","fork":false,"url":"https://api.github.com/repos/codalab/codalab","forks_url":"https://api.github.com/repos/codalab/codalab/forks","keys_url":"https://api.github.com/repos/codalab/codalab/keys{/key_id}","collaborators_url":"https://api.github.com/repos/codalab/codalab/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/codalab/codalab/teams","hooks_url":"https://api.github.com/repos/codalab/codalab/hooks","issue_events_url":"https://api.github.com/repos/codalab/codalab/issues/events{/number}","events_url":"https://api.github.com/repos/codalab/codalab/events","assignees_url":"https://api.github.com/repos/codalab/codalab/assignees{/user}","branches_url":"https://api.github.com/repos/codalab/codalab/branches{/branch}","tags_url":"https://api.github.com/repos/codalab/codalab/tags","blobs_url":"https://api.github.com/repos/codalab/codalab/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/codalab/codalab/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/codalab/codalab/git/refs{/sha}","trees_url":"https://api.github.com/repos/codalab/codalab/git/trees{/sha}","statuses_url":"https://api.github.com/repos/codalab/codalab/statuses/{sha}","languages_url":"https://api.github.com/repos/codalab/codalab/languages","stargazers_url":"https://api.github.com/repos/codalab/codalab/stargazers","contributors_url":"https://api.github.com/repos/codalab/codalab/contributors","subscribers_url":"https://api.github.com/repos/codalab/codalab/subscribers","subscription_url":"https://api.github.com/repos/codalab/codalab/subscription","commits_url":"https://api.github.com/repos/codalab/codalab/commits{/sha}","git_commits_url":"https://api.github.com/repos/codalab/codalab/git/commits{/sha}","comments_url":"https://api.github.com/repos/codalab/codalab/comments{/number}","issue_comment_url":"https://api.github.com/repos/codalab/codalab/issues/comments{/number}","contents_url":"https://api.github.com/repos/codalab/codalab/contents/{+path}","compare_url":"https://api.github.com/repos/codalab/codalab/compare/{base}...{head}","merges_url":"https://api.github.com/repos/codalab/codalab/merges","archive_url":"https://api.github.com/repos/codalab/codalab/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/codalab/codalab/downloads","issues_url":"https://api.github.com/repos/codalab/codalab/issues{/number}","pulls_url":"https://api.github.com/repos/codalab/codalab/pulls{/number}","milestones_url":"https://api.github.com/repos/codalab/codalab/milestones{/number}","notifications_url":"https://api.github.com/repos/codalab/codalab/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/codalab/codalab/labels{/name}","releases_url":"https://api.github.com/repos/codalab/codalab/releases{/id}","created_at":"2013-06-07T18:23:37Z","updated_at":"2015-10-19T02:06:24Z","pushed_at":"2015-10-19T05:51:17Z","git_url":"git://github.com/codalab/codalab.git","ssh_url":"git@github.com:codalab/codalab.git","clone_url":"https://github.com/codalab/codalab.git","svn_url":"https://github.com/codalab/codalab","homepage":"http://codalab.org","size":53189,"stargazers_count":72,"watchers_count":72,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":44,"mirror_url":null,"open_issues_count":169,"forks":44,"open_issues":169,"watchers":72,"default_branch":"master"}},"base":{"label":"codalab:master","ref":"master","sha":"5f6b156481b73210ca6975e965c265c958506a04","user":{"login":"codalab","id":4633552,"avatar_url":"https://avatars.githubusercontent.com/u/4633552?v=3","gravatar_id":"","url":"https://api.github.com/users/codalab","html_url":"https://github.com/codalab","followers_url":"https://api.github.com/users/codalab/followers","following_url":"https://api.github.com/users/codalab/following{/other_user}","gists_url":"https://api.github.com/users/codalab/gists{/gist_id}","starred_url":"https://api.github.com/users/codalab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codalab/subscriptions","organizations_url":"https://api.github.com/users/codalab/orgs","repos_url":"https://api.github.com/users/codalab/repos","events_url":"https://api.github.com/users/codalab/events{/privacy}","received_events_url":"https://api.github.com/users/codalab/received_events","type":"User","site_admin":false},"repo":{"id":10556194,"name":"codalab","full_name":"codalab/codalab","owner":{"login":"codalab","id":4633552,"avatar_url":"https://avatars.githubusercontent.com/u/4633552?v=3","gravatar_id":"","url":"https://api.github.com/users/codalab","html_url":"https://github.com/codalab","followers_url":"https://api.github.com/users/codalab/followers","following_url":"https://api.github.com/users/codalab/following{/other_user}","gists_url":"https://api.github.com/users/codalab/gists{/gist_id}","starred_url":"https://api.github.com/users/codalab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codalab/subscriptions","organizations_url":"https://api.github.com/users/codalab/orgs","repos_url":"https://api.github.com/users/codalab/repos","events_url":"https://api.github.com/users/codalab/events{/privacy}","received_events_url":"https://api.github.com/users/codalab/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/codalab/codalab","description":"CodaLab Project","fork":false,"url":"https://api.github.com/repos/codalab/codalab","forks_url":"https://api.github.com/repos/codalab/codalab/forks","keys_url":"https://api.github.com/repos/codalab/codalab/keys{/key_id}","collaborators_url":"https://api.github.com/repos/codalab/codalab/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/codalab/codalab/teams","hooks_url":"https://api.github.com/repos/codalab/codalab/hooks","issue_events_url":"https://api.github.com/repos/codalab/codalab/issues/events{/number}","events_url":"https://api.github.com/repos/codalab/codalab/events","assignees_url":"https://api.github.com/repos/codalab/codalab/assignees{/user}","branches_url":"https://api.github.com/repos/codalab/codalab/branches{/branch}","tags_url":"https://api.github.com/repos/codalab/codalab/tags","blobs_url":"https://api.github.com/repos/codalab/codalab/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/codalab/codalab/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/codalab/codalab/git/refs{/sha}","trees_url":"https://api.github.com/repos/codalab/codalab/git/trees{/sha}","statuses_url":"https://api.github.com/repos/codalab/codalab/statuses/{sha}","languages_url":"https://api.github.com/repos/codalab/codalab/languages","stargazers_url":"https://api.github.com/repos/codalab/codalab/stargazers","contributors_url":"https://api.github.com/repos/codalab/codalab/contributors","subscribers_url":"https://api.github.com/repos/codalab/codalab/subscribers","subscription_url":"https://api.github.com/repos/codalab/codalab/subscription","commits_url":"https://api.github.com/repos/codalab/codalab/commits{/sha}","git_commits_url":"https://api.github.com/repos/codalab/codalab/git/commits{/sha}","comments_url":"https://api.github.com/repos/codalab/codalab/comments{/number}","issue_comment_url":"https://api.github.com/repos/codalab/codalab/issues/comments{/number}","contents_url":"https://api.github.com/repos/codalab/codalab/contents/{+path}","compare_url":"https://api.github.com/repos/codalab/codalab/compare/{base}...{head}","merges_url":"https://api.github.com/repos/codalab/codalab/merges","archive_url":"https://api.github.com/repos/codalab/codalab/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/codalab/codalab/downloads","issues_url":"https://api.github.com/repos/codalab/codalab/issues{/number}","pulls_url":"https://api.github.com/repos/codalab/codalab/pulls{/number}","milestones_url":"https://api.github.com/repos/codalab/codalab/milestones{/number}","notifications_url":"https://api.github.com/repos/codalab/codalab/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/codalab/codalab/labels{/name}","releases_url":"https://api.github.com/repos/codalab/codalab/releases{/id}","created_at":"2013-06-07T18:23:37Z","updated_at":"2015-10-19T02:06:24Z","pushed_at":"2015-10-19T05:51:17Z","git_url":"git://github.com/codalab/codalab.git","ssh_url":"git@github.com:codalab/codalab.git","clone_url":"https://github.com/codalab/codalab.git","svn_url":"https://github.com/codalab/codalab","homepage":"http://codalab.org","size":53189,"stargazers_count":72,"watchers_count":72,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":44,"mirror_url":null,"open_issues_count":169,"forks":44,"open_issues":169,"watchers":72,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/codalab/codalab/pulls/1342"},"html":{"href":"https://github.com/codalab/codalab/pull/1342"},"issue":{"href":"https://api.github.com/repos/codalab/codalab/issues/1342"},"comments":{"href":"https://api.github.com/repos/codalab/codalab/issues/1342/comments"},"review_comments":{"href":"https://api.github.com/repos/codalab/codalab/pulls/1342/comments"},"review_comment":{"href":"https://api.github.com/repos/codalab/codalab/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/codalab/codalab/pulls/1342/commits"},"statuses":{"href":"https://api.github.com/repos/codalab/codalab/statuses/0bef6777ac329a03dd0beab8e7f08dc965d4913c"}}}}