Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions starter-code/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
githubToken.js
23 changes: 14 additions & 9 deletions starter-code/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,13 @@ <h1>{{title}}</h1>
</script>
<script id="repo-template" type="text/x-handlebars-template">
<li>
//TODO: Fill in our new template expressions!
<!-- //TODO: Fill in our new template expressions!
DONE -->
<a href="{{html_url}}" target="_blank"><h3>{{name}}</h3></a>
<p>Description: {{}}</p>
<p>Primary Language: {{}}</p>
<p>Created: {{}}</p>
<p>Last updated: {{}}</p>
<p>Description: {{description}}</p>
<p>Primary Language: {{language}}</p>
<p>Created: {{created_at}}</p>
<p>Last updated: {{updated_at}}</p>
{{#if watchers_count}}
<p>{{watchers_count}} watching this repo</p>
{{/if}}
Expand Down Expand Up @@ -125,17 +126,21 @@ <h2>Author Stats</h2>
<script src="/vendor/scripts/page.js"></script>

<!-- TODO: Include your secret GitHub token file, which should be gitingore'd,
therefore recreated in every developer's environment. -->
<script src="/githubToken.js"></script>
therefore recreated in every developer's environment.
DONE -->
<script src="/githubToken.js"></script>
<!-- Model files: -->
<!-- TODO: Be sure to include any new model files: -->
<!-- TODO: Be sure to include any new model files:
DONE -->
<script src="/scripts/models/article.js"></script>
<script src="/scripts/models/repo.js"></script>
<!-- View files: -->
<!-- TODO: Be sure to include any new view files: -->
<!-- TODO: Be sure to include any new view files:
DONE -->
<script src="/scripts/views/articleView.js"></script>
<script src="/scripts/views/adminView.js"></script>
<script src="/scripts/views/repoView.js"></script>
<script src="/scripts/views/newArticle.js"></script>
<!-- Controller files: -->
<script src="/scripts/controllers/articleController.js"></script>
<script src="/scripts/controllers/aboutController.js"></script>
Expand Down
2 changes: 0 additions & 2 deletions starter-code/scripts/models/article.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

Article.allArticles = [];

// TODO: Convert the model .toHTML method to a proper View method,
// since it handles the presentation of the data:

Article.createTable = function() {
webDB.execute(
Expand Down
12 changes: 12 additions & 0 deletions starter-code/scripts/models/repo.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,21 @@
repos.allRepos = [];
// TODO: create a githubToken.js file that we can use to generate our headers
// properly.
// DONE

repos.requestRepos = function(callback) {
/* TODO: How would you like to fetch your repos? Someone say AJAX?!
Do not forget to call the callback! */
$.ajax({
url: 'https://api.github.com/users/codefellows-seattle-301d14/repos',
type: 'GET',
headers: {'Authorization': 'token ' + githubToken},
success: function(data) {
repos.allRepos = data;
callback();
console.log(data);
}
});
};

repos.withTheAttribute = function(myAttr) {
Expand Down