{"action":"created","comment":{"url":"https://api.github.com/repos/makersacademy/till_tech_test/pulls/comments/26778192","id":26778192,"diff_hunk":"@@ -0,0 +1,113 @@\n+\n+function HipsterList(cBack) {\n+//menu items\n+ this.shopInfo =\n+      {\n+        \"shopName\": \"The Coffee Connection\",\n+        \"address\": \"123 Lakeside Way\",\n+        \"phone\": \"16503600708\",\n+        \"prices\": \n+          {\n+            \"Cafe Latte\": 4.75,\n+            \"Flat White\": 4.75,\n+            \"Cappucino\": 3.85,\n+            \"Single Espresso\": 2.05,\n+            \"Double Espresso\": 3.75,\n+            \"Americano\": 3.75,\n+            \"Cortado\": 4.55,\n+            \"Tea\": 3.65,\n+            \"Choc Mudcake\": 6.40,\n+            \"Choc Mousse\": 8.20,\n+            \"Affogato\": 14.80,\n+            \"Tiramisu\": 11.40,\n+            \"Blueberry Muffin\": 4.05,\n+            \"Chocolate Chip Muffin\": 4.05,\n+            \"Muffin Of The Day\": 4.55\n+          }\n+      };\n+    this.list = [];\n+    this.price = [];\n+    this.total = [];\n+    this.quantity = [];\n+    this.payment = [];\n+\n+}\n+\n+//functions for list\n+  HipsterList.prototype.add = function(item, quantity) {\n+    if (this.list.indexOf(item) == -1) {\n+       this.list.push(item);\n+       var price = (this.shopInfo.prices[item] * quantity).toFixed(2);\n+       this.price.push(price);\n+       this.quantity.push(quantity);\n+     }\n+    else {\n+       var index = this.list.indexOf(item);\n+       // note this is a really good way convert strings to numbers and add\n+       this.price[index] = +(this.price[index]) + +(this.shopInfo.prices[item] * quantity).toFixed(2);\n+       this.quantity[index] = +this.quantity[index] + +quantity;\n+    }\n+  };\n+  \n+  HipsterList.prototype.getAllPrice = function() {\n+    return this.price;\n+  };\n+\n+  HipsterList.prototype.getAllItems = function() {\n+    return this.list;\n+  };\n+\n+  HipsterList.prototype.getAllQuantity = function() {\n+    return this.quantity;\n+  };\n+\n+  HipsterList.prototype.getTotal = function() {\n+    if (this.price.length > 0) {\n+      this.total = eval(this.price.join(\"+\")).toFixed(2);","path":"public/js/hipsterList.js","position":66,"original_position":66,"commit_id":"0e9d68c7b81b1a6499c98e2509b8e8bded71ac59","original_commit_id":"0e9d68c7b81b1a6499c98e2509b8e8bded71ac59","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"eval can be harmful.","created_at":"2015-03-19T17:36:20Z","updated_at":"2015-03-19T17:36:20Z","html_url":"https://github.com/makersacademy/till_tech_test/pull/10#discussion_r26778192","pull_request_url":"https://api.github.com/repos/makersacademy/till_tech_test/pulls/10","_links":{"self":{"href":"https://api.github.com/repos/makersacademy/till_tech_test/pulls/comments/26778192"},"html":{"href":"https://github.com/makersacademy/till_tech_test/pull/10#discussion_r26778192"},"pull_request":{"href":"https://api.github.com/repos/makersacademy/till_tech_test/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/makersacademy/till_tech_test/pulls/10","id":31541873,"html_url":"https://github.com/makersacademy/till_tech_test/pull/10","diff_url":"https://github.com/makersacademy/till_tech_test/pull/10.diff","patch_url":"https://github.com/makersacademy/till_tech_test/pull/10.patch","issue_url":"https://api.github.com/repos/makersacademy/till_tech_test/issues/10","number":10,"state":"open","locked":false,"title":"Review","user":{"login":"HannahCarney","id":9658258,"avatar_url":"https://avatars.githubusercontent.com/u/9658258?v=3","gravatar_id":"","url":"https://api.github.com/users/HannahCarney","html_url":"https://github.com/HannahCarney","followers_url":"https://api.github.com/users/HannahCarney/followers","following_url":"https://api.github.com/users/HannahCarney/following{/other_user}","gists_url":"https://api.github.com/users/HannahCarney/gists{/gist_id}","starred_url":"https://api.github.com/users/HannahCarney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HannahCarney/subscriptions","organizations_url":"https://api.github.com/users/HannahCarney/orgs","repos_url":"https://api.github.com/users/HannahCarney/repos","events_url":"https://api.github.com/users/HannahCarney/events{/privacy}","received_events_url":"https://api.github.com/users/HannahCarney/received_events","type":"User","site_admin":false},"body":"Code Review","created_at":"2015-03-19T16:42:52Z","updated_at":"2015-03-19T17:36:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f4b6d19e702be79e8ca5864e94963585ee24e1ca","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/makersacademy/till_tech_test/pulls/10/commits","review_comments_url":"https://api.github.com/repos/makersacademy/till_tech_test/pulls/10/comments","review_comment_url":"https://api.github.com/repos/makersacademy/till_tech_test/pulls/comments{/number}","comments_url":"https://api.github.com/repos/makersacademy/till_tech_test/issues/10/comments","statuses_url":"https://api.github.com/repos/makersacademy/till_tech_test/statuses/0e9d68c7b81b1a6499c98e2509b8e8bded71ac59","head":{"label":"HannahCarney:master","ref":"master","sha":"0e9d68c7b81b1a6499c98e2509b8e8bded71ac59","user":{"login":"HannahCarney","id":9658258,"avatar_url":"https://avatars.githubusercontent.com/u/9658258?v=3","gravatar_id":"","url":"https://api.github.com/users/HannahCarney","html_url":"https://github.com/HannahCarney","followers_url":"https://api.github.com/users/HannahCarney/followers","following_url":"https://api.github.com/users/HannahCarney/following{/other_user}","gists_url":"https://api.github.com/users/HannahCarney/gists{/gist_id}","starred_url":"https://api.github.com/users/HannahCarney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HannahCarney/subscriptions","organizations_url":"https://api.github.com/users/HannahCarney/orgs","repos_url":"https://api.github.com/users/HannahCarney/repos","events_url":"https://api.github.com/users/HannahCarney/events{/privacy}","received_events_url":"https://api.github.com/users/HannahCarney/received_events","type":"User","site_admin":false},"repo":{"id":32528297,"name":"till_tech_test-1","full_name":"HannahCarney/till_tech_test-1","owner":{"login":"HannahCarney","id":9658258,"avatar_url":"https://avatars.githubusercontent.com/u/9658258?v=3","gravatar_id":"","url":"https://api.github.com/users/HannahCarney","html_url":"https://github.com/HannahCarney","followers_url":"https://api.github.com/users/HannahCarney/followers","following_url":"https://api.github.com/users/HannahCarney/following{/other_user}","gists_url":"https://api.github.com/users/HannahCarney/gists{/gist_id}","starred_url":"https://api.github.com/users/HannahCarney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HannahCarney/subscriptions","organizations_url":"https://api.github.com/users/HannahCarney/orgs","repos_url":"https://api.github.com/users/HannahCarney/repos","events_url":"https://api.github.com/users/HannahCarney/events{/privacy}","received_events_url":"https://api.github.com/users/HannahCarney/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/HannahCarney/till_tech_test-1","description":"Hiring week tech test","fork":true,"url":"https://api.github.com/repos/HannahCarney/till_tech_test-1","forks_url":"https://api.github.com/repos/HannahCarney/till_tech_test-1/forks","keys_url":"https://api.github.com/repos/HannahCarney/till_tech_test-1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/HannahCarney/till_tech_test-1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/HannahCarney/till_tech_test-1/teams","hooks_url":"https://api.github.com/repos/HannahCarney/till_tech_test-1/hooks","issue_events_url":"https://api.github.com/repos/HannahCarney/till_tech_test-1/issues/events{/number}","events_url":"https://api.github.com/repos/HannahCarney/till_tech_test-1/events","assignees_url":"https://api.github.com/repos/HannahCarney/till_tech_test-1/assignees{/user}","branches_url":"https://api.github.com/repos/HannahCarney/till_tech_test-1/branches{/branch}","tags_url":"https://api.github.com/repos/HannahCarney/till_tech_test-1/tags","blobs_url":"https://api.github.com/repos/HannahCarney/till_tech_test-1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/HannahCarney/till_tech_test-1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/HannahCarney/till_tech_test-1/git/refs{/sha}","trees_url":"https://api.github.com/repos/HannahCarney/till_tech_test-1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/HannahCarney/till_tech_test-1/statuses/{sha}","languages_url":"https://api.github.com/repos/HannahCarney/till_tech_test-1/languages","stargazers_url":"https://api.github.com/repos/HannahCarney/till_tech_test-1/stargazers","contributors_url":"https://api.github.com/repos/HannahCarney/till_tech_test-1/contributors","subscribers_url":"https://api.github.com/repos/HannahCarney/till_tech_test-1/subscribers","subscription_url":"https://api.github.com/repos/HannahCarney/till_tech_test-1/subscription","commits_url":"https://api.github.com/repos/HannahCarney/till_tech_test-1/commits{/sha}","git_commits_url":"https://api.github.com/repos/HannahCarney/till_tech_test-1/git/commits{/sha}","comments_url":"https://api.github.com/repos/HannahCarney/till_tech_test-1/comments{/number}","issue_comment_url":"https://api.github.com/repos/HannahCarney/till_tech_test-1/issues/comments{/number}","contents_url":"https://api.github.com/repos/HannahCarney/till_tech_test-1/contents/{+path}","compare_url":"https://api.github.com/repos/HannahCarney/till_tech_test-1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/HannahCarney/till_tech_test-1/merges","archive_url":"https://api.github.com/repos/HannahCarney/till_tech_test-1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/HannahCarney/till_tech_test-1/downloads","issues_url":"https://api.github.com/repos/HannahCarney/till_tech_test-1/issues{/number}","pulls_url":"https://api.github.com/repos/HannahCarney/till_tech_test-1/pulls{/number}","milestones_url":"https://api.github.com/repos/HannahCarney/till_tech_test-1/milestones{/number}","notifications_url":"https://api.github.com/repos/HannahCarney/till_tech_test-1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/HannahCarney/till_tech_test-1/labels{/name}","releases_url":"https://api.github.com/repos/HannahCarney/till_tech_test-1/releases{/id}","created_at":"2015-03-19T15:03:06Z","updated_at":"2015-03-19T17:36:09Z","pushed_at":"2015-03-19T17:36:09Z","git_url":"git://github.com/HannahCarney/till_tech_test-1.git","ssh_url":"git@github.com:HannahCarney/till_tech_test-1.git","clone_url":"https://github.com/HannahCarney/till_tech_test-1.git","svn_url":"https://github.com/HannahCarney/till_tech_test-1","homepage":null,"size":186,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"makersacademy:master","ref":"master","sha":"a5d6100b52f32329a477ccd9aee480770406665d","user":{"login":"makersacademy","id":3636186,"avatar_url":"https://avatars.githubusercontent.com/u/3636186?v=3","gravatar_id":"","url":"https://api.github.com/users/makersacademy","html_url":"https://github.com/makersacademy","followers_url":"https://api.github.com/users/makersacademy/followers","following_url":"https://api.github.com/users/makersacademy/following{/other_user}","gists_url":"https://api.github.com/users/makersacademy/gists{/gist_id}","starred_url":"https://api.github.com/users/makersacademy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/makersacademy/subscriptions","organizations_url":"https://api.github.com/users/makersacademy/orgs","repos_url":"https://api.github.com/users/makersacademy/repos","events_url":"https://api.github.com/users/makersacademy/events{/privacy}","received_events_url":"https://api.github.com/users/makersacademy/received_events","type":"Organization","site_admin":false},"repo":{"id":31914698,"name":"till_tech_test","full_name":"makersacademy/till_tech_test","owner":{"login":"makersacademy","id":3636186,"avatar_url":"https://avatars.githubusercontent.com/u/3636186?v=3","gravatar_id":"","url":"https://api.github.com/users/makersacademy","html_url":"https://github.com/makersacademy","followers_url":"https://api.github.com/users/makersacademy/followers","following_url":"https://api.github.com/users/makersacademy/following{/other_user}","gists_url":"https://api.github.com/users/makersacademy/gists{/gist_id}","starred_url":"https://api.github.com/users/makersacademy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/makersacademy/subscriptions","organizations_url":"https://api.github.com/users/makersacademy/orgs","repos_url":"https://api.github.com/users/makersacademy/repos","events_url":"https://api.github.com/users/makersacademy/events{/privacy}","received_events_url":"https://api.github.com/users/makersacademy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/makersacademy/till_tech_test","description":"Hiring week tech test","fork":false,"url":"https://api.github.com/repos/makersacademy/till_tech_test","forks_url":"https://api.github.com/repos/makersacademy/till_tech_test/forks","keys_url":"https://api.github.com/repos/makersacademy/till_tech_test/keys{/key_id}","collaborators_url":"https://api.github.com/repos/makersacademy/till_tech_test/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/makersacademy/till_tech_test/teams","hooks_url":"https://api.github.com/repos/makersacademy/till_tech_test/hooks","issue_events_url":"https://api.github.com/repos/makersacademy/till_tech_test/issues/events{/number}","events_url":"https://api.github.com/repos/makersacademy/till_tech_test/events","assignees_url":"https://api.github.com/repos/makersacademy/till_tech_test/assignees{/user}","branches_url":"https://api.github.com/repos/makersacademy/till_tech_test/branches{/branch}","tags_url":"https://api.github.com/repos/makersacademy/till_tech_test/tags","blobs_url":"https://api.github.com/repos/makersacademy/till_tech_test/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/makersacademy/till_tech_test/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/makersacademy/till_tech_test/git/refs{/sha}","trees_url":"https://api.github.com/repos/makersacademy/till_tech_test/git/trees{/sha}","statuses_url":"https://api.github.com/repos/makersacademy/till_tech_test/statuses/{sha}","languages_url":"https://api.github.com/repos/makersacademy/till_tech_test/languages","stargazers_url":"https://api.github.com/repos/makersacademy/till_tech_test/stargazers","contributors_url":"https://api.github.com/repos/makersacademy/till_tech_test/contributors","subscribers_url":"https://api.github.com/repos/makersacademy/till_tech_test/subscribers","subscription_url":"https://api.github.com/repos/makersacademy/till_tech_test/subscription","commits_url":"https://api.github.com/repos/makersacademy/till_tech_test/commits{/sha}","git_commits_url":"https://api.github.com/repos/makersacademy/till_tech_test/git/commits{/sha}","comments_url":"https://api.github.com/repos/makersacademy/till_tech_test/comments{/number}","issue_comment_url":"https://api.github.com/repos/makersacademy/till_tech_test/issues/comments{/number}","contents_url":"https://api.github.com/repos/makersacademy/till_tech_test/contents/{+path}","compare_url":"https://api.github.com/repos/makersacademy/till_tech_test/compare/{base}...{head}","merges_url":"https://api.github.com/repos/makersacademy/till_tech_test/merges","archive_url":"https://api.github.com/repos/makersacademy/till_tech_test/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/makersacademy/till_tech_test/downloads","issues_url":"https://api.github.com/repos/makersacademy/till_tech_test/issues{/number}","pulls_url":"https://api.github.com/repos/makersacademy/till_tech_test/pulls{/number}","milestones_url":"https://api.github.com/repos/makersacademy/till_tech_test/milestones{/number}","notifications_url":"https://api.github.com/repos/makersacademy/till_tech_test/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/makersacademy/till_tech_test/labels{/name}","releases_url":"https://api.github.com/repos/makersacademy/till_tech_test/releases{/id}","created_at":"2015-03-09T18:16:02Z","updated_at":"2015-03-09T18:30:54Z","pushed_at":"2015-03-19T17:00:39Z","git_url":"git://github.com/makersacademy/till_tech_test.git","ssh_url":"git@github.com:makersacademy/till_tech_test.git","clone_url":"https://github.com/makersacademy/till_tech_test.git","svn_url":"https://github.com/makersacademy/till_tech_test","homepage":null,"size":186,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"open_issues_count":10,"forks":15,"open_issues":10,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/makersacademy/till_tech_test/pulls/10"},"html":{"href":"https://github.com/makersacademy/till_tech_test/pull/10"},"issue":{"href":"https://api.github.com/repos/makersacademy/till_tech_test/issues/10"},"comments":{"href":"https://api.github.com/repos/makersacademy/till_tech_test/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/makersacademy/till_tech_test/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/makersacademy/till_tech_test/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/makersacademy/till_tech_test/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/makersacademy/till_tech_test/statuses/0e9d68c7b81b1a6499c98e2509b8e8bded71ac59"}}}}