mirror of https://github.com/espruino/BangleApps
commit
06a6b72d42
19
apps.json
19
apps.json
|
@ -4355,5 +4355,24 @@
|
|||
{"name":"authentiwatch.img","url":"app-icon.js","evaluate":true}
|
||||
],
|
||||
"data": [{"name":"authentiwatch.json"}]
|
||||
},
|
||||
{ "id": "schoolCalendar",
|
||||
"name": "School Calendar",
|
||||
"shortName":"SCalendar",
|
||||
"icon": "CalenderLogo.png",
|
||||
"version": "0.01",
|
||||
"description": "A simple calendar that you can see your upcoming events that you create in the customizer. Keep in note that your events reapeat weekly.(Beta)",
|
||||
"tags": "tool",
|
||||
"readme":"README.md",
|
||||
"custom":"custom.html",
|
||||
"supports": ["BANGLEJS"],
|
||||
"screenshots": [{"url":"screenshot_basic.png"},{"url":"screenshot_info.png"}],
|
||||
"storage": [
|
||||
{"name":"schoolCalendar.app.js"},
|
||||
{"name":"schoolCalendar.img","url":"app-icon.js","evaluate":true}
|
||||
],
|
||||
"data": [
|
||||
{"name":"app.json"}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
|
@ -34,14 +34,12 @@ function getApp() {
|
|||
var ir = require("heatshrink").decompress(atob("jk0ggGDhvdAAXQCYwMEBxAMFAAIaH6c/+c9DgwMC/8zDg4aC/4YCHIwNB7/zHAwNCAgM/DQwqDAYIaHBonT/oNMFBAND74NNBhApEBrQAKBrrrGWpANZHBT7FBpYqIFAYcJBgkA5oMF7gNFFQwoFDgwMHHIoMIAAPM5gMKBrk0oANLmcwBu0zBrMDBv4AFN5gA/ADYA="));
|
||||
var ig = require("heatshrink").decompress(atob("jk0ggGDg93AAVwCYwMEBxAMFAAIaHuc/+c3DgwMC/8yDg4aC/4YCHIwNBv/zHAwNCAgM/DQwqDAYIaHBolz+4NMFBANDv8nBpgMIFIgNaABQNddYy1IBrI4KfYoNLFRAoDDhIMEgHnBgt+BooqGFAoqGBg4OFBhAODBhQNcmUgBpczmAN2mYNZgYN/AApvMAH4Ab"));
|
||||
var igift = require("heatshrink").decompress(atob("q1QxH+ADOi0QbZ5nMHDQAbKgIACKa4ACKnJWVKghW0KgxWTKgxWyKhBWRKhBWwKhRWPKhRWuKhhWNKhhWtKpxWKKhys8KxBU8Ky5U+KypU/KyhU/KyhU/KynGKn5WTKn5WUKmHCADpJJE7uYABZUfKuuYKv5V/Kv5V/Kv5V/Kv5V/Kv5V/Kv5V/AAv+Kv5VT/wADyIAaKpIlbABZSEKv5V/Kv5V/Kv5V/Kv5V/Kv5V/Kv5V/Kv5V/Kv5V/Kv5V/Kv5V/Kv5V/Kv5V/Kv5V/Kv5V/Kv5V/Kv5V/Kv5V/Kv5V/Kv5V/Kv5V/Kv5V/Kv5V/Kv5V/Kv5V/Kv5V/Kv5V/Kv5V/Kv5V/Kv5V/Kv5V/Kv5V/Kv5V/ADNtKv6rdKzZVwKhAABy5V/Khw"));
|
||||
|
||||
var W=240,H=240;
|
||||
var blns = [];
|
||||
function updateFlake(f) {
|
||||
f.im = [ir,ig,ib][Math.round(Math.random()*100)%3];
|
||||
f.s = 0.4+Math.random()*0.5;
|
||||
}
|
||||
|
||||
for (var i=0;i<6;i++) {
|
||||
var f = {
|
||||
y:Math.random()*H,x:(0.5+(i<3?i:i+5))*W/11,
|
||||
|
@ -51,7 +49,6 @@ var ig = require("heatshrink").decompress(atob("jk0ggGDg93AAVwCYwMEBxAMFAAIaHuc/
|
|||
updateFlake(f);
|
||||
blns.push(f);
|
||||
}
|
||||
|
||||
function draw() {
|
||||
blns.forEach(f=>{
|
||||
f.y-=f.v;f.r+=f.t;
|
||||
|
@ -71,7 +68,6 @@ var ig = require("heatshrink").decompress(atob("jk0ggGDg93AAVwCYwMEBxAMFAAIaHuc/
|
|||
g.drawString(${JSON.stringify(line4)},x,y+=10);
|
||||
g.flip();
|
||||
}
|
||||
|
||||
g.clear();
|
||||
setInterval(draw,50);
|
||||
})()`;
|
||||
|
@ -79,7 +75,6 @@ var ig = require("heatshrink").decompress(atob("jk0ggGDg93AAVwCYwMEBxAMFAAIaHuc/
|
|||
return `(function() {
|
||||
var isnow = require("heatshrink").decompress(atob("jEagQWTgfAAocf+gFDh4FDiARBggVB3AFBl3Agf8jfkn/AgX/v/9/+Agfv/2//YrBgfwh4wCgfghYFJCIYdFFIw1EIIpNFL44FFOIoAP"));
|
||||
var itree = require("heatshrink").decompress(atob("mtWxH+ADHHDTI0aGuXH5vNGmhqvTYIzBGtoxF6fTG4g4oGgQyBAAZssGoI0Ga1g1FGdo01ZgIAEGmHHNoLSuAAN/rdb0YFBGlgCBGYIABA4YArGYY1CGn4znAAM6GeVd5PQ5Iyurc/vQ0oGZFAn+d4XC3d5GddiGYIEBy+7zoEBGlFhoEcsQ9GT08+oFk1mkGdaVBMgNArnJ6/KzswGs/J6GlrlbqtbvPC5PCy8wGohniMIPJvIpCqmX3e7vI0BqhqlMIY0DqhtBqoEBa0xgBMIIoEqoABGQwzfsIhBv4qHABM50vQGjg1CGaN66DoBGt1ioGd5LoBGjo1PGYNhvLoCa7wnBqgvGA4YzCAgN5GUAsCqoDBmAHCAYU/wPQ0oSDGcBiDqkwAYcxoFd5PX6GdGjrIIqtUAAc3jk5vPC4fCy5pef5I2BTQMcnAHBy+7y95T0oADnFk1ekBpI2aGRUin7NGAA9hsIzVsIgHTAKZBZoPJ5LNDGhBpXGolcwOsrtcA4TNB3bNDGb/+sVin9AoGe6HX5InEvN/TkP+5XQwM/sRsBzqWB4QuKGjvC6HQ4QdDvKWBZYMwmAuHmFUCYNbqibX3fD5O7qolEZQQ0FBwgKDqgJBGiphEDwNUEgJbBFIQqCAgYOCB4IzCnE6GyhYFGoQnDABYzGAAQ1UAAo2NBoQSBnOB0t/Gjo2EABIPCoGe6HX4QzTGRIAEqtVF4QEBBQc4oE4y/J5PCvIxeABk/oADBvO73eXTyAyZMwM/Awd5vIOFGslAr2Av4PLNcU/jmA6HX5I1KasFcn8dTIOd5PJ4SZGGiNhAAIyNn0ckU+ZYe7AAJpJEYJnNGZk+n9kw9cBAcwGoN5aZg1JJJQABm8/oEjoDKC5ALCrUwqh/NrvQ6HDGp04n9doEdoE/sQJBZQZhCqgABGZk6zw0K/1dnVAoNAFwOlCYL1FubJBy4GCGh1AnOX4XC3YzHFYOeCgdV5PQ5OdD4rKBqqYNGYlbv+X3edGY3CGgKMDAAO7JAJgDAClcr2BEYgADaIZ0DL4uXGbDuB6HX5I1GsP+sNhOgWXIhBmWd4Od5PK4TwFGIJoBAYI2BAD0/jlcQoO7AAJaEGQQADGr0/sjNEvOdAoZmDGgw2ZsVAkeAZpQACGZI2VsU/kVGn1bZoPJZogpGGhA4GfRYwBoGC1mlBQbNFFoo0JNxAGCEod/wM6oFAn9iv/J6/Kzo1Ey9/MZQAKCg4GCFgTDEvPCSwI0BC5I0RN4ocEYYPQ5OdHgeXSwTFKGaJyKFYPC3f+MIdbpzFLAD4zB/1OqtbqtOGgYArGAIADGl9UAAI0wGQN5GoQ0vvIABGoI0uGYQABqo0zNOg0uaQY0/GllOGn40//w="));
|
||||
|
||||
var W=g.getWidth(),H=g.getHeight();
|
||||
var flakes = [];
|
||||
for (var i=0;i<10;i++) {
|
||||
|
@ -94,7 +89,6 @@ var ig = require("heatshrink").decompress(atob("jk0ggGDg93AAVwCYwMEBxAMFAAIaHuc/
|
|||
f.v = f.s * (1+Math.random());
|
||||
flakes.push(f);
|
||||
}
|
||||
|
||||
function draw() {
|
||||
flakes.forEach(f=>{
|
||||
f.y+=f.v;f.r+=f.t;
|
||||
|
@ -111,7 +105,6 @@ var ig = require("heatshrink").decompress(atob("jk0ggGDg93AAVwCYwMEBxAMFAAIaHuc/
|
|||
g.drawString(${JSON.stringify(line4)},x,y+=10);
|
||||
g.flip();
|
||||
}
|
||||
|
||||
g.clear();
|
||||
setInterval(draw,50);
|
||||
})();
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
|
@ -0,0 +1 @@
|
|||
0.01: App is created with gradient background.
|
|
@ -0,0 +1,27 @@
|
|||
# School Calendar
|
||||
|
||||
School Calendar is a calendar that you can see your upcoming classes or schedule.
|
||||
|
||||
## Usage:
|
||||
Enter your calendar events on the customizer then upload. (all day events are not supported yet)
|
||||
|
||||
Once uploaded on the watch when in the table mode you can use BTN1 and BTN3 to scroll up and down on the list. (The red rectangle indicates your current position on the table and your yellow rectangle indicates your current schedule item or your next schedule item.)
|
||||
|
||||
If you press BTN2 it will go into detail mode, and you can see additional information about your schedule item. Also, in this mode you can scroll up and down with BTN1 and BTN3 to move around in the table. To exit detail mode press BTN2 again.
|
||||
|
||||
## Screenshots:
|
||||

|
||||

|
||||
|
||||
## Updates Coming Soon:
|
||||
- [ ] Notifications
|
||||
- [ ] All Day Events
|
||||
- [ ] Improved Rendering Screen
|
||||
- [ ] Better Graphics
|
||||
- [ ] Scrolling Table
|
||||
- [ ] Bangle.js V2 Compatibility
|
||||
- [ ] Full Calendar (Calendar that does not have repeating weekly events.)
|
||||
|
||||
## Creator
|
||||
Ronin0000
|
||||
|
|
@ -0,0 +1 @@
|
|||
require("heatshrink").decompress(atob("mEwyBC/AH4A/AH4A/AH4A/AH4A/AH4A80s0AIIh/L/5f/EP4ATscsAIo9DBY4BVEJZf/L/5fRznzAIJfdEJZfpymyAJmSBpwPLBZRfqIYYBwL9OMuIBzL9VRAMRTDCJhfymBpkL+GEmABzL9UQAJelinOrPWzQDBymSCpe96+c6YnNL9N794tBAYoFD5152u21t1AoP332MuIPDVIJxB88c///AoODD4gFBLoYJBL9YBT888M4IHDNYPvvoDDznzD5pfq54BT737L4QHCVYQFCL4XTD5pfpueuAKOtqpRBxlRB5JfDEJpfqxwBIG4OOwkw/4AC+++xlxC5ZfBymyDoYlHAIJf0AImEiBbB0s0MIOtuoTJL4glML9NrtoBTLoJTBBpJfCyQfNL9VNAKZfB88cBpJfED5hfslgzEAoT3BxlxBYd795RB2uWC4tjAoQNBC4olFCIZfpFoIBJe4JJB+++AYe964XLL4YPLAIJfqhgBNueuAIJnBCp4BPL9Na9YBBsQBCAoY3BA4YBRC4INPL9oBS5YXWDoxfqJIIByL9NS1QBzL9WKAIgzBAooHFAMBfpMJABqLtYA/AH4A/AH4A/AH4A/AH4A/AH4A/AH4A/AH4A/AH4ALA"))
|
|
@ -0,0 +1,6 @@
|
|||
// check for alarms
|
||||
(function() {
|
||||
var alarms = require('Storage').readJSON('schoolCalendarAlarms.json',1)||[];
|
||||
var time = new Date();
|
||||
E.showPrompt(School Calendar Alarm Test)
|
||||
})();
|
|
@ -0,0 +1,420 @@
|
|||
<html>
|
||||
<head>
|
||||
<style>
|
||||
body {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
html, body, #map {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
#controls {
|
||||
padding: 10px;
|
||||
margin: 10px;
|
||||
border: 1px solid black;
|
||||
position:absolute;
|
||||
right:0px;bottom:0px;
|
||||
background-color: rgb(255, 255, 255);
|
||||
z-index: 100;
|
||||
}
|
||||
</style>
|
||||
<link href='fullcalendar/main.css' rel='stylesheet' />
|
||||
<link rel="stylesheet" href="../../css/spectre.min.css">
|
||||
</head>
|
||||
<body>
|
||||
<div>
|
||||
<p>Create your events on the week shown. Keep in note that your events repeat weekly.</p>
|
||||
<p>One you have created your events, Click <button id="upload" class="btn btn-primary">Upload</button>.</p>
|
||||
<p>All day events are not supported. A feature that lets you get the calendar from your watch will be added in a future update.</p>
|
||||
</div>
|
||||
|
||||
<script src='fullcalendar/main.js'></script>
|
||||
<script src="../../core/lib/customize.js"></script>
|
||||
|
||||
<script>
|
||||
var calendar;
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var calendarEl = document.getElementById('calendar');
|
||||
calendar = new FullCalendar.Calendar(calendarEl, {
|
||||
initialView: 'timeGridWeek',
|
||||
headerToolbar: {
|
||||
left: '',
|
||||
center: 'title',
|
||||
right: 'timeGridWeek,listWeek'
|
||||
},
|
||||
navLinks: true, // can click day/week names to navigate views
|
||||
editable: true,
|
||||
selectable: true,
|
||||
selectMirror: true,
|
||||
nowIndicator: true,
|
||||
editable: true,
|
||||
height: 600,
|
||||
initialDate: '2018-06-03', // will be parsed as local
|
||||
select: function(arg) {
|
||||
var title = prompt('Event Title:');
|
||||
if (title) {
|
||||
calendar.addEvent({
|
||||
title: title,
|
||||
start: arg.start,
|
||||
end: arg.end,
|
||||
allDay: arg.allDay
|
||||
})
|
||||
}
|
||||
calendar.unselect()
|
||||
|
||||
},
|
||||
eventClick: function(arg) {
|
||||
if (confirm('Are you sure you want to delete this event?')) {
|
||||
arg.event.remove()
|
||||
}
|
||||
},
|
||||
});
|
||||
calendar.render();
|
||||
});
|
||||
|
||||
// When the 'upload' button is clicked...
|
||||
document.getElementById("upload").addEventListener("click", function () {
|
||||
//Cacultate data:
|
||||
var calendarEvents = calendar.getEvents();
|
||||
let schedule = []
|
||||
//--------------------
|
||||
for(i=0;i<calendarEvents.length;i++){
|
||||
var calendarEntry = {}
|
||||
calendarEntry['cn'] = calendarEvents[i].title;
|
||||
calendarEntry['dow'] = calendarEvents[i].start.getDate()-3;
|
||||
calendarEntry['sh'] = calendarEvents[i].start.getHours();
|
||||
calendarEntry['sm'] = calendarEvents[i].start.getMinutes();
|
||||
calendarEntry['eh'] = calendarEvents[i].end.getHours();
|
||||
calendarEntry['em'] = calendarEvents[i].end.getMinutes();
|
||||
schedule.push(calendarEntry)
|
||||
}
|
||||
// build the app's text using a templated String
|
||||
var app = `
|
||||
require("Font8x12").add(Graphics);
|
||||
require("Font7x11Numeric7Seg", 2).add(Graphics);
|
||||
var file = require("Storage").open("calendarItems.csv","w");
|
||||
let nIntervId;
|
||||
function redrawScreen() {
|
||||
layout.render(layout.background);
|
||||
layout.render(layout.buttons);
|
||||
draw();
|
||||
}
|
||||
function updateDay(ffunction,day){
|
||||
if(ffunction == 1){
|
||||
switch (day) {
|
||||
case 0:
|
||||
return "Sunday";
|
||||
case 1:
|
||||
day = "Monday";
|
||||
break;
|
||||
case 2:
|
||||
day = "Tuesday";
|
||||
break;
|
||||
case 3:
|
||||
day = "Wednesday";
|
||||
break;
|
||||
case 4:
|
||||
day = "Thursday";
|
||||
break;
|
||||
case 5:
|
||||
day = "Friday";
|
||||
break;
|
||||
case 6:
|
||||
day = "Saturday";
|
||||
}
|
||||
return day;
|
||||
}else if(ffunction == 2){
|
||||
switch (day) {
|
||||
case 0:
|
||||
return "Sun";
|
||||
case 1:
|
||||
day = "Mon";
|
||||
break;
|
||||
case 2:
|
||||
day = "Tue";
|
||||
break;
|
||||
case 3:
|
||||
day = "Wed";
|
||||
break;
|
||||
case 4:
|
||||
day = "Thu";
|
||||
break;
|
||||
case 5:
|
||||
day = "Fri";
|
||||
break;
|
||||
case 6:
|
||||
day = "Sat";
|
||||
}
|
||||
return day;
|
||||
}else if(ffunction == 3){
|
||||
switch (day) {
|
||||
case 0:
|
||||
return "S";
|
||||
case 1:
|
||||
day = "M";
|
||||
break;
|
||||
case 2:
|
||||
day = "T";
|
||||
break;
|
||||
case 3:
|
||||
day = "W";
|
||||
break;
|
||||
case 4:
|
||||
day = "R";
|
||||
break;
|
||||
case 5:
|
||||
day = "F";
|
||||
break;
|
||||
case 6:
|
||||
day = "S";
|
||||
}
|
||||
return day;
|
||||
}
|
||||
}
|
||||
function getScheduleTable() {
|
||||
let schedule = [//Monday:
|
||||
{cn: "Biblical Theology", dow:1, sh: 8, sm: 10, eh:9, em: 5, r:"207", t:"Mr. Besaw"},
|
||||
{cn: "English", dow:1, sh: 9, sm: 5, eh:10, em: 0, t:"Dr. Wong"},
|
||||
{cn: "Break", dow:1, sh: 10, sm: 0, eh:10, em: 10, t:""},
|
||||
{cn: "MS Robotics", dow:1, sh: 10, sm: 10, eh:11, em: 0, r:"211", t:"Mr. Broyles"}];//${JSON.stringify(schedule)};
|
||||
logDebug(JSON.stringify(schedule));
|
||||
return schedule;
|
||||
}
|
||||
|
||||
function findNextScheduleIndex() {
|
||||
var schedule = getScheduleTable();
|
||||
var currentDate = new Date();
|
||||
var minuteOfWeek = (currentDate.getDay()*3600)+(currentDate.getHours()*60)+currentDate.getMinutes();
|
||||
//var minuteOfWeek = (4*3600)+(16*60)+0;
|
||||
var currentPosition;
|
||||
for(currentPosition = 0;currentPosition < schedule.length; currentPosition++){
|
||||
var scheduleItemStartMinuteOfWeek = schedule[currentPosition].dow*3600 + schedule[currentPosition].eh*60+schedule[currentPosition].em;
|
||||
if(scheduleItemStartMinuteOfWeek > minuteOfWeek) {
|
||||
return currentPosition;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
function getUpArrow() {return require("heatshrink").decompress(atob("hkOyANKmv9AIIjRCoYZRlvdAI8U3YVK3oBJC4Mc7YVRC4sc7gVCzoBNC4oZDGowXGR58lvoBFC9FcAIoXongBFC58dngBFC6EcAIoPHA"));}
|
||||
function getDownArrow() {return require("heatshrink").decompress(atob("hkOyALImv9AIojPmvdAIoXPlvdAIoXQ3oBFC9GdAIoXnkt9AIoPPAI8U3cc7cc7gBBDIVcAJYXFGYwXOLpU8AI4XBO5sdjgBFR54ZFBpIA=="));}
|
||||
function getMenuIcon() {return require("heatshrink").decompress(atob("iEQyBC/AEU+rwBEn02js17st3stvklrkljkc/cc3cUzYBBD5AdUD4oA/P/4A/P/4A/ADoA=="));}
|
||||
function getDotIcon() {return require("heatshrink").decompress(atob("iEQyBC/AA0t3oBBA4ndAIIPGA4gAFkt9lt9AYIHEzoBBBIwRED41cks8AYIJGA44RGP8xtGP44RJBYh1CAIIHHBJJ/KroBBPoqBFB4YRDAA8dngHHBJKdq3oBDBI4RNP4l9AIYHHBJJBJks8AIIHTAH4ABA="));}
|
||||
var currentPositionTable = 0;
|
||||
var numberOfItemsShown = 8;
|
||||
//Table Positions:
|
||||
var rectStart = 45;
|
||||
var rectEnd = 65;
|
||||
var rectStartX = 10;
|
||||
var rectEndX = 210;
|
||||
//Scences:
|
||||
LIST = 1;
|
||||
INFORMATION = 2;
|
||||
currentStage = LIST;
|
||||
function splitter(str, l){
|
||||
var strs = [];
|
||||
while(str.length > l){
|
||||
var pos = str.substring(0, l).lastIndexOf(' ');
|
||||
pos = pos <= 0 ? l : pos;
|
||||
strs.push(str.substring(0, pos));
|
||||
var i = str.indexOf(' ', pos)+1;
|
||||
if(i < pos || i > pos+l)
|
||||
i = pos;
|
||||
str = str.substring(i);
|
||||
}
|
||||
strs.push(str);
|
||||
return strs;
|
||||
}
|
||||
function updateMinutesToCurrentTime(currentMinuteFunction) {
|
||||
if (currentMinuteFunction<10){
|
||||
currentMinuteUpdatedFunction = "0"+currentMinuteFunction;
|
||||
}else{
|
||||
currentMinuteUpdatedFunction = currentMinuteFunction;
|
||||
}
|
||||
return currentMinuteUpdatedFunction;
|
||||
}
|
||||
function renderBackground(l) {
|
||||
g.clearRect(0,0,240,20);
|
||||
g.drawImage(getBackgroundImage(),110,130,{scale:9,rotate:0});
|
||||
}
|
||||
function renderTable(l) {
|
||||
var foundNumber = findNextScheduleIndex();
|
||||
var yellowIndex = 3;
|
||||
if (foundNumber < 3) { yellowIndex = foundNumber; }
|
||||
for(var x = 0;x<=numberOfItemsShown;x++){
|
||||
g.setColor(255,255,255);
|
||||
g.drawRect(rectStartX,rectStart+(x*20),rectEndX,rectEnd+(20*x));
|
||||
}
|
||||
g.setColor(255,205,0);
|
||||
g.drawRect(rectStartX,rectStart+(yellowIndex*20),rectEndX,rectEnd+(20*yellowIndex));
|
||||
g.setColor(255,0,0);
|
||||
g.drawRect(rectStartX,rectStart+(currentPositionTable*20),rectEndX,rectEnd+(20*currentPositionTable));
|
||||
}
|
||||
function renderTableText(l) {
|
||||
var foundSchedule = getScheduleTable();
|
||||
var foundNumber = findNextScheduleIndex();
|
||||
var startNumber = foundNumber - 2;
|
||||
if (startNumber < 0) { startNumber = 0; }
|
||||
var endNumber = startNumber + 8 - (foundNumber - startNumber);
|
||||
if (endNumber > foundSchedule.length-1) { endNumber = foundSchedule.length-1; }
|
||||
var scheduleHourUpdated;
|
||||
var scheduleMinuteUpdated;
|
||||
for(var currentNumber = startNumber; currentNumber<=endNumber; currentNumber++){
|
||||
scheduleMinuteUpdatedStart = updateMinutesToCurrentTime(foundSchedule[currentNumber].sm);
|
||||
scheduleHourUpdatedStart = foundSchedule[currentNumber].sh;
|
||||
scheduleMinuteUpdatedEnd = updateMinutesToCurrentTime(foundSchedule[currentNumber].em);
|
||||
scheduleHourUpdatedEnd = foundSchedule[currentNumber].eh;
|
||||
scheduleDecriptionUpdated = foundSchedule[currentNumber].cn.substring(0, 20);
|
||||
if(foundSchedule[currentNumber].cn.length >= 15){
|
||||
scheduleDecriptionUpdated = foundSchedule[currentNumber].cn.substring(0, 20)+"...";
|
||||
}
|
||||
schduleDay = updateDay(3,foundSchedule[currentNumber].dow);
|
||||
g.setFont("8x12");
|
||||
g.drawString(scheduleHourUpdatedStart+":"+scheduleMinuteUpdatedStart+"-"+scheduleHourUpdatedEnd+":"+scheduleMinuteUpdatedEnd+" "+schduleDay+" "+scheduleDecriptionUpdated,13,50+(currentNumber*20));
|
||||
}
|
||||
}
|
||||
function buttonsF(l){
|
||||
if(currentStage == LIST){
|
||||
g.drawImage(getDotIcon(),223.5,115);
|
||||
}else{
|
||||
g.drawImage(getMenuIcon(),223.5,115);
|
||||
}
|
||||
g.drawImage(getUpArrow(),225,30);
|
||||
g.drawImage(getDownArrow(),225,215);
|
||||
}
|
||||
function draw() {
|
||||
var currentDate = new Date();
|
||||
var currentDayOfWeek = currentDate.getDay();
|
||||
var currentHour = currentDate.getHours();
|
||||
var currentMinute = currentDate.getMinutes();
|
||||
var currentMinuteUpdated = updateMinutesToCurrentTime(currentMinute);
|
||||
if (layout) {
|
||||
if(currentStage == LIST){
|
||||
layout.time.label = currentHour+":"+currentMinuteUpdated;
|
||||
layout.time.x = 147;
|
||||
layout.time.y = 10;
|
||||
layout.render(layout.table);
|
||||
layout.render(layout.tableText);
|
||||
logDebug("Rendered"+currentPositionTable);
|
||||
}else{
|
||||
layout.time.label = currentHour+":"+currentMinuteUpdated;
|
||||
layout.time.x = 147;
|
||||
layout.time.y = 10;
|
||||
layout.render(layout.info);
|
||||
logDebug("Rendered"+currentPositionTable);
|
||||
}
|
||||
g.clearRect(150,0,220,35);
|
||||
layout.render(layout.time);
|
||||
}
|
||||
}
|
||||
function RedRectDown() {
|
||||
if(currentPositionTable > 0){
|
||||
currentPositionTable -= 1;
|
||||
if(currentStage == INFORMATION){
|
||||
redrawScreen();
|
||||
}else{
|
||||
draw();
|
||||
}
|
||||
}
|
||||
}
|
||||
function RedRectUp() {
|
||||
if(currentPositionTable < numberOfItemsShown){
|
||||
currentPositionTable += 1;
|
||||
if(currentStage == INFORMATION){
|
||||
redrawScreen();
|
||||
}else{
|
||||
draw();
|
||||
}
|
||||
}
|
||||
}
|
||||
function renderMiniBackground(l){
|
||||
for(var i = 233;i<=240;i++){
|
||||
g.drawImage(getBackgroundImage(),i,123,{scale:10,rotate:0});
|
||||
}
|
||||
}
|
||||
function renderLoading(l){
|
||||
g.setFont("8x12");
|
||||
g.drawString("Loading...",240/2-20,240/2-20);
|
||||
}
|
||||
function renderInformation(l){
|
||||
var foundNumber = findNextScheduleIndex();
|
||||
var foundSchedule = getScheduleTable();
|
||||
var startNumber = foundNumber - 2;
|
||||
if (startNumber < 0) { startNumber = 0; }
|
||||
if ((startNumber+currentPositionTable) <= foundSchedule.length-1) {
|
||||
scheduleMinuteUpdatedStart = updateMinutesToCurrentTime(foundSchedule[foundNumber].sm);
|
||||
scheduleHourUpdatedStart = foundSchedule[foundNumber].sh;
|
||||
scheduleMinuteUpdatedEnd = updateMinutesToCurrentTime(foundSchedule[foundNumber].em);
|
||||
scheduleHourUpdatedEnd = foundSchedule[foundNumber].eh;
|
||||
scheduleDay = updateDay(1,foundSchedule[(startNumber+currentPositionTable)].dow);
|
||||
g.setColor(255,255,255);
|
||||
g.setFont("8x12",2);
|
||||
var splitClassNames = splitter(foundSchedule[(startNumber+currentPositionTable)].cn, 15);
|
||||
var currentY = 5;
|
||||
for (var j=0; j < splitClassNames.length; j++) {
|
||||
g.drawString(splitClassNames[j],13,currentY+50);
|
||||
currentY = currentY + 25;
|
||||
}
|
||||
g.setFont("8x12");
|
||||
g.drawString(schduleDay,13,currentY+50);
|
||||
g.drawString(scheduleHourUpdatedStart+":"+scheduleMinuteUpdatedStart+"-"+scheduleHourUpdatedEnd+":"+scheduleMinuteUpdatedEnd,13,currentY+15+50);
|
||||
}
|
||||
}
|
||||
var Layout = require("Layout");
|
||||
var layout = new Layout(
|
||||
{type:"h", c: [
|
||||
{type:"custom", render:renderTableText, id:"tableText"},
|
||||
{type:"custom", render:buttonsF, id:"buttons"},
|
||||
{type:"custom", render:renderBackground, id:"background"},
|
||||
{type:"custom", render:renderTable, id:"table"},
|
||||
{type:"custom", render:renderMiniBackground, id:"miniBackground"},
|
||||
{type:"custom", render:renderLoading, id:"loading"},
|
||||
{type:"custom", render:renderInformation, id:"info"},
|
||||
{type:"txt", font:"7x11Numeric7Seg:2", label:"00:00", id:"time"},
|
||||
]},
|
||||
{type:"v", c:[
|
||||
]},
|
||||
{btns:[
|
||||
{label:"", cb: RedRectUp()},
|
||||
{label:"", cb: l=>print("Two")},
|
||||
{label:"", cb: RedRectDown()}
|
||||
]});
|
||||
function getBackgroundImage() {return require("heatshrink").decompress(atob("j0ZyEKIf4A4gIB6gQB6gYB6ggB6goB6gwB6g4B6hAABAYIBHBZIVLAK8IhIBXgAThhQB6hYB6hgB6hoB6hwB6h4B6iAB6iIB6iQBHiAJOB54XSiYB6igB6ioB6iwB6i4B5A="));}
|
||||
function logDebug(message) {console.log(message);}
|
||||
function changeScene(){
|
||||
layout.render(layout.buttons);
|
||||
if(currentStage == INFORMATION){
|
||||
currentStage = LIST;
|
||||
nIntervId = setInterval(redrawScreen, 100000);
|
||||
}else if(currentStage == LIST){
|
||||
currentStage = INFORMATION;
|
||||
clearInterval();
|
||||
}
|
||||
layout.render(layout.background);
|
||||
layout.render(layout.buttons);
|
||||
draw();
|
||||
}
|
||||
// timeout used to update every minute
|
||||
var drawTimeout;
|
||||
setInterval(draw, 15000);
|
||||
setWatch(RedRectUp, BTN3, { repeat:true, edge:'rising', debounce : 50 });
|
||||
setWatch(RedRectDown, BTN1, { repeat:true, edge:'rising', debounce : 50 });
|
||||
setWatch(changeScene, BTN2, { repeat:true, edge:'rising', debounce : 50 });
|
||||
layout.update();
|
||||
layout.render(layout.loading);
|
||||
layout.render(layout.background);
|
||||
layout.render(layout.buttons);
|
||||
draw();
|
||||
file.write(JSON.stringify(schedule));
|
||||
`;
|
||||
// send finished app (in addition to contents of app.json)
|
||||
sendCustomizedApp({
|
||||
storage: [
|
||||
{ name: "schoolCalendar.app.js", url: "app.js", content: app },
|
||||
]
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<div id='calendar'></div>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,22 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2021 Adam Shaw
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@ -0,0 +1,8 @@
|
|||
|
||||
# FullCalendar Interaction Plugin
|
||||
|
||||
Provides functionality for event drag-n-drop, resizing, dateClick, and selectable actions
|
||||
|
||||
[View the docs »](https://fullcalendar.io/docs/editable)
|
||||
|
||||
This package was created from the [FullCalendar monorepo »](https://github.com/fullcalendar/fullcalendar)
|
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
"name": "@fullcalendar/interaction",
|
||||
"version": "5.9.0",
|
||||
"title": "FullCalendar Interaction Plugin",
|
||||
"description": "Provides functionality for event drag-n-drop, resizing, dateClick, and selectable actions",
|
||||
"docs": "https://fullcalendar.io/docs/editable",
|
||||
"dependencies": {
|
||||
"@fullcalendar/common": "workspace:~5.9.0",
|
||||
"tslib": "^2.1.0"
|
||||
},
|
||||
"main": "main.cjs.js",
|
||||
"module": "main.js",
|
||||
"types": "main.d.ts",
|
||||
"jsdelivr": "main.global.min.js",
|
||||
"browserGlobal": "FullCalendarInteraction",
|
||||
"homepage": "https://fullcalendar.io/",
|
||||
"bugs": "https://fullcalendar.io/reporting-bugs",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/fullcalendar/fullcalendar.git",
|
||||
"homepage": "https://github.com/fullcalendar/fullcalendar"
|
||||
},
|
||||
"license": "MIT",
|
||||
"author": {
|
||||
"name": "Adam Shaw",
|
||||
"email": "arshaw@arshaw.com",
|
||||
"url": "http://arshaw.com/"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@fullcalendar/core-preact": "workspace:*"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"extends": "../../tsconfig.base",
|
||||
"compilerOptions": {
|
||||
"rootDir": "src",
|
||||
"outDir": "tsc"
|
||||
},
|
||||
"include": [
|
||||
"src/**/*"
|
||||
],
|
||||
"references": [
|
||||
{ "path": "../common" }
|
||||
]
|
||||
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
Binary file not shown.
After Width: | Height: | Size: 6.3 KiB |
Binary file not shown.
After Width: | Height: | Size: 3.9 KiB |
Loading…
Reference in New Issue