{"action":"created","comment":{"url":"https://api.github.com/repos/lizardsystem/freq/pulls/comments/48946692","id":48946692,"diff_hunk":"@@ -1,213 +1,155 @@\n-+/*global $:false, jQuery:false, moment:false, ko:false, fillChart:false,\n+/*global $:false, jQuery:false, moment:false, ko:false, fillChart:false,\n demandChart:false, console:false*/\n-(function($) {\n-        /**\n-     * Configure jQuery to send cookies with XmlHttpRequests. Necessary to access\n-     * the Lizard API.\n-     *\n-     * For this to work, the API server must explicitly respond with:\n-     * Access-Control-Allow-Credentials: true\n-     * Access-Control-Allow-Origin: [origin_sent_in_request]\n-     *\n-     * Note: this must be executed before any Ajax calls!\n-     */\n-    var api = 'demo.lizard.net';\n-    $.ajaxSetup({\n-        // Be friends with django, add csrf token. cp-ed from\n-        // http://stackoverflow.com/questions/5100539/django-csrf-check-failing-with-an-ajax-post-request\n-        beforeSend: function(xhr, settings) {\n-          function getCookie(name) {\n-            var cookieValue = null;\n-            if (document.cookie && document.cookie !== '') {\n-              var cookies = document.cookie.split(';');\n-                for (var i = 0; i < cookies.length; i++) {\n-                  var cookie = $.trim(cookies[i]);\n-                  // Does this cookie string begin with the name we want?\n-                  if (cookie.substring(0, name.length + 1) === (name + '=')) {\n-                  cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n-                  break;\n-                }\n-              }\n-            }\n-            return cookieValue;\n-          }\n-          if (!(/^http:.*/.test(api) || /^https:.*/.test(api))) {\n-            // Only send the token to relative URLs i.e. locally.\n-            xhr.setRequestHeader(\"X-CSRFToken\", getCookie('csrftoken'));\n-            }\n-         },\n-        timeout: 60 * 1000,\n-        // The docs say: default: false for same-domain requests, true for\n-        // cross-domain requests. So the default is good enough for us.\n-        // crossDomain: true,\n-        xhrFields: {\n-            // withCredentials:\n-            // The docs say withCredentials has no effect when same origin is used:\n-            // https://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#dom-xmlhttprequest-withcredentials\n-            // \"True when user credentials are to be included in a cross-origin request.\n-            // False when they are to be excluded in a cross-origin request\n-            // and when cookies are to be ignored in its response. Initially false.\"\n-            // So, explicitly set this to true for our purposes.\n-            withCredentials: true\n-        }\n-    });\n-\n-    function loadDataError(jqXHR, textStatus, errorThrown) {\n-        var $error = $('<p>Fout bij het laden van de grafiekdata: ' +\n-            errorThrown + '</p>')\n-    }\n-\n-    function visitUrl(url){\n-        return function(){\n-            window.location.href = url;\n-        };\n-    }\n \n-    function drawLocationsBoundingBox(map, locationsLayer){\n-        var imagesUrl = window.startpage.leafletImagesUrl;\n-        var greenIcon = L.icon({\n-            iconUrl: imagesUrl + 'marker-icon.png',\n-            shadowUrl: imagesUrl + 'marker-shadow-new.png',\n-\n-            iconSize:     [16, 16], // size of the icon\n-            shadowSize:   [40, 40], // size of the shadow\n-            iconAnchor:   [8, 8], // point of the icon which will\n-            // correspond to marker's location\n-            shadowAnchor: [16, 16],  // the same for the shadow\n-            popupAnchor:  [-3, -76] // point from which the popup should open relative to the iconAnchor\n-        });\n-        var selectedIcon = L.icon({\n-            iconUrl: imagesUrl + 'marker-selected.png',\n-            shadowUrl: imagesUrl + 'marker-shadow.png',\n-\n-            iconSize:     [16, 16], // size of the icon\n-            shadowSize:   [40, 40], // size of the shadow\n-            iconAnchor:   [8, 8], // point of the icon which will\n-            // correspond to marker's location\n-            shadowAnchor: [11, 20],  // the same for the shadow\n-            popupAnchor:  [-3, -76] // point from which the popup should open relative to the iconAnchor\n-        });\n \n-        return function(data, textStatus, jqXHR){\n-            var locationError = data['error'];\n-            if(locationError !==\"\" ){\n-                $('#error-well').removeClass('hidden')\n-            } else {\n-                var locs = data['locations'];\n-                locationsLayer.clearLayers();\n-                for(var i=0; i<locs.length; i++){\n-                    var coordinates = [locs[i][0][1], locs[i][0][0]];\n-                    var marker = L.marker(\n-                        coordinates,\n-                        {\n-                            icon: greenIcon,\n-                            title: locs[i][2],\n-                            opacity: 0.6\n-                        });\n-                    marker.on('click', visitUrl('/timeseries/location_uuid/' + locs[i][1] + '&' +  locs[i][0][1] + '&' + locs[i][0][0]));\n-                    locationsLayer.addLayer(marker);\n-                }\n-                coordinates = JSON.parse(window.startpage.coordsSelected);\n-                if(coordinates.length > 0){\n-                    var marker = L.marker(\n-                        coordinates,\n-                        {\n-                            icon: selectedIcon\n-                        }\n-                    );\n-                    locationsLayer.addLayer(marker);\n-                }\n+function visitUrl(url){\n+    return function(){\n+        window.location.href = url;\n+    };\n+}\n+\n+function icon(pxSize, color, innerColor){\n+color = color == undefined ? '#1abc9c' : color;","path":"freq/static/freq/js/freq.js","position":128,"original_position":128,"commit_id":"8786134de546541b1dfe9cebbed9c4a523b28154","original_commit_id":"8786134de546541b1dfe9cebbed9c4a523b28154","user":{"login":"reinout","id":121433,"avatar_url":"https://avatars.githubusercontent.com/u/121433?v=3","gravatar_id":"","url":"https://api.github.com/users/reinout","html_url":"https://github.com/reinout","followers_url":"https://api.github.com/users/reinout/followers","following_url":"https://api.github.com/users/reinout/following{/other_user}","gists_url":"https://api.github.com/users/reinout/gists{/gist_id}","starred_url":"https://api.github.com/users/reinout/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reinout/subscriptions","organizations_url":"https://api.github.com/users/reinout/orgs","repos_url":"https://api.github.com/users/reinout/repos","events_url":"https://api.github.com/users/reinout/events{/privacy}","received_events_url":"https://api.github.com/users/reinout/received_events","type":"User","site_admin":false},"body":"indentation","created_at":"2016-01-06T11:03:08Z","updated_at":"2016-01-06T11:03:08Z","html_url":"https://github.com/lizardsystem/freq/pull/1#discussion_r48946692","pull_request_url":"https://api.github.com/repos/lizardsystem/freq/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/lizardsystem/freq/pulls/comments/48946692"},"html":{"href":"https://github.com/lizardsystem/freq/pull/1#discussion_r48946692"},"pull_request":{"href":"https://api.github.com/repos/lizardsystem/freq/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/lizardsystem/freq/pulls/1","id":54685650,"html_url":"https://github.com/lizardsystem/freq/pull/1","diff_url":"https://github.com/lizardsystem/freq/pull/1.diff","patch_url":"https://github.com/lizardsystem/freq/pull/1.patch","issue_url":"https://api.github.com/repos/lizardsystem/freq/issues/1","number":1,"state":"open","locked":false,"title":"Roel refactor views","user":{"login":"RoelvandenBerg","id":10162961,"avatar_url":"https://avatars.githubusercontent.com/u/10162961?v=3","gravatar_id":"","url":"https://api.github.com/users/RoelvandenBerg","html_url":"https://github.com/RoelvandenBerg","followers_url":"https://api.github.com/users/RoelvandenBerg/followers","following_url":"https://api.github.com/users/RoelvandenBerg/following{/other_user}","gists_url":"https://api.github.com/users/RoelvandenBerg/gists{/gist_id}","starred_url":"https://api.github.com/users/RoelvandenBerg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RoelvandenBerg/subscriptions","organizations_url":"https://api.github.com/users/RoelvandenBerg/orgs","repos_url":"https://api.github.com/users/RoelvandenBerg/repos","events_url":"https://api.github.com/users/RoelvandenBerg/events{/privacy}","received_events_url":"https://api.github.com/users/RoelvandenBerg/received_events","type":"User","site_admin":false},"body":"Reinout,\r\n\r\nAllereerst nogmaals gefeliciteerd!\r\nSorry, vorige week vrijdag werd ik er iets eerder dan verwacht (20 over 5) door de schoonmaakster het gebouw uit gebonjourd ivm kerstnacht (haar goed recht i guess, welke idioot werkt er dan nog ;-)). Aangezien mijn code toen nog niet werkend was (ik was halverwege het omschrijven naar buttons) wilde ik die nog niet committen. Nu heb ik dat wel al gedaan zodat jij er naar kan kijken a.s. week. Mocht je daar zin in hebben. Ik ben helaas nog zeer spaarzaam met comments en docstrings. Sinds de crash alweer twee maanden geleden heb ik ook flake8 niet meer geinstalleerd (I know: Foei!). Maar hou met Pycharm zoveel mogelijk Flake 8 aan. Als daar toch nog veels te veel van niet goed zit hoor ik het graag, dan loop ik daar nog een keer door. \r\n\r\nGroet,\r\n\r\nRoel","created_at":"2015-12-28T21:37:55Z","updated_at":"2016-01-06T11:03:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c3b43d4fa74fb693151fea4c4431941e5bbc4636","assignee":{"login":"reinout","id":121433,"avatar_url":"https://avatars.githubusercontent.com/u/121433?v=3","gravatar_id":"","url":"https://api.github.com/users/reinout","html_url":"https://github.com/reinout","followers_url":"https://api.github.com/users/reinout/followers","following_url":"https://api.github.com/users/reinout/following{/other_user}","gists_url":"https://api.github.com/users/reinout/gists{/gist_id}","starred_url":"https://api.github.com/users/reinout/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reinout/subscriptions","organizations_url":"https://api.github.com/users/reinout/orgs","repos_url":"https://api.github.com/users/reinout/repos","events_url":"https://api.github.com/users/reinout/events{/privacy}","received_events_url":"https://api.github.com/users/reinout/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/lizardsystem/freq/pulls/1/commits","review_comments_url":"https://api.github.com/repos/lizardsystem/freq/pulls/1/comments","review_comment_url":"https://api.github.com/repos/lizardsystem/freq/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lizardsystem/freq/issues/1/comments","statuses_url":"https://api.github.com/repos/lizardsystem/freq/statuses/8786134de546541b1dfe9cebbed9c4a523b28154","head":{"label":"lizardsystem:roel-refactor_views","ref":"roel-refactor_views","sha":"8786134de546541b1dfe9cebbed9c4a523b28154","user":{"login":"lizardsystem","id":1029862,"avatar_url":"https://avatars.githubusercontent.com/u/1029862?v=3","gravatar_id":"","url":"https://api.github.com/users/lizardsystem","html_url":"https://github.com/lizardsystem","followers_url":"https://api.github.com/users/lizardsystem/followers","following_url":"https://api.github.com/users/lizardsystem/following{/other_user}","gists_url":"https://api.github.com/users/lizardsystem/gists{/gist_id}","starred_url":"https://api.github.com/users/lizardsystem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lizardsystem/subscriptions","organizations_url":"https://api.github.com/users/lizardsystem/orgs","repos_url":"https://api.github.com/users/lizardsystem/repos","events_url":"https://api.github.com/users/lizardsystem/events{/privacy}","received_events_url":"https://api.github.com/users/lizardsystem/received_events","type":"Organization","site_admin":false},"repo":{"id":44813583,"name":"freq","full_name":"lizardsystem/freq","owner":{"login":"lizardsystem","id":1029862,"avatar_url":"https://avatars.githubusercontent.com/u/1029862?v=3","gravatar_id":"","url":"https://api.github.com/users/lizardsystem","html_url":"https://github.com/lizardsystem","followers_url":"https://api.github.com/users/lizardsystem/followers","following_url":"https://api.github.com/users/lizardsystem/following{/other_user}","gists_url":"https://api.github.com/users/lizardsystem/gists{/gist_id}","starred_url":"https://api.github.com/users/lizardsystem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lizardsystem/subscriptions","organizations_url":"https://api.github.com/users/lizardsystem/orgs","repos_url":"https://api.github.com/users/lizardsystem/repos","events_url":"https://api.github.com/users/lizardsystem/events{/privacy}","received_events_url":"https://api.github.com/users/lizardsystem/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/lizardsystem/freq","description":"FREQ groundwater analysis app","fork":false,"url":"https://api.github.com/repos/lizardsystem/freq","forks_url":"https://api.github.com/repos/lizardsystem/freq/forks","keys_url":"https://api.github.com/repos/lizardsystem/freq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lizardsystem/freq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lizardsystem/freq/teams","hooks_url":"https://api.github.com/repos/lizardsystem/freq/hooks","issue_events_url":"https://api.github.com/repos/lizardsystem/freq/issues/events{/number}","events_url":"https://api.github.com/repos/lizardsystem/freq/events","assignees_url":"https://api.github.com/repos/lizardsystem/freq/assignees{/user}","branches_url":"https://api.github.com/repos/lizardsystem/freq/branches{/branch}","tags_url":"https://api.github.com/repos/lizardsystem/freq/tags","blobs_url":"https://api.github.com/repos/lizardsystem/freq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lizardsystem/freq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lizardsystem/freq/git/refs{/sha}","trees_url":"https://api.github.com/repos/lizardsystem/freq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lizardsystem/freq/statuses/{sha}","languages_url":"https://api.github.com/repos/lizardsystem/freq/languages","stargazers_url":"https://api.github.com/repos/lizardsystem/freq/stargazers","contributors_url":"https://api.github.com/repos/lizardsystem/freq/contributors","subscribers_url":"https://api.github.com/repos/lizardsystem/freq/subscribers","subscription_url":"https://api.github.com/repos/lizardsystem/freq/subscription","commits_url":"https://api.github.com/repos/lizardsystem/freq/commits{/sha}","git_commits_url":"https://api.github.com/repos/lizardsystem/freq/git/commits{/sha}","comments_url":"https://api.github.com/repos/lizardsystem/freq/comments{/number}","issue_comment_url":"https://api.github.com/repos/lizardsystem/freq/issues/comments{/number}","contents_url":"https://api.github.com/repos/lizardsystem/freq/contents/{+path}","compare_url":"https://api.github.com/repos/lizardsystem/freq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lizardsystem/freq/merges","archive_url":"https://api.github.com/repos/lizardsystem/freq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lizardsystem/freq/downloads","issues_url":"https://api.github.com/repos/lizardsystem/freq/issues{/number}","pulls_url":"https://api.github.com/repos/lizardsystem/freq/pulls{/number}","milestones_url":"https://api.github.com/repos/lizardsystem/freq/milestones{/number}","notifications_url":"https://api.github.com/repos/lizardsystem/freq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lizardsystem/freq/labels{/name}","releases_url":"https://api.github.com/repos/lizardsystem/freq/releases{/id}","created_at":"2015-10-23T13:05:41Z","updated_at":"2015-10-23T13:57:34Z","pushed_at":"2016-01-04T17:28:30Z","git_url":"git://github.com/lizardsystem/freq.git","ssh_url":"git@github.com:lizardsystem/freq.git","clone_url":"https://github.com/lizardsystem/freq.git","svn_url":"https://github.com/lizardsystem/freq","homepage":null,"size":715,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"lizardsystem:master","ref":"master","sha":"f64c564318757e90406eb763c12108904ba6a05c","user":{"login":"lizardsystem","id":1029862,"avatar_url":"https://avatars.githubusercontent.com/u/1029862?v=3","gravatar_id":"","url":"https://api.github.com/users/lizardsystem","html_url":"https://github.com/lizardsystem","followers_url":"https://api.github.com/users/lizardsystem/followers","following_url":"https://api.github.com/users/lizardsystem/following{/other_user}","gists_url":"https://api.github.com/users/lizardsystem/gists{/gist_id}","starred_url":"https://api.github.com/users/lizardsystem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lizardsystem/subscriptions","organizations_url":"https://api.github.com/users/lizardsystem/orgs","repos_url":"https://api.github.com/users/lizardsystem/repos","events_url":"https://api.github.com/users/lizardsystem/events{/privacy}","received_events_url":"https://api.github.com/users/lizardsystem/received_events","type":"Organization","site_admin":false},"repo":{"id":44813583,"name":"freq","full_name":"lizardsystem/freq","owner":{"login":"lizardsystem","id":1029862,"avatar_url":"https://avatars.githubusercontent.com/u/1029862?v=3","gravatar_id":"","url":"https://api.github.com/users/lizardsystem","html_url":"https://github.com/lizardsystem","followers_url":"https://api.github.com/users/lizardsystem/followers","following_url":"https://api.github.com/users/lizardsystem/following{/other_user}","gists_url":"https://api.github.com/users/lizardsystem/gists{/gist_id}","starred_url":"https://api.github.com/users/lizardsystem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lizardsystem/subscriptions","organizations_url":"https://api.github.com/users/lizardsystem/orgs","repos_url":"https://api.github.com/users/lizardsystem/repos","events_url":"https://api.github.com/users/lizardsystem/events{/privacy}","received_events_url":"https://api.github.com/users/lizardsystem/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/lizardsystem/freq","description":"FREQ groundwater analysis app","fork":false,"url":"https://api.github.com/repos/lizardsystem/freq","forks_url":"https://api.github.com/repos/lizardsystem/freq/forks","keys_url":"https://api.github.com/repos/lizardsystem/freq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lizardsystem/freq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lizardsystem/freq/teams","hooks_url":"https://api.github.com/repos/lizardsystem/freq/hooks","issue_events_url":"https://api.github.com/repos/lizardsystem/freq/issues/events{/number}","events_url":"https://api.github.com/repos/lizardsystem/freq/events","assignees_url":"https://api.github.com/repos/lizardsystem/freq/assignees{/user}","branches_url":"https://api.github.com/repos/lizardsystem/freq/branches{/branch}","tags_url":"https://api.github.com/repos/lizardsystem/freq/tags","blobs_url":"https://api.github.com/repos/lizardsystem/freq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lizardsystem/freq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lizardsystem/freq/git/refs{/sha}","trees_url":"https://api.github.com/repos/lizardsystem/freq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lizardsystem/freq/statuses/{sha}","languages_url":"https://api.github.com/repos/lizardsystem/freq/languages","stargazers_url":"https://api.github.com/repos/lizardsystem/freq/stargazers","contributors_url":"https://api.github.com/repos/lizardsystem/freq/contributors","subscribers_url":"https://api.github.com/repos/lizardsystem/freq/subscribers","subscription_url":"https://api.github.com/repos/lizardsystem/freq/subscription","commits_url":"https://api.github.com/repos/lizardsystem/freq/commits{/sha}","git_commits_url":"https://api.github.com/repos/lizardsystem/freq/git/commits{/sha}","comments_url":"https://api.github.com/repos/lizardsystem/freq/comments{/number}","issue_comment_url":"https://api.github.com/repos/lizardsystem/freq/issues/comments{/number}","contents_url":"https://api.github.com/repos/lizardsystem/freq/contents/{+path}","compare_url":"https://api.github.com/repos/lizardsystem/freq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lizardsystem/freq/merges","archive_url":"https://api.github.com/repos/lizardsystem/freq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lizardsystem/freq/downloads","issues_url":"https://api.github.com/repos/lizardsystem/freq/issues{/number}","pulls_url":"https://api.github.com/repos/lizardsystem/freq/pulls{/number}","milestones_url":"https://api.github.com/repos/lizardsystem/freq/milestones{/number}","notifications_url":"https://api.github.com/repos/lizardsystem/freq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lizardsystem/freq/labels{/name}","releases_url":"https://api.github.com/repos/lizardsystem/freq/releases{/id}","created_at":"2015-10-23T13:05:41Z","updated_at":"2015-10-23T13:57:34Z","pushed_at":"2016-01-04T17:28:30Z","git_url":"git://github.com/lizardsystem/freq.git","ssh_url":"git@github.com:lizardsystem/freq.git","clone_url":"https://github.com/lizardsystem/freq.git","svn_url":"https://github.com/lizardsystem/freq","homepage":null,"size":715,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lizardsystem/freq/pulls/1"},"html":{"href":"https://github.com/lizardsystem/freq/pull/1"},"issue":{"href":"https://api.github.com/repos/lizardsystem/freq/issues/1"},"comments":{"href":"https://api.github.com/repos/lizardsystem/freq/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/lizardsystem/freq/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/lizardsystem/freq/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lizardsystem/freq/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/lizardsystem/freq/statuses/8786134de546541b1dfe9cebbed9c4a523b28154"}}}}