Commit f2da6559 authored by Mattias J Duffy's avatar Mattias J Duffy

cleaning out master

parent 6e818728
# Editor configuration, see http://editorconfig.org
root = true
[*]
charset = utf-8
indent_style = tabs
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
max_line_length = off
trim_trailing_whitespace = false
# See http://help.github.com/ignore-files/ for more about ignoring files.
# compiled output
/dist
/tmp
# dependencies
/node_modules
# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
# misc
/.sass-cache
/connect.lock
/coverage/*
/libpeerconnection.log
npm-debug.log
testem.log
/typings
# e2e
/e2e/*.js
/e2e/*.map
#System Files
.DS_Store
Thumbs.db
#random stuff
scraper.js
results.json
dummy-results.json
*.swp
\ No newline at end of file
{
"vsicons.presets.angular": true
}
\ No newline at end of file
# Contributor Code of Conduct
## Version 0.3a-angular
As contributors and maintainers of the What's Open project, we pledge to respect everyone who contributes by posting issues, updating documentation, submitting pull requests, providing feedback in comments, and any other activities.
Communication through any of What's Open's channels (GitLab, IRC, mailing lists, Google+, Twitter, etc.) must be constructive and never resort to personal attacks, trolling, public or private harrassment, insults, or other unprofessional conduct.
We promise to extend courtesy and respect to everyone involved in this project regardless of gender, gender identity, sexual orientation, disability, age, race, ethnicity, religion, or level of experience. We expect anyone contributing to the Angular project to do the same.
If any member of the community violates this code of conduct, the maintainers of the Angular project may take action, removing issues, comments, and PRs or blocking accounts as deemed appropriate.
If you are subject to or witness unacceptable behavior, or have any other concerns, please email us at [conduct@angularjs.org](mailto:coc@angularjs.org).
This diff is collapsed.
# WhatsOpenA2
This project was generated with [angular-cli](https://github.com/angular/angular-cli) version 1.0.0-beta.28.3.
## Development server
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
## Code scaffolding
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive/pipe/service/class/module`.
## Build
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.
## Running unit tests
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
## Running end-to-end tests
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
Before running the tests make sure you are serving the app via `ng serve`.
## Deploying to GitHub Pages
Run `ng github-pages:deploy` to deploy to GitHub Pages.
## Further help
To get more help on the `angular-cli` use `ng help` or go check out the [Angular-CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"project": {
"version": "1.0.0-rc.4",
"name": "whats-open-web"
},
"apps": [
{
"root": "src",
"outDir": "dist",
"assets": [
"assets",
"favicon.ico"
],
"index": "index.html",
"main": "main.ts",
"polyfills": "polyfills.ts",
"test": "test.ts",
"tsconfig": "tsconfig.json",
"prefix": "app",
"styles": [
"styles.scss",
"../node_modules/@angular/material/core/theming/prebuilt/indigo-pink.css"
],
"scripts": [
],
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts"
}
}
],
"e2e": {
"protractor": {
"config": "./protractor.conf.js"
}
},
"lint": [
{
"files": "src/**/*.ts",
"project": "src/tsconfig.json"
},
{
"files": "e2e/**/*.ts",
"project": "e2e/tsconfig.json"
}
],
"test": {
"karma": {
"config": "./karma.conf.js"
}
},
"defaults": {
"styleExt": "scss",
"prefixInterfaces": false,
"inline": {
"style": false,
"template": false
},
"spec": {
"class": false,
"component": true,
"directive": true,
"module": false,
"pipe": true,
"service": true
}
}
}
import { WhatsOpenA2Page } from './app.po';
describe('whats-open-a2 App', function() {
let page: WhatsOpenA2Page;
beforeEach(() => {
page = new WhatsOpenA2Page();
});
it('should display message saying app works', () => {
page.navigateTo();
expect(page.getParagraphText()).toEqual('app works!');
});
});
import { browser, element, by } from 'protractor';
export class WhatsOpenA2Page {
navigateTo() {
return browser.get('/');
}
getParagraphText() {
return element(by.css('app-root h1')).getText();
}
}
{
"compileOnSave": false,
"compilerOptions": {
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"module": "commonjs",
"moduleResolution": "node",
"outDir": "../dist/out-tsc-e2e",
"sourceMap": true,
"target": "es5",
"typeRoots": [
"../node_modules/@types"
]
}
}
// Karma configuration file, see link for more information
// https://karma-runner.github.io/0.13/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', 'angular-cli'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-remap-istanbul'),
require('angular-cli/plugins/karma')
],
files: [
{ pattern: './src/test.ts', watched: false }
],
preprocessors: {
'./src/test.ts': ['angular-cli']
},
mime: {
'text/x-typescript': ['ts','tsx']
},
remapIstanbulReporter: {
reports: {
html: 'coverage',
lcovonly: './coverage/coverage.lcov'
}
},
angularCli: {
config: './angular-cli.json',
environment: 'dev'
},
reporters: config.angularCli && config.angularCli.codeCoverage
? ['progress', 'karma-remap-istanbul']
: ['progress'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false
});
};
{
"name": "whats-open-web",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/common": "^4.0.0",
"@angular/compiler": "^4.0.0",
"@angular/core": "^4.0.0",
"@angular/forms": "^4.0.0",
"@angular/http": "^4.0.0",
"@angular/platform-browser": "^4.0.0",
"@angular/platform-browser-dynamic": "^4.0.0",
"@angular/router": "^4.0.0",
"core-js": "^2.4.1",
"rxjs": "^5.1.0",
"zone.js": "^0.8.4"
},
"devDependencies": {
"@angular/cli": "1.0.0",
"@angular/compiler-cli": "^4.0.0",
"@types/jasmine": "2.5.38",
"@types/node": "~6.0.60",
"codelyzer": "~2.0.0",
"jasmine-core": "~2.5.2",
"jasmine-spec-reporter": "~3.2.0",
"karma": "~1.4.1",
"karma-chrome-launcher": "~2.0.0",
"karma-cli": "~1.0.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"karma-coverage-istanbul-reporter": "^0.2.0",
"protractor": "~5.1.0",
"ts-node": "~2.0.0",
"tslint": "~4.5.0",
"typescript": "~2.2.0"
}
}
{
"name": "Burger King",
"location": "The Johnson Center",
"date_modified": "2015-08-31T16:52:09.600Z",
"phone_number": "703-121-3212",
"tap_n_go_link": "https://www.tapingo.com/order/restaurant/starbucks-gmu/",
"tags": ["vegan", "mexican"],
"address": "4335 Chesapeake River Way Fairfax, Virginia",
"geojson": {
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [125.6, 10.1]
},
"properties": {
"name": "Dinagat Islands"
}
},
"operation_hours": [{
"special_status": false,
"is_closed": false,
"open_all_day": false,
"open_time": [9, 40],
"close_time": [14, 30]
},
{
"special_status": "Closed for Construction",
"is_closed": true,
"open_all_day": false,
"open_time": false,
"close_time": false
},
{
"special_status": false,
"is_closed": false,
"open_all_day": true,
"open_time": false,
"close_time": false
},
{
"special_status": false,
"is_closed": false,
"open_all_day": false,
"open_time": [9, 40],
"close_time": [14, 30]
},
{
"special_status": false,
"is_closed": false,
"open_all_day": false,
"open_time": [9, 40],
"close_time": [14, 30]
},
{
"special_status": false,
"is_closed": false,
"open_all_day": false,
"open_time": [9, 40],
"close_time": [14, 30]
},
{
"special_status": false,
"is_closed": false,
"open_all_day": false,
"open_time": [9, 40],
"close_time": [14, 30]
}
]
}
// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts
/*global jasmine */
var SpecReporter = require('jasmine-spec-reporter');
exports.config = {
allScriptsTimeout: 11000,
specs: [
'./e2e/**/*.e2e-spec.ts'
],
capabilities: {
'browserName': 'chrome'
},
directConnect: true,
baseUrl: 'http://localhost:4200/',
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000,
print: function() {}
},
useAllAngular2AppRoots: true,
beforeLaunch: function() {
require('ts-node').register({
project: 'e2e'
});
},
onPrepare: function() {
jasmine.getEnv().addReporter(new SpecReporter());
}
};
var Xray = require('x-ray');
var fs = require('fs');
var XRegExp = require('xregexp');
var time = XRegExp('((?<closed> closed) | (?<all_day> 24(\\s?)*hours) | (?<open_hour> [01][0-9] ) : \n\
(?<open_minute> [0-9][0-9] ) (\\s?)* \n\
(?<open_ampm> [ap]m ) \n\
(\\s?)*\\W(\\s?)* \n\
(?<close_hour> [01][0-9] ) : \n\
(?<close_minute> [0-9][0-9] ) (\\s?)* \n\
(?<close_ampm> [ap]m )) ', 'ix');
// x-filters are like pipes in Angular 2. if you put a "| functionName" after data it runs that data through the funciton
var x = Xray({
filters: {
parse_op_hrs: function (value) {
var operation_hours = [];
XRegExp.forEach(value, time, function (match) {
var op_hours_obj = {
"special_status": "",
"is_closed": false,
"open_all_day": false,
"open_time": false,
"close_time": false
};
if (match.closed !== undefined) {
op_hours_obj.is_closed = true;
}
else if (match.all_day !== undefined) {
op_hours_obj.open_all_day = true;
}
else {
op_hours_obj.open_time = to_24_hour_arr(Number(match.open_hour), Number(match.open_minute), match.open_ampm);
op_hours_obj.close_time = to_24_hour_arr(Number(match.close_hour), Number(match.close_minute), match.close_ampm);
}
operation_hours.push(op_hours_obj);
});
return operation_hours;
}
}
});
// this is where xray scrapes the data and creates a json object out of it
x('http://dining.gmu.edu/dining-choices/hours-of-operation/', {
title: ['.storename'],
location: ['.location'],
operation_hours: ['.open-closed-sign | parse_op_hrs']
})(function (err, obj) {
var newObj = [];
for (var i = 0; i < obj.title.length; i++) {
// this next line fixes the problem with the .storename tag putting the title and location in
// the same string
obj.title[i] = obj.title[i].replace(obj.location[i], '');
var entry = {
title: obj.title[i].trim(),
date_modified: (new Date()).toISOString(),
location: obj.location[i].trim(),
operation_hours: obj.operation_hours[i]
};
newObj.unshift(entry);
}
fs.writeFile('results.json', JSON.stringify(newObj, null, "\t"), function (err) {
if (err) {
throw err;
}
});
});
var to_24_hour_arr = function (hour, minute, ampm) {
var new_hour;
(ampm === 'pm') ? new_hour = hour + 12 : new_hour = hour;
return [new_hour, minute];
};
let Xray = require('x-ray');
let fs = require('fs');
let XRegExp = require('xregexp');
let time = XRegExp('((?<closed> closed) | (?<all_day> 24(\\s?)*hours) | (?<open_hour> [01][0-9] ) : \n\
(?<open_minute> [0-9][0-9] ) (\\s?)* \n\
(?<open_ampm> [ap]m ) \n\
(\\s?)*\\W(\\s?)* \n\
(?<close_hour> [01][0-9] ) : \n\
(?<close_minute> [0-9][0-9] ) (\\s?)* \n\
(?<close_ampm> [ap]m )) ', 'ix');
// x-filters are like pipes in Angular 2. if you put a "| functionName" after data it runs that data through the funciton
let x = Xray({
filters: {
parse_op_hrs: function (value) {
let operation_hours = [];
XRegExp.forEach(value, time, (match) => {
let op_hours_obj = {
"special_status": "",
"is_closed": false,
"open_all_day": false,
"open_time": false,
"close_time": false
}
if (match.closed !== undefined) {
op_hours_obj.is_closed = true;
} else if (match.all_day !== undefined) {
op_hours_obj.open_all_day = true;
} else {
op_hours_obj.open_time = to_24_hour_arr(Number(match.open_hour), Number(match.open_minute), match.open_ampm);
op_hours_obj.close_time = to_24_hour_arr(Number(match.close_hour), Number(match.close_minute), match.close_ampm);
}
operation_hours.push(op_hours_obj);
});
return operation_hours;
}
}
});
// this is where xray scrapes the data and creates a json object out of it
x('http://dining.gmu.edu/dining-choices/hours-of-operation/', {
title: ['.storename'],
location: ['.location'],
operation_hours: ['.open-closed-sign | parse_op_hrs']
})
// this fixes the json so each element in the array has a title location and oparation hours
(function (err, obj) {
let newObj = [];
for (let i = 0; i < obj.title.length; i++) {
// this next line fixes the problem with the .storename tag putting the title and location in
// the same string
obj.title[i] = obj.title[i].replace(obj.location[i], '');
let entry = {
title: obj.title[i].trim(),
date_modified: (new Date()).toISOString(),
location: obj.location[i].trim(),
operation_hours: obj.operation_hours[i]
}
newObj.unshift(entry);
}
fs.writeFile('results.json', JSON.stringify(newObj, null, "\t"), function (err) {
if (err) { throw err; }
});
})
let to_24_hour_arr = function (hour, minute, ampm) {
let new_hour;
(ampm === 'pm') ? new_hour = hour + 12 : new_hour = hour;
return [new_hour, minute];
}
\ No newline at end of file
$white: #ffffff;
$primary: #354052;
$bluegrey: #7f8fa4;
$border-color: #e6eaee;
$pale-grey: #dfe3e9;
$background-color: #eff3f6;
$open-green:#3AC550;
$closed-grey:#C4B9B9;
$shadow-color:rgba(43,61,73,.15);
// $color-palette: (
// 'white' : #ffffff,
// 'primary' : #354052,
// 'bluegrey': #7f8fa4,
// 'border-color': #e6eaee,
// 'pale-grey': #dfe3e9,
// 'background-color': #eff3f6
// );
// @function get-color($key: 'primary') {
// @return map-get($color-palette, $key);
// }
// @function set-opacity($color: #ffffff , $opacity: 0) {
// // $color: color-palette($name);
// // Get the named opacity level, if it exists
// // @if map-key-exists($scotch-opacity, $opacity) {
// // $opacity: map-get($scotch-opacity, $opacity);
// // }
// // Use rgba() to manipulate the color's alpha level
// @return rgba($color, $opacity);
// }
\ No newline at end of file
@import "color-palette";
@import "text-styles";
.light-card {
background-color: $white;
border-radius: 4px;
border-width: 1px;
border-style: solid;
border-color: $border-color;
}
.shadows{
box-shadow: 12px 15px 20px 0px $shadow-color;
}
\ No newline at end of file
// @import "color-palette";
/* Text styles */
.selected-nav {
font-family: HelveticaNeue-Medium;
font-size: 14px;
font-weight: 500;
font-style: normal;
font-stretch: normal;
text-align: center;
color: $primary;
}
.deselected-nav {
font-family: HelveticaNeue-Medium;
font-size: 14px;
font-weight: 500;
font-style: normal;
font-stretch: normal;
text-align: center;
color: #9fa9ba;
}
.info-text {
font-family: HelveticaNeue-Medium;
font-size: 11px;
font-weight: 500;
font-style: normal;
font-stretch: normal;
text-align: left;
color: $primary;
}
.card-title {
font-family: HelveticaNeue-Medium;
font-size: 11px;
font-weight: 500;
font-style: normal;
font-stretch: normal;
line-height: 1.55;
text-align: center;
color: $primary;
}
.graph-x-axis {
font-family: HelveticaNeue;
font-size: 11px;
font-weight: normal;
font-style: normal;
font-stretch: normal;
text-align: center;
color: $primary;
}
.graph-y-axis {
font-family: HelveticaNeue;
font-size: 10px;
font-weight: normal;
font-style: normal;
font-stretch: normal;
text-align: right;