{"action":"created","comment":{"url":"https://api.github.com/repos/unioncollege-webtech/calculator/pulls/comments/42949846","id":42949846,"diff_hunk":"@@ -0,0 +1,139 @@\n+/* global math */\n+// Variables\n+var buttons = [['7','8','9','+'],['4','5','6','-'],['1','2','3','*'],['0','.','=','/']];\n+var lastNum = '=';\n+\n+function prep() {\n+  // Create base elements for the page\n+  var container = document.createElement('div');\n+  var header = document.createElement('div');\n+  var nav = document.createElement('div');\n+  var main = document.createElement('div');\n+  var aside = document.createElement('div');\n+  var footer = document.createElement('div');\n+\n+  // Apply IDs to the base elements\n+  container.id = 'container';\n+  header.id = 'header';\n+  nav.id = 'nav';\n+  main.id = 'main';\n+  aside.id = 'aside';\n+  footer.id = 'footer';\n+\n+  // Append main elements to container\n+  container.appendChild(header);\n+  container.appendChild(nav);\n+  container.appendChild(main);\n+  container.appendChild(aside);\n+  container.appendChild(footer);\n+\n+  // Add container to page\n+  document.body.appendChild(container);\n+\n+  heading(header);\n+  calculator(main);\n+  themeButtons(footer);\n+\n+  var about = document.createElement('p');\n+  about.appendChild(document.createTextNode('Created by keawade'));\n+  footer.appendChild(about);\n+}\n+\n+function heading(head) {\n+  // Add heading to header\n+  var title = document.createElement('h1');\n+  title.className = 'title';\n+  title.textContent = 'Calculon';\n+  head.appendChild(title);\n+}\n+\n+function calculator(base) {\n+  // Add calculator wrapper div\n+  var calculatorWrap = document.createElement('div');\n+  calculatorWrap.id = 'calculator';\n+  base.appendChild(calculatorWrap);\n+\n+  // Add input box\n+  var box = document.createElement('input');\n+  box.className = 'cal-box';\n+  box.id = 'cal-box';\n+  calculatorWrap.appendChild(box);\n+\n+  // Add calculator buttons\n+  for(var i = 0; i < buttons.length; i++) {\n+    for(var j = 0; j < buttons[i].length; j++) {","path":"calculator.js","position":64,"original_position":64,"commit_id":"2dc8f96b428763d2fb6323f56c5f163e3308fbe5","original_commit_id":"2dc8f96b428763d2fb6323f56c5f163e3308fbe5","user":{"login":"barberboy","id":371332,"avatar_url":"https://avatars.githubusercontent.com/u/371332?v=3","gravatar_id":"","url":"https://api.github.com/users/barberboy","html_url":"https://github.com/barberboy","followers_url":"https://api.github.com/users/barberboy/followers","following_url":"https://api.github.com/users/barberboy/following{/other_user}","gists_url":"https://api.github.com/users/barberboy/gists{/gist_id}","starred_url":"https://api.github.com/users/barberboy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/barberboy/subscriptions","organizations_url":"https://api.github.com/users/barberboy/orgs","repos_url":"https://api.github.com/users/barberboy/repos","events_url":"https://api.github.com/users/barberboy/events{/privacy}","received_events_url":"https://api.github.com/users/barberboy/received_events","type":"User","site_admin":false},"body":"Since you don't actually make use of the `i` index or  nested sub-arrays, you could just flatten the buttons into a single array and do:\r\n\r\n```js\r\n  buttons.forEach(function(buttonContent){\r\n    var button = document.createElement('button');\r\n    button.className = 'cal-button';\r\n    button.id = buttonContent;\r\n    button.appendChild(document.createTextNode(buttonContent));\r\n    button.addEventListener('click', handleButton, false);\r\n    calculatorWrap.appendChild(button);\r\n  });\r\n```","created_at":"2015-10-25T20:26:07Z","updated_at":"2015-10-25T20:26:07Z","html_url":"https://github.com/unioncollege-webtech/calculator/pull/2#discussion_r42949846","pull_request_url":"https://api.github.com/repos/unioncollege-webtech/calculator/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/unioncollege-webtech/calculator/pulls/comments/42949846"},"html":{"href":"https://github.com/unioncollege-webtech/calculator/pull/2#discussion_r42949846"},"pull_request":{"href":"https://api.github.com/repos/unioncollege-webtech/calculator/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/unioncollege-webtech/calculator/pulls/2","id":48674642,"html_url":"https://github.com/unioncollege-webtech/calculator/pull/2","diff_url":"https://github.com/unioncollege-webtech/calculator/pull/2.diff","patch_url":"https://github.com/unioncollege-webtech/calculator/pull/2.patch","issue_url":"https://api.github.com/repos/unioncollege-webtech/calculator/issues/2","number":2,"state":"open","locked":false,"title":"Assignment completed","user":{"login":"keawade","id":7308850,"avatar_url":"https://avatars.githubusercontent.com/u/7308850?v=3","gravatar_id":"","url":"https://api.github.com/users/keawade","html_url":"https://github.com/keawade","followers_url":"https://api.github.com/users/keawade/followers","following_url":"https://api.github.com/users/keawade/following{/other_user}","gists_url":"https://api.github.com/users/keawade/gists{/gist_id}","starred_url":"https://api.github.com/users/keawade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keawade/subscriptions","organizations_url":"https://api.github.com/users/keawade/orgs","repos_url":"https://api.github.com/users/keawade/repos","events_url":"https://api.github.com/users/keawade/events{/privacy}","received_events_url":"https://api.github.com/users/keawade/received_events","type":"User","site_admin":false},"body":"I think I've got the assignment completed. Still a few bugs but they're issues with how math.eval() works and not with my interface.","created_at":"2015-10-25T09:02:19Z","updated_at":"2015-10-25T20:26:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cf40563dd2ea15fc86ea948ddbb7e0abe4a6b113","assignee":{"login":"barberboy","id":371332,"avatar_url":"https://avatars.githubusercontent.com/u/371332?v=3","gravatar_id":"","url":"https://api.github.com/users/barberboy","html_url":"https://github.com/barberboy","followers_url":"https://api.github.com/users/barberboy/followers","following_url":"https://api.github.com/users/barberboy/following{/other_user}","gists_url":"https://api.github.com/users/barberboy/gists{/gist_id}","starred_url":"https://api.github.com/users/barberboy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/barberboy/subscriptions","organizations_url":"https://api.github.com/users/barberboy/orgs","repos_url":"https://api.github.com/users/barberboy/repos","events_url":"https://api.github.com/users/barberboy/events{/privacy}","received_events_url":"https://api.github.com/users/barberboy/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/unioncollege-webtech/calculator/pulls/2/commits","review_comments_url":"https://api.github.com/repos/unioncollege-webtech/calculator/pulls/2/comments","review_comment_url":"https://api.github.com/repos/unioncollege-webtech/calculator/pulls/comments{/number}","comments_url":"https://api.github.com/repos/unioncollege-webtech/calculator/issues/2/comments","statuses_url":"https://api.github.com/repos/unioncollege-webtech/calculator/statuses/2dc8f96b428763d2fb6323f56c5f163e3308fbe5","head":{"label":"keawade:gh-pages","ref":"gh-pages","sha":"2dc8f96b428763d2fb6323f56c5f163e3308fbe5","user":{"login":"keawade","id":7308850,"avatar_url":"https://avatars.githubusercontent.com/u/7308850?v=3","gravatar_id":"","url":"https://api.github.com/users/keawade","html_url":"https://github.com/keawade","followers_url":"https://api.github.com/users/keawade/followers","following_url":"https://api.github.com/users/keawade/following{/other_user}","gists_url":"https://api.github.com/users/keawade/gists{/gist_id}","starred_url":"https://api.github.com/users/keawade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keawade/subscriptions","organizations_url":"https://api.github.com/users/keawade/orgs","repos_url":"https://api.github.com/users/keawade/repos","events_url":"https://api.github.com/users/keawade/events{/privacy}","received_events_url":"https://api.github.com/users/keawade/received_events","type":"User","site_admin":false},"repo":{"id":44711469,"name":"calculator","full_name":"keawade/calculator","owner":{"login":"keawade","id":7308850,"avatar_url":"https://avatars.githubusercontent.com/u/7308850?v=3","gravatar_id":"","url":"https://api.github.com/users/keawade","html_url":"https://github.com/keawade","followers_url":"https://api.github.com/users/keawade/followers","following_url":"https://api.github.com/users/keawade/following{/other_user}","gists_url":"https://api.github.com/users/keawade/gists{/gist_id}","starred_url":"https://api.github.com/users/keawade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keawade/subscriptions","organizations_url":"https://api.github.com/users/keawade/orgs","repos_url":"https://api.github.com/users/keawade/repos","events_url":"https://api.github.com/users/keawade/events{/privacy}","received_events_url":"https://api.github.com/users/keawade/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/keawade/calculator","description":"Exercise your DOM skills to build functional calculator with JavaScript","fork":true,"url":"https://api.github.com/repos/keawade/calculator","forks_url":"https://api.github.com/repos/keawade/calculator/forks","keys_url":"https://api.github.com/repos/keawade/calculator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/keawade/calculator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/keawade/calculator/teams","hooks_url":"https://api.github.com/repos/keawade/calculator/hooks","issue_events_url":"https://api.github.com/repos/keawade/calculator/issues/events{/number}","events_url":"https://api.github.com/repos/keawade/calculator/events","assignees_url":"https://api.github.com/repos/keawade/calculator/assignees{/user}","branches_url":"https://api.github.com/repos/keawade/calculator/branches{/branch}","tags_url":"https://api.github.com/repos/keawade/calculator/tags","blobs_url":"https://api.github.com/repos/keawade/calculator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/keawade/calculator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/keawade/calculator/git/refs{/sha}","trees_url":"https://api.github.com/repos/keawade/calculator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/keawade/calculator/statuses/{sha}","languages_url":"https://api.github.com/repos/keawade/calculator/languages","stargazers_url":"https://api.github.com/repos/keawade/calculator/stargazers","contributors_url":"https://api.github.com/repos/keawade/calculator/contributors","subscribers_url":"https://api.github.com/repos/keawade/calculator/subscribers","subscription_url":"https://api.github.com/repos/keawade/calculator/subscription","commits_url":"https://api.github.com/repos/keawade/calculator/commits{/sha}","git_commits_url":"https://api.github.com/repos/keawade/calculator/git/commits{/sha}","comments_url":"https://api.github.com/repos/keawade/calculator/comments{/number}","issue_comment_url":"https://api.github.com/repos/keawade/calculator/issues/comments{/number}","contents_url":"https://api.github.com/repos/keawade/calculator/contents/{+path}","compare_url":"https://api.github.com/repos/keawade/calculator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/keawade/calculator/merges","archive_url":"https://api.github.com/repos/keawade/calculator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/keawade/calculator/downloads","issues_url":"https://api.github.com/repos/keawade/calculator/issues{/number}","pulls_url":"https://api.github.com/repos/keawade/calculator/pulls{/number}","milestones_url":"https://api.github.com/repos/keawade/calculator/milestones{/number}","notifications_url":"https://api.github.com/repos/keawade/calculator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/keawade/calculator/labels{/name}","releases_url":"https://api.github.com/repos/keawade/calculator/releases{/id}","created_at":"2015-10-22T00:04:46Z","updated_at":"2015-10-22T15:15:45Z","pushed_at":"2015-10-25T20:23:45Z","git_url":"git://github.com/keawade/calculator.git","ssh_url":"git@github.com:keawade/calculator.git","clone_url":"https://github.com/keawade/calculator.git","svn_url":"https://github.com/keawade/calculator","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"gh-pages"}},"base":{"label":"unioncollege-webtech:gh-pages","ref":"gh-pages","sha":"3b52ec56cff699a4590d311faff0ca31042edc8a","user":{"login":"unioncollege-webtech","id":4185215,"avatar_url":"https://avatars.githubusercontent.com/u/4185215?v=3","gravatar_id":"","url":"https://api.github.com/users/unioncollege-webtech","html_url":"https://github.com/unioncollege-webtech","followers_url":"https://api.github.com/users/unioncollege-webtech/followers","following_url":"https://api.github.com/users/unioncollege-webtech/following{/other_user}","gists_url":"https://api.github.com/users/unioncollege-webtech/gists{/gist_id}","starred_url":"https://api.github.com/users/unioncollege-webtech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unioncollege-webtech/subscriptions","organizations_url":"https://api.github.com/users/unioncollege-webtech/orgs","repos_url":"https://api.github.com/users/unioncollege-webtech/repos","events_url":"https://api.github.com/users/unioncollege-webtech/events{/privacy}","received_events_url":"https://api.github.com/users/unioncollege-webtech/received_events","type":"Organization","site_admin":false},"repo":{"id":44637682,"name":"calculator","full_name":"unioncollege-webtech/calculator","owner":{"login":"unioncollege-webtech","id":4185215,"avatar_url":"https://avatars.githubusercontent.com/u/4185215?v=3","gravatar_id":"","url":"https://api.github.com/users/unioncollege-webtech","html_url":"https://github.com/unioncollege-webtech","followers_url":"https://api.github.com/users/unioncollege-webtech/followers","following_url":"https://api.github.com/users/unioncollege-webtech/following{/other_user}","gists_url":"https://api.github.com/users/unioncollege-webtech/gists{/gist_id}","starred_url":"https://api.github.com/users/unioncollege-webtech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unioncollege-webtech/subscriptions","organizations_url":"https://api.github.com/users/unioncollege-webtech/orgs","repos_url":"https://api.github.com/users/unioncollege-webtech/repos","events_url":"https://api.github.com/users/unioncollege-webtech/events{/privacy}","received_events_url":"https://api.github.com/users/unioncollege-webtech/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/unioncollege-webtech/calculator","description":"Exercise your DOM skills to build functional calculator with JavaScript","fork":false,"url":"https://api.github.com/repos/unioncollege-webtech/calculator","forks_url":"https://api.github.com/repos/unioncollege-webtech/calculator/forks","keys_url":"https://api.github.com/repos/unioncollege-webtech/calculator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/unioncollege-webtech/calculator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/unioncollege-webtech/calculator/teams","hooks_url":"https://api.github.com/repos/unioncollege-webtech/calculator/hooks","issue_events_url":"https://api.github.com/repos/unioncollege-webtech/calculator/issues/events{/number}","events_url":"https://api.github.com/repos/unioncollege-webtech/calculator/events","assignees_url":"https://api.github.com/repos/unioncollege-webtech/calculator/assignees{/user}","branches_url":"https://api.github.com/repos/unioncollege-webtech/calculator/branches{/branch}","tags_url":"https://api.github.com/repos/unioncollege-webtech/calculator/tags","blobs_url":"https://api.github.com/repos/unioncollege-webtech/calculator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/unioncollege-webtech/calculator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/unioncollege-webtech/calculator/git/refs{/sha}","trees_url":"https://api.github.com/repos/unioncollege-webtech/calculator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/unioncollege-webtech/calculator/statuses/{sha}","languages_url":"https://api.github.com/repos/unioncollege-webtech/calculator/languages","stargazers_url":"https://api.github.com/repos/unioncollege-webtech/calculator/stargazers","contributors_url":"https://api.github.com/repos/unioncollege-webtech/calculator/contributors","subscribers_url":"https://api.github.com/repos/unioncollege-webtech/calculator/subscribers","subscription_url":"https://api.github.com/repos/unioncollege-webtech/calculator/subscription","commits_url":"https://api.github.com/repos/unioncollege-webtech/calculator/commits{/sha}","git_commits_url":"https://api.github.com/repos/unioncollege-webtech/calculator/git/commits{/sha}","comments_url":"https://api.github.com/repos/unioncollege-webtech/calculator/comments{/number}","issue_comment_url":"https://api.github.com/repos/unioncollege-webtech/calculator/issues/comments{/number}","contents_url":"https://api.github.com/repos/unioncollege-webtech/calculator/contents/{+path}","compare_url":"https://api.github.com/repos/unioncollege-webtech/calculator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/unioncollege-webtech/calculator/merges","archive_url":"https://api.github.com/repos/unioncollege-webtech/calculator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/unioncollege-webtech/calculator/downloads","issues_url":"https://api.github.com/repos/unioncollege-webtech/calculator/issues{/number}","pulls_url":"https://api.github.com/repos/unioncollege-webtech/calculator/pulls{/number}","milestones_url":"https://api.github.com/repos/unioncollege-webtech/calculator/milestones{/number}","notifications_url":"https://api.github.com/repos/unioncollege-webtech/calculator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/unioncollege-webtech/calculator/labels{/name}","releases_url":"https://api.github.com/repos/unioncollege-webtech/calculator/releases{/id}","created_at":"2015-10-20T22:07:28Z","updated_at":"2015-10-20T22:13:49Z","pushed_at":"2015-10-25T20:23:46Z","git_url":"git://github.com/unioncollege-webtech/calculator.git","ssh_url":"git@github.com:unioncollege-webtech/calculator.git","clone_url":"https://github.com/unioncollege-webtech/calculator.git","svn_url":"https://github.com/unioncollege-webtech/calculator","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":8,"mirror_url":null,"open_issues_count":1,"forks":8,"open_issues":1,"watchers":0,"default_branch":"gh-pages"}},"_links":{"self":{"href":"https://api.github.com/repos/unioncollege-webtech/calculator/pulls/2"},"html":{"href":"https://github.com/unioncollege-webtech/calculator/pull/2"},"issue":{"href":"https://api.github.com/repos/unioncollege-webtech/calculator/issues/2"},"comments":{"href":"https://api.github.com/repos/unioncollege-webtech/calculator/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/unioncollege-webtech/calculator/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/unioncollege-webtech/calculator/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/unioncollege-webtech/calculator/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/unioncollege-webtech/calculator/statuses/2dc8f96b428763d2fb6323f56c5f163e3308fbe5"}}}}