{"action":"created","comment":{"url":"https://api.github.com/repos/medullan/navocat-collector/pulls/comments/31946155","id":31946155,"diff_hunk":"@@ -0,0 +1,453 @@\n+/**\n+ * Created by layton on 5/28/15.\n+ */\n+\n+angular.module('core').controller('HomeCtrl', [\n+    '$scope',\n+    'UserService',\n+    '$state',\n+    '$log',\n+    'toastr',\n+    function($scope, UserService, $state, $log,toastr) {\n+        $scope.loginModel = {key: null};\n+        $scope.UserService = UserService;\n+        if(UserService.tokenExists()){\n+            $state.go('logs');\n+        }\n+\n+        $scope.auth = function(key){\n+            UserService.verifyPrivateKey(key).then(function(data){\n+                    UserService.storeToken(data.key);\n+                    $state.go('logs');\n+            },\n+            function(data){\n+                toastr.error('There was an error verifying your key: ' + data.status.toUpperCase());\n+            });\n+        };\n+\n+    }\n+]);\n+\n+angular.module('core').controller('DoneCtrl', [\n+    '$scope',\n+    'UserService',\n+    '$state',\n+    '$log',\n+    'LogStoreService',\n+    'CoreConstants',\n+    'toastr',\n+    function($scope, UserService, $state, $log, LogStoreService, CoreConstants, toastr) {\n+        $scope.UserService = UserService;\n+        $scope.archivedLogs = LogStoreService.deleteActiveLogs();\n+        LogStoreService.deleteRemoteLogs().then(function(data){\n+            //cleanup\n+            UserService.deleteStores();\n+            LogStoreService.deleteStores();\n+            $log.log('logs deleted?', data);\n+        });\n+\n+        $scope.jsonToString = function(val){\n+            return JSON.stringify(val);\n+        };\n+        $scope.getJsonString = function(){\n+            return angular.element('#hidden-elem').text();\n+        };\n+\n+        $scope.copyDone = function(){\n+            toastr.info('JSON copied to clipboard!', 'Information');\n+        };\n+    }\n+]);\n+\n+angular.module('core').controller('SiteCtrl', [\n+    '$scope',\n+    'UserService',\n+    '$state',\n+    '$log',\n+    'LogStoreService',\n+    'CoreConstants',\n+    '$modal',\n+    function($scope, UserService, $state, $log, LogStoreService, CoreConstants, $modal) {\n+\n+        $scope.UserService = UserService;\n+\n+        $scope.confirmEndSession = function(size){\n+            var modalInstance = $modal.open({\n+                animation: true,\n+                templateUrl: CoreConstants.assetBaseUrl + '/views/partials/confirmclear.html',\n+                controller: 'ConfirmModalCtrl',\n+                size: size,\n+                resolve: {\n+                    info: function () {\n+                        var info = {\n+                            title: 'Are you sure you want to end the session?',\n+                            leadMessage: 'By ending the session and selecting \\'Continue\\':' ,\n+                            closingMessage: 'To save the logs, use the \\'Copy JSON\\' feature on the next screen before you close your browser window. This JSON will include your recent log activity and all logs that were imported.',\n+                            messages: [\n+                                'You will be logged out of the Collector Verifier',\n+                                'Your logs will be deleted from the server and cannot be recovered'\n+                            ]\n+                        };\n+                        return info;\n+                    }\n+                }\n+            });\n+\n+            modalInstance.result.then(function (confirm) {\n+                if(confirm){\n+                    UserService.setRecentLogOut(true);\n+                    $state.go('done');\n+                }\n+            }, function () {\n+                $log.info('ConfirmClear Modal dismissed at: ' + new Date());\n+            });\n+        };\n+\n+\n+\n+    }\n+]);\n+\n+angular.module('core').controller('ConfirmModalCtrl', [\n+    '$scope',\n+    '$modalInstance',\n+    'info',\n+    function ($scope, $modalInstance, info) {\n+        $scope.info = info;\n+        $scope.info.continueBtnTxt = $scope.info.continueBtnTxt || 'Continue';\n+        $scope.info.title = $scope.info.title || 'Are you sure?';\n+        $scope.ok = function () {\n+            $modalInstance.close(true);\n+        };\n+\n+        $scope.cancel = function () {\n+            $modalInstance.dismiss('cancel');\n+        };\n+    }\n+]);\n+\n+angular.module('core').controller('ImportModalCtrl', [\n+    '$scope',\n+    '$modalInstance',\n+    'info',\n+    'toastr',\n+    'LogStoreService',\n+    function ($scope, $modalInstance, info, toastr, LogStoreService) {\n+        $scope.info = info;\n+\n+        $scope.import = function(json){\n+            var logs = null;\n+            try{\n+                if(angular.isString(json) && json.length > 0){\n+                    logs = JSON.parse(json);\n+                    if(angular.isArray(logs)){\n+                        if(logs.length > 0){\n+                            var archive = LogStoreService.getArchivedLogs() || [];","path":"verifier/assets/js/app.controllers.js","position":145,"original_position":145,"commit_id":"45954dfc94994b8ec808cd4133400b3ad314e6df","original_commit_id":"45954dfc94994b8ec808cd4133400b3ad314e6df","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Line is too long.","created_at":"2015-06-08T18:46:35Z","updated_at":"2015-06-08T18:46:35Z","html_url":"https://github.com/medullan/navocat-collector/pull/47#discussion_r31946155","pull_request_url":"https://api.github.com/repos/medullan/navocat-collector/pulls/47","_links":{"self":{"href":"https://api.github.com/repos/medullan/navocat-collector/pulls/comments/31946155"},"html":{"href":"https://github.com/medullan/navocat-collector/pull/47#discussion_r31946155"},"pull_request":{"href":"https://api.github.com/repos/medullan/navocat-collector/pulls/47"}}},"pull_request":{"url":"https://api.github.com/repos/medullan/navocat-collector/pulls/47","id":36233841,"html_url":"https://github.com/medullan/navocat-collector/pull/47","diff_url":"https://github.com/medullan/navocat-collector/pull/47.diff","patch_url":"https://github.com/medullan/navocat-collector/pull/47.patch","issue_url":"https://api.github.com/repos/medullan/navocat-collector/issues/47","number":47,"state":"open","locked":false,"title":"RVA Logs","user":{"login":"lwhiteley","id":6108793,"avatar_url":"https://avatars.githubusercontent.com/u/6108793?v=3","gravatar_id":"","url":"https://api.github.com/users/lwhiteley","html_url":"https://github.com/lwhiteley","followers_url":"https://api.github.com/users/lwhiteley/followers","following_url":"https://api.github.com/users/lwhiteley/following{/other_user}","gists_url":"https://api.github.com/users/lwhiteley/gists{/gist_id}","starred_url":"https://api.github.com/users/lwhiteley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lwhiteley/subscriptions","organizations_url":"https://api.github.com/users/lwhiteley/orgs","repos_url":"https://api.github.com/users/lwhiteley/repos","events_url":"https://api.github.com/users/lwhiteley/events{/privacy}","received_events_url":"https://api.github.com/users/lwhiteley/received_events","type":"User","site_admin":false},"body":"Changelog:\r\nfeature: add feature for generating and pulling logs for hits made to the collector\r\nfix: app environment awareness. config now has 'env' property that stores the current environment.   ENV['RACK_ENV'] was also set to enable this.\r\n\r\n\r\n","created_at":"2015-05-26T18:55:59Z","updated_at":"2015-06-08T18:46:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"705b4111a0ae61d347162069b551adffe0f91a5a","assignee":{"login":"wesleyboland","id":907931,"avatar_url":"https://avatars.githubusercontent.com/u/907931?v=3","gravatar_id":"","url":"https://api.github.com/users/wesleyboland","html_url":"https://github.com/wesleyboland","followers_url":"https://api.github.com/users/wesleyboland/followers","following_url":"https://api.github.com/users/wesleyboland/following{/other_user}","gists_url":"https://api.github.com/users/wesleyboland/gists{/gist_id}","starred_url":"https://api.github.com/users/wesleyboland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wesleyboland/subscriptions","organizations_url":"https://api.github.com/users/wesleyboland/orgs","repos_url":"https://api.github.com/users/wesleyboland/repos","events_url":"https://api.github.com/users/wesleyboland/events{/privacy}","received_events_url":"https://api.github.com/users/wesleyboland/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/medullan/navocat-collector/pulls/47/commits","review_comments_url":"https://api.github.com/repos/medullan/navocat-collector/pulls/47/comments","review_comment_url":"https://api.github.com/repos/medullan/navocat-collector/pulls/comments{/number}","comments_url":"https://api.github.com/repos/medullan/navocat-collector/issues/47/comments","statuses_url":"https://api.github.com/repos/medullan/navocat-collector/statuses/45954dfc94994b8ec808cd4133400b3ad314e6df","head":{"label":"medullan:qa-logs","ref":"qa-logs","sha":"45954dfc94994b8ec808cd4133400b3ad314e6df","user":{"login":"medullan","id":5503042,"avatar_url":"https://avatars.githubusercontent.com/u/5503042?v=3","gravatar_id":"","url":"https://api.github.com/users/medullan","html_url":"https://github.com/medullan","followers_url":"https://api.github.com/users/medullan/followers","following_url":"https://api.github.com/users/medullan/following{/other_user}","gists_url":"https://api.github.com/users/medullan/gists{/gist_id}","starred_url":"https://api.github.com/users/medullan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/medullan/subscriptions","organizations_url":"https://api.github.com/users/medullan/orgs","repos_url":"https://api.github.com/users/medullan/repos","events_url":"https://api.github.com/users/medullan/events{/privacy}","received_events_url":"https://api.github.com/users/medullan/received_events","type":"Organization","site_admin":false},"repo":{"id":17293064,"name":"navocat-collector","full_name":"medullan/navocat-collector","owner":{"login":"medullan","id":5503042,"avatar_url":"https://avatars.githubusercontent.com/u/5503042?v=3","gravatar_id":"","url":"https://api.github.com/users/medullan","html_url":"https://github.com/medullan","followers_url":"https://api.github.com/users/medullan/followers","following_url":"https://api.github.com/users/medullan/following{/other_user}","gists_url":"https://api.github.com/users/medullan/gists{/gist_id}","starred_url":"https://api.github.com/users/medullan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/medullan/subscriptions","organizations_url":"https://api.github.com/users/medullan/orgs","repos_url":"https://api.github.com/users/medullan/repos","events_url":"https://api.github.com/users/medullan/events{/privacy}","received_events_url":"https://api.github.com/users/medullan/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/medullan/navocat-collector","description":"Navocat Collector","fork":false,"url":"https://api.github.com/repos/medullan/navocat-collector","forks_url":"https://api.github.com/repos/medullan/navocat-collector/forks","keys_url":"https://api.github.com/repos/medullan/navocat-collector/keys{/key_id}","collaborators_url":"https://api.github.com/repos/medullan/navocat-collector/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/medullan/navocat-collector/teams","hooks_url":"https://api.github.com/repos/medullan/navocat-collector/hooks","issue_events_url":"https://api.github.com/repos/medullan/navocat-collector/issues/events{/number}","events_url":"https://api.github.com/repos/medullan/navocat-collector/events","assignees_url":"https://api.github.com/repos/medullan/navocat-collector/assignees{/user}","branches_url":"https://api.github.com/repos/medullan/navocat-collector/branches{/branch}","tags_url":"https://api.github.com/repos/medullan/navocat-collector/tags","blobs_url":"https://api.github.com/repos/medullan/navocat-collector/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/medullan/navocat-collector/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/medullan/navocat-collector/git/refs{/sha}","trees_url":"https://api.github.com/repos/medullan/navocat-collector/git/trees{/sha}","statuses_url":"https://api.github.com/repos/medullan/navocat-collector/statuses/{sha}","languages_url":"https://api.github.com/repos/medullan/navocat-collector/languages","stargazers_url":"https://api.github.com/repos/medullan/navocat-collector/stargazers","contributors_url":"https://api.github.com/repos/medullan/navocat-collector/contributors","subscribers_url":"https://api.github.com/repos/medullan/navocat-collector/subscribers","subscription_url":"https://api.github.com/repos/medullan/navocat-collector/subscription","commits_url":"https://api.github.com/repos/medullan/navocat-collector/commits{/sha}","git_commits_url":"https://api.github.com/repos/medullan/navocat-collector/git/commits{/sha}","comments_url":"https://api.github.com/repos/medullan/navocat-collector/comments{/number}","issue_comment_url":"https://api.github.com/repos/medullan/navocat-collector/issues/comments{/number}","contents_url":"https://api.github.com/repos/medullan/navocat-collector/contents/{+path}","compare_url":"https://api.github.com/repos/medullan/navocat-collector/compare/{base}...{head}","merges_url":"https://api.github.com/repos/medullan/navocat-collector/merges","archive_url":"https://api.github.com/repos/medullan/navocat-collector/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/medullan/navocat-collector/downloads","issues_url":"https://api.github.com/repos/medullan/navocat-collector/issues{/number}","pulls_url":"https://api.github.com/repos/medullan/navocat-collector/pulls{/number}","milestones_url":"https://api.github.com/repos/medullan/navocat-collector/milestones{/number}","notifications_url":"https://api.github.com/repos/medullan/navocat-collector/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/medullan/navocat-collector/labels{/name}","releases_url":"https://api.github.com/repos/medullan/navocat-collector/releases{/id}","created_at":"2014-02-28T16:58:19Z","updated_at":"2015-04-17T18:16:13Z","pushed_at":"2015-06-08T18:46:17Z","git_url":"git://github.com/medullan/navocat-collector.git","ssh_url":"git@github.com:medullan/navocat-collector.git","clone_url":"https://github.com/medullan/navocat-collector.git","svn_url":"https://github.com/medullan/navocat-collector","homepage":"http://collector.medullan.com","size":6038,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3,"mirror_url":null,"open_issues_count":1,"forks":3,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"medullan:master","ref":"master","sha":"278c1e9213abf74382cd8dc32bf5c64916ded7a5","user":{"login":"medullan","id":5503042,"avatar_url":"https://avatars.githubusercontent.com/u/5503042?v=3","gravatar_id":"","url":"https://api.github.com/users/medullan","html_url":"https://github.com/medullan","followers_url":"https://api.github.com/users/medullan/followers","following_url":"https://api.github.com/users/medullan/following{/other_user}","gists_url":"https://api.github.com/users/medullan/gists{/gist_id}","starred_url":"https://api.github.com/users/medullan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/medullan/subscriptions","organizations_url":"https://api.github.com/users/medullan/orgs","repos_url":"https://api.github.com/users/medullan/repos","events_url":"https://api.github.com/users/medullan/events{/privacy}","received_events_url":"https://api.github.com/users/medullan/received_events","type":"Organization","site_admin":false},"repo":{"id":17293064,"name":"navocat-collector","full_name":"medullan/navocat-collector","owner":{"login":"medullan","id":5503042,"avatar_url":"https://avatars.githubusercontent.com/u/5503042?v=3","gravatar_id":"","url":"https://api.github.com/users/medullan","html_url":"https://github.com/medullan","followers_url":"https://api.github.com/users/medullan/followers","following_url":"https://api.github.com/users/medullan/following{/other_user}","gists_url":"https://api.github.com/users/medullan/gists{/gist_id}","starred_url":"https://api.github.com/users/medullan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/medullan/subscriptions","organizations_url":"https://api.github.com/users/medullan/orgs","repos_url":"https://api.github.com/users/medullan/repos","events_url":"https://api.github.com/users/medullan/events{/privacy}","received_events_url":"https://api.github.com/users/medullan/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/medullan/navocat-collector","description":"Navocat Collector","fork":false,"url":"https://api.github.com/repos/medullan/navocat-collector","forks_url":"https://api.github.com/repos/medullan/navocat-collector/forks","keys_url":"https://api.github.com/repos/medullan/navocat-collector/keys{/key_id}","collaborators_url":"https://api.github.com/repos/medullan/navocat-collector/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/medullan/navocat-collector/teams","hooks_url":"https://api.github.com/repos/medullan/navocat-collector/hooks","issue_events_url":"https://api.github.com/repos/medullan/navocat-collector/issues/events{/number}","events_url":"https://api.github.com/repos/medullan/navocat-collector/events","assignees_url":"https://api.github.com/repos/medullan/navocat-collector/assignees{/user}","branches_url":"https://api.github.com/repos/medullan/navocat-collector/branches{/branch}","tags_url":"https://api.github.com/repos/medullan/navocat-collector/tags","blobs_url":"https://api.github.com/repos/medullan/navocat-collector/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/medullan/navocat-collector/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/medullan/navocat-collector/git/refs{/sha}","trees_url":"https://api.github.com/repos/medullan/navocat-collector/git/trees{/sha}","statuses_url":"https://api.github.com/repos/medullan/navocat-collector/statuses/{sha}","languages_url":"https://api.github.com/repos/medullan/navocat-collector/languages","stargazers_url":"https://api.github.com/repos/medullan/navocat-collector/stargazers","contributors_url":"https://api.github.com/repos/medullan/navocat-collector/contributors","subscribers_url":"https://api.github.com/repos/medullan/navocat-collector/subscribers","subscription_url":"https://api.github.com/repos/medullan/navocat-collector/subscription","commits_url":"https://api.github.com/repos/medullan/navocat-collector/commits{/sha}","git_commits_url":"https://api.github.com/repos/medullan/navocat-collector/git/commits{/sha}","comments_url":"https://api.github.com/repos/medullan/navocat-collector/comments{/number}","issue_comment_url":"https://api.github.com/repos/medullan/navocat-collector/issues/comments{/number}","contents_url":"https://api.github.com/repos/medullan/navocat-collector/contents/{+path}","compare_url":"https://api.github.com/repos/medullan/navocat-collector/compare/{base}...{head}","merges_url":"https://api.github.com/repos/medullan/navocat-collector/merges","archive_url":"https://api.github.com/repos/medullan/navocat-collector/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/medullan/navocat-collector/downloads","issues_url":"https://api.github.com/repos/medullan/navocat-collector/issues{/number}","pulls_url":"https://api.github.com/repos/medullan/navocat-collector/pulls{/number}","milestones_url":"https://api.github.com/repos/medullan/navocat-collector/milestones{/number}","notifications_url":"https://api.github.com/repos/medullan/navocat-collector/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/medullan/navocat-collector/labels{/name}","releases_url":"https://api.github.com/repos/medullan/navocat-collector/releases{/id}","created_at":"2014-02-28T16:58:19Z","updated_at":"2015-04-17T18:16:13Z","pushed_at":"2015-06-08T18:46:17Z","git_url":"git://github.com/medullan/navocat-collector.git","ssh_url":"git@github.com:medullan/navocat-collector.git","clone_url":"https://github.com/medullan/navocat-collector.git","svn_url":"https://github.com/medullan/navocat-collector","homepage":"http://collector.medullan.com","size":6038,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3,"mirror_url":null,"open_issues_count":1,"forks":3,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/medullan/navocat-collector/pulls/47"},"html":{"href":"https://github.com/medullan/navocat-collector/pull/47"},"issue":{"href":"https://api.github.com/repos/medullan/navocat-collector/issues/47"},"comments":{"href":"https://api.github.com/repos/medullan/navocat-collector/issues/47/comments"},"review_comments":{"href":"https://api.github.com/repos/medullan/navocat-collector/pulls/47/comments"},"review_comment":{"href":"https://api.github.com/repos/medullan/navocat-collector/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/medullan/navocat-collector/pulls/47/commits"},"statuses":{"href":"https://api.github.com/repos/medullan/navocat-collector/statuses/45954dfc94994b8ec808cd4133400b3ad314e6df"}}}}