{"action":"created","comment":{"url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/pulls/comments/86686369","pull_request_review_id":7332841,"id":86686369,"diff_hunk":"@@ -0,0 +1,98 @@\n+<!DOCTYPE html>\n+<html>\n+<head>\n+  <meta charset=\"utf-8\">\n+  <meta name=\"viewport\" content=\"width=device-width\">\n+  <script src=\"https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js\"></script>\n+  <script src=\"https://cloudboost.io/js-sdk/cloudboost.js\"></script>\n+  <script src=\"item.js\"></script>\n+  <style>\n+  body {\n+    background-image:   url('http://images.designtrends.com/wp-content/uploads/2015/11/06043811/Pokemon-Background-Designs46.png');\n+    color:  #595959;\n+  }\n+  </style>\n+  <title>Pokémart | Get your Pokemons here!</title>\n+</head>\n+<body>\n+<center><h1>Welcome to the PokéMart!<br>\n+<span>You have: $</span><span id = 'money'></span><br>\n+<span>The store has: $</span><span id='storemoney'></span>\n+</h1>\n+\n+</center>\n+  <br>\n+<center>\n+<table>\n+\n+</table>\n+<table>\n+\n+</table>\n+<center>\n+  <button id=\"addItem\" onclick=\"restock()\">Add An Item</button>\n+</center>\n+<script>\n+CB.CloudApp.init('vjctptvxldnr', '29887421-6a73-4f05-ab41-487878490841');\n+let money = 5000;\n+let storeMoney = 10000;\n+let inventory =[];\n+update();\n+function restock(){\n+  let num = Math.floor(Math.random()*749)+1;\n+  $.ajax({\n+  url: 'http://pokeapi.co/api/v2/item/' + num + '/',\n+  dataType: 'json',\n+  success: function(data){\n+    let item = new CB.CloudObject(\"Item\");\n+    num = Math.floor(Math.random()*50)+1;\n+    let itemObj = new Item(data.name, data.cost, num, data.sprites.default, item);\n+    itemObj.save();\n+}})}\n+\n+function update2(){\n+\n+}\n+\n+function update(){\n+  $(\"table\").empty();\n+  inventory=[];\n+  let itemQuery = new CB.CloudQuery(\"Item\");\n+  itemQuery.setLimit(1000);\n+  itemQuery.find({\n+    success: (list) => {\n+      console.log(list);\n+      for(let index in list){\n+        if(index%5 == 0){\n+          $(\"table\").append(`<tr id=\"row${index/5}\"></tr>`);\n+        }\n+        $(`#row${Math.floor(index/5)}`).append(`<td id=\"box${index}\">`);\n+          $(`#box${index}`).append(`<img id='image${index}' src=\"\"></img><br>`);\n+          $(`#box${index}`).append(`<span>Name: </span><span id=\"name${index}\"></span><br>`);\n+          $(`#box${index}`).append(`<span>Quantity: </span><span id=\"quantity${index}\"></span><br>`);\n+          $(`#box${index}`).append(`<span>Price: $</span><span id=\"price${index}\"></span><br>`);\n+          $(`#box${index}`).append(`<button id=\"buy${index}\" onclick=\"inventory[${index}].buy()\">Buy me!</button>`);\n+          $(`#box${index}`).append(`<button id=\"sell${index}\" onclick=\"inventory[${index}].sell()\">Sell me!</button>`);\n+        $(`#row${Math.floor(index/5)}`).append(`<td`);\n+\n+        $(`#image${index}`).attr(\"src\",list[index].document.sprite);\n+        $(`#name${index}`).html(list[index].document.name);\n+        $(`#quantity${index}`).html(list[index].document.quantity);\n+        $(`#price${index}`).html(list[index].document.cost);\n+\n+        let item = new Item(list[index].document.name, list[index].document.cost, list[index].document.quantity, list[index].document.sprite, list[index]);","path":"week-6-poke-mart.html","position":83,"original_position":83,"commit_id":"c10986e3cc02179eaa67fcae64259a6d9b4528ba","original_commit_id":"c10986e3cc02179eaa67fcae64259a6d9b4528ba","user":{"login":"rickyc","id":111761,"avatar_url":"https://avatars.githubusercontent.com/u/111761?v=3","gravatar_id":"","url":"https://api.github.com/users/rickyc","html_url":"https://github.com/rickyc","followers_url":"https://api.github.com/users/rickyc/followers","following_url":"https://api.github.com/users/rickyc/following{/other_user}","gists_url":"https://api.github.com/users/rickyc/gists{/gist_id}","starred_url":"https://api.github.com/users/rickyc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rickyc/subscriptions","organizations_url":"https://api.github.com/users/rickyc/orgs","repos_url":"https://api.github.com/users/rickyc/repos","events_url":"https://api.github.com/users/rickyc/events{/privacy}","received_events_url":"https://api.github.com/users/rickyc/received_events","type":"User","site_admin":false},"body":"If you find yourself typing the same thing over and over you should probably make a variable to contain it.\r\n\r\n```js\r\nconst document = list[index].document;\r\n// now you can use document.name\r\n```\r\n\r\nor newer es6 syntax\r\n\r\n```js\r\nconst { name, cost, quantity } = list[index].document;\r\n// now you can use name, cost, quantity\r\n```","created_at":"2016-11-06T13:30:37Z","updated_at":"2016-11-06T13:30:55Z","html_url":"https://github.com/Noahb930/nha-oop-fall-2016/pull/5#discussion_r86686369","pull_request_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/pulls/comments/86686369"},"html":{"href":"https://github.com/Noahb930/nha-oop-fall-2016/pull/5#discussion_r86686369"},"pull_request":{"href":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/pulls/5","id":90523716,"html_url":"https://github.com/Noahb930/nha-oop-fall-2016/pull/5","diff_url":"https://github.com/Noahb930/nha-oop-fall-2016/pull/5.diff","patch_url":"https://github.com/Noahb930/nha-oop-fall-2016/pull/5.patch","issue_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/issues/5","number":5,"state":"open","locked":false,"title":"Homework 4","user":{"login":"Noahb930","id":12190926,"avatar_url":"https://avatars.githubusercontent.com/u/12190926?v=3","gravatar_id":"","url":"https://api.github.com/users/Noahb930","html_url":"https://github.com/Noahb930","followers_url":"https://api.github.com/users/Noahb930/followers","following_url":"https://api.github.com/users/Noahb930/following{/other_user}","gists_url":"https://api.github.com/users/Noahb930/gists{/gist_id}","starred_url":"https://api.github.com/users/Noahb930/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Noahb930/subscriptions","organizations_url":"https://api.github.com/users/Noahb930/orgs","repos_url":"https://api.github.com/users/Noahb930/repos","events_url":"https://api.github.com/users/Noahb930/events{/privacy}","received_events_url":"https://api.github.com/users/Noahb930/received_events","type":"User","site_admin":false},"body":"**Description**\nI recoded the pokemart created by @InspectorElement last year using oop and classes.\n\n**Class(es)**\nI created an items class that takes the parameters:\n-name (string)\n-cost (integer)\n-quantity (integer)\n-sprite (string)\n-item (cloudburst obj)\n","created_at":"2016-10-23T18:10:05Z","updated_at":"2016-11-06T13:30:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"139f90205bdc68383648cc3d3d067433c3343928","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/pulls/5/commits","review_comments_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/pulls/5/comments","review_comment_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/issues/5/comments","statuses_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/statuses/c10986e3cc02179eaa67fcae64259a6d9b4528ba","head":{"label":"Noahb930:homework-4","ref":"homework-4","sha":"c10986e3cc02179eaa67fcae64259a6d9b4528ba","user":{"login":"Noahb930","id":12190926,"avatar_url":"https://avatars.githubusercontent.com/u/12190926?v=3","gravatar_id":"","url":"https://api.github.com/users/Noahb930","html_url":"https://github.com/Noahb930","followers_url":"https://api.github.com/users/Noahb930/followers","following_url":"https://api.github.com/users/Noahb930/following{/other_user}","gists_url":"https://api.github.com/users/Noahb930/gists{/gist_id}","starred_url":"https://api.github.com/users/Noahb930/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Noahb930/subscriptions","organizations_url":"https://api.github.com/users/Noahb930/orgs","repos_url":"https://api.github.com/users/Noahb930/repos","events_url":"https://api.github.com/users/Noahb930/events{/privacy}","received_events_url":"https://api.github.com/users/Noahb930/received_events","type":"User","site_admin":false},"repo":{"id":67834997,"name":"nha-oop-fall-2016","full_name":"Noahb930/nha-oop-fall-2016","owner":{"login":"Noahb930","id":12190926,"avatar_url":"https://avatars.githubusercontent.com/u/12190926?v=3","gravatar_id":"","url":"https://api.github.com/users/Noahb930","html_url":"https://github.com/Noahb930","followers_url":"https://api.github.com/users/Noahb930/followers","following_url":"https://api.github.com/users/Noahb930/following{/other_user}","gists_url":"https://api.github.com/users/Noahb930/gists{/gist_id}","starred_url":"https://api.github.com/users/Noahb930/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Noahb930/subscriptions","organizations_url":"https://api.github.com/users/Noahb930/orgs","repos_url":"https://api.github.com/users/Noahb930/repos","events_url":"https://api.github.com/users/Noahb930/events{/privacy}","received_events_url":"https://api.github.com/users/Noahb930/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Noahb930/nha-oop-fall-2016","description":null,"fork":false,"url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016","forks_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/forks","keys_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/teams","hooks_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/hooks","issue_events_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/issues/events{/number}","events_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/events","assignees_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/assignees{/user}","branches_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/branches{/branch}","tags_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/tags","blobs_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/git/refs{/sha}","trees_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/statuses/{sha}","languages_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/languages","stargazers_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/stargazers","contributors_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/contributors","subscribers_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/subscribers","subscription_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/subscription","commits_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/commits{/sha}","git_commits_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/git/commits{/sha}","comments_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/comments{/number}","issue_comment_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/issues/comments{/number}","contents_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/contents/{+path}","compare_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/merges","archive_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/downloads","issues_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/issues{/number}","pulls_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/pulls{/number}","milestones_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/milestones{/number}","notifications_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/labels{/name}","releases_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/releases{/id}","deployments_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/deployments","created_at":"2016-09-09T21:51:10Z","updated_at":"2016-09-16T21:23:28Z","pushed_at":"2016-11-04T21:37:19Z","git_url":"git://github.com/Noahb930/nha-oop-fall-2016.git","ssh_url":"git@github.com:Noahb930/nha-oop-fall-2016.git","clone_url":"https://github.com/Noahb930/nha-oop-fall-2016.git","svn_url":"https://github.com/Noahb930/nha-oop-fall-2016","homepage":null,"size":198,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"Noahb930:master","ref":"master","sha":"a8b2983be32ea09dd97fcaab589683df4f82a076","user":{"login":"Noahb930","id":12190926,"avatar_url":"https://avatars.githubusercontent.com/u/12190926?v=3","gravatar_id":"","url":"https://api.github.com/users/Noahb930","html_url":"https://github.com/Noahb930","followers_url":"https://api.github.com/users/Noahb930/followers","following_url":"https://api.github.com/users/Noahb930/following{/other_user}","gists_url":"https://api.github.com/users/Noahb930/gists{/gist_id}","starred_url":"https://api.github.com/users/Noahb930/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Noahb930/subscriptions","organizations_url":"https://api.github.com/users/Noahb930/orgs","repos_url":"https://api.github.com/users/Noahb930/repos","events_url":"https://api.github.com/users/Noahb930/events{/privacy}","received_events_url":"https://api.github.com/users/Noahb930/received_events","type":"User","site_admin":false},"repo":{"id":67834997,"name":"nha-oop-fall-2016","full_name":"Noahb930/nha-oop-fall-2016","owner":{"login":"Noahb930","id":12190926,"avatar_url":"https://avatars.githubusercontent.com/u/12190926?v=3","gravatar_id":"","url":"https://api.github.com/users/Noahb930","html_url":"https://github.com/Noahb930","followers_url":"https://api.github.com/users/Noahb930/followers","following_url":"https://api.github.com/users/Noahb930/following{/other_user}","gists_url":"https://api.github.com/users/Noahb930/gists{/gist_id}","starred_url":"https://api.github.com/users/Noahb930/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Noahb930/subscriptions","organizations_url":"https://api.github.com/users/Noahb930/orgs","repos_url":"https://api.github.com/users/Noahb930/repos","events_url":"https://api.github.com/users/Noahb930/events{/privacy}","received_events_url":"https://api.github.com/users/Noahb930/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Noahb930/nha-oop-fall-2016","description":null,"fork":false,"url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016","forks_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/forks","keys_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/teams","hooks_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/hooks","issue_events_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/issues/events{/number}","events_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/events","assignees_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/assignees{/user}","branches_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/branches{/branch}","tags_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/tags","blobs_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/git/refs{/sha}","trees_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/statuses/{sha}","languages_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/languages","stargazers_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/stargazers","contributors_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/contributors","subscribers_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/subscribers","subscription_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/subscription","commits_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/commits{/sha}","git_commits_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/git/commits{/sha}","comments_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/comments{/number}","issue_comment_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/issues/comments{/number}","contents_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/contents/{+path}","compare_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/merges","archive_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/downloads","issues_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/issues{/number}","pulls_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/pulls{/number}","milestones_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/milestones{/number}","notifications_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/labels{/name}","releases_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/releases{/id}","deployments_url":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/deployments","created_at":"2016-09-09T21:51:10Z","updated_at":"2016-09-16T21:23:28Z","pushed_at":"2016-11-04T21:37:19Z","git_url":"git://github.com/Noahb930/nha-oop-fall-2016.git","ssh_url":"git@github.com:Noahb930/nha-oop-fall-2016.git","clone_url":"https://github.com/Noahb930/nha-oop-fall-2016.git","svn_url":"https://github.com/Noahb930/nha-oop-fall-2016","homepage":null,"size":198,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/pulls/5"},"html":{"href":"https://github.com/Noahb930/nha-oop-fall-2016/pull/5"},"issue":{"href":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/issues/5"},"comments":{"href":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/Noahb930/nha-oop-fall-2016/statuses/c10986e3cc02179eaa67fcae64259a6d9b4528ba"}}}}
{"actor":{"display_login":"rickyc"}}