{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/kuma/pulls/comments/32242998","id":32242998,"diff_hunk":"@@ -0,0 +1,190 @@\n+(function($) {\n+\n+    // Private var to assign IDs to history for accessibility purposes\n+    var historyCount = 0;\n+\n+    // The close button template\n+    var $historyCloseButton = $('<button><abbr><span></span><i></i></abbr></button>')\n+                              .addClass('bc-history-button')\n+                              .find('abbr')\n+                                .addClass('only-icon')\n+                                .attr('title', gettext('Return to compatability table.'))\n+                                .end()\n+                              .find('span')\n+                                .append(gettext('Close'))\n+                              .end()\n+                              .find('i')\n+                                .addClass('icon-times')\n+                                .attr('aria-hidden', true)\n+                              .end();\n+\n+\n+    //  Usage: $('.compat-table').mozCompatTable();\n+    return jQuery.fn.mozCompatTable = function() {\n+        return $(this).each(function() {\n+\n+            // Keep track of what may be open within this table\n+            var $openCell;\n+\n+            // If nothing provided, bail\n+            var $table = $(this);\n+            if(!$table.length) return;\n+\n+            // Activate all history cells for keyboard;  TODO:  add \"aria-controls\"\n+            $table.find('.bc-has-history').each(function() {\n+                var historyId = 'bc-history-' + (++historyCount);\n+                var $td = $(this);\n+\n+                $td.attr({\n+                    tabIndex: 0,\n+                    'aria-expanded': false,\n+                    'aria-controls': historyId\n+                });\n+                $td.find('.bc-history').attr('id', historyId);\n+                $td.find('.bc-history-link').attr('tabIndex', -1);\n+            });\n+\n+            // Listen for clicks on \"history\" cells\n+            $table.on('click', '.bc-has-history, .bc-history', function() {\n+                var $target = $(this);\n+\n+                if($target.hasClass('.bc-history')) {\n+                    e.stopImmediatePropagation();\n+                }\n+                closeAndOpenHistory($target);\n+            });\n+\n+            // Listen for clicks on \"close\" buttons\n+            $table.on('click', '.bc-history-button', function(ev) {\n+                ev.stopImmediatePropagation();\n+                hideHistory();\n+            });\n+\n+            // Listen for keys to open/close history\n+            $table.on('keypress', '.bc-has-history', function(ev) {\n+                var $td = $(this);\n+                var key = ev.which;\n+\n+                if(key === 13 || key === 32) {\n+                    closeAndOpenHistory($td);\n+                    ev.preventDefault();\n+                } else if(key === 27) {\n+                    hideHistory();\n+                    ev.preventDefault();\n+                }\n+            });\n+\n+\n+            // Function which closes any open history, opens the target history\n+            function closeAndOpenHistory($td) {\n+                var previousOpenCell = $openCell && $openCell.get(0);\n+\n+                // Close what's open, if anything\n+                hideHistory();\n+\n+                // If they clicks the same cell (are closing), we can leave now\n+                if($td.get(0) == previousOpenCell) {\n+                    $openCell = false;\n+                    return;\n+                }\n+\n+                // Set this cell as open\n+                $openCell = $td;\n+\n+                // Show!\n+                showHistory();\n+            }\n+\n+\n+            // Opens the history for a given item\n+            function showHistory() {\n+\n+                var $row = $openCell.closest('tr');\n+                var $history = $openCell.find('.bc-history').outerWidth($table.width());\n+\n+                // get cell coords\n+                var cellLeft = $openCell.offset().left;\n+\n+                // get cell left border\n+                var cellLeftBorder = $openCell.css('border-left-width');\n+\n+                // get table coords\n+                var tableLeft = $table.offset().left;\n+\n+                // left coord of table minus left coord of cell\n+                var historyLeft = tableLeft - cellLeft - parseInt(cellLeftBorder, 10) - 1;\n+\n+                // top\n+                // can't just to top:100% in CSS because IE messes it up.\n+\n+                // get cell height\n+                var cellTop = $openCell.outerHeight();\n+\n+                // get cell top border\n+                var celltopBorder = $openCell.css('border-top-width');\n+\n+                // get cell bottom border\n+                var cellBottomBorder = $openCell.css('border-bottom-width');\n+\n+                var historyTop = cellTop - parseInt(cellBottomBorder, 10) - parseInt(celltopBorder, 10);\n+\n+                var historyHeight;\n+                var windowWidth;\n+\n+                // Add a close button if one doesn't already exist\n+                if($history.find('.bc-history-button').length == 0) {","path":"media/js/wiki-compat-tables.js","position":135,"original_position":135,"commit_id":"42c98bcdbb540c12a8305796102cbc6106a19f01","original_commit_id":"42c98bcdbb540c12a8305796102cbc6106a19f01","user":{"login":"openjck","id":933396,"avatar_url":"https://avatars.githubusercontent.com/u/933396?v=3","gravatar_id":"","url":"https://api.github.com/users/openjck","html_url":"https://github.com/openjck","followers_url":"https://api.github.com/users/openjck/followers","following_url":"https://api.github.com/users/openjck/following{/other_user}","gists_url":"https://api.github.com/users/openjck/gists{/gist_id}","starred_url":"https://api.github.com/users/openjck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openjck/subscriptions","organizations_url":"https://api.github.com/users/openjck/orgs","repos_url":"https://api.github.com/users/openjck/repos","events_url":"https://api.github.com/users/openjck/events{/privacy}","received_events_url":"https://api.github.com/users/openjck/received_events","type":"User","site_admin":false},"body":"Would be great to use `===` here, too.","created_at":"2015-06-11T17:00:06Z","updated_at":"2015-06-11T17:00:06Z","html_url":"https://github.com/mozilla/kuma/pull/3248#discussion_r32242998","pull_request_url":"https://api.github.com/repos/mozilla/kuma/pulls/3248","_links":{"self":{"href":"https://api.github.com/repos/mozilla/kuma/pulls/comments/32242998"},"html":{"href":"https://github.com/mozilla/kuma/pull/3248#discussion_r32242998"},"pull_request":{"href":"https://api.github.com/repos/mozilla/kuma/pulls/3248"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/kuma/pulls/3248","id":37401545,"html_url":"https://github.com/mozilla/kuma/pull/3248","diff_url":"https://github.com/mozilla/kuma/pull/3248.diff","patch_url":"https://github.com/mozilla/kuma/pull/3248.patch","issue_url":"https://api.github.com/repos/mozilla/kuma/issues/3248","number":3248,"state":"open","locked":false,"title":"Bug 1170235 Add initial assets for Compat Tables","user":{"login":"openjck","id":933396,"avatar_url":"https://avatars.githubusercontent.com/u/933396?v=3","gravatar_id":"","url":"https://api.github.com/users/openjck","html_url":"https://github.com/openjck","followers_url":"https://api.github.com/users/openjck/followers","following_url":"https://api.github.com/users/openjck/following{/other_user}","gists_url":"https://api.github.com/users/openjck/gists{/gist_id}","starred_url":"https://api.github.com/users/openjck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openjck/subscriptions","organizations_url":"https://api.github.com/users/openjck/orgs","repos_url":"https://api.github.com/users/openjck/repos","events_url":"https://api.github.com/users/openjck/events{/privacy}","received_events_url":"https://api.github.com/users/openjck/received_events","type":"User","site_admin":false},"body":"Supersedes #3235 with a rebase so that we can avoid switching between Puppet and Ansible when testing this change.\r\n\r\nThis is ready for testing but needs approval from the writing team before being merged.","created_at":"2015-06-10T20:36:16Z","updated_at":"2015-06-11T17:00:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"372869eb520e17a51b131ee64a406e39adc9b118","assignee":{"login":"openjck","id":933396,"avatar_url":"https://avatars.githubusercontent.com/u/933396?v=3","gravatar_id":"","url":"https://api.github.com/users/openjck","html_url":"https://github.com/openjck","followers_url":"https://api.github.com/users/openjck/followers","following_url":"https://api.github.com/users/openjck/following{/other_user}","gists_url":"https://api.github.com/users/openjck/gists{/gist_id}","starred_url":"https://api.github.com/users/openjck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openjck/subscriptions","organizations_url":"https://api.github.com/users/openjck/orgs","repos_url":"https://api.github.com/users/openjck/repos","events_url":"https://api.github.com/users/openjck/events{/privacy}","received_events_url":"https://api.github.com/users/openjck/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/kuma/pulls/3248/commits","review_comments_url":"https://api.github.com/repos/mozilla/kuma/pulls/3248/comments","review_comment_url":"https://api.github.com/repos/mozilla/kuma/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/kuma/issues/3248/comments","statuses_url":"https://api.github.com/repos/mozilla/kuma/statuses/42c98bcdbb540c12a8305796102cbc6106a19f01","head":{"label":"openjck:3235-rebase","ref":"3235-rebase","sha":"42c98bcdbb540c12a8305796102cbc6106a19f01","user":{"login":"openjck","id":933396,"avatar_url":"https://avatars.githubusercontent.com/u/933396?v=3","gravatar_id":"","url":"https://api.github.com/users/openjck","html_url":"https://github.com/openjck","followers_url":"https://api.github.com/users/openjck/followers","following_url":"https://api.github.com/users/openjck/following{/other_user}","gists_url":"https://api.github.com/users/openjck/gists{/gist_id}","starred_url":"https://api.github.com/users/openjck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openjck/subscriptions","organizations_url":"https://api.github.com/users/openjck/orgs","repos_url":"https://api.github.com/users/openjck/repos","events_url":"https://api.github.com/users/openjck/events{/privacy}","received_events_url":"https://api.github.com/users/openjck/received_events","type":"User","site_admin":false},"repo":{"id":13564934,"name":"kuma","full_name":"openjck/kuma","owner":{"login":"openjck","id":933396,"avatar_url":"https://avatars.githubusercontent.com/u/933396?v=3","gravatar_id":"","url":"https://api.github.com/users/openjck","html_url":"https://github.com/openjck","followers_url":"https://api.github.com/users/openjck/followers","following_url":"https://api.github.com/users/openjck/following{/other_user}","gists_url":"https://api.github.com/users/openjck/gists{/gist_id}","starred_url":"https://api.github.com/users/openjck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openjck/subscriptions","organizations_url":"https://api.github.com/users/openjck/orgs","repos_url":"https://api.github.com/users/openjck/repos","events_url":"https://api.github.com/users/openjck/events{/privacy}","received_events_url":"https://api.github.com/users/openjck/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/openjck/kuma","description":"The Django project that powers MDN.","fork":true,"url":"https://api.github.com/repos/openjck/kuma","forks_url":"https://api.github.com/repos/openjck/kuma/forks","keys_url":"https://api.github.com/repos/openjck/kuma/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openjck/kuma/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openjck/kuma/teams","hooks_url":"https://api.github.com/repos/openjck/kuma/hooks","issue_events_url":"https://api.github.com/repos/openjck/kuma/issues/events{/number}","events_url":"https://api.github.com/repos/openjck/kuma/events","assignees_url":"https://api.github.com/repos/openjck/kuma/assignees{/user}","branches_url":"https://api.github.com/repos/openjck/kuma/branches{/branch}","tags_url":"https://api.github.com/repos/openjck/kuma/tags","blobs_url":"https://api.github.com/repos/openjck/kuma/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openjck/kuma/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openjck/kuma/git/refs{/sha}","trees_url":"https://api.github.com/repos/openjck/kuma/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openjck/kuma/statuses/{sha}","languages_url":"https://api.github.com/repos/openjck/kuma/languages","stargazers_url":"https://api.github.com/repos/openjck/kuma/stargazers","contributors_url":"https://api.github.com/repos/openjck/kuma/contributors","subscribers_url":"https://api.github.com/repos/openjck/kuma/subscribers","subscription_url":"https://api.github.com/repos/openjck/kuma/subscription","commits_url":"https://api.github.com/repos/openjck/kuma/commits{/sha}","git_commits_url":"https://api.github.com/repos/openjck/kuma/git/commits{/sha}","comments_url":"https://api.github.com/repos/openjck/kuma/comments{/number}","issue_comment_url":"https://api.github.com/repos/openjck/kuma/issues/comments{/number}","contents_url":"https://api.github.com/repos/openjck/kuma/contents/{+path}","compare_url":"https://api.github.com/repos/openjck/kuma/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openjck/kuma/merges","archive_url":"https://api.github.com/repos/openjck/kuma/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openjck/kuma/downloads","issues_url":"https://api.github.com/repos/openjck/kuma/issues{/number}","pulls_url":"https://api.github.com/repos/openjck/kuma/pulls{/number}","milestones_url":"https://api.github.com/repos/openjck/kuma/milestones{/number}","notifications_url":"https://api.github.com/repos/openjck/kuma/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openjck/kuma/labels{/name}","releases_url":"https://api.github.com/repos/openjck/kuma/releases{/id}","created_at":"2013-10-14T15:21:39Z","updated_at":"2015-04-27T18:05:51Z","pushed_at":"2015-06-10T20:35:34Z","git_url":"git://github.com/openjck/kuma.git","ssh_url":"git@github.com:openjck/kuma.git","clone_url":"https://github.com/openjck/kuma.git","svn_url":"https://github.com/openjck/kuma","homepage":"https://developer.mozilla.org","size":147514,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"mozilla:master","ref":"master","sha":"26b61718a991ecb2f1057a2709830fdb0bd6c041","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":1352520,"name":"kuma","full_name":"mozilla/kuma","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/kuma","description":"The Django project that powers MDN.","fork":false,"url":"https://api.github.com/repos/mozilla/kuma","forks_url":"https://api.github.com/repos/mozilla/kuma/forks","keys_url":"https://api.github.com/repos/mozilla/kuma/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/kuma/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/kuma/teams","hooks_url":"https://api.github.com/repos/mozilla/kuma/hooks","issue_events_url":"https://api.github.com/repos/mozilla/kuma/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/kuma/events","assignees_url":"https://api.github.com/repos/mozilla/kuma/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/kuma/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/kuma/tags","blobs_url":"https://api.github.com/repos/mozilla/kuma/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/kuma/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/kuma/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/kuma/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/kuma/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/kuma/languages","stargazers_url":"https://api.github.com/repos/mozilla/kuma/stargazers","contributors_url":"https://api.github.com/repos/mozilla/kuma/contributors","subscribers_url":"https://api.github.com/repos/mozilla/kuma/subscribers","subscription_url":"https://api.github.com/repos/mozilla/kuma/subscription","commits_url":"https://api.github.com/repos/mozilla/kuma/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/kuma/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/kuma/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/kuma/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/kuma/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/kuma/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/kuma/merges","archive_url":"https://api.github.com/repos/mozilla/kuma/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/kuma/downloads","issues_url":"https://api.github.com/repos/mozilla/kuma/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/kuma/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/kuma/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/kuma/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/kuma/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/kuma/releases{/id}","created_at":"2011-02-10T21:48:06Z","updated_at":"2015-06-11T11:50:18Z","pushed_at":"2015-06-11T15:53:11Z","git_url":"git://github.com/mozilla/kuma.git","ssh_url":"git@github.com:mozilla/kuma.git","clone_url":"https://github.com/mozilla/kuma.git","svn_url":"https://github.com/mozilla/kuma","homepage":"https://developer.mozilla.org","size":144624,"stargazers_count":598,"watchers_count":598,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":383,"mirror_url":null,"open_issues_count":13,"forks":383,"open_issues":13,"watchers":598,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/kuma/pulls/3248"},"html":{"href":"https://github.com/mozilla/kuma/pull/3248"},"issue":{"href":"https://api.github.com/repos/mozilla/kuma/issues/3248"},"comments":{"href":"https://api.github.com/repos/mozilla/kuma/issues/3248/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/kuma/pulls/3248/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/kuma/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/kuma/pulls/3248/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/kuma/statuses/42c98bcdbb540c12a8305796102cbc6106a19f01"}}}}