{"action":"created","comment":{"url":"https://api.github.com/repos/adicu/density/pulls/comments/28176484","id":28176484,"diff_hunk":"@@ -0,0 +1,100 @@\n+// vanilla js document.ready bc we are kool kids\n+document.addEventListener('DOMContentLoaded', function() {\n+  document.getElementById('map').addEventListener('load', function() {\n+    \n+    //Iterate through locations and display their data\n+    var data = document.querySelector('#data');\n+    var locations = JSON.parse(data.dataset.locations);\n+    var map = document.getElementById('map');\n+    var innerSvg = map.contentDocument;\n+    var popup = document.getElementById('locationPopup');\n+\n+    var initialOffsetTop = map.getBoundingClientRect().top + window.scrollY;\n+    var initialOffsetLeft = map.getBoundingClientRect().left + window.scrollX;\n+    \n+    //Create a mapping from parent_id --> text representation\n+    var buildingStrings = {};\n+    \n+    //Create a mapping from parent_id --> list full %s for elements inside (e.g. floors of a building)\n+    var buildingFloors = {};\n+\n+    //Create a mapping from parent_id --> query (http://....hours)\n+    var buildingHours = {};\n+    \n+    locations.forEach(function(location) {\n+      if (location.name != 'Butler Library stk') { //We're skipping this out of non-use]\n+        if (buildingFloors[location.parentId] == null) {\n+          buildingFloors[location.parentId] = {};\n+        }\n+        if (buildingStrings[location.parentId] == null) {\n+          buildingStrings[location.parentId] = '<b>' + location.parentName + '</b><br />' +\n+            '<em>Click to view hours</em><br /><br />';","path":"density/static/js/map.js","position":31,"original_position":31,"commit_id":"32d3be0547ec509c5afa24675cc30cad8da68ef0","original_commit_id":"32d3be0547ec509c5afa24675cc30cad8da68ef0","user":{"login":"danrschlosser","id":2433509,"avatar_url":"https://avatars.githubusercontent.com/u/2433509?v=3","gravatar_id":"","url":"https://api.github.com/users/danrschlosser","html_url":"https://github.com/danrschlosser","followers_url":"https://api.github.com/users/danrschlosser/followers","following_url":"https://api.github.com/users/danrschlosser/following{/other_user}","gists_url":"https://api.github.com/users/danrschlosser/gists{/gist_id}","starred_url":"https://api.github.com/users/danrschlosser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danrschlosser/subscriptions","organizations_url":"https://api.github.com/users/danrschlosser/orgs","repos_url":"https://api.github.com/users/danrschlosser/repos","events_url":"https://api.github.com/users/danrschlosser/events{/privacy}","received_events_url":"https://api.github.com/users/danrschlosser/received_events","type":"User","site_admin":false},"body":"whatup with these `<br />` tags yo","created_at":"2015-04-10T20:12:42Z","updated_at":"2015-04-10T20:12:42Z","html_url":"https://github.com/adicu/density/pull/148#discussion_r28176484","pull_request_url":"https://api.github.com/repos/adicu/density/pulls/148","_links":{"self":{"href":"https://api.github.com/repos/adicu/density/pulls/comments/28176484"},"html":{"href":"https://github.com/adicu/density/pull/148#discussion_r28176484"},"pull_request":{"href":"https://api.github.com/repos/adicu/density/pulls/148"}}},"pull_request":{"url":"https://api.github.com/repos/adicu/density/pulls/148","id":32615149,"html_url":"https://github.com/adicu/density/pull/148","diff_url":"https://github.com/adicu/density/pull/148.diff","patch_url":"https://github.com/adicu/density/pull/148.patch","issue_url":"https://api.github.com/repos/adicu/density/issues/148","number":148,"state":"open","locked":false,"title":"Cleaning up javascript","user":{"login":"evantarrh","id":5566223,"avatar_url":"https://avatars.githubusercontent.com/u/5566223?v=3","gravatar_id":"","url":"https://api.github.com/users/evantarrh","html_url":"https://github.com/evantarrh","followers_url":"https://api.github.com/users/evantarrh/followers","following_url":"https://api.github.com/users/evantarrh/following{/other_user}","gists_url":"https://api.github.com/users/evantarrh/gists{/gist_id}","starred_url":"https://api.github.com/users/evantarrh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evantarrh/subscriptions","organizations_url":"https://api.github.com/users/evantarrh/orgs","repos_url":"https://api.github.com/users/evantarrh/repos","events_url":"https://api.github.com/users/evantarrh/events{/privacy}","received_events_url":"https://api.github.com/users/evantarrh/received_events","type":"User","site_admin":false},"body":"Review: @natebrennand @RaymondXu \r\n* Put the map javascript into its own file, gets Flask location data from HTML data attribute\r\n* Lots of syntax changes in the map JS in order to follow proper style\r\n\r\nCloses #147.","created_at":"2015-04-03T20:43:41Z","updated_at":"2015-04-10T20:12:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"18efcbc0652747071d6dccb7e13031ba6b25e29c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/adicu/density/pulls/148/commits","review_comments_url":"https://api.github.com/repos/adicu/density/pulls/148/comments","review_comment_url":"https://api.github.com/repos/adicu/density/pulls/comments{/number}","comments_url":"https://api.github.com/repos/adicu/density/issues/148/comments","statuses_url":"https://api.github.com/repos/adicu/density/statuses/32d3be0547ec509c5afa24675cc30cad8da68ef0","head":{"label":"evantarrh:map-js-cleanup","ref":"map-js-cleanup","sha":"32d3be0547ec509c5afa24675cc30cad8da68ef0","user":{"login":"evantarrh","id":5566223,"avatar_url":"https://avatars.githubusercontent.com/u/5566223?v=3","gravatar_id":"","url":"https://api.github.com/users/evantarrh","html_url":"https://github.com/evantarrh","followers_url":"https://api.github.com/users/evantarrh/followers","following_url":"https://api.github.com/users/evantarrh/following{/other_user}","gists_url":"https://api.github.com/users/evantarrh/gists{/gist_id}","starred_url":"https://api.github.com/users/evantarrh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evantarrh/subscriptions","organizations_url":"https://api.github.com/users/evantarrh/orgs","repos_url":"https://api.github.com/users/evantarrh/repos","events_url":"https://api.github.com/users/evantarrh/events{/privacy}","received_events_url":"https://api.github.com/users/evantarrh/received_events","type":"User","site_admin":false},"repo":{"id":30770464,"name":"density","full_name":"evantarrh/density","owner":{"login":"evantarrh","id":5566223,"avatar_url":"https://avatars.githubusercontent.com/u/5566223?v=3","gravatar_id":"","url":"https://api.github.com/users/evantarrh","html_url":"https://github.com/evantarrh","followers_url":"https://api.github.com/users/evantarrh/followers","following_url":"https://api.github.com/users/evantarrh/following{/other_user}","gists_url":"https://api.github.com/users/evantarrh/gists{/gist_id}","starred_url":"https://api.github.com/users/evantarrh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evantarrh/subscriptions","organizations_url":"https://api.github.com/users/evantarrh/orgs","repos_url":"https://api.github.com/users/evantarrh/repos","events_url":"https://api.github.com/users/evantarrh/events{/privacy}","received_events_url":"https://api.github.com/users/evantarrh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/evantarrh/density","description":"wireless density API","fork":true,"url":"https://api.github.com/repos/evantarrh/density","forks_url":"https://api.github.com/repos/evantarrh/density/forks","keys_url":"https://api.github.com/repos/evantarrh/density/keys{/key_id}","collaborators_url":"https://api.github.com/repos/evantarrh/density/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/evantarrh/density/teams","hooks_url":"https://api.github.com/repos/evantarrh/density/hooks","issue_events_url":"https://api.github.com/repos/evantarrh/density/issues/events{/number}","events_url":"https://api.github.com/repos/evantarrh/density/events","assignees_url":"https://api.github.com/repos/evantarrh/density/assignees{/user}","branches_url":"https://api.github.com/repos/evantarrh/density/branches{/branch}","tags_url":"https://api.github.com/repos/evantarrh/density/tags","blobs_url":"https://api.github.com/repos/evantarrh/density/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/evantarrh/density/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/evantarrh/density/git/refs{/sha}","trees_url":"https://api.github.com/repos/evantarrh/density/git/trees{/sha}","statuses_url":"https://api.github.com/repos/evantarrh/density/statuses/{sha}","languages_url":"https://api.github.com/repos/evantarrh/density/languages","stargazers_url":"https://api.github.com/repos/evantarrh/density/stargazers","contributors_url":"https://api.github.com/repos/evantarrh/density/contributors","subscribers_url":"https://api.github.com/repos/evantarrh/density/subscribers","subscription_url":"https://api.github.com/repos/evantarrh/density/subscription","commits_url":"https://api.github.com/repos/evantarrh/density/commits{/sha}","git_commits_url":"https://api.github.com/repos/evantarrh/density/git/commits{/sha}","comments_url":"https://api.github.com/repos/evantarrh/density/comments{/number}","issue_comment_url":"https://api.github.com/repos/evantarrh/density/issues/comments{/number}","contents_url":"https://api.github.com/repos/evantarrh/density/contents/{+path}","compare_url":"https://api.github.com/repos/evantarrh/density/compare/{base}...{head}","merges_url":"https://api.github.com/repos/evantarrh/density/merges","archive_url":"https://api.github.com/repos/evantarrh/density/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/evantarrh/density/downloads","issues_url":"https://api.github.com/repos/evantarrh/density/issues{/number}","pulls_url":"https://api.github.com/repos/evantarrh/density/pulls{/number}","milestones_url":"https://api.github.com/repos/evantarrh/density/milestones{/number}","notifications_url":"https://api.github.com/repos/evantarrh/density/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/evantarrh/density/labels{/name}","releases_url":"https://api.github.com/repos/evantarrh/density/releases{/id}","created_at":"2015-02-13T18:46:30Z","updated_at":"2015-04-10T20:02:22Z","pushed_at":"2015-04-10T20:08:14Z","git_url":"git://github.com/evantarrh/density.git","ssh_url":"git@github.com:evantarrh/density.git","clone_url":"https://github.com/evantarrh/density.git","svn_url":"https://github.com/evantarrh/density","homepage":null,"size":1983,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"adicu:master","ref":"master","sha":"5e0ca8f7a0382ffec48b3cc2b2872f4cca1de4cc","user":{"login":"adicu","id":987267,"avatar_url":"https://avatars.githubusercontent.com/u/987267?v=3","gravatar_id":"","url":"https://api.github.com/users/adicu","html_url":"https://github.com/adicu","followers_url":"https://api.github.com/users/adicu/followers","following_url":"https://api.github.com/users/adicu/following{/other_user}","gists_url":"https://api.github.com/users/adicu/gists{/gist_id}","starred_url":"https://api.github.com/users/adicu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adicu/subscriptions","organizations_url":"https://api.github.com/users/adicu/orgs","repos_url":"https://api.github.com/users/adicu/repos","events_url":"https://api.github.com/users/adicu/events{/privacy}","received_events_url":"https://api.github.com/users/adicu/received_events","type":"Organization","site_admin":false},"repo":{"id":24915168,"name":"density","full_name":"adicu/density","owner":{"login":"adicu","id":987267,"avatar_url":"https://avatars.githubusercontent.com/u/987267?v=3","gravatar_id":"","url":"https://api.github.com/users/adicu","html_url":"https://github.com/adicu","followers_url":"https://api.github.com/users/adicu/followers","following_url":"https://api.github.com/users/adicu/following{/other_user}","gists_url":"https://api.github.com/users/adicu/gists{/gist_id}","starred_url":"https://api.github.com/users/adicu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adicu/subscriptions","organizations_url":"https://api.github.com/users/adicu/orgs","repos_url":"https://api.github.com/users/adicu/repos","events_url":"https://api.github.com/users/adicu/events{/privacy}","received_events_url":"https://api.github.com/users/adicu/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/adicu/density","description":"wireless density API","fork":false,"url":"https://api.github.com/repos/adicu/density","forks_url":"https://api.github.com/repos/adicu/density/forks","keys_url":"https://api.github.com/repos/adicu/density/keys{/key_id}","collaborators_url":"https://api.github.com/repos/adicu/density/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/adicu/density/teams","hooks_url":"https://api.github.com/repos/adicu/density/hooks","issue_events_url":"https://api.github.com/repos/adicu/density/issues/events{/number}","events_url":"https://api.github.com/repos/adicu/density/events","assignees_url":"https://api.github.com/repos/adicu/density/assignees{/user}","branches_url":"https://api.github.com/repos/adicu/density/branches{/branch}","tags_url":"https://api.github.com/repos/adicu/density/tags","blobs_url":"https://api.github.com/repos/adicu/density/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/adicu/density/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/adicu/density/git/refs{/sha}","trees_url":"https://api.github.com/repos/adicu/density/git/trees{/sha}","statuses_url":"https://api.github.com/repos/adicu/density/statuses/{sha}","languages_url":"https://api.github.com/repos/adicu/density/languages","stargazers_url":"https://api.github.com/repos/adicu/density/stargazers","contributors_url":"https://api.github.com/repos/adicu/density/contributors","subscribers_url":"https://api.github.com/repos/adicu/density/subscribers","subscription_url":"https://api.github.com/repos/adicu/density/subscription","commits_url":"https://api.github.com/repos/adicu/density/commits{/sha}","git_commits_url":"https://api.github.com/repos/adicu/density/git/commits{/sha}","comments_url":"https://api.github.com/repos/adicu/density/comments{/number}","issue_comment_url":"https://api.github.com/repos/adicu/density/issues/comments{/number}","contents_url":"https://api.github.com/repos/adicu/density/contents/{+path}","compare_url":"https://api.github.com/repos/adicu/density/compare/{base}...{head}","merges_url":"https://api.github.com/repos/adicu/density/merges","archive_url":"https://api.github.com/repos/adicu/density/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/adicu/density/downloads","issues_url":"https://api.github.com/repos/adicu/density/issues{/number}","pulls_url":"https://api.github.com/repos/adicu/density/pulls{/number}","milestones_url":"https://api.github.com/repos/adicu/density/milestones{/number}","notifications_url":"https://api.github.com/repos/adicu/density/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/adicu/density/labels{/name}","releases_url":"https://api.github.com/repos/adicu/density/releases{/id}","created_at":"2014-10-07T22:53:24Z","updated_at":"2015-04-10T20:04:36Z","pushed_at":"2015-04-10T20:04:35Z","git_url":"git://github.com/adicu/density.git","ssh_url":"git@github.com:adicu/density.git","clone_url":"https://github.com/adicu/density.git","svn_url":"https://github.com/adicu/density","homepage":null,"size":2883,"stargazers_count":5,"watchers_count":5,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":16,"mirror_url":null,"open_issues_count":32,"forks":16,"open_issues":32,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/adicu/density/pulls/148"},"html":{"href":"https://github.com/adicu/density/pull/148"},"issue":{"href":"https://api.github.com/repos/adicu/density/issues/148"},"comments":{"href":"https://api.github.com/repos/adicu/density/issues/148/comments"},"review_comments":{"href":"https://api.github.com/repos/adicu/density/pulls/148/comments"},"review_comment":{"href":"https://api.github.com/repos/adicu/density/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/adicu/density/pulls/148/commits"},"statuses":{"href":"https://api.github.com/repos/adicu/density/statuses/32d3be0547ec509c5afa24675cc30cad8da68ef0"}}}}