From 27218d1119e529b8fc221cfd20c3eae23fc7c4ce Mon Sep 17 00:00:00 2001 From: Guy Sandler Date: Fri, 16 Jan 2026 14:10:10 -0800 Subject: [PATCH] gpa presets --- README.md | 3 +++ html/popup.html | 5 +++-- js/popup.js | 41 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5a1f5fc..0679666 100644 --- a/README.md +++ b/README.md @@ -299,3 +299,6 @@ here is some proof the lisence was changed and this is based on the reverted MIT [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) ![Better Canvas](/icon/icon-48.png) + +Copyright (c) 2026 Guy Sandler + diff --git a/html/popup.html b/html/popup.html index 49aeac3..883511e 100644 --- a/html/popup.html +++ b/html/popup.html @@ -696,8 +696,9 @@ The letter grade will be calculated as greater than or equal to the percentage given.

If your school doesn't use the +/- system, you can enter 101 for those grades to remove them from the calculation. (for example A+ = 101, A = 90, A- = 101) - - +

GPA Scale Presets 0-4

+ + diff --git a/js/popup.js b/js/popup.js index 8d7132c..5fcbaa2 100644 --- a/js/popup.js +++ b/js/popup.js @@ -563,6 +563,47 @@ function setup() { // document.getElementById("view-submissions-btn").addEventListener("click", displayMySubmissions); document.getElementById("submit-form-btn").addEventListener("click", displayThemeSubmissionForm); + document.getElementById("gpa-plus-minus").addEventListener("click", () => { + applyGPAPreset({ + "A+": { "cutoff": 97, "gpa": 4.0 }, + "A": { "cutoff": 93, "gpa": 4.0 }, + "A-": { "cutoff": 90, "gpa": 3.7 }, + "B+": { "cutoff": 87, "gpa": 3.3 }, + "B": { "cutoff": 83, "gpa": 3.0 }, + "B-": { "cutoff": 80, "gpa": 2.7 }, + "C+": { "cutoff": 77, "gpa": 2.3 }, + "C": { "cutoff": 73, "gpa": 2.0 }, + "C-": { "cutoff": 70, "gpa": 1.7 }, + "D+": { "cutoff": 67, "gpa": 1.3 }, + "D": { "cutoff": 63, "gpa": 1.0 }, + "D-": { "cutoff": 60, "gpa": 0.7 }, + "F": { "cutoff": 0, "gpa": 0 } + }); + }); + document.getElementById("gpa-by-letter").addEventListener("click", () => { + applyGPAPreset({ + "A+": { "cutoff": 90, "gpa": 4.0 }, + "A": { "cutoff": 80, "gpa": 4.0 }, + "A-": { "cutoff": 70, "gpa": 4.0 }, + "B+": { "cutoff": 65, "gpa": 3.0 }, + "B": { "cutoff": 60, "gpa": 3.0 }, + "B-": { "cutoff": 55, "gpa": 3.0 }, + "C+": { "cutoff": 50, "gpa": 2.0 }, + "C": { "cutoff": 45, "gpa": 2.0 }, + "C-": { "cutoff": 40, "gpa": 2.0 }, + "D+": { "cutoff": 35, "gpa": 1.0 }, + "D": { "cutoff": 30, "gpa": 1.0 }, + "D-": { "cutoff": 25, "gpa": 1.0 }, + "F": { "cutoff": 0, "gpa": 0 } + }); + }); + +} + +function applyGPAPreset(bounds) { + chrome.storage.sync.set({ "gpa_calc_bounds": bounds }, () => { + displayGPABounds(); + }); } function setupCustomStyle(initial) {