{"action":"created","comment":{"url":"https://api.github.com/repos/sgmap/beta.gouv.fr/pulls/comments/64395377","id":64395377,"diff_hunk":"@@ -0,0 +1,17 @@\n+<script>\n+(function(win, $) {\n+\t$(\".tooltip\").on('click',function(e){\n+\t\t$(\".card:not(\"+e.target.textContent+\")\").forEach(function(el) {\n+\t\t\tel.style.display = !e.target.filtering ? 'none' : 'block';\n+\t\t});\n+\t\t$(\".card.\"+e.target.textContent).forEach(function(el) {\n+\t\t\tel.style.display = 'block';\n+\t\t});\n+\t\t$(\".tooltip\").forEach(function(el){\n+\t\t\tel.filtering = false;\n+\t\t})\n+\t\te.target.filtering = !e.target.filtering;\n+\t});\n+\t// https://github.com/finom/balalaika\n+\t})(window, function(t,e,n,i,o,r,s,u,c,f,l,h){return h=function(t,e){return new h.i(t,e)},h.i=function(i,o){n.push.apply(this,i?i.nodeType||i==t?[i]:\"\"+i===i?/</.test(i)?((u=e.createElement(o||\"q\")).innerHTML=i,u.children):(o&&h(o)[0]||e).querySelectorAll(i):/f/.test(typeof i)?/c/.test(e.readyState)?i():h(e).on(\"DOMContentLoaded\",i):i:n)},h.i[l=\"prototype\"]=(h.extend=function(t){for(f=arguments,u=1;u<f.length;u++)if(l=f[u])for(c in l)t[c]=l[c];return t})(h.fn=h[l]=n,{on:function(t,e){return t=t.split(i),this.map(function(n){(i[u=t[0]+(n.b$=n.b$||++o)]=i[u]||[]).push([e,t[1]]),n[\"add\"+r](t[0],e)}),this},off:function(t,e){return t=t.split(i),l=\"remove\"+r,this.map(function(n){if(f=i[t[0]+n.b$],u=f&&f.length)for(;c=f[--u];)e&&e!=c[0]||t[1]&&t[1]!=c[1]||(n[l](t[0],c[0]),f.splice(u,1));else!t[1]&&n[l](t[0],e)}),this},is:function(t){return u=this[0],(u.matches||u[\"webkit\"+s]||u[\"moz\"+s]||u[\"ms\"+s]).call(u,t)}}),h}(window,document,[],/\\.(.+)/,0,\"EventListener\",\"MatchesSelector\"));","path":"_includes/clickable-states.html","position":16,"original_position":16,"commit_id":"8aa5b95aa95e4bf0052bc8ebf07510de01acddb4","original_commit_id":"8aa5b95aa95e4bf0052bc8ebf07510de01acddb4","user":{"login":"Morendil","id":216452,"avatar_url":"https://avatars.githubusercontent.com/u/216452?v=3","gravatar_id":"","url":"https://api.github.com/users/Morendil","html_url":"https://github.com/Morendil","followers_url":"https://api.github.com/users/Morendil/followers","following_url":"https://api.github.com/users/Morendil/following{/other_user}","gists_url":"https://api.github.com/users/Morendil/gists{/gist_id}","starred_url":"https://api.github.com/users/Morendil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Morendil/subscriptions","organizations_url":"https://api.github.com/users/Morendil/orgs","repos_url":"https://api.github.com/users/Morendil/repos","events_url":"https://api.github.com/users/Morendil/events{/privacy}","received_events_url":"https://api.github.com/users/Morendil/received_events","type":"User","site_admin":false},"body":"Oui effectivement... En fait il faut\r\n\r\n- un équivalent de on()\r\n- un équivalent de $(selector)\r\n- un équivalent de $(document).ready()\r\n\r\nJe me suis un peu fait aider (http://youmightnotneedjquery.com), et ça donne le code ci-dessous, qui fait à peine 100 octets de moins que Balalaika (et 600 octets de moins que la fonctionnalité + Balalaika):\r\n\r\n```\r\n<script>\r\nfunction ready(fn) {\r\n  if (document.readyState != 'loading'){\r\n    fn();\r\n  } else {\r\n    document.addEventListener('DOMContentLoaded', fn);\r\n  }\r\n}\r\n\r\nfunction forAll(selector,fn) {\r\n\tvar elements = document.querySelectorAll(selector);\r\n\tArray.prototype.forEach.call(elements, fn);\r\n}\r\n\r\nready(function() {\r\n\tvar elements = document.querySelectorAll(\".tooltip\");\r\n\tArray.prototype.forEach.call(elements, function(el, i){\r\n\t\tel.addEventListener('click', function(e) {\r\n\t\t\tforAll(\".card:not(\"+e.target.textContent+\")\", function(el, i){\r\n\t\t\t\tel.style.display = !e.target.filtering ? 'none' : 'block';\r\n\t\t\t});\r\n\t\t\tforAll(\".card.\"+e.target.textContent, function(el, i){\r\n\t\t\t\tel.style.display = 'block';\r\n\t\t\t});\r\n\t\t\tforAll(\".tooltip\", function(el, i){\r\n\t\t\t\tel.filtering = false;\r\n\t\t\t});\r\n\t\t\te.target.filtering = !e.target.filtering;\r\n\t\t});\r\n\t});\r\n})\r\n</script>\r\n```\r\n\r\nWDYT?","created_at":"2016-05-24T14:00:12Z","updated_at":"2016-05-24T14:00:12Z","html_url":"https://github.com/sgmap/beta.gouv.fr/pull/184#discussion_r64395377","pull_request_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/pulls/184","_links":{"self":{"href":"https://api.github.com/repos/sgmap/beta.gouv.fr/pulls/comments/64395377"},"html":{"href":"https://github.com/sgmap/beta.gouv.fr/pull/184#discussion_r64395377"},"pull_request":{"href":"https://api.github.com/repos/sgmap/beta.gouv.fr/pulls/184"}}},"pull_request":{"url":"https://api.github.com/repos/sgmap/beta.gouv.fr/pulls/184","id":70209133,"html_url":"https://github.com/sgmap/beta.gouv.fr/pull/184","diff_url":"https://github.com/sgmap/beta.gouv.fr/pull/184.diff","patch_url":"https://github.com/sgmap/beta.gouv.fr/pull/184.patch","issue_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/issues/184","number":184,"state":"open","locked":false,"title":"Fixes #34 - makes startup states clickable","user":{"login":"Morendil","id":216452,"avatar_url":"https://avatars.githubusercontent.com/u/216452?v=3","gravatar_id":"","url":"https://api.github.com/users/Morendil","html_url":"https://github.com/Morendil","followers_url":"https://api.github.com/users/Morendil/followers","following_url":"https://api.github.com/users/Morendil/following{/other_user}","gists_url":"https://api.github.com/users/Morendil/gists{/gist_id}","starred_url":"https://api.github.com/users/Morendil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Morendil/subscriptions","organizations_url":"https://api.github.com/users/Morendil/orgs","repos_url":"https://api.github.com/users/Morendil/repos","events_url":"https://api.github.com/users/Morendil/events{/privacy}","received_events_url":"https://api.github.com/users/Morendil/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-05-16T15:00:37Z","updated_at":"2016-05-24T14:00:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7385d3a25691f52dde8b6bffbfc7b0f31eac4b93","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/pulls/184/commits","review_comments_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/pulls/184/comments","review_comment_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/issues/184/comments","statuses_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/statuses/8aa5b95aa95e4bf0052bc8ebf07510de01acddb4","head":{"label":"sgmap:clickable-states","ref":"clickable-states","sha":"8aa5b95aa95e4bf0052bc8ebf07510de01acddb4","user":{"login":"sgmap","id":7874148,"avatar_url":"https://avatars.githubusercontent.com/u/7874148?v=3","gravatar_id":"","url":"https://api.github.com/users/sgmap","html_url":"https://github.com/sgmap","followers_url":"https://api.github.com/users/sgmap/followers","following_url":"https://api.github.com/users/sgmap/following{/other_user}","gists_url":"https://api.github.com/users/sgmap/gists{/gist_id}","starred_url":"https://api.github.com/users/sgmap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgmap/subscriptions","organizations_url":"https://api.github.com/users/sgmap/orgs","repos_url":"https://api.github.com/users/sgmap/repos","events_url":"https://api.github.com/users/sgmap/events{/privacy}","received_events_url":"https://api.github.com/users/sgmap/received_events","type":"Organization","site_admin":false},"repo":{"id":48237006,"name":"beta.gouv.fr","full_name":"sgmap/beta.gouv.fr","owner":{"login":"sgmap","id":7874148,"avatar_url":"https://avatars.githubusercontent.com/u/7874148?v=3","gravatar_id":"","url":"https://api.github.com/users/sgmap","html_url":"https://github.com/sgmap","followers_url":"https://api.github.com/users/sgmap/followers","following_url":"https://api.github.com/users/sgmap/following{/other_user}","gists_url":"https://api.github.com/users/sgmap/gists{/gist_id}","starred_url":"https://api.github.com/users/sgmap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgmap/subscriptions","organizations_url":"https://api.github.com/users/sgmap/orgs","repos_url":"https://api.github.com/users/sgmap/repos","events_url":"https://api.github.com/users/sgmap/events{/privacy}","received_events_url":"https://api.github.com/users/sgmap/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sgmap/beta.gouv.fr","description":"Le site public de l'Incubateur de Services Numériques de l'État français.","fork":false,"url":"https://api.github.com/repos/sgmap/beta.gouv.fr","forks_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/forks","keys_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/teams","hooks_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/hooks","issue_events_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/issues/events{/number}","events_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/events","assignees_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/assignees{/user}","branches_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/branches{/branch}","tags_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/tags","blobs_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/git/refs{/sha}","trees_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/statuses/{sha}","languages_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/languages","stargazers_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/stargazers","contributors_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/contributors","subscribers_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/subscribers","subscription_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/subscription","commits_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/commits{/sha}","git_commits_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/git/commits{/sha}","comments_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/comments{/number}","issue_comment_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/issues/comments{/number}","contents_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/contents/{+path}","compare_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/merges","archive_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/downloads","issues_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/issues{/number}","pulls_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/pulls{/number}","milestones_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/milestones{/number}","notifications_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/labels{/name}","releases_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/releases{/id}","deployments_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/deployments","created_at":"2015-12-18T13:33:48Z","updated_at":"2016-04-21T02:41:48Z","pushed_at":"2016-05-23T17:35:29Z","git_url":"git://github.com/sgmap/beta.gouv.fr.git","ssh_url":"git@github.com:sgmap/beta.gouv.fr.git","clone_url":"https://github.com/sgmap/beta.gouv.fr.git","svn_url":"https://github.com/sgmap/beta.gouv.fr","homepage":"https://beta.gouv.fr","size":8503,"stargazers_count":10,"watchers_count":10,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":18,"mirror_url":null,"open_issues_count":14,"forks":18,"open_issues":14,"watchers":10,"default_branch":"gh-pages"}},"base":{"label":"sgmap:gh-pages","ref":"gh-pages","sha":"dd56571b4d7c9fac691e9a3d4db0ade272baa3c2","user":{"login":"sgmap","id":7874148,"avatar_url":"https://avatars.githubusercontent.com/u/7874148?v=3","gravatar_id":"","url":"https://api.github.com/users/sgmap","html_url":"https://github.com/sgmap","followers_url":"https://api.github.com/users/sgmap/followers","following_url":"https://api.github.com/users/sgmap/following{/other_user}","gists_url":"https://api.github.com/users/sgmap/gists{/gist_id}","starred_url":"https://api.github.com/users/sgmap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgmap/subscriptions","organizations_url":"https://api.github.com/users/sgmap/orgs","repos_url":"https://api.github.com/users/sgmap/repos","events_url":"https://api.github.com/users/sgmap/events{/privacy}","received_events_url":"https://api.github.com/users/sgmap/received_events","type":"Organization","site_admin":false},"repo":{"id":48237006,"name":"beta.gouv.fr","full_name":"sgmap/beta.gouv.fr","owner":{"login":"sgmap","id":7874148,"avatar_url":"https://avatars.githubusercontent.com/u/7874148?v=3","gravatar_id":"","url":"https://api.github.com/users/sgmap","html_url":"https://github.com/sgmap","followers_url":"https://api.github.com/users/sgmap/followers","following_url":"https://api.github.com/users/sgmap/following{/other_user}","gists_url":"https://api.github.com/users/sgmap/gists{/gist_id}","starred_url":"https://api.github.com/users/sgmap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgmap/subscriptions","organizations_url":"https://api.github.com/users/sgmap/orgs","repos_url":"https://api.github.com/users/sgmap/repos","events_url":"https://api.github.com/users/sgmap/events{/privacy}","received_events_url":"https://api.github.com/users/sgmap/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sgmap/beta.gouv.fr","description":"Le site public de l'Incubateur de Services Numériques de l'État français.","fork":false,"url":"https://api.github.com/repos/sgmap/beta.gouv.fr","forks_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/forks","keys_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/teams","hooks_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/hooks","issue_events_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/issues/events{/number}","events_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/events","assignees_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/assignees{/user}","branches_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/branches{/branch}","tags_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/tags","blobs_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/git/refs{/sha}","trees_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/statuses/{sha}","languages_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/languages","stargazers_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/stargazers","contributors_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/contributors","subscribers_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/subscribers","subscription_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/subscription","commits_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/commits{/sha}","git_commits_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/git/commits{/sha}","comments_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/comments{/number}","issue_comment_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/issues/comments{/number}","contents_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/contents/{+path}","compare_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/merges","archive_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/downloads","issues_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/issues{/number}","pulls_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/pulls{/number}","milestones_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/milestones{/number}","notifications_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/labels{/name}","releases_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/releases{/id}","deployments_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/deployments","created_at":"2015-12-18T13:33:48Z","updated_at":"2016-04-21T02:41:48Z","pushed_at":"2016-05-23T17:35:29Z","git_url":"git://github.com/sgmap/beta.gouv.fr.git","ssh_url":"git@github.com:sgmap/beta.gouv.fr.git","clone_url":"https://github.com/sgmap/beta.gouv.fr.git","svn_url":"https://github.com/sgmap/beta.gouv.fr","homepage":"https://beta.gouv.fr","size":8503,"stargazers_count":10,"watchers_count":10,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":18,"mirror_url":null,"open_issues_count":14,"forks":18,"open_issues":14,"watchers":10,"default_branch":"gh-pages"}},"_links":{"self":{"href":"https://api.github.com/repos/sgmap/beta.gouv.fr/pulls/184"},"html":{"href":"https://github.com/sgmap/beta.gouv.fr/pull/184"},"issue":{"href":"https://api.github.com/repos/sgmap/beta.gouv.fr/issues/184"},"comments":{"href":"https://api.github.com/repos/sgmap/beta.gouv.fr/issues/184/comments"},"review_comments":{"href":"https://api.github.com/repos/sgmap/beta.gouv.fr/pulls/184/comments"},"review_comment":{"href":"https://api.github.com/repos/sgmap/beta.gouv.fr/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sgmap/beta.gouv.fr/pulls/184/commits"},"statuses":{"href":"https://api.github.com/repos/sgmap/beta.gouv.fr/statuses/8aa5b95aa95e4bf0052bc8ebf07510de01acddb4"}}}}
{"actor":{"display_login":"Morendil"}}