-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
todo challenge #143
Open
TY231618
wants to merge
16
commits into
makersacademy:master
Choose a base branch
from
TY231618:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
todo challenge #143
Changes from 13 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
f3ec403
Env set up and test suites ready to go
6bd90f9
Added contoller
13420ac
First protractor test green
38b0672
Can add a new todo, green test
d77d964
new tasks are not completed, green test
5c1357d
text box clears after adding a task
f3749d1
user can remove completed tasks
95069f5
displays a seperate list for completed tasks
4aa66d0
displays a seperate list for active tasks
90cff04
displays a seperate list for all tasks
b4adadf
Displays number of todos for all, active and completed lists
ec6f681
user can wipe whole list of todos
41347a5
Updated README and added very basic styling
002fe39
Updated README.md
1308711
updated README.md some more
57272ec
updasted travis
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/bower_components | ||
/node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"name": "todo_challenge", | ||
"homepage": "https://github.com/TY231618/todo_challenge", | ||
"authors": [ | ||
"Tony Young <[email protected]>" | ||
], | ||
"description": "", | ||
"main": "", | ||
"moduleType": [], | ||
"license": "MIT", | ||
"ignore": [ | ||
"**/.*", | ||
"node_modules", | ||
"bower_components", | ||
"test", | ||
"tests" | ||
], | ||
"dependencies": { | ||
"jquery": "^2.2.0", | ||
"bootstrap": "^3.3.6", | ||
"angular": "^1.4.9", | ||
"angular-resource": "^1.4.9" | ||
}, | ||
"devDependencies": { | ||
"angular-mocks": "^1.4.9", | ||
"angular-route": "^1.4.9" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
body { | ||
text-align: center; | ||
background-image: url(/Users/TY/Desktop/stickynote.jpg); | ||
} | ||
|
||
h2 { | ||
font-family: Consolas, Sans-Serif; | ||
width:800px; | ||
margin:10px auto; | ||
text-align:left; | ||
padding:10px; | ||
padding-left: 400px; | ||
} | ||
|
||
.done { | ||
text-decoration: line-through; color: #ccc; | ||
} | ||
|
||
/*.center{ | ||
width:200px; | ||
margin:0 auto; | ||
text-align:left; | ||
}*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<!doctype html> | ||
<html lang="en" ng-app="TodoList"> | ||
<head> | ||
|
||
<meta charset="utf-8"> | ||
|
||
<title>Todo List Challenge</title> | ||
|
||
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.css"> | ||
<link rel="stylesheet" href="css/main.css"> | ||
|
||
<script src="bower_components/jquery/dist/jquery.js"></script> | ||
<script src="bower_components/angular/angular.js"></script> | ||
<script src="bower_components/angular-resource/angular-resource.js"></script> | ||
<script src="js/app.js"></script> | ||
<script src="js/todoListController.js"></script> | ||
|
||
</head> | ||
|
||
<body ng-controller="TodoListController as todoCtrl"> | ||
<br> | ||
<div class="center"> | ||
<form class="form-horizontal" name="frm" ng-submit="todoCtrl.addTodo(todoCtrl.newTodo)"> | ||
<input type="text" name="newTodo" ng-model="todoCtrl.newTodo" placeholder="Add a todo..." required/> | ||
<br><br> | ||
<button class="btn btn-success btn-xs" ng-click="todoCtrl.allTodo()">All</button> | ||
<button class="btn btn-success btn-xs" ng-click="todoCtrl.activeTodo()">Active</button> | ||
<button class="btn btn-success btn-xs" ng-click="todoCtrl.completedTodo()">Completed</button> | ||
<button class="btn btn-info btn-xs" ng-click="todoCtrl.addTodo(todoCtrl.newTodo)">Add Todo</button> | ||
<button class="btn btn-info btn-xs" ng-click="todoCtrl.removeTodo()">Remove Todo</button> | ||
<button class="btn btn-danger btn-xs" ng-click="todoCtrl.clearAll()">Clear List</button> | ||
|
||
</form> | ||
|
||
<br><br> | ||
<h2>My list of todos.....</h2> | ||
<ul ng-repeat="list in todoCtrl.todos"> | ||
<li> | ||
<span ng-class="{'done': list.done}">{{list.title}}</span> | ||
<input type="checkbox" ng-model="list.done"/> | ||
</li> | ||
</ul> | ||
<p>Number of Todos: {{todoCtrl.countTodo()}}</p> | ||
|
||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
var todoList = angular.module('TodoList', ['ngResource']); | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
todoList.controller('TodoListController', function() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This function has too many statements. (11) |
||
var self = this; | ||
|
||
self.todos = []; | ||
self.filteredTodoList = []; | ||
self.oldList = []; | ||
|
||
self.addTodo = function(newTodo){ | ||
self.allTodo(); | ||
self.todos.push({title: newTodo, done: false}); | ||
self.newTodo = ''; | ||
self.filteredTodoList = self.todos; | ||
|
||
}; | ||
|
||
self.removeTodo = function () { | ||
self.allTodo(); | ||
self.oldList = self.todos; | ||
self.todos = []; | ||
|
||
|
||
for (var i = 0; i < self.oldList.length; i++) { | ||
if (!self.oldList[i].done) { | ||
self.todos.push(self.oldList[i]); | ||
} | ||
} | ||
self.filteredTodoList = self.todos; | ||
|
||
} | ||
|
||
self.completedTodo = function () { | ||
self.oldList = self.filteredTodoList; | ||
self.todos = []; | ||
|
||
for (var i = 0; i < self.oldList.length; i++) { | ||
if (self.oldList[i].done) { | ||
self.todos.push(self.oldList[i]); | ||
} | ||
} | ||
} | ||
|
||
self.activeTodo = function () { | ||
self.oldList = self.filteredTodoList; | ||
self.todos = []; | ||
|
||
for (var i = 0; i < self.oldList.length; i++) { | ||
if (!self.oldList[i].done) { | ||
self.todos.push(self.oldList[i]); | ||
} | ||
} | ||
} | ||
|
||
self.allTodo = function () { | ||
self.todos = self.filteredTodoList; | ||
} | ||
|
||
self.countTodo = function () { | ||
return self.todos.length; | ||
} | ||
|
||
self.clearAll = function() { | ||
self.todos = []; | ||
self.filteredTodoList = []; | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"name": "todo_challenge", | ||
"version": "1.0.0", | ||
"description": "* Deadline: submit completed pull request by 9am on Monday * You may use whatever level of JavaScript you feel comfortable with - pure JS, jQuery, Angular, or whatever weird and wonderful framework you want to try. Extra points for DogeScript", | ||
"main": "index.js", | ||
"directories": { | ||
"doc": "docs" | ||
}, | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/TY231618/todo_challenge.git" | ||
}, | ||
"author": "", | ||
"license": "ISC", | ||
"bugs": { | ||
"url": "https://github.com/TY231618/todo_challenge/issues" | ||
}, | ||
"homepage": "https://github.com/TY231618/todo_challenge#readme", | ||
"devDependencies": { | ||
"jasmine-core": "^2.4.1", | ||
"karma": "^0.13.19", | ||
"karma-chrome-launcher": "^0.2.2", | ||
"karma-jasmine": "^0.3.6", | ||
"karma-phantomjs-launcher": "^1.0.0", | ||
"phantomjs": "^2.1.3", | ||
"protractor": "^3.0.0" | ||
}, | ||
"dependencies": { | ||
"http-server": "^0.8.5" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
exports.config = { | ||
seleniumAddress: 'http://localhost:4444/wd/hub', | ||
specs: ['todoListFeature.js'] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
describe('Todo List', function() { | ||
|
||
|
||
beforeEach(function() { | ||
browser.get('http://localhost:8080'); | ||
}); | ||
|
||
it('has a title', function() { | ||
expect(browser.getTitle()).toEqual('Todo List Challenge'); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
// Karma configuration | ||
// Generated on Thu Nov 27 2014 10:43:21 GMT+0000 (GMT) | ||
|
||
module.exports = function(config) { | ||
config.set({ | ||
|
||
// base path that will be used to resolve all patterns (eg. files, exclude) | ||
basePath: '../', | ||
|
||
|
||
// frameworks to use | ||
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter | ||
frameworks: ['jasmine'], | ||
|
||
|
||
// list of files / patterns to load in the browser | ||
files: [ | ||
'bower_components/angular/angular.js', | ||
'bower_components/angular-route/angular-route.js', | ||
'bower_components/angular-resource/angular-resource.js', | ||
'bower_components/angular-mocks/angular-mocks.js', | ||
'js/**/*.js', | ||
'test/**/*.spec.js' | ||
], | ||
|
||
|
||
// list of files to exclude | ||
exclude: [], | ||
|
||
|
||
// preprocess matching files before serving them to the browser | ||
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor | ||
preprocessors: {}, | ||
|
||
|
||
// test results reporter to use | ||
// possible values: 'dots', 'progress' | ||
// available reporters: https://npmjs.org/browse/keyword/karma-reporter | ||
reporters: ['progress'], | ||
|
||
|
||
// web server port | ||
port: 9876, | ||
|
||
|
||
// enable / disable colors in the output (reporters and logs) | ||
colors: true, | ||
|
||
|
||
// level of logging | ||
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG | ||
logLevel: config.LOG_INFO, | ||
|
||
|
||
// enable / disable watching file and executing tests whenever any file changes | ||
autoWatch: true, | ||
|
||
|
||
// start these browsers | ||
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher | ||
browsers: ['PhantomJS'], | ||
|
||
|
||
// Continuous Integration mode | ||
// if true, Karma captures browsers, runs the tests and exits | ||
singleRun: false | ||
}); | ||
}; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'angular' is not defined.