From 098addc2304485bcc2559783428dea9b77c717ef Mon Sep 17 00:00:00 2001 From: notrodes Date: Mon, 7 Feb 2022 19:23:41 -0500 Subject: [PATCH 01/27] Begin reimplementing recentActivity. Uncommenting lots of code, changed the name of some properties of an object because scraper returns different names. --- public/css/home.css | 2 +- public/home.html | 16 +++++---- public/js/home.js | 88 ++++++++++++++++++++++++++------------------- src/scrape.ts | 2 +- 4 files changed, 63 insertions(+), 45 deletions(-) diff --git a/public/css/home.css b/public/css/home.css index d5fe4eeb..c34b636c 100644 --- a/public/css/home.css +++ b/public/css/home.css @@ -1,4 +1,4 @@ -/*////////////////////////////////////////////////////////////////// +/* ////////////////////////////////////////////////////////////////// [ FONT ]*/ @font-face { diff --git a/public/home.html b/public/home.html index 0b15de72..6089ae6e 100644 --- a/public/home.html +++ b/public/home.html @@ -213,12 +213,14 @@

Import Data

+ +
@@ -307,6 +309,7 @@

Modal Title..

+
@@ -342,14 +345,13 @@

Modal Title..

- - -
- + +
+
diff --git a/public/js/home.js b/public/js/home.js index d1977779..69bac393 100644 --- a/public/js/home.js +++ b/public/js/home.js @@ -149,6 +149,7 @@ function adjustColumns(table) { } initialize_jquery_prototype(); +initialize_resize_hamburger(); $('#stats_plot').width($(window).width() * 7 / 11); /* @@ -222,8 +223,8 @@ let recentActivity = new Tabulator("#recentActivity", { columns: [ {title: "Date", field: "date", formatter: rowFormatter}, {title: "Class", field: "classname", formatter: classFormatter}, - {title: "Assignment", field: "assignment", formatter: rowFormatter, headerSort: false}, - {title: "Score", field: "score", formatter: rowFormatter, headerSort: false}, + {title: "Assignment", field: "assignmentname", formatter: rowFormatter, headerSort: false}, + {title: "Score", field: "grade", formatter: rowFormatter, headerSort: false}, {title: "Max Score", field: "max_score", formatter: rowFormatter, headerSort: false}, {title: "Percentage", field: "percentage", formatter: rowGradeFormatter}, ], @@ -314,8 +315,8 @@ let mostRecentTable = new Tabulator("#mostRecentTable", { //{title:"Date", field:"date", formatter: rowFormatter, headerSort: false}, {title: "Date", field: "date", formatter: rowFormatter}, {title: "Class", field: "classname", formatter: classFormatter}, - {title: "Assignment", field: "assignment", formatter: rowFormatter, headerSort: false}, - {title: "Score", field: "score", formatter: rowFormatter, headerSort: false}, + {title: "Assignment", field: "assignmentname", formatter: rowFormatter, headerSort: false}, + {title: "Score", field: "grade", formatter: rowFormatter, headerSort: false}, {title: "Max Score", field: "max_score", formatter: rowFormatter, headerSort: false}, {title: "Percentage", field: "percentage", formatter: rowGradeFormatter}, ], @@ -857,7 +858,7 @@ let classesTable = new Tabulator("#classesTable", { }); //sets up the tooltips in the classes table -setup_tooltips() +setup_tooltips(); function correct() { const per = parseInt($("#corrections_modal_input").prop("value")); @@ -1020,30 +1021,29 @@ function responseCallback(response, includedTerms) { } } - let activityArray = currentTableData.recent.recentActivityArray.slice(); - for (let i = 0; i < activityArray.length; i++) { - try { - let assignmentName = activityArray[i].assignment; - let className = activityArray[i].classname; - let temp_classIndex = classIndex(className); - - let assignmentIndex = currentTableData.currentTermData - .classes[temp_classIndex].assignments.map(x => x.name) - .indexOf(assignmentName); - console.log(assignmentIndex); - - currentTableData.recent.recentActivityArray[i].assignmentName = assignmentName; - currentTableData.recent.recentActivityArray[i].className = className; - currentTableData.recent.recentActivityArray[i].temp_classIndex = temp_classIndex; - currentTableData.recent.recentActivityArray[i].assignmentIndex = assignmentIndex; - - currentTableData.recent.recentActivityArray[i].max_score = currentTableData.currentTermData.classes[temp_classIndex].assignments[assignmentIndex].max_score; - currentTableData.recent.recentActivityArray[i].percentage = currentTableData.currentTermData.classes[temp_classIndex].assignments[assignmentIndex].percentage; - currentTableData.recent.recentActivityArray[i].color = currentTableData.currentTermData.classes[temp_classIndex].assignments[assignmentIndex].color; - } catch (err) { - // console.error("Please report this error on the Aspine github issue pages. ID Number 101. Error: " + err); - } - } + // let activityArray = currentTableData.recent.recentActivityArray; + // for (let i = 0; i < activityArray.length; i++) { + // let assignmentName = activityArray[i].assignmentname; + // let className = activityArray[i].classname; + // let temp_classIndex = classIndex(className); + + // let assignmentIndex = currentTableData.currentTermData + // .classes[temp_classIndex].assignments.map(x => x.name) + // .indexOf(assignmentName); + // if (assignmentIndex < 0) break; + // console.log(assignmentIndex); + // const helper = currentTableData.currentTermData.classes[temp_classIndex].assignments[assignmentIndex]; + // currentTableData.recent.recentActivityArray[i] = + // { + // assignmentName, + // className, + // temp_classIndex, + // assignmentIndex, + // max_score: helper.max_score, + // percentage: helper.percentage, + // color: helper.color + // }; + // } // Calculate GPA for current term currentTableData.terms.current.GPA = response.GPA || @@ -1083,9 +1083,6 @@ function responseCallback(response, includedTerms) { classesTable.setData(response.classes); //set data of classes table to the tableData property of the response json object - //initializes hamburger resize - initialize_resize_hamburger() - fetch("/schedule", { method: "POST", }).then(async res => scheduleCallback(await res.json())); @@ -1194,10 +1191,9 @@ function pdfCallback(response) { } } // Currently no need for toggle; there are no recent assignments -/* function recent_toggle() { if (!document.getElementById("recent_toggle").checked) { - recentActivity.setData(tableData.recent.recentActivityArray); + // recentActivity.setData(tableData.recent.recentActivityArray); document.getElementById("recentActivity").style.display = "block"; document.getElementById("recentAttendance").style.display = "none"; document.getElementById("recent_title").innerHTML = "Assignments"; @@ -1211,7 +1207,6 @@ function recent_toggle() { recentAttendance.redraw(); } } -*/ function schedule_toggle(day) { if (covid_schedule) { @@ -1229,6 +1224,12 @@ function schedule_toggle(day) { scheduleTable.setData(currentTableData.formattedSchedule); } +// for (const tab of document.getElementsByClassName('tablinks')) { +// window.addEventListener('click', event => { +// openTab(event.target.id); +// }); +// } + window.onpopstate = event => { openTabHelper(event.state); } @@ -1239,6 +1240,7 @@ function openTab(tab_name) { } function openTabHelper(tab_name) { + // Get all elements with class="tabcontent" and hide them // Get all elements with class="tablinks" and remove the class "active" for (const active of document.getElementsByClassName("active")) { active.classList.remove('active'); @@ -1290,6 +1292,20 @@ function openTabHelper(tab_name) { scheduleTable.redraw(); break; } + + if (tab_name === "clock") { + document.getElementById("small_clock").style.display = "none"; + document.getElementById("small_clock_period").style.display = "none"; + } else { + document.getElementById("small_clock").style.display = "block"; + document.getElementById("small_clock_period").style.display = "block"; + } + + recentActivity.redraw(); + recentAttendance.redraw(); + + categoriesTable.redraw(); + } function openSideNav() { @@ -1417,4 +1433,4 @@ updatesCallback(( */ //#endif -openTab('grades'); \ No newline at end of file +openTab('grades'); diff --git a/src/scrape.ts b/src/scrape.ts index 5780d527..1aeddb6a 100644 --- a/src/scrape.ts +++ b/src/scrape.ts @@ -360,7 +360,7 @@ async function get_recent(session: Session): Promise { const recentActivityArray = [...document.querySelectorAll("gradebookScore")].map(x => Object.fromEntries([ - "date", "classname", "score", "assignment", + "date", "classname", "grade", "assignmentname", ].map(att => [att, x.getAttribute(att)])) as unknown as ActivityEvent ); return { recentAttendanceArray, recentActivityArray }; From 176de362531b45108ed6c14b5c5bc0467274a77a Mon Sep 17 00:00:00 2001 From: Pratyush Venkatakrishnan Date: Sun, 27 Mar 2022 13:47:15 -0400 Subject: [PATCH 02/27] Change field names back for recent activity To avoid API breakage, rename Aspen's fields to our fields instead of adapting ourselves to Aspen's changes. --- public/js/home.js | 8 ++++---- src/scrape.ts | 14 ++++++++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/public/js/home.js b/public/js/home.js index 69bac393..04478a1d 100644 --- a/public/js/home.js +++ b/public/js/home.js @@ -223,8 +223,8 @@ let recentActivity = new Tabulator("#recentActivity", { columns: [ {title: "Date", field: "date", formatter: rowFormatter}, {title: "Class", field: "classname", formatter: classFormatter}, - {title: "Assignment", field: "assignmentname", formatter: rowFormatter, headerSort: false}, - {title: "Score", field: "grade", formatter: rowFormatter, headerSort: false}, + {title: "Assignment", field: "assignment", formatter: rowFormatter, headerSort: false}, + {title: "Score", field: "score", formatter: rowFormatter, headerSort: false}, {title: "Max Score", field: "max_score", formatter: rowFormatter, headerSort: false}, {title: "Percentage", field: "percentage", formatter: rowGradeFormatter}, ], @@ -315,8 +315,8 @@ let mostRecentTable = new Tabulator("#mostRecentTable", { //{title:"Date", field:"date", formatter: rowFormatter, headerSort: false}, {title: "Date", field: "date", formatter: rowFormatter}, {title: "Class", field: "classname", formatter: classFormatter}, - {title: "Assignment", field: "assignmentname", formatter: rowFormatter, headerSort: false}, - {title: "Score", field: "grade", formatter: rowFormatter, headerSort: false}, + {title: "Assignment", field: "assignment", formatter: rowFormatter, headerSort: false}, + {title: "Score", field: "score", formatter: rowFormatter, headerSort: false}, {title: "Max Score", field: "max_score", formatter: rowFormatter, headerSort: false}, {title: "Percentage", field: "percentage", formatter: rowGradeFormatter}, ], diff --git a/src/scrape.ts b/src/scrape.ts index 1aeddb6a..084fbbc8 100644 --- a/src/scrape.ts +++ b/src/scrape.ts @@ -358,11 +358,17 @@ async function get_recent(session: Session): Promise { ].map(att => [att, x.getAttribute(att)])) as unknown as AttendanceEvent ); const recentActivityArray = - [...document.querySelectorAll("gradebookScore")].map(x => - Object.fromEntries([ + [...document.querySelectorAll("gradebookScore")].map(x => { + let item = Object.fromEntries([ "date", "classname", "grade", "assignmentname", - ].map(att => [att, x.getAttribute(att)])) as unknown as ActivityEvent - ); + ].map(att => [att, x.getAttribute(att)])) as any; + + item.score = item.grade; + item.assignment = item.assignmentname; + delete item.grade; + delete item.assignmentname; + return item as ActivityEvent; + }); return { recentAttendanceArray, recentActivityArray }; } From 12aca3d3be855ef31668f9115000b4cff97403cc Mon Sep 17 00:00:00 2001 From: TekTaxi Date: Wed, 19 Oct 2022 19:21:47 -0400 Subject: [PATCH 03/27] changed how button table gets hidden --- public/css/home.css | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/public/css/home.css b/public/css/home.css index 9b1fc386..04d8331b 100644 --- a/public/css/home.css +++ b/public/css/home.css @@ -639,8 +639,7 @@ i.fa.fa-toolbox { } #buttonsTable .tabulator-tableHolder{ - position: absolute; - left: -10000000000000000000000000px; + display: none; } #buttonsTable .tabulator-headers{ From 9a7fce3f1dee930e7b9e521ca5d21c7d1b3a1f8b Mon Sep 17 00:00:00 2001 From: TekTaxi Date: Wed, 19 Oct 2022 20:58:26 -0400 Subject: [PATCH 04/27] changes default of recent tab to attendance --- public/css/home.css | 5 ++++- public/home.html | 2 +- public/js/home.js | 16 ++++++++-------- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/public/css/home.css b/public/css/home.css index 04d8331b..c4d407e2 100644 --- a/public/css/home.css +++ b/public/css/home.css @@ -305,8 +305,11 @@ button:hover { background-color: var(--white3); } - +/* sets attendance as default instead of activity */ #recentAttendance { + display: block; +} +#recentActivity { display: none; } diff --git a/public/home.html b/public/home.html index 48816435..e4fe0cbb 100644 --- a/public/home.html +++ b/public/home.html @@ -346,7 +346,7 @@

Modal Title..

diff --git a/public/js/home.js b/public/js/home.js index 4dffc599..fdfacc1a 100644 --- a/public/js/home.js +++ b/public/js/home.js @@ -1202,22 +1202,22 @@ function pdfCallback(response) { generate_pdf(pdf_index); } } -// Currently no need for toggle; there are no recent assignments +// default is set as attendance, shows assignments when toggle is checked function recent_toggle() { if (!document.getElementById("recent_toggle").checked) { - // recentActivity.setData(tableData.recent.recentActivityArray); - document.getElementById("recentActivity").style.display = "block"; - document.getElementById("recentAttendance").style.display = "none"; - document.getElementById("recent_title").innerHTML = "Assignments"; - recentActivity.redraw(); - } - else { //recentActivity.setData(tableData.recent.recentAttendanceArray); document.getElementById("recentActivity").style.display = "none"; document.getElementById("recentAttendance").style.display = "block"; document.getElementById("recent_title").innerHTML = "Attendance"; recentAttendance.redraw(); } + else { + // recentActivity.setData(tableData.recent.recentActivityArray); + document.getElementById("recentActivity").style.display = "block"; + document.getElementById("recentAttendance").style.display = "none"; + document.getElementById("recent_title").innerHTML = "Assignments"; + recentActivity.redraw(); + } } function schedule_toggle(day) { From c0cdd48ea7cbcbd85e61e27d274c33d2065ba1cc Mon Sep 17 00:00:00 2001 From: TekTaxi Date: Wed, 19 Oct 2022 21:23:11 -0400 Subject: [PATCH 05/27] fixes slider in dark mode --- public/css/home.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/css/home.css b/public/css/home.css index c4d407e2..f7a72d16 100644 --- a/public/css/home.css +++ b/public/css/home.css @@ -498,7 +498,7 @@ button:hover { to {opacity: 1;} } #recent_title { - color: var(--white); + color: white; display: inline; position: relative; font-size: 20px; From 778e184d1f858ac9036418cb9f2be1042986a052 Mon Sep 17 00:00:00 2001 From: TekTaxi Date: Wed, 19 Oct 2022 23:20:33 -0400 Subject: [PATCH 06/27] shows recent activity table if you reopen grades tab --- public/js/home.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/public/js/home.js b/public/js/home.js index fdfacc1a..d76626b4 100644 --- a/public/js/home.js +++ b/public/js/home.js @@ -230,7 +230,7 @@ let recentActivity = new Tabulator("#recentActivity", { ], rowClick: function(e, row) { //trigger an alert message when the row is clicked // questionable - $("#mostRecentDiv").hide(); + document.getElementById("mostRecentDiv").style.display = "none"; classesTable.selectRow(1); let elem = document.getElementById("default_open"); @@ -312,7 +312,6 @@ let mostRecentTable = new Tabulator("#mostRecentTable", { // height: 400, layout: "fitColumns", columns: [ - //{title:"Date", field:"date", formatter: rowFormatter, headerSort: false}, {title: "Date", field: "date", formatter: rowFormatter}, {title: "Class", field: "classname", formatter: classFormatter}, {title: "Assignment", field: "assignment", formatter: rowFormatter, headerSort: false}, @@ -321,7 +320,7 @@ let mostRecentTable = new Tabulator("#mostRecentTable", { {title: "Percentage", field: "percentage", formatter: rowGradeFormatter}, ], rowClick: function(e, row) { //trigger an alert message when the row is clicked - $("#mostRecentDiv").hide(); + document.getElementById("mostRecentDiv").style.display = "none"; classesTable.selectRow(1); @@ -796,7 +795,7 @@ let buttonsTable = new Tabulator("#buttonsTable", { }, { title: "Reset Table Data", - titleFormatter: () => '', + titleFormatter: () => '', headerClick: resetTableData, width: 76, headerSort: false, @@ -840,7 +839,7 @@ let classesTable = new Tabulator("#classesTable", { }, ], rowClick: function(e, row) { // trigger an alert message when the row is clicked - $("#mostRecentDiv").hide(); + document.getElementById("mostRecentDiv").style.display = "none"; hideModal("stats"); assignmentsTable.clearFilter(); @@ -1077,7 +1076,7 @@ function responseCallback(response, includedTerms) { //Stuff to do now that tableData is initialized - $("#mostRecentDiv").show(); + document.getElementById("mostRecentDiv").style.display = "block"; mostRecentTable.setData(currentTableData.recent.recentActivityArray.slice(0, 5)); initialize_quarter_dropdown(includedTerms); @@ -1267,6 +1266,7 @@ function openTabHelper(tab_name) { switch (tab_name) { case 'grades': + document.getElementById("mostRecentDiv").style.display = "block"; mostRecentTable.redraw(); classesTable.redraw(); assignmentsTable.redraw(); From f418b8a3a314d9387d4b0b5a1549e46e3bcdbced Mon Sep 17 00:00:00 2001 From: TekTaxi Date: Wed, 19 Oct 2022 23:20:52 -0400 Subject: [PATCH 07/27] rename tab to attendance & recent --- public/home.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/home.html b/public/home.html index e4fe0cbb..e10c8641 100644 --- a/public/home.html +++ b/public/home.html @@ -90,7 +90,7 @@

Aspine

- + From c1486889c1699c7027878ad3395112ea7fc79c5d Mon Sep 17 00:00:00 2001 From: TekTaxi Date: Wed, 19 Oct 2022 23:34:09 -0400 Subject: [PATCH 08/27] fix bug where table disapears when row is clicked --- public/js/home.js | 1 - 1 file changed, 1 deletion(-) diff --git a/public/js/home.js b/public/js/home.js index d76626b4..d75ac567 100644 --- a/public/js/home.js +++ b/public/js/home.js @@ -320,7 +320,6 @@ let mostRecentTable = new Tabulator("#mostRecentTable", { {title: "Percentage", field: "percentage", formatter: rowGradeFormatter}, ], rowClick: function(e, row) { //trigger an alert message when the row is clicked - document.getElementById("mostRecentDiv").style.display = "none"; classesTable.selectRow(1); From ac0d1b7bcc700c7b421fd6b9ab71cf256ae002a1 Mon Sep 17 00:00:00 2001 From: jshaw-7 <98419655+jshaw-7@users.noreply.github.com> Date: Thu, 20 Oct 2022 10:46:05 -0400 Subject: [PATCH 09/27] hides score and max score in recent activity table on smaller screen sizes --- public/js/home.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/public/js/home.js b/public/js/home.js index d75ac567..95207481 100644 --- a/public/js/home.js +++ b/public/js/home.js @@ -140,6 +140,17 @@ function adjustColumns(table) { table.showColumn("score"); table.showColumn("maxScore"); } + case "mostRecentTable": + if (window.matchMedia("(max-width: 576px)").matches) { + table.hideColumn("score"); + table.hideColumn("max_score"); + } else if (window.matchMedia("(max-width: 768px)").matches) { + table.hideColumn("score"); + table.hideColumn("max_score"); + } else { + table.showColumn("score"); + table.showColumn("max_score"); + } break; default: console.error(`Unrecognized table with id ${table.element.id}`); @@ -311,6 +322,9 @@ let categoriesTable = new Tabulator("#categoriesTable", { let mostRecentTable = new Tabulator("#mostRecentTable", { // height: 400, layout: "fitColumns", + tableBuilt: function() { + window.addEventListener("resize", () => adjustColumns(this)); + }, columns: [ {title: "Date", field: "date", formatter: rowFormatter}, {title: "Class", field: "classname", formatter: classFormatter}, @@ -859,6 +873,7 @@ let classesTable = new Tabulator("#classesTable", { adjustColumns(assignmentsTable); adjustColumns(categoriesTable); + adjustColumns(mostRecentTable); return; } From b5e1872c7702669628f9cbfd76ddf2d63bad2ba9 Mon Sep 17 00:00:00 2001 From: TekTaxi Date: Thu, 20 Oct 2022 11:15:01 -0400 Subject: [PATCH 10/27] mostRecentTable has all items, fixed height with scroll --- public/css/home.css | 4 ++++ public/js/home.js | 11 ++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/public/css/home.css b/public/css/home.css index f7a72d16..b7878c06 100644 --- a/public/css/home.css +++ b/public/css/home.css @@ -651,6 +651,10 @@ i.fa.fa-toolbox { } +#mostRecentTable .tabulator-tableHolder { + height: 100%; +} + #classesTable .tabulator-col, #classesTable .tabulator-header, #assignmentsTable .tabulator-col, diff --git a/public/js/home.js b/public/js/home.js index d75ac567..19ff5011 100644 --- a/public/js/home.js +++ b/public/js/home.js @@ -309,7 +309,7 @@ let categoriesTable = new Tabulator("#categoriesTable", { }); let mostRecentTable = new Tabulator("#mostRecentTable", { - // height: 400, + height: 450, layout: "fitColumns", columns: [ {title: "Date", field: "date", formatter: rowFormatter}, @@ -1075,8 +1075,9 @@ function responseCallback(response, includedTerms) { //Stuff to do now that tableData is initialized - document.getElementById("mostRecentDiv").style.display = "block"; - mostRecentTable.setData(currentTableData.recent.recentActivityArray.slice(0, 5)); + document.getElementById("mostRecentDiv").style.display = "block"; + // this is where we decide what goes into most recent activity on grades page (how many assignments) + mostRecentTable.setData(currentTableData.recent.recentActivityArray); initialize_quarter_dropdown(includedTerms); setup_quarter_dropdown(); @@ -1087,7 +1088,11 @@ function responseCallback(response, includedTerms) { initialize_tableData_dropdown(); } + // potentially add loop here to match assignments + // if recent assignment id == actual assignment id, add to array + // loop over the whole list of assignment ids for the class to match recentActivity.setData(currentTableData.recent.recentActivityArray); + recentAttendance.setData(currentTableData.recent.recentAttendanceArray); classesTable.setData(response.classes); //set data of classes table to the tableData property of the response json object From eec955da49744df4f2f3eefdef92d7b343dc5e76 Mon Sep 17 00:00:00 2001 From: TekTaxi Date: Thu, 20 Oct 2022 11:16:55 -0400 Subject: [PATCH 11/27] mostRecentTable has all items, fixed height with scroll --- public/js/home.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/js/home.js b/public/js/home.js index 19ff5011..51ea99aa 100644 --- a/public/js/home.js +++ b/public/js/home.js @@ -1077,7 +1077,7 @@ function responseCallback(response, includedTerms) { document.getElementById("mostRecentDiv").style.display = "block"; // this is where we decide what goes into most recent activity on grades page (how many assignments) - mostRecentTable.setData(currentTableData.recent.recentActivityArray); + mostRecentTable.setData(currentTableData.recent.recentActivityArray); // .slide(0, i) if we want to limit initialize_quarter_dropdown(includedTerms); setup_quarter_dropdown(); From 40c8c508b602e673ce17232782bc9013937d8028 Mon Sep 17 00:00:00 2001 From: jshaw-7 <98419655+jshaw-7@users.noreply.github.com> Date: Thu, 20 Oct 2022 14:34:22 -0400 Subject: [PATCH 12/27] fixed bug with table data not filling up the entire div when page first loaded --- public/css/home.css | 5 +++-- public/js/home.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/public/css/home.css b/public/css/home.css index b7878c06..c5372c01 100644 --- a/public/css/home.css +++ b/public/css/home.css @@ -648,11 +648,12 @@ i.fa.fa-toolbox { #buttonsTable .tabulator-headers{ display: flex; justify-content: flex-end; - } #mostRecentTable .tabulator-tableHolder { - height: 100%; + height: 100% !important; + max-height: 100% !important; + min-height: 100% !important; } #classesTable .tabulator-col, diff --git a/public/js/home.js b/public/js/home.js index e56d69c2..186d0cc1 100644 --- a/public/js/home.js +++ b/public/js/home.js @@ -320,7 +320,7 @@ let categoriesTable = new Tabulator("#categoriesTable", { }); let mostRecentTable = new Tabulator("#mostRecentTable", { - height: 450, + height: "35vh", layout: "fitColumns", tableBuilt: function() { window.addEventListener("resize", () => adjustColumns(this)); From fffb33acf3cd3aa05434f980ec4f39ef1fe096f9 Mon Sep 17 00:00:00 2001 From: Julia Shaw Date: Fri, 12 May 2023 09:10:39 -0400 Subject: [PATCH 13/27] deleted max score and percentage from mostRecentTable and recentActivity tabulators --- public/js/home.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/public/js/home.js b/public/js/home.js index 186d0cc1..2b3875d5 100644 --- a/public/js/home.js +++ b/public/js/home.js @@ -236,8 +236,7 @@ let recentActivity = new Tabulator("#recentActivity", { {title: "Class", field: "classname", formatter: classFormatter}, {title: "Assignment", field: "assignment", formatter: rowFormatter, headerSort: false}, {title: "Score", field: "score", formatter: rowFormatter, headerSort: false}, - {title: "Max Score", field: "max_score", formatter: rowFormatter, headerSort: false}, - {title: "Percentage", field: "percentage", formatter: rowGradeFormatter}, + ], rowClick: function(e, row) { //trigger an alert message when the row is clicked // questionable @@ -330,8 +329,6 @@ let mostRecentTable = new Tabulator("#mostRecentTable", { {title: "Class", field: "classname", formatter: classFormatter}, {title: "Assignment", field: "assignment", formatter: rowFormatter, headerSort: false}, {title: "Score", field: "score", formatter: rowFormatter, headerSort: false}, - {title: "Max Score", field: "max_score", formatter: rowFormatter, headerSort: false}, - {title: "Percentage", field: "percentage", formatter: rowGradeFormatter}, ], rowClick: function(e, row) { //trigger an alert message when the row is clicked From 947bafeb88a931f3356f9956d0a3a340fee9c8b7 Mon Sep 17 00:00:00 2001 From: notrodes Date: Mon, 7 Feb 2022 19:23:41 -0500 Subject: [PATCH 14/27] Begin reimplementing recentActivity. Uncommenting lots of code, changed the name of some properties of an object because scraper returns different names. --- public/home.html | 4 ++++ public/js/home.js | 1 - src/scrape.ts | 8 ++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/public/home.html b/public/home.html index e10c8641..e1391897 100644 --- a/public/home.html +++ b/public/home.html @@ -346,7 +346,11 @@

Modal Title..

diff --git a/public/js/home.js b/public/js/home.js index 2b3875d5..7af17cbe 100644 --- a/public/js/home.js +++ b/public/js/home.js @@ -236,7 +236,6 @@ let recentActivity = new Tabulator("#recentActivity", { {title: "Class", field: "classname", formatter: classFormatter}, {title: "Assignment", field: "assignment", formatter: rowFormatter, headerSort: false}, {title: "Score", field: "score", formatter: rowFormatter, headerSort: false}, - ], rowClick: function(e, row) { //trigger an alert message when the row is clicked // questionable diff --git a/src/scrape.ts b/src/scrape.ts index 4e1b1dee..9a225981 100644 --- a/src/scrape.ts +++ b/src/scrape.ts @@ -366,6 +366,7 @@ async function get_recent(session: Session): Promise { ].map(att => [att, x.getAttribute(att)])) as unknown as AttendanceEvent ); const recentActivityArray = +<<<<<<< HEAD [...document.querySelectorAll("gradebookScore")].map(x => { let item = Object.fromEntries([ "date", "classname", "grade", "assignmentname", @@ -377,6 +378,13 @@ async function get_recent(session: Session): Promise { delete item.assignmentname; return item as ActivityEvent; }); +======= + [...document.querySelectorAll("gradebookScore")].map(x => + Object.fromEntries([ + "date", "classname", "grade", "assignmentname", + ].map(att => [att, x.getAttribute(att)])) as unknown as ActivityEvent + ); +>>>>>>> db643de (Begin reimplementing recentActivity. Uncommenting lots of code, changed the name of some properties of an object because scraper returns different names.) return { recentAttendanceArray, recentActivityArray }; } From bc00bbff7fda8553f8ae87e5c75c3c9de19d6943 Mon Sep 17 00:00:00 2001 From: Julia Shaw Date: Sat, 13 May 2023 13:33:32 -0400 Subject: [PATCH 15/27] got rid of colors for class names --- public/js/extraFunctions.js | 17 ----------------- public/js/home.js | 15 ++------------- 2 files changed, 2 insertions(+), 30 deletions(-) diff --git a/public/js/extraFunctions.js b/public/js/extraFunctions.js index 809d6801..9d235ee8 100755 --- a/public/js/extraFunctions.js +++ b/public/js/extraFunctions.js @@ -41,23 +41,6 @@ let classIndex = function(classname) { // why the mod 8? } -let classFormatter = function(cell, formatterParams) { - let rowClass = cell.getRow().getData().classname; - let classColor = classColors[classIndex(rowClass)]; - let value = cell.getValue(); - - if (vip_username_list.includes(currentTableData.username)) { - return "" + value + ""; - - } - - if (classColor === "black") { - return value; - } else { - return "" + value + ""; - } -} - let weightFormatter = function(cell, formatterParams) { let value = cell.getValue(); let rowColor = cell.getRow().getData().color; diff --git a/public/js/home.js b/public/js/home.js index 7af17cbe..ef854478 100644 --- a/public/js/home.js +++ b/public/js/home.js @@ -140,17 +140,6 @@ function adjustColumns(table) { table.showColumn("score"); table.showColumn("maxScore"); } - case "mostRecentTable": - if (window.matchMedia("(max-width: 576px)").matches) { - table.hideColumn("score"); - table.hideColumn("max_score"); - } else if (window.matchMedia("(max-width: 768px)").matches) { - table.hideColumn("score"); - table.hideColumn("max_score"); - } else { - table.showColumn("score"); - table.showColumn("max_score"); - } break; default: console.error(`Unrecognized table with id ${table.element.id}`); @@ -233,7 +222,7 @@ let recentActivity = new Tabulator("#recentActivity", { layout: "fitColumns", columns: [ {title: "Date", field: "date", formatter: rowFormatter}, - {title: "Class", field: "classname", formatter: classFormatter}, + {title: "Class", field: "classname", formatter: rowFormatter}, {title: "Assignment", field: "assignment", formatter: rowFormatter, headerSort: false}, {title: "Score", field: "score", formatter: rowFormatter, headerSort: false}, ], @@ -325,7 +314,7 @@ let mostRecentTable = new Tabulator("#mostRecentTable", { }, columns: [ {title: "Date", field: "date", formatter: rowFormatter}, - {title: "Class", field: "classname", formatter: classFormatter}, + {title: "Class", field: "classname", formatter: rowFormatter}, {title: "Assignment", field: "assignment", formatter: rowFormatter, headerSort: false}, {title: "Score", field: "score", formatter: rowFormatter, headerSort: false}, ], From 04317d5b9b662c2d8c8f81f9f3b9ba2739ed7e0b Mon Sep 17 00:00:00 2001 From: Julia Shaw Date: Sat, 13 May 2023 13:50:12 -0400 Subject: [PATCH 16/27] fixed a few errors with rebase --- public/home.html | 6 +----- src/scrape.ts | 8 -------- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/public/home.html b/public/home.html index e1391897..f9cd1ffd 100644 --- a/public/home.html +++ b/public/home.html @@ -346,12 +346,8 @@

Modal Title..

+
diff --git a/src/scrape.ts b/src/scrape.ts index 9a225981..4e1b1dee 100644 --- a/src/scrape.ts +++ b/src/scrape.ts @@ -366,7 +366,6 @@ async function get_recent(session: Session): Promise { ].map(att => [att, x.getAttribute(att)])) as unknown as AttendanceEvent ); const recentActivityArray = -<<<<<<< HEAD [...document.querySelectorAll("gradebookScore")].map(x => { let item = Object.fromEntries([ "date", "classname", "grade", "assignmentname", @@ -378,13 +377,6 @@ async function get_recent(session: Session): Promise { delete item.assignmentname; return item as ActivityEvent; }); -======= - [...document.querySelectorAll("gradebookScore")].map(x => - Object.fromEntries([ - "date", "classname", "grade", "assignmentname", - ].map(att => [att, x.getAttribute(att)])) as unknown as ActivityEvent - ); ->>>>>>> db643de (Begin reimplementing recentActivity. Uncommenting lots of code, changed the name of some properties of an object because scraper returns different names.) return { recentAttendanceArray, recentActivityArray }; } From eab2c8243d89a75f8834e5e00a00e11d8dbebf74 Mon Sep 17 00:00:00 2001 From: jshaw-7 <98419655+jshaw-7@users.noreply.github.com> Date: Fri, 18 Nov 2022 21:05:24 -0500 Subject: [PATCH 17/27] added links (from login page) to info tab --- public/home.html | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/public/home.html b/public/home.html index f9cd1ffd..12d51ca1 100644 --- a/public/home.html +++ b/public/home.html @@ -401,6 +401,24 @@

Loading...

+

Helpful Links

+

Overview

Aspine is a website that makes it easier for CPSD students to access and From 3712dc033c1853bc2c94c21048f92b40f3866474 Mon Sep 17 00:00:00 2001 From: jshaw-7 <98419655+jshaw-7@users.noreply.github.com> Date: Fri, 18 Nov 2022 21:08:25 -0500 Subject: [PATCH 18/27] deleted css id not needed --- public/home.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/home.html b/public/home.html index 12d51ca1..bb0d50f4 100644 --- a/public/home.html +++ b/public/home.html @@ -402,7 +402,7 @@

Loading...

Helpful Links

-
-
@@ -216,7 +207,18 @@

Import Data

-
+ +
+ + +
+