Commit 4870c0c1 authored by mdsecurity's avatar mdsecurity

removing a lot of the logic

until the api is done
parent c0bd342a
......@@ -41,4 +41,5 @@ Thumbs.db
#random stuff
scraper.js
results.json
\ No newline at end of file
results.json
dummy-results.json
\ No newline at end of file
{
"vsicons.presets.angular": true
}
\ No newline at end of file
......@@ -3,7 +3,7 @@
This project was generated with [angular-cli](https://github.com/angular/angular-cli) version 1.0.0-beta.26.
## 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.
Run `ng serve` for a dev server. Navigate to [http://localhost:4200/](https://github.com/angular/angular-cli). The app will automatically reload if you change any of the source files.
## Code scaffolding
......
No preview for this file type
[
{
"title": "Wing Zone",
"date_modified": "2017-02-04T00:38:21.126Z",
"date_modified": "2017-02-04T18:49:00.869Z",
"location": "Fairfax Campus, The Hub",
"operation_hours": [
{
......@@ -99,7 +99,7 @@
},
{
"title": "Panera Bread",
"date_modified": "2017-02-04T00:38:21.126Z",
"date_modified": "2017-02-04T18:49:00.869Z",
"location": "Fairfax Campus, Johnson Center",
"operation_hours": [
{
......@@ -197,7 +197,7 @@
},
{
"title": "Panda Express",
"date_modified": "2017-02-04T00:38:21.126Z",
"date_modified": "2017-02-04T18:49:00.869Z",
"location": "Fairfax Campus, Merten Hall",
"operation_hours": [
{
......@@ -295,7 +295,7 @@
},
{
"title": "Manhattan Pizza",
"date_modified": "2017-02-04T00:38:21.126Z",
"date_modified": "2017-02-04T18:49:00.869Z",
"location": "Fairfax Campus, Merten Hall",
"operation_hours": [
{
......@@ -393,7 +393,7 @@
},
{
"title": "Argo Tea",
"date_modified": "2017-02-04T00:38:21.126Z",
"date_modified": "2017-02-04T18:49:00.869Z",
"location": "Fairfax Campus, Fenwick Library",
"operation_hours": [
{
......@@ -491,7 +491,7 @@
},
{
"title": "Taco Bell",
"date_modified": "2017-02-04T00:38:21.126Z",
"date_modified": "2017-02-04T18:49:00.869Z",
"location": "Fairfax Campus, SUB I",
"operation_hours": [
{
......@@ -577,7 +577,7 @@
},
{
"title": "Subway",
"date_modified": "2017-02-04T00:38:21.126Z",
"date_modified": "2017-02-04T18:49:00.869Z",
"location": "Fairfax Campus, Rogers Hall",
"operation_hours": [
{
......@@ -675,7 +675,7 @@
},
{
"title": "Star Ginger",
"date_modified": "2017-02-04T00:38:21.126Z",
"date_modified": "2017-02-04T18:49:00.869Z",
"location": "Fairfax Campus, Johnson Center",
"operation_hours": [
{
......@@ -773,7 +773,7 @@
},
{
"title": "Starbucks",
"date_modified": "2017-02-04T00:38:21.126Z",
"date_modified": "2017-02-04T18:49:00.869Z",
"location": "Fairfax Campus, Northern Neck",
"operation_hours": [
{
......@@ -829,7 +829,7 @@
},
{
"title": "Starbucks",
"date_modified": "2017-02-04T00:38:21.126Z",
"date_modified": "2017-02-04T18:49:00.869Z",
"location": "Fairfax Campus, Johnson Center",
"operation_hours": [
{
......@@ -927,7 +927,7 @@
},
{
"title": "Southside",
"date_modified": "2017-02-04T00:38:21.126Z",
"date_modified": "2017-02-04T18:49:00.869Z",
"location": "Fairfax Campus, Southside",
"operation_hours": [
{
......@@ -1025,7 +1025,7 @@
},
{
"title": "Simply To Go",
"date_modified": "2017-02-04T00:38:21.126Z",
"date_modified": "2017-02-04T18:49:00.869Z",
"location": "Fairfax Campus, SUB I",
"operation_hours": [
{
......@@ -1111,7 +1111,7 @@
},
{
"title": "Second Stop Patriot Shop",
"date_modified": "2017-02-04T00:38:21.126Z",
"date_modified": "2017-02-04T18:49:00.869Z",
"location": "Fairfax Campus, Rogers Hall",
"operation_hours": [
{
......@@ -1209,7 +1209,7 @@
},
{
"title": "Red Hot & Blue",
"date_modified": "2017-02-04T00:38:21.126Z",
"date_modified": "2017-02-04T18:49:00.869Z",
"location": "Fairfax Campus, Johnson Center",
"operation_hours": [
{
......@@ -1307,7 +1307,7 @@
},
{
"title": "Rathskeller",
"date_modified": "2017-02-04T00:38:21.126Z",
"date_modified": "2017-02-04T18:49:00.869Z",
"location": "Fairfax Campus, SUB I",
"operation_hours": [
{
......@@ -1393,7 +1393,7 @@
},
{
"title": "Randall's Cafe",
"date_modified": "2017-02-04T00:38:21.126Z",
"date_modified": "2017-02-04T18:49:00.869Z",
"location": "SciTech (Prince William Campus)",
"operation_hours": [
{
......@@ -1479,7 +1479,7 @@
},
{
"title": "Peet's Coffee",
"date_modified": "2017-02-04T00:38:21.126Z",
"date_modified": "2017-02-04T18:49:00.869Z",
"location": "Fairfax Campus, Innovation Hall",
"operation_hours": [
{
......@@ -1559,7 +1559,7 @@
},
{
"title": "Peet's Coffee",
"date_modified": "2017-02-04T00:38:21.126Z",
"date_modified": "2017-02-04T18:49:00.869Z",
"location": "Fairfax Campus, Exploratory Hall",
"operation_hours": [
{
......@@ -1645,7 +1645,7 @@
},
{
"title": "One Stop Patriot Shop",
"date_modified": "2017-02-04T00:38:21.126Z",
"date_modified": "2017-02-04T18:49:00.869Z",
"location": "Fairfax Campus, Blue Ridge",
"operation_hours": [
{
......@@ -1743,7 +1743,7 @@
},
{
"title": "Jorge's",
"date_modified": "2017-02-04T00:38:21.126Z",
"date_modified": "2017-02-04T18:49:00.869Z",
"location": "Fairfax Campus, Johnson Center",
"operation_hours": [
{
......@@ -1829,7 +1829,7 @@
},
{
"title": "IndAroma",
"date_modified": "2017-02-04T00:38:21.126Z",
"date_modified": "2017-02-04T18:49:00.869Z",
"location": "Fairfax Campus, Johnson Center",
"operation_hours": [
{
......@@ -1927,7 +1927,7 @@
},
{
"title": "Ike's",
"date_modified": "2017-02-04T00:38:21.126Z",
"date_modified": "2017-02-04T18:49:00.869Z",
"location": "Fairfax Campus, President's Park",
"operation_hours": [
{
......@@ -1983,7 +1983,7 @@
},
{
"title": "The Globe",
"date_modified": "2017-02-04T00:38:21.126Z",
"date_modified": "2017-02-04T18:49:00.869Z",
"location": "Fairfax Campus, The Global Center",
"operation_hours": [
{
......@@ -2081,7 +2081,7 @@
},
{
"title": "Freshens",
"date_modified": "2017-02-04T00:38:21.126Z",
"date_modified": "2017-02-04T18:49:00.869Z",
"location": "Fairfax Campus, The RAC",
"operation_hours": [
{
......@@ -2167,7 +2167,7 @@
},
{
"title": "Freshens",
"date_modified": "2017-02-04T00:38:21.126Z",
"date_modified": "2017-02-04T18:49:00.869Z",
"location": "Fairfax Campus, Johnson Center",
"operation_hours": [
{
......@@ -2253,7 +2253,7 @@
},
{
"title": "Express",
"date_modified": "2017-02-04T00:38:21.126Z",
"date_modified": "2017-02-04T18:49:00.869Z",
"location": "Fairfax Campus, Johnson Center",
"operation_hours": [
{
......@@ -2351,7 +2351,7 @@
},
{
"title": "Einstein Bros. Bagels",
"date_modified": "2017-02-04T00:38:21.126Z",
"date_modified": "2017-02-04T18:49:00.869Z",
"location": "Fairfax Campus, Merten Hall",
"operation_hours": [
{
......@@ -2437,7 +2437,7 @@
},
{
"title": "Einstein Bros. Bagels",
"date_modified": "2017-02-04T00:38:21.126Z",
"date_modified": "2017-02-04T18:49:00.869Z",
"location": "Fairfax Campus, Engineering Building",
"operation_hours": [
{
......@@ -2523,7 +2523,7 @@
},
{
"title": "Chick Fil A",
"date_modified": "2017-02-04T00:38:21.126Z",
"date_modified": "2017-02-04T18:49:00.869Z",
"location": "Fairfax Campus, SUB I",
"operation_hours": [
{
......@@ -2609,7 +2609,7 @@
},
{
"title": "Burger King",
"date_modified": "2017-02-04T00:38:21.126Z",
"date_modified": "2017-02-04T18:49:00.869Z",
"location": "Fairfax Campus, Johnson Center",
"operation_hours": [
{
......@@ -2707,7 +2707,7 @@
},
{
"title": "Au Bon Pain",
"date_modified": "2017-02-04T00:38:21.126Z",
"date_modified": "2017-02-04T18:49:00.869Z",
"location": "Arlington Campus",
"operation_hours": [
{
......
......@@ -23,26 +23,15 @@ var x = Xray({
};
if (match.closed !== undefined) {
op_hours_obj.is_closed = true;
operation_hours.push(op_hours_obj);
}
else if (match.all_day !== undefined) {
operation_hours.push({
"special_status": "",
"is_closed": false,
"open_all_day": true,
"open_time": false,
"close_time": false
});
op_hours_obj.open_all_day = true;
}
else {
operation_hours.push({
"special_status": "",
"is_closed": false,
"open_all_day": false,
"open_time": to_24_hour_arr(Number(match.open_hour), Number(match.open_minute), match.open_ampm),
"close_time": to_24_hour_arr(Number(match.close_hour), Number(match.close_minute), match.close_ampm)
});
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;
}
......@@ -61,7 +50,7 @@ x('http://dining.gmu.edu/dining-choices/hours-of-operation/', {
obj.title[i] = obj.title[i].replace(obj.location[i], '');
var entry = {
title: obj.title[i].trim(),
date_modified: new Date(),
date_modified: (new Date()).toISOString(),
location: obj.location[i].trim(),
operation_hours: obj.operation_hours[i]
};
......
......@@ -14,6 +14,7 @@ let x = Xray({
filters: {
parse_op_hrs: function (value) {
let operation_hours = [];
XRegExp.forEach(value, time, (match) => {
let op_hours_obj = {
"special_status": "",
......@@ -34,7 +35,7 @@ let x = Xray({
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);
});
......@@ -57,7 +58,7 @@ x('http://dining.gmu.edu/dining-choices/hours-of-operation/', {
obj.title[i] = obj.title[i].replace(obj.location[i], '');
let entry = {
title: obj.title[i].trim(),
date_modified: new Date(),
date_modified: (new Date()).toISOString(),
location: obj.location[i].trim(),
operation_hours: obj.operation_hours[i]
}
......
@import "color-palette";
@import "text-styles";
.light-card {
background-color: $white;
border-radius: 4px;
border-width: 1px;
border-style: solid;
border-color: $border-color;
}
\ No newline at end of file
@import "color-palette";
// @import "color-palette";
/* Text styles */
.selected-nav {
......
......@@ -13,6 +13,7 @@ import { SafeUrlPipe } from './safe-url.pipe';
import { PlaceWindowComponent } from './place-window/place-window.component';
import { PlaceCardComponent } from './place-window/area/place-card/place-card.component';
import { AreaComponent } from './place-window/area/area.component';
import { FilterBarComponent } from './filter-bar/filter-bar.component';
@NgModule({
declarations: [
AppComponent,
......@@ -24,7 +25,9 @@ import { AreaComponent } from './place-window/area/area.component';
SafeUrlPipe,
PlaceWindowComponent,
PlaceCardComponent,
AreaComponent
AreaComponent,
FilterBarComponent,
FilterBarComponent
],
imports: [
BrowserModule,
......
@import '../../color-palette';
@import '../../text-styles';
@import '../../global-styles';
.context-bar {
height: 100%;
......@@ -10,13 +10,6 @@
box-sizing: content-box;
}
.light-card {
background-color: $white;
border-radius: 4px;
border-width: 1px;
border-style: solid;
border-color: $border-color;
}
.image{
width: 77.8px;
height: 82.7px;
......
<div class="light-card flter-bar">
</div>
\ No newline at end of file
@import '../../global-styles';
.filter-bar{
width: 176.48px;
}
\ No newline at end of file
/* tslint:disable:no-unused-variable */
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { DebugElement } from '@angular/core';
import { FilterBarComponent } from './filter-bar.component';
describe('FilterBarComponent', () => {
let component: FilterBarComponent;
let fixture: ComponentFixture<FilterBarComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ FilterBarComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(FilterBarComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-filter-bar',
templateUrl: './filter-bar.component.html',
styleUrls: ['./filter-bar.component.scss']
})
export class FilterBarComponent implements OnInit {
constructor() { }
ngOnInit() {
}
}
@import '../../../../color-palette';
@import '../../../../global-styles';
.place-card {
width: 199px;
height: 111px;
......@@ -8,14 +8,6 @@
box-sizing: content-box;
}
.light-card {
background-color: $white;
border-radius: 4px;
border-width: 1px;
border-style: solid;
border-color: $border-color;
}
.place-picture {
height: 84px;
width: 84px;
......@@ -50,7 +42,7 @@
margin:0px;
margin-top: 0px;
margin-bottom: 0px;
}
}
.status-text {
margin-left: 3px;
height:11px;
......@@ -79,8 +71,9 @@
.star-icon{
color:$primary;
align-self: flex-end;
margin-right: 3px;
margin-bottom: 10px;
margin-right: 4px;
margin-top:4px;
margin-bottom: 6px;
}
.place-info-block{
display: flex;
......
......@@ -13,33 +13,33 @@ export class PlaceCardComponent implements OnInit {
constructor() { }
ngOnInit() {
let t1 = new Date();
let t2 = new Date();
let weekStartTimes: Date[] = [];
let weekEndTimes: Date[] = [];
let weekOpenTimes: number[][] = [];
let weekCloseTimes: number[][] = [];
for (let i = 0; i < 7; i++) {
t1 = new Date();
t2 = new Date();
t1.setDate(5 + Math.random() * 6);
t1.setHours((Math.random() * 10) + 1);
t2.setHours((Math.random() * 10) + 13);
weekStartTimes.push(t1);
weekEndTimes.push(t2);
const hour1 = Math.floor(Math.random() * 24);
const minute1 = Math.floor(Math.random() * 60);
const hour2 = Math.floor(Math.random() * 24);
const minute2 = Math.floor(Math.random() * 60);
weekOpenTimes.push([hour1, minute1]);
weekCloseTimes.push([hour2, minute2]);
}
this.place = new Place('Burger King', weekStartTimes,
weekEndTimes, 'picture: string', 'open', 'The Johnson Center');
let todaysDate = this.place[new Date().getDay()];
console.log(todaysDate);
this.place = new Place('Burger King', weekOpenTimes,
weekCloseTimes, 'picture: string', 'The Johnson Center');
if (this.place.status === 'open') {
this.status = 'OPEN';
} else {
this.status = 'CLOSED';
}
}
//if t1 is bigger than t2 it returns true ;
private time_between = function (t1: number[], t2: number[]): boolean {
// multiplying hours by 60 and adding minutes
const t1_minutes = t1[0] * 60 + t1[1];
const t2_minutes = t2[0] * 60 + t2[1];
}
}
if (t1_minutes > t2_minutes) {
return true;
}
return false;
}
}
\ No newline at end of file
......@@ -2,20 +2,20 @@
export class Place {
name: string;
picture: string;
status: string;
startTimes: Date[];
endTimes: Date[];
openTimes: number[][];
closeTimes: number[][];
location: string;
constructor(name: string, startTimes: Date[],
endTimes: Date[], picture: string, status: string, location: string) {
constructor(name: string, openTimes: number[][],
closeTimes: number[][], picture: string, location: string) {
this.name = name;
this.startTimes = startTimes;
this.endTimes = endTimes;
this.openTimes = openTimes;
this.closeTimes = closeTimes;
this.picture = picture;
this.status = status;
this.location = location;
}
}
}
/* You can add global styles to this file, and also import other style files */
......@@ -10,5 +10,8 @@ html {
body {
height: inherit;
background-color: $background-color;
background-image: url("/assets/clock.png");
background-repeat: repeat;
margin: 0px;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment