From 28ad6ad244399b103c803dba55e6646fb6cd2838 Mon Sep 17 00:00:00 2001 From: duckduckgoose-gif <70455698+duckduckgoose-gif@users.noreply.github.com> Date: Sat, 1 Jun 2024 18:13:24 -0400 Subject: [PATCH 1/7] adds the partially done timer code cant get the timer to display on the website however --- static/Home.js | 55 +++++++++++++++++++++++++++++++++++++++++++- templates/index.html | 16 ++++++++----- 2 files changed, 64 insertions(+), 7 deletions(-) diff --git a/static/Home.js b/static/Home.js index 731aa118..b751424f 100644 --- a/static/Home.js +++ b/static/Home.js @@ -4,8 +4,49 @@ document.getElementById('scrolltodash').addEventListener('click', function() { behavior: 'smooth' }); }); +//bell schedule, values in total minutes of day example: 2AM would be 120 minutes +var bellSchedule = [0, 485, 531, 577, 625, 671, 717, 763, 809, 855, 902] +var thursBellSchedule = [0, 486, 530, 574, 618, 633, 677, 721, 765, 809, 853, 897] +// Create function to show date + time +function getDate(){ + var today = new Date(); + var time = today.getMinutes + (today.getHours * 60); + isThursday = today.getDay() === 4; + if (isThursday == true){ + for(let i = 0; i < thursBellSchedule.length; i++){ + if (time < thursBellSchedule[i + 1]){ + return i + } + } + } else { + for(let i = 0; i < bellSchedule.length; i++){ + if (time < bellScheduleellSchedule[i + 1]){ + return i + + } + } + } +} +function updateTime(){ + var period = getDate() + var today = new Date(); + var time = today.getMinutes + (today.getHours * 60) + var isThursday = today.getDay() === 4; + if (isThursday == true){ + var timeRemaining = thursBellSchedule[period + 1] - time; + } else{ + var timeRemaining = bellSchedule[period + 1] - time; + } + return timeRemaining; +} +function hTimer() { + var minRemaining = updateTime(); + var secRemaining = minRemaining % 60; + var minDisplay = Math.floor(minRemaining / 60); + document.getElementById("timer").textContent = minDisplay + ":" + (secRemaining < 10 ? "0" : "") + secRemaining; +} // Create function show_recent_messages to display the number and location of messages that were sent in the last 24 hours in classes and assignments that the user is in function show_recent_messages(messages, classes, assignments){ @@ -95,7 +136,16 @@ function get_classes_ids(classes){ } return ids; } - +window.onload = function() { + setInterval(hTimer, 1000); + hTimer(); + + console.log("Its always around me, all this noise but Not nearly as loud as the voice sayin Let it happen, let it happenIt's gonna feel so good Just let it happen, let it happen. Im a heartbreakerstomperliterallyeverywhereatonce") + +} +window.addEventListener("DOMContentLoaded", (event) => { + console.log("DOM fully loaded and parsed, going with whatg i always longed forrrrrrr feel like a brandnew person making the same msitakes"); +}); //Create a fetch request to /data to get Chat, Classes, and Assignments data async function main(){ @@ -112,6 +162,9 @@ const data = await fetchRequest('/data', { data: "Chat, FILTERED Classes, Assign show_recent_messages(messages, classes, assignments); console.log("done") return true; + + + } // Register service worker for the app diff --git a/templates/index.html b/templates/index.html index f87c46f9..dcfc4e0e 100644 --- a/templates/index.html +++ b/templates/index.html @@ -72,13 +72,17 @@

This is the dashboard

Recent Messages

- + +
+

00:00

+

Current Class:

+
+
+ - - - + + - - \ No newline at end of file + From 3ab6796e59012445fb88a9afb96be264b636de06 Mon Sep 17 00:00:00 2001 From: Paul Nieuwerburgh Date: Sun, 2 Jun 2024 12:19:47 -0400 Subject: [PATCH 2/7] Timer Fix --- static/Home.js | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/static/Home.js b/static/Home.js index b751424f..3c54cb94 100644 --- a/static/Home.js +++ b/static/Home.js @@ -7,11 +7,15 @@ document.getElementById('scrolltodash').addEventListener('click', function() { //bell schedule, values in total minutes of day example: 2AM would be 120 minutes var bellSchedule = [0, 485, 531, 577, 625, 671, 717, 763, 809, 855, 902] var thursBellSchedule = [0, 486, 530, 574, 618, 633, 677, 721, 765, 809, 853, 897] + + // Create function to show date + time -function getDate(){ +function getPeriod(){ + // get the time in minutes since midnight var today = new Date(); - var time = today.getMinutes + (today.getHours * 60); - isThursday = today.getDay() === 4; + var time = today.getMinutes() + (today.getHours() * 60) + console.log(time) + var isThursday = (today.getDay() === 4); if (isThursday == true){ for(let i = 0; i < thursBellSchedule.length; i++){ if (time < thursBellSchedule[i + 1]){ @@ -20,18 +24,19 @@ function getDate(){ } } else { for(let i = 0; i < bellSchedule.length; i++){ - if (time < bellScheduleellSchedule[i + 1]){ + if (time < bellSchedule[i + 1]){ return i } } } - } + function updateTime(){ - var period = getDate() + var period = getPeriod() + console.log(period) var today = new Date(); - var time = today.getMinutes + (today.getHours * 60) + var time = today.getMinutes() + (today.getHours() * 60) var isThursday = today.getDay() === 4; if (isThursday == true){ var timeRemaining = thursBellSchedule[period + 1] - time; @@ -42,10 +47,10 @@ function updateTime(){ } function hTimer() { - var minRemaining = updateTime(); - var secRemaining = minRemaining % 60; - var minDisplay = Math.floor(minRemaining / 60); - document.getElementById("timer").textContent = minDisplay + ":" + (secRemaining < 10 ? "0" : "") + secRemaining; + var minRemaining = updateTime(); - 1 + // get the number of seconds remaining in the current minute: i.e. if the time is 12:34:56, this will return 4 + var secRemaining = 60-(new Date().getSeconds()); + document.getElementById("timer").textContent = minRemaining + ":" + secRemaining; } // Create function show_recent_messages to display the number and location of messages that were sent in the last 24 hours in classes and assignments that the user is in @@ -53,13 +58,13 @@ function show_recent_messages(messages, classes, assignments){ //Create a variable to store the data in format [{location: assignment and/or class, num_messages: number of messages sent in the last 24 hours, id: id of the assignment or class}] var locations = []; var class_ids = get_classes_ids(classes); - console.log(class_ids) + //Iterate over all messages for (const message of messages) { var in_classes = in_user_classes(message.location, classes); var in_assignments = in_user_assignments(class_ids, assignments, message.location); var recent = is_recent(message.timestamp); - console.log(in_classes, in_assignments, recent) + //Check if the message was sent in the last 24 hours if (recent && (in_classes !== false || in_assignments !== false)){ //Check if the location of the message is already in the locations list @@ -149,10 +154,10 @@ window.addEventListener("DOMContentLoaded", (event) => { //Create a fetch request to /data to get Chat, Classes, and Assignments data async function main(){ -console.log("fetching data") + const data = await fetchRequest('/data', { data: "Chat, FILTERED Classes, Assignments" }); - console.log("got data") + //Store the data in variables var messages = data['Chat'] var classes = data['Classes'] @@ -160,7 +165,7 @@ const data = await fetchRequest('/data', { data: "Chat, FILTERED Classes, Assign show_recent_messages(messages, classes, assignments); - console.log("done") + return true; From fa2122db8b047743d138bd2d3d9be776806abfc1 Mon Sep 17 00:00:00 2001 From: duckduckgoose-gif <70455698+duckduckgoose-gif@users.noreply.github.com> Date: Sun, 9 Jun 2024 16:53:55 -0400 Subject: [PATCH 3/7] Disables timer if school currently isnt in session --- __pycache__/classroom.cpython-312.pyc | Bin 3610 -> 3601 bytes __pycache__/database.cpython-312.pyc | Bin 10205 -> 10196 bytes __pycache__/goals.cpython-312.pyc | Bin 5580 -> 5571 bytes __pycache__/grades.cpython-312.pyc | Bin 13462 -> 13453 bytes __pycache__/jupiter.cpython-312.pyc | Bin 10112 -> 10103 bytes __pycache__/main.cpython-312.pyc | Bin 33591 -> 33582 bytes static/Home.js | 29 +++++++++++++++++++++----- 7 files changed, 24 insertions(+), 5 deletions(-) diff --git a/__pycache__/classroom.cpython-312.pyc b/__pycache__/classroom.cpython-312.pyc index 4d874b334bb5bc6afdf37cfd879d2e551a1742a2..2ebb1789e3fee5ec08268b906caa40ceeaa13a0e 100644 GIT binary patch delta 41 vcmbOwGf{^7G%qg~0}x!uu-(Y5#l&x%Y!wq)oLW>IBnT6jd*(xTqIJKxa#@WNu$8ob7%XVb|2Cocr delta 50 zcmccOf7hS;G%qg~0}$lS_1MVG%pzf(Y!wq)oLW>I@ diff --git a/__pycache__/grades.cpython-312.pyc b/__pycache__/grades.cpython-312.pyc index fa2c2a0cad1eeb08319fd9b8322d060ab332bc72..5f6ecacc711e2e9c6864072b4a2fd943cbd49d07 100644 GIT binary patch delta 41 vcmbQ1*_+9InwOW00SG4S58udrj+x&e*(xTqIJKxa#@WNu$8qyV=A{Mz4SWrz delta 50 zcmeCpoR-ObnwOW00SNSXTsCr_W0tT?wu%WYPAw{q@kuN#N{sQ(OLZyAEKA+|f_bR{ E0CkZNlK=n! diff --git a/__pycache__/jupiter.cpython-312.pyc b/__pycache__/jupiter.cpython-312.pyc index b5209b7432a5575aa432d764d8b8f808406ac08d..48afb9956a8ac1dc0e860d3e8b10c615486cd757 100644 GIT binary patch delta 41 vcmZqh|L(_qnwOW00SG4S58ue`$ii=!Y!wq)oLW>ICBr6{v3b#t7+ Gg(3i~&k?== diff --git a/static/Home.js b/static/Home.js index 3c54cb94..ebc8d8ef 100644 --- a/static/Home.js +++ b/static/Home.js @@ -21,6 +21,9 @@ function getPeriod(){ if (time < thursBellSchedule[i + 1]){ return i } + else if (i < 500){ + return 0 + } } } else { for(let i = 0; i < bellSchedule.length; i++){ @@ -28,10 +31,22 @@ function getPeriod(){ return i } + else if (i < 460){ + return 0 + } } } } - +function datechecker(){ + var today = new Date(); + if(today.getMinutes() > 500 || today.getDay() == 0 || today.getDay() == 6){ + return false + } + else{ + return true + } + +} function updateTime(){ var period = getPeriod() console.log(period) @@ -47,10 +62,14 @@ function updateTime(){ } function hTimer() { - var minRemaining = updateTime(); - 1 - // get the number of seconds remaining in the current minute: i.e. if the time is 12:34:56, this will return 4 - var secRemaining = 60-(new Date().getSeconds()); - document.getElementById("timer").textContent = minRemaining + ":" + secRemaining; + if (datechecker() === true){ + var minRemaining = updateTime(); - 1 + var secRemaining = 60-(new Date().getSeconds()); + document.getElementById("timer").textContent = minRemaining + ":" + secRemaining; + } + else if (datachecker() === false){ + document.getElementById("timer").textContent = "No School :D"; + } } // Create function show_recent_messages to display the number and location of messages that were sent in the last 24 hours in classes and assignments that the user is in From 412b4cc3ecdf076896c5e882667c7bad74cb9be9 Mon Sep 17 00:00:00 2001 From: duckduckgoose-gif <70455698+duckduckgoose-gif@users.noreply.github.com> Date: Sat, 29 Jun 2024 22:29:37 -0400 Subject: [PATCH 4/7] recetn changes --- __pycache__/database.cpython-312.pyc | Bin 10196 -> 10196 bytes __pycache__/goals.cpython-312.pyc | Bin 5571 -> 5571 bytes __pycache__/grades.cpython-312.pyc | Bin 13453 -> 13453 bytes __pycache__/jupiter.cpython-312.pyc | Bin 10103 -> 10103 bytes __pycache__/main.cpython-312.pyc | Bin 33582 -> 34175 bytes main.py | 10 ++++++++++ static/Home.js | 5 ++++- 7 files changed, 14 insertions(+), 1 deletion(-) diff --git a/__pycache__/database.cpython-312.pyc b/__pycache__/database.cpython-312.pyc index c8d8d2132e01922d8c235a403bf4504ba170687f..403b9af4f5454b071057d8b6dfbf9feafe597bef 100644 GIT binary patch delta 20 acmccOf5o5sG%qg~0}veF*07QLq&fge=LYHk delta 20 acmccOf5o5sG%qg~0}xEuAHI?Mq&fgc&jynK diff --git a/__pycache__/goals.cpython-312.pyc b/__pycache__/goals.cpython-312.pyc index bb8d3c9e3b8d322e78ca1c46efc765398441cbca..70115dc907fdd22116e4597d37d8584b1279cfa7 100644 GIT binary patch delta 20 acmX@CeOR0OG%qg~0}veF*07O#hbRC-9R^(h delta 20 acmX@CeOR0OG%qg~0}xEuAHI=$hbRC*1qKEH diff --git a/__pycache__/grades.cpython-312.pyc b/__pycache__/grades.cpython-312.pyc index 5f6ecacc711e2e9c6864072b4a2fd943cbd49d07..773f17e79ac0540115b987f63079f75f134251a6 100644 GIT binary patch delta 20 acmeCp?9Jpp&CAQh00hUkHEiT=G64WWga%ds delta 20 acmeCp?9Jpp&CAQh00a~Ehi~L=G64WUYz6-S diff --git a/__pycache__/jupiter.cpython-312.pyc b/__pycache__/jupiter.cpython-312.pyc index 48afb9956a8ac1dc0e860d3e8b10c615486cd757..6a843c59f2bc1c5e414ca72584d98573204134c5 100644 GIT binary patch delta 20 acmezF_uY^CG%qg~0}veF*07N~M;!o8I|k7J delta 20 acmezF_uY^CG%qg~0}xEuAHI=0M;!o6BL;c^ diff --git a/__pycache__/main.cpython-312.pyc b/__pycache__/main.cpython-312.pyc index cea43c89c6a3ad9d067e5a44bfdb54a5ce6755a6..fad6777a903063b378120c0d4c0f80f251c0d698 100644 GIT binary patch delta 2207 zcmZWpdr(wW7{BM$anA8D}j!v%$8l)qn)FNv&ClMDMu(qLGw z6b{fCLJIb9KQsK^L3_LX!M-<25AxZ<{n zCuN==u<;XXOnjC5Uf%A`NL05&V4^$lqwa0Cn4xM}pd}RYh1g~Y%=RPr0b;Zjc)q0g z9%APEiyceMoBhn!;cX6v{HT5dg=zWj#7SIQd5MwqIWL&AuauTw7f5>9Nae>SbEIuxYt&*Nc111DaZ~Q| zT_aU5grlaCNlD1C59f`iFNmY|$_(puiIkIia@k}V${N}}yen#3G*T6{m5isAj>@AO zqUCF%X=}i(f-EPa4JTFbL;W>LOs^;XwUdgFoKn?a@v$}IP|vv4(O-QzZ9ZtsHDo}! zY)Klv|6)q@q52W!_3YQT9m~70u3rFw76q=d37S=s$H1M9}sOl^7Tc~aC) zTvEksKroS(yPsJ;UVE2ntaRmyWii>&~Q*o1UYYmx-8+iWW{Juw^ zJ#Uq`J)&~5PzHS4IM0)yyj?iYqZ&>Xsh(uhX<0_Js~)Rzxn8^%hFo&w8x#eis`2B6+4pdL4m zF8+yr3B}ZEV@sSw`5a6(!G9@VNxucNPFqnyNb1+feuMBK!r!9irD^0U-?`LIzXx_5 zKeF^X{Q<0vd}!HcG!B+ed${s9iCp7*Y7SEcZo>nbZN*|q6bNtj>?Q~_-EqB7K0TtR97^E zV|ORB!s<~id)32)&I0o_?WNTdgk0x?bz795G3hV-&pPW&3TqCPVHoB{xQt-odG+&P z3w8BniD{ru-B$s$>ty{@Kv6J7{xP|=6 zA8IU1)QKY)*vZElv*;oaT+-r=B_he-cWy|dML>L`)ow^6#V#s9pF*wDwV@(|*ncz7amyuE)*qBQzfc{Mz+BjQ;7988;YMgEX z_{HQd-;OSa7&CMPyL_91!L3a131#pw!k!WI##}=SGdYx)@rE{}KPb8f`v?UxuW6l6 zS3tTsT374c1gaSI+MrWcytAnX=zNX%a?C{Xvh3BF--JhU#Wrw}IiP#_!9ycx)(ji6euT@5(VEx7|P zY+gqO-2k+o4+pK>*YPu~GzGD)-e3l8hLuiO`NW}D@dXCF3J?NbxN);OgQ2eKU`v3t z0K0=f*LiWe=4mzWe{eSS!b+d^!h@Nlb~%`A83Km<&$(GJJiPxm&JC=8CsHxdJvYvx z4MIGoSwjsXDdX+kYl)wq?skzu?f33lae8v6_^KVbxfmjr(Am-x2)20j0}06x875(Er^f+z@MzBy#Kc`Yzv}xG>%zBz;ZwkH$QjNz!_j6q&J5>J zA1{W3#c&=N&H!74fLEE}Eo2o4coP_&JHxYPbqIKh3=fInkudDO-c;r#&>MzZX2&tz iHU8o*JK3wfx9f2!sf=X&C<)@cNfE5c-I}*=O!^B%b6Jr9 delta 1885 zcmZ8hZ%k8H6o2=hyeXiKS73ilQN(Mpyj zLmipA`)Op^X0rKVF3#;`ewy1dMT}-fqaoTQn-N`fkp-Fa-!$%=SILa;!|(mx`G3zn z=RMsk9(hl+owZuc0z3;pZffffePe4c6U!)XjyU*WnTr(h^JS$HVJ9@%)kpZ(3v*Uy z%mC{H;($pO5{3kg%N}7L^@}0FFK)C50!V1!CA5hfwhAg4P~sG?odI7|4XZ(w9Y^m*^fsgvNvR{aLxmO# zd_`5BautXb8l`$A9<3@ObG5-L6VW0|hRG}I$y}-M?%PB#+xBJe$=<)}qAB;hnEP;| zL~w+~hZ6?Ad1+~11S0%g>8_b;IN_23Pg*QBrG}GvmYQx-IKSW>q!jwptaa5ck;JEPb9H-NX&_-w zFybkMFAx-z84;f1rwLfntOjE~e>BPhDzotDnhKf$;$H2@noq^TOthT}pi*#{g%4W- zENNW1%mNTX|bXU4q{*@pSfW+T>u8ZXw@4kMUu<=Hf7Ut5M0$h*`$yP7tmV)v@HY1 z4j@bQ9+;CpSLrrX;qtOW2siks&q3YbbW<}ocZy_`?`W+imHc>XFqvb zfUbgcS=vyrmOvF5Av<)cG?YVYL0q7%3l(B9y zIK$1<7mneoG29S_TfuP984fqYxnwwn3}=JkBrv>vhWE_yZuR?N*m#CL)?3H?1a5}m nk=gf{Zk#_(ILL0zzN=qKe~sk*EeT@&xCm@~v-aIPXQclCY83Sz diff --git a/main.py b/main.py index cf1928a9..3c1c7a45 100644 --- a/main.py +++ b/main.py @@ -297,6 +297,16 @@ def fetch_data(): if sheet_name=="Friends": #send if the user's osis is in the OSIS or targetOSIS of the row response[sheet_name] = [item for item in data if str(session['user_data']['osis']) in item['OSIS'] or str(session['user_data']['osis']) in item['targetOSIS']] + elif sheet_name =="FClasses": + #sebd all classes that users firends are in + firend_osises = [item['targetOSIS'] for item in data if + str(session['user_data']['osis']) in item['OSIS']] + [item['OSIS'] for + item in data if str (session['user_data']['osis']) in item['targetOSIS']] + r = [] + classes = get_data("Classes") + for friend in friend_osises: + r += [item for item in classes if friend in item['OSIS']] + response[sheet_name] = r elif sheet_name=="Assignments": # send if item['class'] is the id for any of the rows in response['Classes'] class_ids = [item['id'] for item in response['Classes']] diff --git a/static/Home.js b/static/Home.js index ebc8d8ef..e9ab69bc 100644 --- a/static/Home.js +++ b/static/Home.js @@ -10,6 +10,9 @@ var thursBellSchedule = [0, 486, 530, 574, 618, 633, 677, 721, 765, 809, 853, 89 // Create function to show date + time +function setPeriod(){ + +} function getPeriod(){ // get the time in minutes since midnight var today = new Date(); @@ -164,7 +167,7 @@ window.onload = function() { setInterval(hTimer, 1000); hTimer(); - console.log("Its always around me, all this noise but Not nearly as loud as the voice sayin Let it happen, let it happenIt's gonna feel so good Just let it happen, let it happen. Im a heartbreakerstomperliterallyeverywhereatonce") + console.log("Its always around me, all this noise but Not nearly as loud as the voice sayin Let it happen, let it happenIt's gonna feel so good Just let it happen, let it happen. Ie") } window.addEventListener("DOMContentLoaded", (event) => { From 3dc16f41b19c9c438cb886113c1c1052d120e5ce Mon Sep 17 00:00:00 2001 From: Paul Nieuwerburgh Date: Fri, 5 Jul 2024 08:00:45 -0400 Subject: [PATCH 5/7] minor changes --- static/Home.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/static/Home.js b/static/Home.js index ebc8d8ef..6a1d0147 100644 --- a/static/Home.js +++ b/static/Home.js @@ -62,14 +62,15 @@ function updateTime(){ } function hTimer() { - if (datechecker() === true){ + var minRemaining = updateTime(); - 1 var secRemaining = 60-(new Date().getSeconds()); + + // if secRemaining is less than 10, add a 0 in front of it + if (secRemaining < 10){ + secRemaining = "0" + secRemaining; + } document.getElementById("timer").textContent = minRemaining + ":" + secRemaining; - } - else if (datachecker() === false){ - document.getElementById("timer").textContent = "No School :D"; - } } // Create function show_recent_messages to display the number and location of messages that were sent in the last 24 hours in classes and assignments that the user is in @@ -161,8 +162,12 @@ function get_classes_ids(classes){ return ids; } window.onload = function() { + if (datechecker() === true){ setInterval(hTimer, 1000); - hTimer(); + } + else{ + document.getElementById("timer").textContent = "No School :D"; + } console.log("Its always around me, all this noise but Not nearly as loud as the voice sayin Let it happen, let it happenIt's gonna feel so good Just let it happen, let it happen. Im a heartbreakerstomperliterallyeverywhereatonce") From 40608609fd3453568375ac1bd487457278d3acde Mon Sep 17 00:00:00 2001 From: duckduckgoose-gif <70455698+duckduckgoose-gif@users.noreply.github.com> Date: Wed, 7 Aug 2024 17:18:27 -0400 Subject: [PATCH 6/7] new function --- static/Home.js | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/static/Home.js b/static/Home.js index 57fec764..b8d5a9c3 100644 --- a/static/Home.js +++ b/static/Home.js @@ -9,10 +9,33 @@ var bellSchedule = [0, 485, 531, 577, 625, 671, 717, 763, 809, 855, 902] var thursBellSchedule = [0, 486, 530, 574, 618, 633, 677, 721, 765, 809, 853, 897] -// Create function to show date + time -function setPeriod(){ +function setPeriod(userClasses, friendsData, friendsClasses, currentPeriod) { + + const userClass = userClasses.find(classItem => classItem.period === currentPeriod); + + // Set the HTML element to the name of the user's class + if (userClass) { + document.getElementById("current-class").textContent = `Current Class: ${userClass.name}`; + } + + // Loop through each friend + friendsData.forEach(friend => { + // Find the class in friendsClasses where the period matches and the friend's OSIS is included + const friendClass = friendsClasses.find(classItem => classItem.period === currentPeriod && classItem.osisList.includes(friend.osis)); + + + if (friendClass) { + const friendClassElement = document.createElement('h5'); + // Set the textContent property to the name of the class + friendClassElement.textContent = `${friend.name}: ${friendClass.name}`; + + + document.getElementById("friends-classes").appendChild(friendClassElement); + } + }); } + function getPeriod(){ // get the time in minutes since midnight var today = new Date(); @@ -182,7 +205,7 @@ window.addEventListener("DOMContentLoaded", (event) => { //Create a fetch request to /data to get Chat, Classes, and Assignments data async function main(){ -const data = await fetchRequest('/data', { data: "Chat, FILTERED Classes, Assignments" }); +const data = await fetchRequest('/data', { data: "Chat, FILTERED Classes, Assignments, FILTERED Friends, FILTERED FClasses" }); //Store the data in variables From 31d4a1f1abc8b09b27e375acaed7c7531c3fb895 Mon Sep 17 00:00:00 2001 From: duckduckgoose-gif <70455698+duckduckgoose-gif@users.noreply.github.com> Date: Sun, 27 Oct 2024 20:48:31 -0400 Subject: [PATCH 7/7] everything js works cant get html to do shit --- static/Home.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/static/Home.js b/static/Home.js index b8d5a9c3..b35ca7bb 100644 --- a/static/Home.js +++ b/static/Home.js @@ -13,21 +13,13 @@ var thursBellSchedule = [0, 486, 530, 574, 618, 633, 677, 721, 765, 809, 853, 89 function setPeriod(userClasses, friendsData, friendsClasses, currentPeriod) { const userClass = userClasses.find(classItem => classItem.period === currentPeriod); - - // Set the HTML element to the name of the user's class if (userClass) { document.getElementById("current-class").textContent = `Current Class: ${userClass.name}`; } - - // Loop through each friend friendsData.forEach(friend => { - // Find the class in friendsClasses where the period matches and the friend's OSIS is included const friendClass = friendsClasses.find(classItem => classItem.period === currentPeriod && classItem.osisList.includes(friend.osis)); - - if (friendClass) { const friendClassElement = document.createElement('h5'); - // Set the textContent property to the name of the class friendClassElement.textContent = `${friend.name}: ${friendClass.name}`;