Add scheduleac

This commit is contained in:
Kenneth Jao 2024-10-24 02:27:50 -04:00
commit 1f80de1222
17 changed files with 712 additions and 0 deletions

1
scheduleac/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.out

View File

@ -0,0 +1,12 @@
# This file contains information which helps Meteor properly upgrade your
# app when you run 'meteor update'. You should check it into version control
# with your project.
notices-for-0.9.0
notices-for-0.9.1
0.9.4-platform-file
notices-for-facebook-graph-api-2
1.2.0-standard-minifiers-package
1.2.0-meteor-platform-split
1.2.0-cordova-changes
1.2.0-breaking-changes

1
scheduleac/.meteor/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
local

7
scheduleac/.meteor/.id Normal file
View File

@ -0,0 +1,7 @@
# This file contains a token that is unique to your project.
# Check it into your repository along with the rest of this directory.
# It can be used for purposes such as:
# - ensuring you don't accidentally deploy one app on top of another
# - providing package authors with aggregated statistics
19rhzs13b9azhvowgeq

View File

@ -0,0 +1,29 @@
# Meteor packages used by this project, one per line.
# Check this file (and the other files in this directory) into your repository.
#
# 'meteor add' and 'meteor remove' will edit this file for you,
# but you can also edit it by hand.
meteor-base # Packages every Meteor app needs to have
mobile-experience # Packages for a great mobile UX
mongo # The database Meteor supports right now
blaze-html-templates # Compile .html files into Meteor Blaze views
session # Client-side reactive dictionary for your app
jquery # Helpful client-side library
tracker # Meteor's client-side reactive programming library
standard-minifiers # JS/CSS minifiers run for production mode
es5-shim # ECMAScript 5 compatibility for older browsers.
ecmascript # Enable ECMAScript2015+ syntax in app code
autopublish # Publish all data to the clients (for prototyping)
insecure # Allow all DB writes from clients (for prototyping)
rajit:bootstrap3-datepicker
twbs:bootstrap
accounts-google
accounts-ui
ongoworks:security
percolate:synced-cron
momentjs:moment
fortawesome:fontawesome
mystor:device-detection

View File

@ -0,0 +1,2 @@
server
browser

View File

@ -0,0 +1 @@
METEOR@1.2.1

View File

@ -0,0 +1,86 @@
accounts-base@1.2.2
accounts-google@1.0.6
accounts-oauth@1.1.8
accounts-ui@1.1.6
accounts-ui-unstyled@1.1.8
autopublish@1.0.4
autoupdate@1.2.4
babel-compiler@5.8.24_1
babel-runtime@0.1.4
base64@1.0.4
binary-heap@1.0.4
blaze@2.1.3
blaze-html-templates@1.0.1
blaze-tools@1.0.4
boilerplate-generator@1.0.4
caching-compiler@1.0.0
caching-html-compiler@1.0.2
callback-hook@1.0.4
check@1.1.0
ddp@1.2.2
ddp-client@1.2.1
ddp-common@1.2.2
ddp-rate-limiter@1.0.0
ddp-server@1.2.2
deps@1.0.9
diff-sequence@1.0.1
ecmascript@0.1.6
ecmascript-runtime@0.2.6
ejson@1.0.7
es5-shim@4.1.14
fastclick@1.0.7
fortawesome:fontawesome@4.5.0
geojson-utils@1.0.4
google@1.1.7
hot-code-push@1.0.0
html-tools@1.0.5
htmljs@1.0.5
http@1.1.1
id-map@1.0.4
insecure@1.0.4
jquery@1.11.4
launch-screen@1.0.4
less@2.5.1
livedata@1.0.15
localstorage@1.0.5
logging@1.0.8
meteor@1.1.10
meteor-base@1.0.1
minifiers@1.1.7
minimongo@1.0.10
mobile-experience@1.0.1
mobile-status-bar@1.0.6
momentjs:moment@2.11.2
mongo@1.1.3
mongo-id@1.0.1
mystor:device-detection@0.2.0
npm-mongo@1.4.39_1
oauth@1.1.6
oauth2@1.1.5
observe-sequence@1.0.7
ongoworks:security@1.3.0
ordered-dict@1.0.4
percolate:synced-cron@1.3.0
promise@0.5.1
rajit:bootstrap3-datepicker@1.5.0
random@1.0.5
rate-limit@1.0.0
reactive-dict@1.1.3
reactive-var@1.0.6
reload@1.1.4
retry@1.0.4
routepolicy@1.0.6
service-configuration@1.0.5
session@1.1.1
spacebars@1.0.7
spacebars-compiler@1.0.7
standard-minifiers@1.0.2
templating@1.1.5
templating-tools@1.0.0
tracker@1.0.9
twbs:bootstrap@3.3.6
ui@1.0.8
underscore@1.0.4
url@1.0.5
webapp@1.2.3
webapp-hashing@1.0.5

4
scheduleac/README.md Normal file
View File

@ -0,0 +1,4 @@
# scheduleac
Website for tracking if AC/Health class is Health or AC
Live at http://actoday.tk/

View File

@ -0,0 +1,233 @@
@font-face {
font-family: 'Lato';
src: url('./lato-light.woff');
}
html {
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
}
body {
background-image: url('./bg.png');
overflow-x: hidden;
}
h1 {
font-family: Lato;
font-size: 300%;
margin-left: 4.2%;
}
.datepicker {
margin-top: 10.3%;
}
#date {
margin-top:4%;
margin-left: 3.5%;
max-width: 50%;
}
#other {
margin-top: 3%;
margin-bottom: 2%;
width: 89%;
margin-left: 3%;
padding-left:5%;
}
.selection {
font-size: 150%;
width: 35%;
min-height: 50%;
float: right;
margin-right: 8%;
}
#post {
margin-top: -18%;
}
#day {
margin-top: -4%;
}
#button {
margin-left: 3.5%;
margin-top: 3%;
font-size: 200%;
width: 88%;
color: #fff;
background-color: #DD655D;
border: 0;
cursor: pointer;
text-decoration: none;
text-align: left;
outline: none;
-webkit-transition: background-color 0.5s ease;
-moz-transition: background-color 0.5s ease;
-ms-transition: background-color 0.5s ease;
transition: background-color 0.5s ease;
}
#button:hover {
background-color: #EA4D4D;
}
.login-display-name {
display: none !important;
}
.login-button {
margin-left: 20% !important;
width: 100% !important;
height: 28px !important;
}
.eachDay {
position: relative;
font-family: Lato;
max-width: 30%;
box-shadow: 4px 5px 3px 2px #444;
margin-left: auto;
margin-right: auto;
margin-bottom:2%;
padding-top: 1.5%;
padding-bottom: 1%;
padding-left: 3%;
padding-right: 5%;
-webkit-transition: transform 0.5s ease, background-color 0.5s ease;
-moz-transition: transform 0.5s ease, background-color 0.5s ease;
-ms-transition: transform 0.5s ease, background-color 0.5s ease;
transition: transform 0.5s ease, background-color 0.5s ease;
}
.eachDay:hover {
-webkit-transform: scale(1.02);
-moz-transform: scale(1.02);
-ms-transform: scale(1.02);
transform: scale(1.02);
}
.recent {
color: #353535;
font-size: 160%;
min-width:45%;
max-width:45%;
padding-top:3%;
padding-bottom:3%;
}
.scheduleList {
margin-top: 10%;
}
.type {
font-size:600%;
max-width:30%;
}
.date {
font-size:250%;
padding-top:2%;
}
.AC {
background-color: #5BEF78;
}
.Health {
background-color: #136FB5;
}
.pulltab {
position:fixed;
margin-top:0%;
width: 0;
height: 0;
border-top: 40px solid transparent;
border-bottom: 40px solid transparent;
border-left: 40px solid #FF746B;
-webkit-transition: transform 0.2s ease, border 0.2s ease, margin 0.3s ease;
-moz-transition: transform 0.2s ease, border 0.2s ease, margin 0.3s ease;
-ms-transition: transform 0.2s ease, border 0.2s ease, margin 0.3s ease;
transition: transform 0.2s ease, border 0.2s ease, margin 0.3s ease;
}
.pulltab:hover {
-webkit-transform: scale(1.3);
-moz-transform: scale(1.3);
-ms-transform: scale(1.3);
transform: scale(1.3);
}
.sidebar {
position:absolute;
min-height:100%;
background-color: #FF746B;
box-shadow: 2px 2px 5px 3px #444;
padding-left: 7%;
padding-right: 2%;
padding-top: 2%;
}
.scale {
font-family: Lato;
min-height: 100%;
min-width: 17%;
position: fixed;
top: 0;
left: -20%;
-webkit-transition: transform 0.3s ease;
-moz-transition: transform 0.3s ease;
-ms-transition: transform 0.3s ease;
transition: transform 0.3s ease;
}
.fa {
float:right;
clear:right;
position: absolute;
top: 3%;
right: 2.3%;
-webkit-transition: color 0.5s ease;
-moz-transition: color 0.5s ease;
-ms-transition: color 0.5s ease;
transition: color 0.5s ease;
}
.fa:hover {
color: #FF746B;
}
.about {
position: absolute;
bottom: 3%;
max-width: 70%;
margin-left: 3.5%;
font-size: 110%;
}
.github {
font-size: 120%;
-webkit-transition: color 0.3s ease;
-moz-transition: color 0.3s ease;
-ms-transition: color 0.3s ease;
transition: color 0.3s ease;
}
.github:hover {
text-decoration: none;
color: #69CBE4;
}

View File

@ -0,0 +1,86 @@
<head>
<title>AC/Health Schedule</title>
<link rel="icon" sizes="32x32" href="/favicon.ico">
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-40611162-4', 'auto');
ga('send', 'pageview');
</script>
</head>
<body>
{{#if isDesktop}}
{{> client}}
{{else}}
{{> phone}}
{{/if}}
</body>
<template name="day">
<p class="type">{{aftertext}} </p><p class="date">{{pretext}}</p> <p class="other">{{other}}</p>
{{#if allowed}}
<i class="fa fa-times fa-3x"></i>
{{/if}}
</template>
<template name="recent">
<div class="recent eachDay {{aftertext}}">
<p class="type">{{aftertext}} </p><p class="date">{{pretext}}</p> <p class="other">{{other}}</p>
{{#if allowed}}
<i class="fa fa-times fa-3x"></i>
{{/if}}
</div>
</template>
<template name="client">
<div class="pulltab"></div>
<div class="scale">
{{> sidebar}}
</div>
<div class="scheduleList">
{{#each mostrecent}}
{{> recent}}
{{/each}}
{{#each sched}}
<div class="eachDay {{aftertext}}">
{{> day}}
</div>
{{/each}}
</div>
</template>
<template name="sidebar">
<div class="sidebar">
<h1>AC/Health Schedule</h1>
{{> loginButtons}}
{{#if allowed}}
<input type="text" class="form-control" id="date" placeholder="date">
<select class='selection' id="post">
<option value="AC">AC</option>
<option value="Health">Health</option>
</select>
<select class='selection' id="day">
<option value="A">A</option>
<option value="B">B</option>
</select>
<input type="text" id="other" placeholder="comments">
<button id="button">Update!</button>
{{/if}}
<div class='about'>
<p>Developed by Yaman Qalieh</p>
<p>Visuals by Kenny Jao</p>
<a class="github" target="_blank" href="https://github.com/yamanq/scheduleac">Github</a>
</div>
</div>
</template>
<template name="phone">
{{#each phone}}
{{> recent}}
{{/each}}
</template>

193
scheduleac/client/client.js Normal file
View File

@ -0,0 +1,193 @@
var allowedu = {};
var clicked = false;
allowedu["ybq987@gmail.com"] = true;
allowedu["dweinger@bloomfield.org"] = true;
allowedu["ksjdragon@gmail.com"] = true;
currentcard = 0;
Meteor.subscribe('schedule');
Template.client.helpers({
sched: function() {
beforeslice = schedule.find({}, {
sort: {
timestamp: 1
},
limit: 9
}).fetch();
return beforeslice.slice(1, beforeslice.length);
},
mostrecent: function() {
return schedule.find({}, {
sort: {
timestamp: 1
},
limit: 1
}).fetch();
}
});
Template.client.events({
"click button": function() {
pre = document.getElementById("date").value;
document.getElementById("date").value = "";
post = document.getElementById('post').value;
day = document.getElementById('day').value;
other = document.getElementById("other").value;
document.getElementById("other").value = "";
Meteor.call('add_button', this, pre, post, day, other);
},
"keypress input": function(event) {
if (event.keyCode === 13) {
pre = document.getElementById("date").value;
document.getElementById("date").value = "";
post = document.getElementById('post').value;
other = document.getElementById("other").value;
document.getElementById("other").value = "";
Meteor.call('add_button', this, pre, post, day, other);
}
},
"click .pulltab": function() {
clicked = !clicked;
Session.set("sidebar", clicked);
if (clicked) {
$(".pulltab").css("border-left", "40px solid #DD655D").css("margin-left", "17%");
$(".scale")
.css("-webkit-transform", "translateX(117%)")
.css("-moz-transform", "translateX(117%)")
.css("-ms-transform", "translateX(117%)")
.css("transform", "translateX(117%)");
} else {
$(".pulltab").css("border-left", "40px solid #FF746B").css("margin-left", "0");
$(".scale")
.css("-webkit-transform", "translateX(-59%)")
.css("-moz-transform", "translateX(-59%)")
.css("-ms-transform", "translateX(-59%)")
.css("transform", "translateX(-59%)");
}
}
});
Template.day.helpers({
pretext: function() {
date = moment(this.pretext);
date = date.calendar(null, {
sameDay: '[Today]',
nextDay: '[Tomorrow]',
nextWeek: 'dddd',
lastDay: '[Yesterday]',
lastWeek: '[Last] dddd',
sameElse: 'MM/DD/YYYY'
});
if (this.day !== undefined) {
date = date + " (" + this.day + ")"
}
return date
},
aftertext: function() {
return this.aftertext;
},
other: function() {
return this.other;
},
allowed: function() {
return (Meteor.user() !== undefined && Meteor.user().services.google.email in allowedu);
}
});
Template.day.events({
'click .fa': function() {
Meteor.call('remove', this);
},
'click .eachDay': function() {
var user_id = Session.get('user_id')
console.log(user_id);
}
})
Template.recent.events({
'click .fa': function() {
Meteor.call('remove', this);
}
})
Template.recent.helpers({
pretext: function() {
date = moment(this.pretext);
date = date.calendar(null, {
sameDay: '[Today]',
nextDay: '[Tomorrow]',
nextWeek: 'dddd',
lastDay: '[Yesterday]',
lastWeek: '[Last] dddd',
sameElse: 'MM/DD/YYYY'
});
if (this.day != undefined) {
date = date + " (" + this.day + ")"
}
return date
},
aftertext: function() {
return this.aftertext;
},
other: function() {
return this.other;
},
allowed: function() {
if (!(Meteor.user() === undefined) && Meteor.user().services.google.email in allowedu) {
return true;
} else {
return false;
}
}
});
Template.sidebar.helpers({
allowed: function() {
if (!(Meteor.user() === undefined) && Meteor.user().services.google.email in allowedu) {
return true;
} else {
return false;
}
}
});
Template.sidebar.events({
"focus input": function() {
today = new Date()
$('#date').datepicker({
startDate: today.toLocaleDateString(),
orientation: "top auto",
daysOfWeekDisabled: "0,6",
autoclose: true,
todayHighlight: true
});
}
})
/*Template.day.rendered = function() {
$('.eachDay').each(function ( index ) {
$('.eachDay').eq(index)
.css("z-index", 100-index)
.css("-webkit-transform", "scale(" + getScale(index, 0) + ")")
.css("-moz-transform", "scale(" + getScale(index, 0) + ")")
.css("-ms-transform", "scale(" + getScale(index, 0) + ")")
.css("transform", "scale(" + getScale(index, 0) + ")");
})
}
function getScale(index, start) {
return Math.abs(index-start) * -0.2 + 1.5
}*/
Template.phone.helpers({
phone: function() {
return schedule.find({}, {
sort: {
timestamp: 1
},
limit: 10
}).fetch();
}
});

View File

@ -0,0 +1 @@
schedule = new Mongo.Collection("schedule");

BIN
scheduleac/public/bg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

View File

@ -0,0 +1,56 @@
var allowed = {};
allowed["ybq987@gmail.com"] = true;
allowed["dweinger@bloomfield.org"] = true;
//allowed["ksjdragon@gmail.com"] = true;
schedule.permit(['insert', 'update', 'remove']).never().apply();
// schedule.remove({});
SyncedCron.add({
name: 'Remove Entries past today',
schedule: function(parser) {
return parser.recur().on('14:35:00').time();
},
job: function() {
var thedate = moment();
var today = thedate.format("X");
// Remove matching Documents
schedule.remove({timestamp: {$lt: today}});
console.log(thedate.format());
}
});
SyncedCron.start();
Meteor.methods({
add_button: function(chrome, pre, post, day, other) {
if ((Meteor.user() != undefined) && (Meteor.user().services.google.email in allowed) && !(pre === "")) {
mymoment = moment(pre.replace("/", "-"), "MM-DD-YYYY");
thepretext = mymoment.toISOString().split("T")[0];
time = mymoment.format("X");
previous = schedule.find({"pretext": thepretext}).fetch();
if (previous.length > 0) {
entry = previous[0]
schedule.update(entry._id, {"aftertext": post, "pretext": entry.pretext, "day": day, "other": other, "timestamp": entry.timestamp});
} else {
schedule.insert({
"pretext": thepretext,
"aftertext": post,
"day": day,
"other": other,
"timestamp": time
});
}
}
},
remove: function(chrome) {
if (Meteor.user() != undefined && Meteor.user().services.google.email in allowed) {
schedule.remove(chrome._id);
}
}
})