{"action":"created","comment":{"url":"https://api.github.com/repos/rwisecar/portfolio/pulls/comments/76496088","id":76496088,"diff_hunk":"@@ -1,45 +1,51 @@\n-//Object constructor\n-function Content (opts) {\n-  for (key in opts){\n-    this[key] = opts[key];\n+'use strict';\n+(function(module){\n+\n+  //Object constructor\n+// Lee helped me figure out where to put the var in this Content Object Constructor\n+  function Content (opts) {\n+    for (var key in opts){\n+      this[key] = opts[key];\n+    }\n   }\n-}\n-\n-//Creating empty array to hold sorted data before push to local storage\n-\n-Content.allContent = [];\n-\n-//makeHTML function applies date of publication and compiles content via handlebars template\n-Content.prototype.makeHtml = function() {\n-  this.daysAgo = parseInt((new Date() - new Date(this.publishedOn))/60/60/24/1000);\n-  this.publishStatus = this.publishedOn ? 'published ' + this.daysAgo + ' days ago' : '(draft)';\n-\n-  var source = $('#content-template').html();\n-  var templateRender = Handlebars.compile(source);\n-  return templateRender(this);\n-};\n-\n-//loadAll function sorts by date and pushes to allContent array\n-Content.loadAll = function(inputData) {\n-  inputData.sort(function(first, second) {\n-    return (new Date(second.publishedOn)) - (new Date(first.publishedOn));\n-  }).forEach(function(contentObject){\n-    Content.allContent.push(new Content(contentObject));\n-  });\n-};\n-\n-Content.fetchAll = function(){\n-  console.log('hey');\n-  if (localStorage.storedSources) {\n-    Content.loadAll(JSON.parse(localStorage.storedSources));\n-    contentView.renderIndexPage();\n-  } else {\n-    console.log('hey again');\n-    $.getJSON('../data/sources.json', function(data){\n-      console.log('yo');\n-      localStorage.setItem('storedSources', JSON.stringify(data));\n-      Content.loadAll(data);\n-      contentView.renderIndexPage();\n+\n+  //Creating empty array to hold sorted data before push to local storage\n+\n+  Content.allContent = [];\n+\n+  //makeHTML function applies date of publication and compiles content via handlebars template\n+  Content.prototype.makeHtml = function() {\n+    this.daysAgo = parseInt((new Date() - new Date(this.publishedOn))/60/60/24/1000);\n+    this.publishStatus = this.publishedOn ? 'published ' + this.daysAgo + ' days ago' : '(draft)';\n+\n+    var source = $('#content-template').html();\n+    var templateRender = Handlebars.compile(source);\n+    return templateRender(this);\n+  };\n+\n+  //loadAll function sorts by date and pushes to allContent array\n+  Content.loadAll = function(inputData) {\n+    inputData.sort(function(first, second) {\n+      return (new Date(second.publishedOn)) - (new Date(first.publishedOn));\n+    }).map(function(contentObject){\n+      Content.allContent.push(new Content(contentObject));\n     });\n   };\n-};\n+\n+  Content.fetchAll = function(){","path":"scripts/article.js","position":77,"original_position":77,"commit_id":"4a61fef87732fba5a2067f660e056a1d8a99bda8","original_commit_id":"4a61fef87732fba5a2067f660e056a1d8a99bda8","user":{"login":"broxsonl","id":18368239,"avatar_url":"https://avatars.githubusercontent.com/u/18368239?v=3","gravatar_id":"","url":"https://api.github.com/users/broxsonl","html_url":"https://github.com/broxsonl","followers_url":"https://api.github.com/users/broxsonl/followers","following_url":"https://api.github.com/users/broxsonl/following{/other_user}","gists_url":"https://api.github.com/users/broxsonl/gists{/gist_id}","starred_url":"https://api.github.com/users/broxsonl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broxsonl/subscriptions","organizations_url":"https://api.github.com/users/broxsonl/orgs","repos_url":"https://api.github.com/users/broxsonl/repos","events_url":"https://api.github.com/users/broxsonl/events{/privacy}","received_events_url":"https://api.github.com/users/broxsonl/received_events","type":"User","site_admin":false},"body":"Your fetchall is so much cleaner and more concise than mine is. This is great and easy to read/understand.","created_at":"2016-08-26T22:15:03Z","updated_at":"2016-08-26T22:15:03Z","html_url":"https://github.com/rwisecar/portfolio/pull/7#discussion_r76496088","pull_request_url":"https://api.github.com/repos/rwisecar/portfolio/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/rwisecar/portfolio/pulls/comments/76496088"},"html":{"href":"https://github.com/rwisecar/portfolio/pull/7#discussion_r76496088"},"pull_request":{"href":"https://api.github.com/repos/rwisecar/portfolio/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/rwisecar/portfolio/pulls/7","id":82904119,"html_url":"https://github.com/rwisecar/portfolio/pull/7","diff_url":"https://github.com/rwisecar/portfolio/pull/7.diff","patch_url":"https://github.com/rwisecar/portfolio/pull/7.patch","issue_url":"https://api.github.com/repos/rwisecar/portfolio/issues/7","number":7,"state":"open","locked":false,"title":"Class 09","user":{"login":"rwisecar","id":20154489,"avatar_url":"https://avatars.githubusercontent.com/u/20154489?v=3","gravatar_id":"","url":"https://api.github.com/users/rwisecar","html_url":"https://github.com/rwisecar","followers_url":"https://api.github.com/users/rwisecar/followers","following_url":"https://api.github.com/users/rwisecar/following{/other_user}","gists_url":"https://api.github.com/users/rwisecar/gists{/gist_id}","starred_url":"https://api.github.com/users/rwisecar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rwisecar/subscriptions","organizations_url":"https://api.github.com/users/rwisecar/orgs","repos_url":"https://api.github.com/users/rwisecar/repos","events_url":"https://api.github.com/users/rwisecar/events{/privacy}","received_events_url":"https://api.github.com/users/rwisecar/received_events","type":"User","site_admin":false},"body":"My experience was pretty straightforward. I know the big problems in my code, but it was helpful going through it and figuring out what could be better and what could be more streamlined.","created_at":"2016-08-26T15:07:28Z","updated_at":"2016-08-26T22:15:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5a4b0a3d2c7cb1bf9a67a2ac52f098343f6add74","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/rwisecar/portfolio/pulls/7/commits","review_comments_url":"https://api.github.com/repos/rwisecar/portfolio/pulls/7/comments","review_comment_url":"https://api.github.com/repos/rwisecar/portfolio/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rwisecar/portfolio/issues/7/comments","statuses_url":"https://api.github.com/repos/rwisecar/portfolio/statuses/4a61fef87732fba5a2067f660e056a1d8a99bda8","head":{"label":"rwisecar:class-09","ref":"class-09","sha":"4a61fef87732fba5a2067f660e056a1d8a99bda8","user":{"login":"rwisecar","id":20154489,"avatar_url":"https://avatars.githubusercontent.com/u/20154489?v=3","gravatar_id":"","url":"https://api.github.com/users/rwisecar","html_url":"https://github.com/rwisecar","followers_url":"https://api.github.com/users/rwisecar/followers","following_url":"https://api.github.com/users/rwisecar/following{/other_user}","gists_url":"https://api.github.com/users/rwisecar/gists{/gist_id}","starred_url":"https://api.github.com/users/rwisecar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rwisecar/subscriptions","organizations_url":"https://api.github.com/users/rwisecar/orgs","repos_url":"https://api.github.com/users/rwisecar/repos","events_url":"https://api.github.com/users/rwisecar/events{/privacy}","received_events_url":"https://api.github.com/users/rwisecar/received_events","type":"User","site_admin":false},"repo":{"id":65749258,"name":"portfolio","full_name":"rwisecar/portfolio","owner":{"login":"rwisecar","id":20154489,"avatar_url":"https://avatars.githubusercontent.com/u/20154489?v=3","gravatar_id":"","url":"https://api.github.com/users/rwisecar","html_url":"https://github.com/rwisecar","followers_url":"https://api.github.com/users/rwisecar/followers","following_url":"https://api.github.com/users/rwisecar/following{/other_user}","gists_url":"https://api.github.com/users/rwisecar/gists{/gist_id}","starred_url":"https://api.github.com/users/rwisecar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rwisecar/subscriptions","organizations_url":"https://api.github.com/users/rwisecar/orgs","repos_url":"https://api.github.com/users/rwisecar/repos","events_url":"https://api.github.com/users/rwisecar/events{/privacy}","received_events_url":"https://api.github.com/users/rwisecar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rwisecar/portfolio","description":"Portfolio of my work","fork":false,"url":"https://api.github.com/repos/rwisecar/portfolio","forks_url":"https://api.github.com/repos/rwisecar/portfolio/forks","keys_url":"https://api.github.com/repos/rwisecar/portfolio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rwisecar/portfolio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rwisecar/portfolio/teams","hooks_url":"https://api.github.com/repos/rwisecar/portfolio/hooks","issue_events_url":"https://api.github.com/repos/rwisecar/portfolio/issues/events{/number}","events_url":"https://api.github.com/repos/rwisecar/portfolio/events","assignees_url":"https://api.github.com/repos/rwisecar/portfolio/assignees{/user}","branches_url":"https://api.github.com/repos/rwisecar/portfolio/branches{/branch}","tags_url":"https://api.github.com/repos/rwisecar/portfolio/tags","blobs_url":"https://api.github.com/repos/rwisecar/portfolio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rwisecar/portfolio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rwisecar/portfolio/git/refs{/sha}","trees_url":"https://api.github.com/repos/rwisecar/portfolio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rwisecar/portfolio/statuses/{sha}","languages_url":"https://api.github.com/repos/rwisecar/portfolio/languages","stargazers_url":"https://api.github.com/repos/rwisecar/portfolio/stargazers","contributors_url":"https://api.github.com/repos/rwisecar/portfolio/contributors","subscribers_url":"https://api.github.com/repos/rwisecar/portfolio/subscribers","subscription_url":"https://api.github.com/repos/rwisecar/portfolio/subscription","commits_url":"https://api.github.com/repos/rwisecar/portfolio/commits{/sha}","git_commits_url":"https://api.github.com/repos/rwisecar/portfolio/git/commits{/sha}","comments_url":"https://api.github.com/repos/rwisecar/portfolio/comments{/number}","issue_comment_url":"https://api.github.com/repos/rwisecar/portfolio/issues/comments{/number}","contents_url":"https://api.github.com/repos/rwisecar/portfolio/contents/{+path}","compare_url":"https://api.github.com/repos/rwisecar/portfolio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rwisecar/portfolio/merges","archive_url":"https://api.github.com/repos/rwisecar/portfolio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rwisecar/portfolio/downloads","issues_url":"https://api.github.com/repos/rwisecar/portfolio/issues{/number}","pulls_url":"https://api.github.com/repos/rwisecar/portfolio/pulls{/number}","milestones_url":"https://api.github.com/repos/rwisecar/portfolio/milestones{/number}","notifications_url":"https://api.github.com/repos/rwisecar/portfolio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rwisecar/portfolio/labels{/name}","releases_url":"https://api.github.com/repos/rwisecar/portfolio/releases{/id}","deployments_url":"https://api.github.com/repos/rwisecar/portfolio/deployments","created_at":"2016-08-15T16:59:05Z","updated_at":"2016-08-23T23:55:38Z","pushed_at":"2016-08-26T21:33:30Z","git_url":"git://github.com/rwisecar/portfolio.git","ssh_url":"git@github.com:rwisecar/portfolio.git","clone_url":"https://github.com/rwisecar/portfolio.git","svn_url":"https://github.com/rwisecar/portfolio","homepage":null,"size":256,"stargazers_count":0,"watchers_count":0,"language":"CSS","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":"rwisecar:master","ref":"master","sha":"32683c76fe6e0a4a84c2b8f3e35fd6bc90dd8135","user":{"login":"rwisecar","id":20154489,"avatar_url":"https://avatars.githubusercontent.com/u/20154489?v=3","gravatar_id":"","url":"https://api.github.com/users/rwisecar","html_url":"https://github.com/rwisecar","followers_url":"https://api.github.com/users/rwisecar/followers","following_url":"https://api.github.com/users/rwisecar/following{/other_user}","gists_url":"https://api.github.com/users/rwisecar/gists{/gist_id}","starred_url":"https://api.github.com/users/rwisecar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rwisecar/subscriptions","organizations_url":"https://api.github.com/users/rwisecar/orgs","repos_url":"https://api.github.com/users/rwisecar/repos","events_url":"https://api.github.com/users/rwisecar/events{/privacy}","received_events_url":"https://api.github.com/users/rwisecar/received_events","type":"User","site_admin":false},"repo":{"id":65749258,"name":"portfolio","full_name":"rwisecar/portfolio","owner":{"login":"rwisecar","id":20154489,"avatar_url":"https://avatars.githubusercontent.com/u/20154489?v=3","gravatar_id":"","url":"https://api.github.com/users/rwisecar","html_url":"https://github.com/rwisecar","followers_url":"https://api.github.com/users/rwisecar/followers","following_url":"https://api.github.com/users/rwisecar/following{/other_user}","gists_url":"https://api.github.com/users/rwisecar/gists{/gist_id}","starred_url":"https://api.github.com/users/rwisecar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rwisecar/subscriptions","organizations_url":"https://api.github.com/users/rwisecar/orgs","repos_url":"https://api.github.com/users/rwisecar/repos","events_url":"https://api.github.com/users/rwisecar/events{/privacy}","received_events_url":"https://api.github.com/users/rwisecar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rwisecar/portfolio","description":"Portfolio of my work","fork":false,"url":"https://api.github.com/repos/rwisecar/portfolio","forks_url":"https://api.github.com/repos/rwisecar/portfolio/forks","keys_url":"https://api.github.com/repos/rwisecar/portfolio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rwisecar/portfolio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rwisecar/portfolio/teams","hooks_url":"https://api.github.com/repos/rwisecar/portfolio/hooks","issue_events_url":"https://api.github.com/repos/rwisecar/portfolio/issues/events{/number}","events_url":"https://api.github.com/repos/rwisecar/portfolio/events","assignees_url":"https://api.github.com/repos/rwisecar/portfolio/assignees{/user}","branches_url":"https://api.github.com/repos/rwisecar/portfolio/branches{/branch}","tags_url":"https://api.github.com/repos/rwisecar/portfolio/tags","blobs_url":"https://api.github.com/repos/rwisecar/portfolio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rwisecar/portfolio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rwisecar/portfolio/git/refs{/sha}","trees_url":"https://api.github.com/repos/rwisecar/portfolio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rwisecar/portfolio/statuses/{sha}","languages_url":"https://api.github.com/repos/rwisecar/portfolio/languages","stargazers_url":"https://api.github.com/repos/rwisecar/portfolio/stargazers","contributors_url":"https://api.github.com/repos/rwisecar/portfolio/contributors","subscribers_url":"https://api.github.com/repos/rwisecar/portfolio/subscribers","subscription_url":"https://api.github.com/repos/rwisecar/portfolio/subscription","commits_url":"https://api.github.com/repos/rwisecar/portfolio/commits{/sha}","git_commits_url":"https://api.github.com/repos/rwisecar/portfolio/git/commits{/sha}","comments_url":"https://api.github.com/repos/rwisecar/portfolio/comments{/number}","issue_comment_url":"https://api.github.com/repos/rwisecar/portfolio/issues/comments{/number}","contents_url":"https://api.github.com/repos/rwisecar/portfolio/contents/{+path}","compare_url":"https://api.github.com/repos/rwisecar/portfolio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rwisecar/portfolio/merges","archive_url":"https://api.github.com/repos/rwisecar/portfolio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rwisecar/portfolio/downloads","issues_url":"https://api.github.com/repos/rwisecar/portfolio/issues{/number}","pulls_url":"https://api.github.com/repos/rwisecar/portfolio/pulls{/number}","milestones_url":"https://api.github.com/repos/rwisecar/portfolio/milestones{/number}","notifications_url":"https://api.github.com/repos/rwisecar/portfolio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rwisecar/portfolio/labels{/name}","releases_url":"https://api.github.com/repos/rwisecar/portfolio/releases{/id}","deployments_url":"https://api.github.com/repos/rwisecar/portfolio/deployments","created_at":"2016-08-15T16:59:05Z","updated_at":"2016-08-23T23:55:38Z","pushed_at":"2016-08-26T21:33:30Z","git_url":"git://github.com/rwisecar/portfolio.git","ssh_url":"git@github.com:rwisecar/portfolio.git","clone_url":"https://github.com/rwisecar/portfolio.git","svn_url":"https://github.com/rwisecar/portfolio","homepage":null,"size":256,"stargazers_count":0,"watchers_count":0,"language":"CSS","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/rwisecar/portfolio/pulls/7"},"html":{"href":"https://github.com/rwisecar/portfolio/pull/7"},"issue":{"href":"https://api.github.com/repos/rwisecar/portfolio/issues/7"},"comments":{"href":"https://api.github.com/repos/rwisecar/portfolio/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/rwisecar/portfolio/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/rwisecar/portfolio/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rwisecar/portfolio/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/rwisecar/portfolio/statuses/4a61fef87732fba5a2067f660e056a1d8a99bda8"}}}}
{"actor":{"display_login":"broxsonl"}}