Skip to content

Tue lab gl #20

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
wants to merge 5 commits into
base: master
Choose a base branch
from
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
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["es2015"]
}
22 changes: 22 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"rules": {
"no-console": "off",
"indent": [ "error", 2 ],
"quotes": [ "error", "single" ],
"semi": ["error", "always"],
"linebreak-style": [ "error", "unix" ],
# "linebreak-style": [ "error", "windows"]
},
"env": {
"es6": true,
"node": true,
"mocha": true,
"jasmine": true
},
"ecmaFeatures": {
"modules": true,
"experimentalObjectRestSpread": true,
"impliedStrict": true
},
"extends": "eslint:recommended"
}
125 changes: 125 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@

# Created by https://www.gitignore.io/api/monodevelop,vim,node,windows,archlinuxpackages

### ArchLinuxPackages ###
*.tar
*.tar.*
*.jar
*.exe
*.msi
*.zip
*.tgz
*.log
*.log.*
*.sig

pkg/
src/

### MonoDevelop ###
#User Specific
*.userprefs
*.usertasks

#Mono Project Files
*.pidb
*.resources
test-results/

### Node ###
# Logs
logs
npm-debug.log*
yarn-debug.log*
yarn-error.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

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Typescript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env


### Vim ###
# swap
[._]*.s[a-v][a-z]
[._]*.sw[a-p]
[._]s[a-v][a-z]
[._]sw[a-p]
# session
Session.vim
# temporary
.netrwhist
*~
# auto-generated tag files
tags

### Windows ###
# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msm
*.msp

# Windows shortcuts
*.lnk

#temp hide of public folder
public/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

##Build

build/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job on the CSS

# End of https://www.gitignore.io/api/monodevelop,vim,node,windows,archlinuxpackages
61 changes: 61 additions & 0 deletions app/entry.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
'use strict';

require('./scss/reset.scss');
require('./scss/main.scss');

const angular = require('angular');
const cowsay = require('cowsay-browser');

const 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('cowsayCtrl.update()');
return cowsay.say({ text: input || 'moooooooo', f: this.current });
};

this.speak = function(input) {
$log.debug('cowsayCtrl.speak()');
this.spoken = this.update(input);
this.history.push(this.spoken);
};

this.undo = function() {
$log.debug('cowsayCtrl.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: '/home'
},
{
name: 'about',
url: '/about-us'
},
{
name: 'contact',
url: '/contact-us'
}
];
};
67 changes: 67 additions & 0 deletions app/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<!DOCTYPE html>
<html ng-app="cowsayApp">
<head>
<title>Welcome to Cowville!</title>
</head>
<body>
<header>
<nav ng-controller="NavController as navCtrl">
<h1>cowcontrol.io</h1>
<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'">

<div class="cowfield">
<div class="describe">
<span class="largetitle">cow creator</span>
<span class="smalltitle">make it, view it, and undo it!</span>
</div>
<pre class="cow">
{{ cowsayCtrl.update(cowsayCtrl.text) }}
</pre>
</div>

<form
ng-submit="cowsayCtrl.speak(cowsayCtrl.text)"
name="cowsayForm"
no validate>
<select class="selector" ng-model="cowsayCtrl.current">
<option ng-repeat="cowfile in cowsayCtrl.cowfiles" value="{{ cowfile }}">
{{ cowfile }}
</option>
</select>

<input class="selector" type="text" ng-model="cowsayCtrl.text" required>
<button class="selector" type="submit">Speak!</button>

<div class="line"></div>

<div class="cowfield">
<div ng-show="cowsayCtrl.spoken" class="history" >
<div class="describe">
<span class="largetitle">view it!</span>
<span class="smalltitle">check out the cow you just made!</span>
</div>
<pre>
{{ cowsayCtrl.spoken }}
</pre>
</div>
</div>
<button class="selector" type="button" ng-click="cowsayCtrl.undo()">undo this cow!</button>

</form>
</section>
</main>
<footer></footer>
</body>
</html>
Empty file added app/index2.html
Empty file.
Loading