{"action":"created","comment":{"url":"https://api.github.com/repos/google/timesketch/pulls/comments/190203884","pull_request_review_id":122530867,"id":190203884,"diff_hunk":"@@ -389,12 +408,75 @@ export const tsEvent = function () {\n                 }\n \n             })\n+        },\n+    }\n+}\n \n+export const tsEventAdd = ['$window', '$timeout', function ($window, $timeout) {\n+    /**\n+     * Render event details.\n+     * @param sketch-id - The id for the sketch.\n+     * @param meta - Metadata object returned from the datastore search.\n+     * @param event - Event object.\n+     */\n+    return {\n+        restrict: 'E',\n+        template: require('./event-add.html'),\n+        scope: {\n+            sketchId: '=',\n+            sketch: '=',\n+            event: '=',\n+            events: '=',\n+            filter: '=',\n+            query: '=',\n+            queryDsl: '=',\n+            index: '@',\n+            addEventData: '=',\n+        },\n+        require: '^tsSearch',\n+        controller: function ($scope, timesketchApi) {\n+            $scope.clearAddEvent = function (event) {\n+                $scope.addEventData[event._id].timestamp_desc = ''\n+                $scope.addEventData[event._id].message = ''\n+                $scope.addEventData[event._id].timestamp = event._source.datetime\n+                $scope.addEventData[event._id].showForm = !$scope.addEvent[event._id].showForm\n+            }\n+            $scope.genEventId = function () {\n+              let id = '';\n+              const alpha = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_\";\n+              for (let i = 0; i < 20; i++) {\n+                id += alpha.charAt(Math.floor(Math.random() * alpha.length));\n+              }\n+              return id;\n+            }\n         },\n         link: function (scope, elem, attrs, ctrl) {\n-            scope.getContext = function (event) {\n-                ctrl.getContext(event)\n+            scope.doAddEvent = function (eventId, index) {\n+                const event = scope.addEventData[eventId]\n+                scope.addEventData[eventId].disabled = true\n+                ctrl.addEvent(event).then( function (response) {\n+                    const resp_timeline = response.data.objects[0]\n+                    const ts = Date.parse(scope.addEventData[eventId].timestamp)\n+                    const tsm = ts * 1000","path":"timesketch/ui/explore/event.directive.ts","position":109,"original_position":109,"commit_id":"c69799a74e3fa95062c5df1d8e43a782f654cd06","original_commit_id":"c69799a74e3fa95062c5df1d8e43a782f654cd06","user":{"login":"berggren","id":316362,"avatar_url":"https://avatars0.githubusercontent.com/u/316362?v=4","gravatar_id":"","url":"https://api.github.com/users/berggren","html_url":"https://github.com/berggren","followers_url":"https://api.github.com/users/berggren/followers","following_url":"https://api.github.com/users/berggren/following{/other_user}","gists_url":"https://api.github.com/users/berggren/gists{/gist_id}","starred_url":"https://api.github.com/users/berggren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/berggren/subscriptions","organizations_url":"https://api.github.com/users/berggren/orgs","repos_url":"https://api.github.com/users/berggren/repos","events_url":"https://api.github.com/users/berggren/events{/privacy}","received_events_url":"https://api.github.com/users/berggren/received_events","type":"User","site_admin":false},"body":"this is never used, please remove.","created_at":"2018-05-23T10:54:56Z","updated_at":"2018-05-23T10:55:01Z","html_url":"https://github.com/google/timesketch/pull/587#discussion_r190203884","pull_request_url":"https://api.github.com/repos/google/timesketch/pulls/587","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/google/timesketch/pulls/comments/190203884"},"html":{"href":"https://github.com/google/timesketch/pull/587#discussion_r190203884"},"pull_request":{"href":"https://api.github.com/repos/google/timesketch/pulls/587"}}},"pull_request":{"url":"https://api.github.com/repos/google/timesketch/pulls/587","id":184651590,"html_url":"https://github.com/google/timesketch/pull/587","diff_url":"https://github.com/google/timesketch/pull/587.diff","patch_url":"https://github.com/google/timesketch/pull/587.patch","issue_url":"https://api.github.com/repos/google/timesketch/issues/587","number":587,"state":"open","locked":false,"title":"Add events manually","user":{"login":"adamjnichols","id":5170332,"avatar_url":"https://avatars1.githubusercontent.com/u/5170332?v=4","gravatar_id":"","url":"https://api.github.com/users/adamjnichols","html_url":"https://github.com/adamjnichols","followers_url":"https://api.github.com/users/adamjnichols/followers","following_url":"https://api.github.com/users/adamjnichols/following{/other_user}","gists_url":"https://api.github.com/users/adamjnichols/gists{/gist_id}","starred_url":"https://api.github.com/users/adamjnichols/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamjnichols/subscriptions","organizations_url":"https://api.github.com/users/adamjnichols/orgs","repos_url":"https://api.github.com/users/adamjnichols/repos","events_url":"https://api.github.com/users/adamjnichols/events{/privacy}","received_events_url":"https://api.github.com/users/adamjnichols/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-04-27T15:15:29Z","updated_at":"2018-05-23T10:55:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"491c7b813acafe92e971a1bade7b2df7c288db52","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/google/timesketch/pulls/587/commits","review_comments_url":"https://api.github.com/repos/google/timesketch/pulls/587/comments","review_comment_url":"https://api.github.com/repos/google/timesketch/pulls/comments{/number}","comments_url":"https://api.github.com/repos/google/timesketch/issues/587/comments","statuses_url":"https://api.github.com/repos/google/timesketch/statuses/c69799a74e3fa95062c5df1d8e43a782f654cd06","head":{"label":"google:ajn-api-timelines","ref":"ajn-api-timelines","sha":"c69799a74e3fa95062c5df1d8e43a782f654cd06","user":{"login":"google","id":1342004,"avatar_url":"https://avatars1.githubusercontent.com/u/1342004?v=4","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":21009909,"name":"timesketch","full_name":"google/timesketch","owner":{"login":"google","id":1342004,"avatar_url":"https://avatars1.githubusercontent.com/u/1342004?v=4","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/google/timesketch","description":"Collaborative forensic timeline analysis","fork":false,"url":"https://api.github.com/repos/google/timesketch","forks_url":"https://api.github.com/repos/google/timesketch/forks","keys_url":"https://api.github.com/repos/google/timesketch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/timesketch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/timesketch/teams","hooks_url":"https://api.github.com/repos/google/timesketch/hooks","issue_events_url":"https://api.github.com/repos/google/timesketch/issues/events{/number}","events_url":"https://api.github.com/repos/google/timesketch/events","assignees_url":"https://api.github.com/repos/google/timesketch/assignees{/user}","branches_url":"https://api.github.com/repos/google/timesketch/branches{/branch}","tags_url":"https://api.github.com/repos/google/timesketch/tags","blobs_url":"https://api.github.com/repos/google/timesketch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/timesketch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/timesketch/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/timesketch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/timesketch/statuses/{sha}","languages_url":"https://api.github.com/repos/google/timesketch/languages","stargazers_url":"https://api.github.com/repos/google/timesketch/stargazers","contributors_url":"https://api.github.com/repos/google/timesketch/contributors","subscribers_url":"https://api.github.com/repos/google/timesketch/subscribers","subscription_url":"https://api.github.com/repos/google/timesketch/subscription","commits_url":"https://api.github.com/repos/google/timesketch/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/timesketch/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/timesketch/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/timesketch/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/timesketch/contents/{+path}","compare_url":"https://api.github.com/repos/google/timesketch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/timesketch/merges","archive_url":"https://api.github.com/repos/google/timesketch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/timesketch/downloads","issues_url":"https://api.github.com/repos/google/timesketch/issues{/number}","pulls_url":"https://api.github.com/repos/google/timesketch/pulls{/number}","milestones_url":"https://api.github.com/repos/google/timesketch/milestones{/number}","notifications_url":"https://api.github.com/repos/google/timesketch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/timesketch/labels{/name}","releases_url":"https://api.github.com/repos/google/timesketch/releases{/id}","deployments_url":"https://api.github.com/repos/google/timesketch/deployments","created_at":"2014-06-19T17:49:45Z","updated_at":"2018-05-22T12:52:03Z","pushed_at":"2018-05-22T15:18:27Z","git_url":"git://github.com/google/timesketch.git","ssh_url":"git@github.com:google/timesketch.git","clone_url":"https://github.com/google/timesketch.git","svn_url":"https://github.com/google/timesketch","homepage":"","size":7737,"stargazers_count":853,"watchers_count":853,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":161,"mirror_url":null,"archived":false,"open_issues_count":81,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":161,"open_issues":81,"watchers":853,"default_branch":"master"}},"base":{"label":"google:master","ref":"master","sha":"5f8f5cd030eac88bb2f04883f08db599c9ab60d6","user":{"login":"google","id":1342004,"avatar_url":"https://avatars1.githubusercontent.com/u/1342004?v=4","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":21009909,"name":"timesketch","full_name":"google/timesketch","owner":{"login":"google","id":1342004,"avatar_url":"https://avatars1.githubusercontent.com/u/1342004?v=4","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/google/timesketch","description":"Collaborative forensic timeline analysis","fork":false,"url":"https://api.github.com/repos/google/timesketch","forks_url":"https://api.github.com/repos/google/timesketch/forks","keys_url":"https://api.github.com/repos/google/timesketch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/timesketch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/timesketch/teams","hooks_url":"https://api.github.com/repos/google/timesketch/hooks","issue_events_url":"https://api.github.com/repos/google/timesketch/issues/events{/number}","events_url":"https://api.github.com/repos/google/timesketch/events","assignees_url":"https://api.github.com/repos/google/timesketch/assignees{/user}","branches_url":"https://api.github.com/repos/google/timesketch/branches{/branch}","tags_url":"https://api.github.com/repos/google/timesketch/tags","blobs_url":"https://api.github.com/repos/google/timesketch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/timesketch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/timesketch/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/timesketch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/timesketch/statuses/{sha}","languages_url":"https://api.github.com/repos/google/timesketch/languages","stargazers_url":"https://api.github.com/repos/google/timesketch/stargazers","contributors_url":"https://api.github.com/repos/google/timesketch/contributors","subscribers_url":"https://api.github.com/repos/google/timesketch/subscribers","subscription_url":"https://api.github.com/repos/google/timesketch/subscription","commits_url":"https://api.github.com/repos/google/timesketch/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/timesketch/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/timesketch/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/timesketch/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/timesketch/contents/{+path}","compare_url":"https://api.github.com/repos/google/timesketch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/timesketch/merges","archive_url":"https://api.github.com/repos/google/timesketch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/timesketch/downloads","issues_url":"https://api.github.com/repos/google/timesketch/issues{/number}","pulls_url":"https://api.github.com/repos/google/timesketch/pulls{/number}","milestones_url":"https://api.github.com/repos/google/timesketch/milestones{/number}","notifications_url":"https://api.github.com/repos/google/timesketch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/timesketch/labels{/name}","releases_url":"https://api.github.com/repos/google/timesketch/releases{/id}","deployments_url":"https://api.github.com/repos/google/timesketch/deployments","created_at":"2014-06-19T17:49:45Z","updated_at":"2018-05-22T12:52:03Z","pushed_at":"2018-05-22T15:18:27Z","git_url":"git://github.com/google/timesketch.git","ssh_url":"git@github.com:google/timesketch.git","clone_url":"https://github.com/google/timesketch.git","svn_url":"https://github.com/google/timesketch","homepage":"","size":7737,"stargazers_count":853,"watchers_count":853,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":161,"mirror_url":null,"archived":false,"open_issues_count":81,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":161,"open_issues":81,"watchers":853,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/google/timesketch/pulls/587"},"html":{"href":"https://github.com/google/timesketch/pull/587"},"issue":{"href":"https://api.github.com/repos/google/timesketch/issues/587"},"comments":{"href":"https://api.github.com/repos/google/timesketch/issues/587/comments"},"review_comments":{"href":"https://api.github.com/repos/google/timesketch/pulls/587/comments"},"review_comment":{"href":"https://api.github.com/repos/google/timesketch/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/google/timesketch/pulls/587/commits"},"statuses":{"href":"https://api.github.com/repos/google/timesketch/statuses/c69799a74e3fa95062c5df1d8e43a782f654cd06"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"berggren"}}