-
Notifications
You must be signed in to change notification settings - Fork 13
lab-khalid #10
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
Open
khalidM3
wants to merge
1
commit into
codefellows-javascript-401d13:master
Choose a base branch
from
khalidM3: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
lab-khalid #10
Changes from all commits
Commits
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 hidden or 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,3 @@ | ||
{ | ||
"presets": ["es2015"] | ||
} |
This file contains hidden or 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,21 @@ | ||
{ | ||
"rules": { | ||
"no-console": "off", | ||
"indent": [ "error", 2 ], | ||
"quotes": [ "error", "single" ], | ||
"semi": ["error", "always"], | ||
"linebreak-style": [ "error", "unix" ] | ||
}, | ||
"env": { | ||
"es6": true, | ||
"node": true, | ||
"mocha": true, | ||
"jasmine": true | ||
}, | ||
"ecmaFeatures": { | ||
"modules": true, | ||
"experimentalObjectRestSpread": true, | ||
"impliedStrict": true | ||
}, | ||
"extends": "eslint:recommended" | ||
} |
This file contains hidden or 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,30 @@ | ||
# Created by https://www.gitignore.io/api/node,vim,macos,linux,windows | ||
.DS_Store | ||
node_modules/ | ||
.env | ||
### Node ### | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# node-waf configuration | ||
.lock-wscript |
This file contains hidden or 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 @@ | ||
'use strict'; | ||
|
||
require('./scss/reset.scss'); | ||
require('./scss/main.scss'); | ||
|
||
const | ||
angular = require('angular'), | ||
cowsay = require('cowsay-browser'), | ||
|
||
cowsayApp = angular.module('cowsayApp', []); | ||
|
||
cowsayApp.controller('CowsayController', ['$log', CowsayController]); | ||
|
||
function CowsayController($log){ | ||
$log.debug('CowsayController'); | ||
|
||
this.title = 'Welcome to Cowville'; | ||
this.history = []; | ||
|
||
cowsay.list((err, cowfiles) => { | ||
this.cowfiles = cowfiles; | ||
this.current = this.cowfiles[0]; | ||
}); | ||
|
||
this.update = function(input){ | ||
$log.debug('CowsayController.update()'); | ||
|
||
return cowsay.say({ text: input || 'MOOOOOOOOOOOOO!' ,f: this.current }); | ||
}; | ||
|
||
this.speak = function(input) { | ||
$log.debug('CowsayController.speak()'); | ||
|
||
this.spoken = this.update(input); | ||
this.history.push(this.spoken); | ||
}; | ||
|
||
this.undo = function(){ | ||
$log.debug('CowsayController.undo()'); | ||
|
||
this.history.pop(); | ||
this.spoken = this.history.pop() || ''; | ||
}; | ||
} | ||
|
||
cowsayApp.controller('NavController', ['$log', NavController]); | ||
|
||
function NavController($log) { | ||
$log.debug('NavController'); | ||
|
||
this.routes = [ | ||
{ | ||
name: 'home', | ||
url: '/' | ||
}, | ||
{ | ||
name: 'about', | ||
url: '/about' | ||
}, | ||
{ | ||
name: 'contact', | ||
url: '/contact' | ||
} | ||
]; | ||
} |
This file contains hidden or 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,52 @@ | ||
<!DOCTYPE html> | ||
<html ng-app="cowsayApp"> | ||
<head> | ||
<title>WELCOME TO COWVILLE</title> | ||
</head> | ||
<body> | ||
|
||
<header> | ||
<nav ng-controller="NavController as navCtrl"> | ||
<ul> | ||
<li ng-repeat="route in navCtrl.routes"> | ||
<a href="{{link.url}}"> {{ route.name }} </a> | ||
</li> | ||
</ul> | ||
</nav> | ||
</header> | ||
|
||
<main> | ||
<section | ||
class="container" | ||
ng-controller="CowsayController as cowsayCtrl" | ||
ng-init="cowsayCtrl.current = 'squirrel'"> | ||
<h2> {{ cowsayCtrl.title }} </h2> | ||
|
||
<pre class="cow"> | ||
{{ cowsayCtrl.update(cowsayCtrl.text) }} | ||
</pre> | ||
|
||
<form | ||
ng-submit="cowsayCtrl.speak(cowsayCtrl.text)" | ||
name="cowsayForm" | ||
novalidate> | ||
<select ng-model="cowsayCtrl.current"> | ||
<option ng-repeat="cowfile in cowsayCtrl.cowfiles" value="{{ cowfile }}"> | ||
{{ cowfile }} | ||
</option> | ||
</select> | ||
|
||
<input type="text" ng-model="cowsayCtrl.text" required> | ||
<button type="submit">SPEAK</button> | ||
|
||
<div ng-show="cowsayCtrl.spoken" class="history"> | ||
<pre> | ||
{{ cowsayCtrl.spoken }} | ||
</pre> | ||
<button type="button" ng-click="cowsayCtrl.undo()">UNDO</button> | ||
</div> | ||
</form> | ||
</section> | ||
</main> | ||
</body> | ||
</html> |
This file contains hidden or 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 @@ | ||
$custom: black; | ||
|
||
nav { | ||
background-color: $custom; | ||
color: slategray; | ||
ul{ | ||
// display: inline-block; | ||
margin-left: 50%; | ||
} | ||
li{ | ||
display: inline-block; | ||
// margin-left: 20%; | ||
padding: 0 10% 5% 0; | ||
} | ||
a { | ||
text-decoration: none; | ||
color: slategrey; | ||
} | ||
} | ||
|
||
h2 { | ||
font-size: 2vw; | ||
} | ||
pre { | ||
display: inline-block; | ||
border: 2px solid black; | ||
} | ||
|
||
.first{ | ||
display: inline-block; | ||
background-color: dodgerblue; | ||
} | ||
form{ | ||
display: inline; | ||
border: 1px solid black; | ||
aside{ | ||
display: inline-block; | ||
margin-top: -200px; | ||
width: 30%; | ||
height: 20vw; | ||
background-color: crimson; | ||
} | ||
} | ||
|
||
|
||
|
||
|
This file contains hidden or 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,48 @@ | ||
/* http://meyerweb.com/eric/tools/css/reset/ | ||
v2.0 | 20110126 | ||
License: none (public domain) | ||
*/ | ||
|
||
html, body, div, span, applet, object, iframe, | ||
h1, h2, h3, h4, h5, h6, p, blockquote, pre, | ||
a, abbr, acronym, address, big, cite, code, | ||
del, dfn, em, img, ins, kbd, q, s, samp, | ||
small, strike, strong, sub, sup, tt, var, | ||
b, u, i, center, | ||
dl, dt, dd, ol, ul, li, | ||
fieldset, form, label, legend, | ||
table, caption, tbody, tfoot, thead, tr, th, td, | ||
article, aside, canvas, details, embed, | ||
figure, figcaption, footer, header, hgroup, | ||
menu, nav, output, ruby, section, summary, | ||
time, mark, audio, video { | ||
margin: 0; | ||
padding: 0; | ||
border: 0; | ||
font-size: 100%; | ||
font: inherit; | ||
vertical-align: baseline; | ||
} | ||
/* HTML5 display-role reset for older browsers */ | ||
article, aside, details, figcaption, figure, | ||
footer, header, hgroup, menu, nav, section { | ||
display: block; | ||
} | ||
body { | ||
line-height: 1; | ||
} | ||
ol, ul { | ||
list-style: none; | ||
} | ||
blockquote, q { | ||
quotes: none; | ||
} | ||
blockquote:before, blockquote:after, | ||
q:before, q:after { | ||
content: ''; | ||
content: none; | ||
} | ||
table { | ||
border-collapse: collapse; | ||
border-spacing: 0; | ||
} |
This file contains hidden or 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,72 @@ | ||
// Karma configuration | ||
// Generated on Wed Mar 22 2017 17:18:36 GMT-0700 (PDT) | ||
const webpackconfig = require('./webpack.config.js'); | ||
webpackconfig.entry = {}; | ||
|
||
module.exports = function(config) { | ||
config.set({ | ||
webpack: webpackconfig, | ||
// 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: [ | ||
'test/**/*-test.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/**/*-test.js': ['webpack'] | ||
}, | ||
|
||
|
||
// test results reporter to use | ||
// possible values: 'dots', 'progress' | ||
// available reporters: https://npmjs.org/browse/keyword/karma-reporter | ||
reporters: ['mocha'], | ||
|
||
|
||
// 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, | ||
|
||
// Concurrency level | ||
// how many browser should be started simultaneous | ||
concurrency: Infinity | ||
}) | ||
} |
This file contains hidden or 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,41 @@ | ||
{ | ||
"name": "testing-controllers-demo", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "karma.conf.js", | ||
"scripts": { | ||
"build": "./node_modules/webpack/bin/webpack.js", | ||
"watch": "./node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot", | ||
"test-watch": "./node_modules/karma/bin/karma start", | ||
"test": "./node_modules/karma/bin/karma start --single-run" | ||
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. "lint": "./node_modules/eslint/bin/eslint.js ./**/*.js" missing your lint script |
||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC", | ||
"dependencies": { | ||
"angular": "^1.6.1", | ||
"babel-core": "^6.21.0", | ||
"babel-loader": "^6.2.10", | ||
"babel-preset-es2015": "^6.18.0", | ||
"cowsay-browser": "^1.1.8", | ||
"css-loader": "^0.26.1", | ||
"extract-text-webpack-plugin": "^1.0.1", | ||
"file-loader": "^0.9.0", | ||
"html-webpack-plugin": "^2.26.0", | ||
"node-sass": "^4.3.0", | ||
"sass-loader": "^4.1.1", | ||
"style-loader": "^0.13.1", | ||
"url-loader": "^0.5.7", | ||
"webpack": "^1.14.0" | ||
}, | ||
"devDependencies": { | ||
"angular-mocks": "^1.6.1", | ||
"jasmine-core": "^2.5.2", | ||
"karma": "^1.4.0", | ||
"karma-jasmine": "^1.1.0", | ||
"karma-mocha-reporter": "^2.2.3", | ||
"karma-phantomjs-launcher": "^1.0.2", | ||
"karma-webpack": "^2.0.1", | ||
"webpack-dev-server": "^1.16.2" | ||
} | ||
} |
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.
##Build
build/
make sure to ignore the build folder