{"action":"created","comment":{"url":"https://api.github.com/repos/appium/appium.io/pulls/comments/138254631","pull_request_review_id":62023331,"id":138254631,"diff_hunk":"@@ -26,45 +29,65 @@ function capitalize (languageName) {\n   return languageName.charAt(0).toUpperCase() + languageName.slice(1);\n }\n \n-function appendLanguageBlock (tabEl, preEl, languageName, id, active) {\n-  const navTag = tabEl.find('.nav');\n-  navTag.append(`<li role=\"presentation\" ${active ? 'class=\"active\"' : ''} role=\"tab\">\n-    <a href='#${id}' data-toggle='tab'>${capitalize(languageName)}</a>\n-  </li>`);\n-  const tabPanel = tabEl.find('.tab-content');\n-  let html = preEl[0].outerHTML;\n-  html = stripLanguageComment(html);\n-  tabPanel.append(`<div role=\"tabpanel\" class=\"tab-pane ${active ? 'active' : ''}\" id=\"${id}\">${html.trim()}</div>`);\n-}\n-\n export function fencedCodeTabify (html) {\n   const jqHTML = $(html);\n-  let tabTagHTML = `<div>\n-    <ul class=\"nav nav-tabs\" role=\"tablist\">\n-    </ul>\n-    <div class=\"tab-content\">\n-    </div>\n-  </div>`;\n \n   let tabPaneIndex = 0;\n \n+  let languageBlocks = [];\n+\n   jqHTML.find(\"pre > code\").each((index, codeTag) => {\n     const preTag = $(codeTag).parent();\n     const siblings = preTag.nextAll();\n-    const tabEl = $(tabTagHTML);\n     let language = capitalize($(codeTag).attr('class'));\n-    let siblingIndex = 0;\n-    appendLanguageBlock(tabEl, preTag, language, `${tabPaneIndex}_${siblingIndex++}`, true);\n+\n+    let siblingCount = 1;\n+    languageBlocks.push({\n+      language: language.toLowerCase(),","path":"scripts/tabs.js","position":54,"original_position":54,"commit_id":"4fd46aa66bb34de9e5956c02d6494c69886147b4","original_commit_id":"4fd46aa66bb34de9e5956c02d6494c69886147b4","user":{"login":"mykola-mokhnach","id":7767781,"avatar_url":"https://avatars1.githubusercontent.com/u/7767781?v=4","gravatar_id":"","url":"https://api.github.com/users/mykola-mokhnach","html_url":"https://github.com/mykola-mokhnach","followers_url":"https://api.github.com/users/mykola-mokhnach/followers","following_url":"https://api.github.com/users/mykola-mokhnach/following{/other_user}","gists_url":"https://api.github.com/users/mykola-mokhnach/gists{/gist_id}","starred_url":"https://api.github.com/users/mykola-mokhnach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mykola-mokhnach/subscriptions","organizations_url":"https://api.github.com/users/mykola-mokhnach/orgs","repos_url":"https://api.github.com/users/mykola-mokhnach/repos","events_url":"https://api.github.com/users/mykola-mokhnach/events{/privacy}","received_events_url":"https://api.github.com/users/mykola-mokhnach/received_events","type":"User","site_admin":false},"body":"I'd rather move this to a separate function to avoid unnecessary code duplication:\r\n\r\n```js\r\nconst pushLanguageBlock = (lang, el, tabPaneIndex) => {\r\n   languageBlocks.push({\r\n         language: lang.toLowerCase(),\r\n         capitalizedLanguage: capitalize(lang),\r\n         html: stripLanguageComment($(el)[0].outerHTML),\r\n         tabIndex,\r\n       });\r\n}\r\n...\r\n```","created_at":"2017-09-12T05:26:41Z","updated_at":"2017-09-12T05:26:41Z","html_url":"https://github.com/appium/appium.io/pull/96#discussion_r138254631","pull_request_url":"https://api.github.com/repos/appium/appium.io/pulls/96","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/appium/appium.io/pulls/comments/138254631"},"html":{"href":"https://github.com/appium/appium.io/pull/96#discussion_r138254631"},"pull_request":{"href":"https://api.github.com/repos/appium/appium.io/pulls/96"}}},"pull_request":{"url":"https://api.github.com/repos/appium/appium.io/pulls/96","id":140458609,"html_url":"https://github.com/appium/appium.io/pull/96","diff_url":"https://github.com/appium/appium.io/pull/96.diff","patch_url":"https://github.com/appium/appium.io/pull/96.patch","issue_url":"https://api.github.com/repos/appium/appium.io/issues/96","number":96,"state":"open","locked":false,"title":"Sort tabs by language priority","user":{"login":"dpgraham","id":852574,"avatar_url":"https://avatars2.githubusercontent.com/u/852574?v=4","gravatar_id":"","url":"https://api.github.com/users/dpgraham","html_url":"https://github.com/dpgraham","followers_url":"https://api.github.com/users/dpgraham/followers","following_url":"https://api.github.com/users/dpgraham/following{/other_user}","gists_url":"https://api.github.com/users/dpgraham/gists{/gist_id}","starred_url":"https://api.github.com/users/dpgraham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpgraham/subscriptions","organizations_url":"https://api.github.com/users/dpgraham/orgs","repos_url":"https://api.github.com/users/dpgraham/repos","events_url":"https://api.github.com/users/dpgraham/events{/privacy}","received_events_url":"https://api.github.com/users/dpgraham/received_events","type":"User","site_admin":false},"body":"* Use EJS template to render the tabs instead of raw jQuery (the jQuery code was getting out of hand and difficult to edit)\r\n* Sort the language tabs by priority (Java comes first, then Python, Javascript, etc...)","created_at":"2017-09-11T23:39:32Z","updated_at":"2017-09-12T05:26:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a33f47e184b689183221ebf508cb2893450dcbe6","assignee":null,"assignees":[],"requested_reviewers":[{"login":"jlipps","id":605053,"avatar_url":"https://avatars3.githubusercontent.com/u/605053?v=4","gravatar_id":"","url":"https://api.github.com/users/jlipps","html_url":"https://github.com/jlipps","followers_url":"https://api.github.com/users/jlipps/followers","following_url":"https://api.github.com/users/jlipps/following{/other_user}","gists_url":"https://api.github.com/users/jlipps/gists{/gist_id}","starred_url":"https://api.github.com/users/jlipps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlipps/subscriptions","organizations_url":"https://api.github.com/users/jlipps/orgs","repos_url":"https://api.github.com/users/jlipps/repos","events_url":"https://api.github.com/users/jlipps/events{/privacy}","received_events_url":"https://api.github.com/users/jlipps/received_events","type":"User","site_admin":false},{"login":"imurchie","id":2614354,"avatar_url":"https://avatars2.githubusercontent.com/u/2614354?v=4","gravatar_id":"","url":"https://api.github.com/users/imurchie","html_url":"https://github.com/imurchie","followers_url":"https://api.github.com/users/imurchie/followers","following_url":"https://api.github.com/users/imurchie/following{/other_user}","gists_url":"https://api.github.com/users/imurchie/gists{/gist_id}","starred_url":"https://api.github.com/users/imurchie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imurchie/subscriptions","organizations_url":"https://api.github.com/users/imurchie/orgs","repos_url":"https://api.github.com/users/imurchie/repos","events_url":"https://api.github.com/users/imurchie/events{/privacy}","received_events_url":"https://api.github.com/users/imurchie/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/appium/appium.io/pulls/96/commits","review_comments_url":"https://api.github.com/repos/appium/appium.io/pulls/96/comments","review_comment_url":"https://api.github.com/repos/appium/appium.io/pulls/comments{/number}","comments_url":"https://api.github.com/repos/appium/appium.io/issues/96/comments","statuses_url":"https://api.github.com/repos/appium/appium.io/statuses/4fd46aa66bb34de9e5956c02d6494c69886147b4","head":{"label":"appium:dpgraham-ui-improvements","ref":"dpgraham-ui-improvements","sha":"4fd46aa66bb34de9e5956c02d6494c69886147b4","user":{"login":"appium","id":3221291,"avatar_url":"https://avatars2.githubusercontent.com/u/3221291?v=4","gravatar_id":"","url":"https://api.github.com/users/appium","html_url":"https://github.com/appium","followers_url":"https://api.github.com/users/appium/followers","following_url":"https://api.github.com/users/appium/following{/other_user}","gists_url":"https://api.github.com/users/appium/gists{/gist_id}","starred_url":"https://api.github.com/users/appium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/appium/subscriptions","organizations_url":"https://api.github.com/users/appium/orgs","repos_url":"https://api.github.com/users/appium/repos","events_url":"https://api.github.com/users/appium/events{/privacy}","received_events_url":"https://api.github.com/users/appium/received_events","type":"Organization","site_admin":false},"repo":{"id":9250346,"name":"appium.io","full_name":"appium/appium.io","owner":{"login":"appium","id":3221291,"avatar_url":"https://avatars2.githubusercontent.com/u/3221291?v=4","gravatar_id":"","url":"https://api.github.com/users/appium","html_url":"https://github.com/appium","followers_url":"https://api.github.com/users/appium/followers","following_url":"https://api.github.com/users/appium/following{/other_user}","gists_url":"https://api.github.com/users/appium/gists{/gist_id}","starred_url":"https://api.github.com/users/appium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/appium/subscriptions","organizations_url":"https://api.github.com/users/appium/orgs","repos_url":"https://api.github.com/users/appium/repos","events_url":"https://api.github.com/users/appium/events{/privacy}","received_events_url":"https://api.github.com/users/appium/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/appium/appium.io","description":"The public front-end for Appium","fork":false,"url":"https://api.github.com/repos/appium/appium.io","forks_url":"https://api.github.com/repos/appium/appium.io/forks","keys_url":"https://api.github.com/repos/appium/appium.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/appium/appium.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/appium/appium.io/teams","hooks_url":"https://api.github.com/repos/appium/appium.io/hooks","issue_events_url":"https://api.github.com/repos/appium/appium.io/issues/events{/number}","events_url":"https://api.github.com/repos/appium/appium.io/events","assignees_url":"https://api.github.com/repos/appium/appium.io/assignees{/user}","branches_url":"https://api.github.com/repos/appium/appium.io/branches{/branch}","tags_url":"https://api.github.com/repos/appium/appium.io/tags","blobs_url":"https://api.github.com/repos/appium/appium.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/appium/appium.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/appium/appium.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/appium/appium.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/appium/appium.io/statuses/{sha}","languages_url":"https://api.github.com/repos/appium/appium.io/languages","stargazers_url":"https://api.github.com/repos/appium/appium.io/stargazers","contributors_url":"https://api.github.com/repos/appium/appium.io/contributors","subscribers_url":"https://api.github.com/repos/appium/appium.io/subscribers","subscription_url":"https://api.github.com/repos/appium/appium.io/subscription","commits_url":"https://api.github.com/repos/appium/appium.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/appium/appium.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/appium/appium.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/appium/appium.io/issues/comments{/number}","contents_url":"https://api.github.com/repos/appium/appium.io/contents/{+path}","compare_url":"https://api.github.com/repos/appium/appium.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/appium/appium.io/merges","archive_url":"https://api.github.com/repos/appium/appium.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/appium/appium.io/downloads","issues_url":"https://api.github.com/repos/appium/appium.io/issues{/number}","pulls_url":"https://api.github.com/repos/appium/appium.io/pulls{/number}","milestones_url":"https://api.github.com/repos/appium/appium.io/milestones{/number}","notifications_url":"https://api.github.com/repos/appium/appium.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/appium/appium.io/labels{/name}","releases_url":"https://api.github.com/repos/appium/appium.io/releases{/id}","deployments_url":"https://api.github.com/repos/appium/appium.io/deployments","created_at":"2013-04-05T20:51:20Z","updated_at":"2017-09-08T05:02:11Z","pushed_at":"2017-09-11T23:39:33Z","git_url":"git://github.com/appium/appium.io.git","ssh_url":"git@github.com:appium/appium.io.git","clone_url":"https://github.com/appium/appium.io.git","svn_url":"https://github.com/appium/appium.io","homepage":"http://appium.io/","size":8360,"stargazers_count":12,"watchers_count":12,"language":"HTML","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":36,"mirror_url":null,"open_issues_count":22,"forks":36,"open_issues":22,"watchers":12,"default_branch":"gh-pages"}},"base":{"label":"appium:js-refactor-gh","ref":"js-refactor-gh","sha":"ce1225c0a931f276fc74f2c36fe8a8405c6e3583","user":{"login":"appium","id":3221291,"avatar_url":"https://avatars2.githubusercontent.com/u/3221291?v=4","gravatar_id":"","url":"https://api.github.com/users/appium","html_url":"https://github.com/appium","followers_url":"https://api.github.com/users/appium/followers","following_url":"https://api.github.com/users/appium/following{/other_user}","gists_url":"https://api.github.com/users/appium/gists{/gist_id}","starred_url":"https://api.github.com/users/appium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/appium/subscriptions","organizations_url":"https://api.github.com/users/appium/orgs","repos_url":"https://api.github.com/users/appium/repos","events_url":"https://api.github.com/users/appium/events{/privacy}","received_events_url":"https://api.github.com/users/appium/received_events","type":"Organization","site_admin":false},"repo":{"id":9250346,"name":"appium.io","full_name":"appium/appium.io","owner":{"login":"appium","id":3221291,"avatar_url":"https://avatars2.githubusercontent.com/u/3221291?v=4","gravatar_id":"","url":"https://api.github.com/users/appium","html_url":"https://github.com/appium","followers_url":"https://api.github.com/users/appium/followers","following_url":"https://api.github.com/users/appium/following{/other_user}","gists_url":"https://api.github.com/users/appium/gists{/gist_id}","starred_url":"https://api.github.com/users/appium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/appium/subscriptions","organizations_url":"https://api.github.com/users/appium/orgs","repos_url":"https://api.github.com/users/appium/repos","events_url":"https://api.github.com/users/appium/events{/privacy}","received_events_url":"https://api.github.com/users/appium/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/appium/appium.io","description":"The public front-end for Appium","fork":false,"url":"https://api.github.com/repos/appium/appium.io","forks_url":"https://api.github.com/repos/appium/appium.io/forks","keys_url":"https://api.github.com/repos/appium/appium.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/appium/appium.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/appium/appium.io/teams","hooks_url":"https://api.github.com/repos/appium/appium.io/hooks","issue_events_url":"https://api.github.com/repos/appium/appium.io/issues/events{/number}","events_url":"https://api.github.com/repos/appium/appium.io/events","assignees_url":"https://api.github.com/repos/appium/appium.io/assignees{/user}","branches_url":"https://api.github.com/repos/appium/appium.io/branches{/branch}","tags_url":"https://api.github.com/repos/appium/appium.io/tags","blobs_url":"https://api.github.com/repos/appium/appium.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/appium/appium.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/appium/appium.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/appium/appium.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/appium/appium.io/statuses/{sha}","languages_url":"https://api.github.com/repos/appium/appium.io/languages","stargazers_url":"https://api.github.com/repos/appium/appium.io/stargazers","contributors_url":"https://api.github.com/repos/appium/appium.io/contributors","subscribers_url":"https://api.github.com/repos/appium/appium.io/subscribers","subscription_url":"https://api.github.com/repos/appium/appium.io/subscription","commits_url":"https://api.github.com/repos/appium/appium.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/appium/appium.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/appium/appium.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/appium/appium.io/issues/comments{/number}","contents_url":"https://api.github.com/repos/appium/appium.io/contents/{+path}","compare_url":"https://api.github.com/repos/appium/appium.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/appium/appium.io/merges","archive_url":"https://api.github.com/repos/appium/appium.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/appium/appium.io/downloads","issues_url":"https://api.github.com/repos/appium/appium.io/issues{/number}","pulls_url":"https://api.github.com/repos/appium/appium.io/pulls{/number}","milestones_url":"https://api.github.com/repos/appium/appium.io/milestones{/number}","notifications_url":"https://api.github.com/repos/appium/appium.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/appium/appium.io/labels{/name}","releases_url":"https://api.github.com/repos/appium/appium.io/releases{/id}","deployments_url":"https://api.github.com/repos/appium/appium.io/deployments","created_at":"2013-04-05T20:51:20Z","updated_at":"2017-09-08T05:02:11Z","pushed_at":"2017-09-11T23:39:33Z","git_url":"git://github.com/appium/appium.io.git","ssh_url":"git@github.com:appium/appium.io.git","clone_url":"https://github.com/appium/appium.io.git","svn_url":"https://github.com/appium/appium.io","homepage":"http://appium.io/","size":8360,"stargazers_count":12,"watchers_count":12,"language":"HTML","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":36,"mirror_url":null,"open_issues_count":22,"forks":36,"open_issues":22,"watchers":12,"default_branch":"gh-pages"}},"_links":{"self":{"href":"https://api.github.com/repos/appium/appium.io/pulls/96"},"html":{"href":"https://github.com/appium/appium.io/pull/96"},"issue":{"href":"https://api.github.com/repos/appium/appium.io/issues/96"},"comments":{"href":"https://api.github.com/repos/appium/appium.io/issues/96/comments"},"review_comments":{"href":"https://api.github.com/repos/appium/appium.io/pulls/96/comments"},"review_comment":{"href":"https://api.github.com/repos/appium/appium.io/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/appium/appium.io/pulls/96/commits"},"statuses":{"href":"https://api.github.com/repos/appium/appium.io/statuses/4fd46aa66bb34de9e5956c02d6494c69886147b4"}},"author_association":"NONE"}}
{"actor":{"display_login":"mykola-mokhnach"}}