{"action":"created","comment":{"url":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map/pulls/comments/72321491","id":72321491,"diff_hunk":"@@ -852,21 +850,84 @@ function processScanned(i, item) {\n \n }\n \n+function processNewPokemons(pokemons, oldPokemonKeys) {\n+\n+    newPokemonItems = []\n+\n+    $.each(pokemons, function (key, item) {\n+        if(oldPokemonKeys.indexOf(key) == -1 && isPokemonNotified(item.pokemon_id)){\n+            newPokemonItems.push(item);\n+        }\n+    });\n+\n+    if(newPokemonItems.length==0) return;\n+\n+    if (Store.get('playSound')) {\n+      audio.play();\n+    }\n+\n+    $.each(newPokemonItems, function (key, item) {\n+        if (item.marker.animationDisabled != true) {\n+            item.marker.setAnimation(google.maps.Animation.BOUNCE);\n+        }\n+    });\n+\n+    if(newPokemonItems.length < 4) {\n+        $.each(newPokemonItems, function (key, item) {\n+            var notification = sendNotification('A wild ' + item.pokemon_name + ' appeared!', 'Click to load map', 'static/icons/' + item.pokemon_id + '.png');\n+            if(notification){\n+                notification.onclick = function () {\n+                    window.focus();\n+                    notification.close();\n+                    centerMap(item.latitude, item.longitude, false);\n+                    if (item.marker.animationDisabled != true) {\n+                        item.marker.setAnimation(google.maps.Animation.BOUNCE);\n+                    }\n+                    setTimeout(function() {\n+                        redrawPokemon(pokemons);\n+                    }, 2000);\n+                };\n+            }\n+        });\n+    } else {\n+        var notification = sendNotification('Several pokemons appeared!', 'Click to load map', 'static/appicons/114x114.png');\n+        if(notification){\n+            notification.onclick = function () {\n+                window.focus();\n+                notification.close();\n+                $.each(newPokemonItems, function (key, item) {\n+                    if (item.marker.animationDisabled != true) {\n+                        item.marker.setAnimation(google.maps.Animation.BOUNCE);\n+                    }\n+                });\n+                setTimeout(function() {\n+                    redrawPokemon(pokemons);\n+                }, 2000);\n+            };\n+        }\n+    }\n+\n+}\n \n function updateMap() {\n \n     loadRawData().done(function (result) {\n+        oldPokemonKeys = Object.keys(map_data.pokemons)\n+        oldLurePokemonKeys = Object.keys(map_data.lure_pokemons)\n         $.each(result.pokemons, processPokemons);\n         $.each(result.pokestops, processPokestops);\n         $.each(result.pokestops, processLuredPokemon);\n         $.each(result.gyms, processGyms);\n         $.each(result.scanned, processScanned);\n-        clearOutOfBoundsMarkers(map_data.pokemons);\n-        clearOutOfBoundsMarkers(map_data.lure_pokemons);\n-        clearOutOfBoundsMarkers(map_data.gyms);\n-        clearOutOfBoundsMarkers(map_data.pokestops);\n-        clearOutOfBoundsMarkers(map_data.scanned);\n+        // If someone needs this feature - please implement a version that doesn't break notifications\n+        // clearOutOfBoundsMarkers(map_data.pokemons);","path":"static/map.js","position":172,"original_position":172,"commit_id":"1767c8b9eaf5a2e6596e59cefd0603761783240a","original_commit_id":"1767c8b9eaf5a2e6596e59cefd0603761783240a","user":{"login":"PiaFraus","id":1433600,"avatar_url":"https://avatars.githubusercontent.com/u/1433600?v=3","gravatar_id":"","url":"https://api.github.com/users/PiaFraus","html_url":"https://github.com/PiaFraus","followers_url":"https://api.github.com/users/PiaFraus/followers","following_url":"https://api.github.com/users/PiaFraus/following{/other_user}","gists_url":"https://api.github.com/users/PiaFraus/gists{/gist_id}","starred_url":"https://api.github.com/users/PiaFraus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PiaFraus/subscriptions","organizations_url":"https://api.github.com/users/PiaFraus/orgs","repos_url":"https://api.github.com/users/PiaFraus/repos","events_url":"https://api.github.com/users/PiaFraus/events{/privacy}","received_events_url":"https://api.github.com/users/PiaFraus/received_events","type":"User","site_admin":false},"body":"@BillyWM, \r\n\r\n> Let's not break one feature to fix another\r\n\r\nAgree. This lines were added and broke the notification feature, so I am removing the code, that broke a feature.\r\n\r\n\r\n\r\n","created_at":"2016-07-26T19:38:24Z","updated_at":"2016-07-26T19:38:24Z","html_url":"https://github.com/AHAAAAAAA/PokemonGo-Map/pull/2131#discussion_r72321491","pull_request_url":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map/pulls/2131","_links":{"self":{"href":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map/pulls/comments/72321491"},"html":{"href":"https://github.com/AHAAAAAAA/PokemonGo-Map/pull/2131#discussion_r72321491"},"pull_request":{"href":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map/pulls/2131"}}},"pull_request":{"url":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map/pulls/2131","id":78779646,"html_url":"https://github.com/AHAAAAAAA/PokemonGo-Map/pull/2131","diff_url":"https://github.com/AHAAAAAAA/PokemonGo-Map/pull/2131.diff","patch_url":"https://github.com/AHAAAAAAA/PokemonGo-Map/pull/2131.patch","issue_url":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map/issues/2131","number":2131,"state":"open","locked":false,"title":"Improved and fixed notifications","user":{"login":"PiaFraus","id":1433600,"avatar_url":"https://avatars.githubusercontent.com/u/1433600?v=3","gravatar_id":"","url":"https://api.github.com/users/PiaFraus","html_url":"https://github.com/PiaFraus","followers_url":"https://api.github.com/users/PiaFraus/followers","following_url":"https://api.github.com/users/PiaFraus/following{/other_user}","gists_url":"https://api.github.com/users/PiaFraus/gists{/gist_id}","starred_url":"https://api.github.com/users/PiaFraus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PiaFraus/subscriptions","organizations_url":"https://api.github.com/users/PiaFraus/orgs","repos_url":"https://api.github.com/users/PiaFraus/repos","events_url":"https://api.github.com/users/PiaFraus/events{/privacy}","received_events_url":"https://api.github.com/users/PiaFraus/received_events","type":"User","site_admin":false},"body":"Improved and fixed notifications\r\n\r\n## Description\r\n* Notifications has nothing to do with creating markers. So I moved it out of there to a special processor.\r\n* Notifications don't spam anymore - if more then 3 notification will be spawned in the same update - one general notification will popup.\r\n* Added wildcard pokemon to notification selector.\r\n* Pokemon bouncing will happen on click and not when page is just in the background.\r\n* Pokemon bouncing will stop after 2 seconds of notification click.\r\n* Commented out the clearOutOfBoundsMarkers since it breaks the notification system.\r\n\r\n## Motivation and Context\r\nNotifications is one of the most important feature for me and my friends/colleagues.\r\nPreviously we had to select hundreds of them one by one. Now there is a wildcard.\r\nPreviously if you refresh a page or jsut too many pokemons spawned - you will have way too many notifications. Now they are joined together.\r\n\r\n## How Has This Been Tested?\r\nTested locally.\r\n\r\n## Screenshots (if appropriate):\r\n\r\n## Types of changes\r\n<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->\r\n- [x] Bug fix (non-breaking change which fixes an issue)\r\n- [x] New feature (non-breaking change which adds functionality)\r\n- [x] Breaking change (fix or feature that would cause existing functionality to change)\r\n\r\n## Checklist:\r\n<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->\r\n<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->\r\n- [x] My code follows the code style of this project.\r\n- [ ] My change requires a change to the documentation.\r\n- [ ] I have updated the documentation accordingly.\r\n","created_at":"2016-07-26T01:43:48Z","updated_at":"2016-07-26T19:38:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0a84003617c9d9e6d01750a49c2259e3c5a8e381","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map/pulls/2131/commits","review_comments_url":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map/pulls/2131/comments","review_comment_url":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map/pulls/comments{/number}","comments_url":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map/issues/2131/comments","statuses_url":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map/statuses/1767c8b9eaf5a2e6596e59cefd0603761783240a","head":{"label":"PiaFraus:fixed_notifications","ref":"fixed_notifications","sha":"1767c8b9eaf5a2e6596e59cefd0603761783240a","user":{"login":"PiaFraus","id":1433600,"avatar_url":"https://avatars.githubusercontent.com/u/1433600?v=3","gravatar_id":"","url":"https://api.github.com/users/PiaFraus","html_url":"https://github.com/PiaFraus","followers_url":"https://api.github.com/users/PiaFraus/followers","following_url":"https://api.github.com/users/PiaFraus/following{/other_user}","gists_url":"https://api.github.com/users/PiaFraus/gists{/gist_id}","starred_url":"https://api.github.com/users/PiaFraus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PiaFraus/subscriptions","organizations_url":"https://api.github.com/users/PiaFraus/orgs","repos_url":"https://api.github.com/users/PiaFraus/repos","events_url":"https://api.github.com/users/PiaFraus/events{/privacy}","received_events_url":"https://api.github.com/users/PiaFraus/received_events","type":"User","site_admin":false},"repo":{"id":63920997,"name":"PokemonGo-Map","full_name":"PiaFraus/PokemonGo-Map","owner":{"login":"PiaFraus","id":1433600,"avatar_url":"https://avatars.githubusercontent.com/u/1433600?v=3","gravatar_id":"","url":"https://api.github.com/users/PiaFraus","html_url":"https://github.com/PiaFraus","followers_url":"https://api.github.com/users/PiaFraus/followers","following_url":"https://api.github.com/users/PiaFraus/following{/other_user}","gists_url":"https://api.github.com/users/PiaFraus/gists{/gist_id}","starred_url":"https://api.github.com/users/PiaFraus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PiaFraus/subscriptions","organizations_url":"https://api.github.com/users/PiaFraus/orgs","repos_url":"https://api.github.com/users/PiaFraus/repos","events_url":"https://api.github.com/users/PiaFraus/events{/privacy}","received_events_url":"https://api.github.com/users/PiaFraus/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/PiaFraus/PokemonGo-Map","description":"Live visualization of all the pokemon in your area... and more!","fork":true,"url":"https://api.github.com/repos/PiaFraus/PokemonGo-Map","forks_url":"https://api.github.com/repos/PiaFraus/PokemonGo-Map/forks","keys_url":"https://api.github.com/repos/PiaFraus/PokemonGo-Map/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PiaFraus/PokemonGo-Map/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PiaFraus/PokemonGo-Map/teams","hooks_url":"https://api.github.com/repos/PiaFraus/PokemonGo-Map/hooks","issue_events_url":"https://api.github.com/repos/PiaFraus/PokemonGo-Map/issues/events{/number}","events_url":"https://api.github.com/repos/PiaFraus/PokemonGo-Map/events","assignees_url":"https://api.github.com/repos/PiaFraus/PokemonGo-Map/assignees{/user}","branches_url":"https://api.github.com/repos/PiaFraus/PokemonGo-Map/branches{/branch}","tags_url":"https://api.github.com/repos/PiaFraus/PokemonGo-Map/tags","blobs_url":"https://api.github.com/repos/PiaFraus/PokemonGo-Map/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PiaFraus/PokemonGo-Map/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PiaFraus/PokemonGo-Map/git/refs{/sha}","trees_url":"https://api.github.com/repos/PiaFraus/PokemonGo-Map/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PiaFraus/PokemonGo-Map/statuses/{sha}","languages_url":"https://api.github.com/repos/PiaFraus/PokemonGo-Map/languages","stargazers_url":"https://api.github.com/repos/PiaFraus/PokemonGo-Map/stargazers","contributors_url":"https://api.github.com/repos/PiaFraus/PokemonGo-Map/contributors","subscribers_url":"https://api.github.com/repos/PiaFraus/PokemonGo-Map/subscribers","subscription_url":"https://api.github.com/repos/PiaFraus/PokemonGo-Map/subscription","commits_url":"https://api.github.com/repos/PiaFraus/PokemonGo-Map/commits{/sha}","git_commits_url":"https://api.github.com/repos/PiaFraus/PokemonGo-Map/git/commits{/sha}","comments_url":"https://api.github.com/repos/PiaFraus/PokemonGo-Map/comments{/number}","issue_comment_url":"https://api.github.com/repos/PiaFraus/PokemonGo-Map/issues/comments{/number}","contents_url":"https://api.github.com/repos/PiaFraus/PokemonGo-Map/contents/{+path}","compare_url":"https://api.github.com/repos/PiaFraus/PokemonGo-Map/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PiaFraus/PokemonGo-Map/merges","archive_url":"https://api.github.com/repos/PiaFraus/PokemonGo-Map/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PiaFraus/PokemonGo-Map/downloads","issues_url":"https://api.github.com/repos/PiaFraus/PokemonGo-Map/issues{/number}","pulls_url":"https://api.github.com/repos/PiaFraus/PokemonGo-Map/pulls{/number}","milestones_url":"https://api.github.com/repos/PiaFraus/PokemonGo-Map/milestones{/number}","notifications_url":"https://api.github.com/repos/PiaFraus/PokemonGo-Map/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PiaFraus/PokemonGo-Map/labels{/name}","releases_url":"https://api.github.com/repos/PiaFraus/PokemonGo-Map/releases{/id}","deployments_url":"https://api.github.com/repos/PiaFraus/PokemonGo-Map/deployments","created_at":"2016-07-22T03:34:03Z","updated_at":"2016-07-22T03:34:05Z","pushed_at":"2016-07-26T18:09:50Z","git_url":"git://github.com/PiaFraus/PokemonGo-Map.git","ssh_url":"git@github.com:PiaFraus/PokemonGo-Map.git","clone_url":"https://github.com/PiaFraus/PokemonGo-Map.git","svn_url":"https://github.com/PiaFraus/PokemonGo-Map","homepage":"","size":12756,"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":"develop"}},"base":{"label":"AHAAAAAAA:develop","ref":"develop","sha":"2e6c87079a7bdd4960520dc6eb69bed015c3cfe4","user":{"login":"AHAAAAAAA","id":1760334,"avatar_url":"https://avatars.githubusercontent.com/u/1760334?v=3","gravatar_id":"","url":"https://api.github.com/users/AHAAAAAAA","html_url":"https://github.com/AHAAAAAAA","followers_url":"https://api.github.com/users/AHAAAAAAA/followers","following_url":"https://api.github.com/users/AHAAAAAAA/following{/other_user}","gists_url":"https://api.github.com/users/AHAAAAAAA/gists{/gist_id}","starred_url":"https://api.github.com/users/AHAAAAAAA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AHAAAAAAA/subscriptions","organizations_url":"https://api.github.com/users/AHAAAAAAA/orgs","repos_url":"https://api.github.com/users/AHAAAAAAA/repos","events_url":"https://api.github.com/users/AHAAAAAAA/events{/privacy}","received_events_url":"https://api.github.com/users/AHAAAAAAA/received_events","type":"User","site_admin":false},"repo":{"id":63488276,"name":"PokemonGo-Map","full_name":"AHAAAAAAA/PokemonGo-Map","owner":{"login":"AHAAAAAAA","id":1760334,"avatar_url":"https://avatars.githubusercontent.com/u/1760334?v=3","gravatar_id":"","url":"https://api.github.com/users/AHAAAAAAA","html_url":"https://github.com/AHAAAAAAA","followers_url":"https://api.github.com/users/AHAAAAAAA/followers","following_url":"https://api.github.com/users/AHAAAAAAA/following{/other_user}","gists_url":"https://api.github.com/users/AHAAAAAAA/gists{/gist_id}","starred_url":"https://api.github.com/users/AHAAAAAAA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AHAAAAAAA/subscriptions","organizations_url":"https://api.github.com/users/AHAAAAAAA/orgs","repos_url":"https://api.github.com/users/AHAAAAAAA/repos","events_url":"https://api.github.com/users/AHAAAAAAA/events{/privacy}","received_events_url":"https://api.github.com/users/AHAAAAAAA/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AHAAAAAAA/PokemonGo-Map","description":"🌏 Live visualization of all the pokemon in your area... and more!","fork":false,"url":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map","forks_url":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map/forks","keys_url":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map/teams","hooks_url":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map/hooks","issue_events_url":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map/issues/events{/number}","events_url":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map/events","assignees_url":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map/assignees{/user}","branches_url":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map/branches{/branch}","tags_url":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map/tags","blobs_url":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map/git/refs{/sha}","trees_url":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map/statuses/{sha}","languages_url":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map/languages","stargazers_url":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map/stargazers","contributors_url":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map/contributors","subscribers_url":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map/subscribers","subscription_url":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map/subscription","commits_url":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map/commits{/sha}","git_commits_url":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map/git/commits{/sha}","comments_url":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map/comments{/number}","issue_comment_url":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map/issues/comments{/number}","contents_url":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map/contents/{+path}","compare_url":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map/merges","archive_url":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map/downloads","issues_url":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map/issues{/number}","pulls_url":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map/pulls{/number}","milestones_url":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map/milestones{/number}","notifications_url":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map/labels{/name}","releases_url":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map/releases{/id}","deployments_url":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map/deployments","created_at":"2016-07-16T15:06:33Z","updated_at":"2016-07-26T19:36:36Z","pushed_at":"2016-07-26T19:34:56Z","git_url":"git://github.com/AHAAAAAAA/PokemonGo-Map.git","ssh_url":"git@github.com:AHAAAAAAA/PokemonGo-Map.git","clone_url":"https://github.com/AHAAAAAAA/PokemonGo-Map.git","svn_url":"https://github.com/AHAAAAAAA/PokemonGo-Map","homepage":"https://jz6.github.io/PoGoMap/","size":119341,"stargazers_count":7535,"watchers_count":7535,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2609,"mirror_url":null,"open_issues_count":483,"forks":2609,"open_issues":483,"watchers":7535,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map/pulls/2131"},"html":{"href":"https://github.com/AHAAAAAAA/PokemonGo-Map/pull/2131"},"issue":{"href":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map/issues/2131"},"comments":{"href":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map/issues/2131/comments"},"review_comments":{"href":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map/pulls/2131/comments"},"review_comment":{"href":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map/pulls/2131/commits"},"statuses":{"href":"https://api.github.com/repos/AHAAAAAAA/PokemonGo-Map/statuses/1767c8b9eaf5a2e6596e59cefd0603761783240a"}}}}
{"actor":{"display_login":"PiaFraus"}}