Remove obsolete features
Removes d.tech institution-specific customizations, CBL grade
calculation, changelogs, remote configuration, grade calculation,
external/prerelease branches, and more.
Change-Id: I199b489f7395d36f97965e281b91895dae263006
Reviewed-on: https://src.jottocraft.com/c/dtps/+/137
Reviewed-by: spike <[email protected]>
diff --git a/scripts/core.js b/scripts/core.js
index 3df265d..38bc218 100644
--- a/scripts/core.js
+++ b/scripts/core.js
@@ -8,7 +8,7 @@
*/
//Make sure DTPS isn't already loading
-if (typeof dtps !== "undefined") throw "Error: DTPS is already loading";
+if (typeof dtps !== "undefined") throw new Error("Error: DTPS is already loading");
/**
* Global DTPS object
@@ -24,7 +24,7 @@
* @property {boolean} unstable This is true if loading an unstable version of DTPS
* @property {boolean} gradebookExpanded True if gradebook details (Show more...) is open. Used in the generic gradebook and may be used in custom gradebook implementations.
* @property {boolean} reloadPending True if the user has made changes that require a reload
- * @property {string|undefined} popup Popup to show when loaded. Either undefined (no popup), "firstrun", or "changelog".
+ * @property {string|undefined} popup Popup to show when loaded. Either undefined (no popup) or "firstrun".
* @property {User} user Current user, fetched with dtps.init
* @property {number|string} selectedClass The selected class number, or "dash" if the dashboard is selected. Set when the first screen is loaded in dtps.init.
* @property {string} selectedContent The selected class content/tab. Set when the first class content is loaded. Defaults to "stream".
@@ -33,21 +33,18 @@
* @property {DashboardItem[]} dashboardItems Array of items that can be shown on the dashboard
* @property {DashboardItem[]} leftDashboard Items on the left side of the dashboard based on dtps.dashboardItems and user prefrences. Set in dtps.loadDashboardPrefs.
* @property {DashboardItem[]} rightDashboard Items on the right side of the dashboard based on dtps.dashboardItems and user prefrences. Set in dtps.loadDashboardPrefs.
- * @property {object} remoteConfig Configuration variables that can be remotely changed
* @property {boolean} searchScrollListener True if the search scroll listener has been added
- * @property {string} cblSpec A URL to the CBL specification document used by dangerous Power+ CBL features
*/
var dtps = {
ver: 3_09_2,
readableVer: "v3.9.2",
- env: new URL(window.dtpsBaseURL || "https://powerplus.app").hostname == "localhost" ? "dev" : window.jottocraftSatEnv || "prod",
+ env: new URL(window.dtpsBaseURL || "https://powerplus.app").hostname == "localhost" ? "dev" : "prod",
classes: [],
baseURL: window.dtpsBaseURL || "https://powerplus.app",
unstable: window.dtpsBaseURL !== "https://powerplus.app",
gradebookExpanded: false,
reloadPending: false,
updates: [],
- cblSpec: "https://docs.google.com/document/d/1AO5OcQozr1HAt_gT-mfmv8A2ibUP2l3PHPYWoL3xivo/edit",
dashboardItems: [
{
name: "Calendar",
@@ -74,20 +71,7 @@
size: 250,
defaultSide: "right"
}
- ],
- remoteConfig: {
- allowWhatIfGrades: true,
- canvasRequestSpacing: 25,
- debugClassID: "1455",
- gradeCalculationEnabled: true,
- loadingAlert: false,
- remoteUpdate: {
- title: null,
- html: null,
- host: null,
- active: false
- }
- }
+ ]
};
//Load jQuery ASAP
@@ -151,75 +135,6 @@
}
/**
- * Fetches and displays the DTPS changelog modal
- *
- * @param {number} fromVersion The previous version of DTPS installed. Will show popup changelogs since that version, if there aren't any, it will silently skip.
- * @param {boolean} draft True to show draft changelogs
- */
-dtps.changelog = function (fromVersion, draft = false) {
- let changelogFetchURL;
- if (fromVersion) {
- //Check for popup w/ all previous important updates query
- changelogFetchURL = `https://dev.jottocraft.com/api/issues?query=${encodeURIComponent(`project: RRS product: dtps rollout: released version code: ${fromVersion + 1} .. ${dtps.ver} popup: popup sort by: {version code} desc`)}&fields=summary,description,idReadable,customFields(projectCustomField(field(name)),value(name))`;
- } else {
- //Latest query
- changelogFetchURL = `https://dev.jottocraft.com/api/issues?query=${encodeURIComponent(`project: RRS product: dtps rollout: ${draft ? "draft" : "released"} version code: * .. ${dtps.ver} sort by: {version code} desc`)}&fields=summary,description,idReadable,customFields(projectCustomField(field(name)),value(name))&$top=1`;
- }
-
- jQuery.getScript("https://cdnjs.cloudflare.com/ajax/libs/showdown/1.8.6/showdown.min.js", function () {
- markdown = new showdown.Converter();
- //Fetch changelog for the current release
- jQuery.getJSON(changelogFetchURL, function (data) {
- window.localStorage.setItem('dtps', dtps.ver);
-
- let releasesHTML = [];
-
- data.forEach(release => {
- const releaseDate = release.customFields?.find(f => f.projectCustomField?.field?.name === "Release date")?.value;
- const releaseDateFormatted = new Date(releaseDate).toLocaleDateString();
-
- //Convert changelog to HTML and render in the changelog card
- var changelogHTML = markdown.makeHtml(release.description);
- releasesHTML.push(`
- <div style="display: flex; flex-direction: row; align-items: center;">
- <i style="margin-right: 6px;" class="fluid-icon">browser_updated</i>
- <h4 style="margin: 6px 0px;">${release.summary}</h4>
- </div>
- <div style="display: flex; flex-direction: row; align-items: center; color: var(--lightText);">
- <i style="margin-right: 4px; font-size: 18px;" class="fluid-icon">event</i>
- <p style="margin: 6px 0px;">${releaseDateFormatted}</p>
- </div>
- <br />
- <div id="changelogStyles">
- ${changelogHTML}
- </div>
- `);
- });
-
- if (!releasesHTML.length) {
- if (fromVersion) {
- //No data for popups, silently skip
- return;
- }
-
- releasesHTML.push(`<p>Couldn't find any changelog data</p>`);
- }
-
- jQuery(".card.changelog").html(`
- <i onclick="fluid.cards.close('.card.changelog')" class="fluid-icon close">close</i>
- ${releasesHTML.join(`<div style="margin: 40px 0px !important;" class="divider"></div>`)}
- <br />
- <button onclick="window.open('https://dev.jottocraft.com/issues?q=project:%20RRS%20product:%20dtps%20rollout:%20released%20sort%20by:%20%7Bversion%20code%7D%20desc')" class="btn small outline"><i class="fluid-icon">update</i> View previous changelogs</button>
- `);
-
- //Show changelog
- fluid.cards.close(".card.focus");
- fluid.cards(".card.changelog");
- });
- });
-};
-
-/**
* Logs debugging messages
*
* @param {...*} msg The debugging messages to log
@@ -261,9 +176,9 @@
<div class="welcomeSection">
<i class="fluid-icon">dashboard</i>
- <h5>${dtpsLMS.gradebook ? "Manage your coursework and grades" : "Manage your coursework"}</h5>
+ <h5>Manage your coursework</h5>
<p>Power+ organizes all of your coursework so you can easily see what you need to do next. The dashboard shows upcoming assignments, recent grades, and announcements.
- ${dtpsLMS.dtech ? `<p style="color: var(--text);"><b>As of June 2022, d.tech CBL features are no longer actively updated. If you'd like to use these potentially obsolete features, you must opt-in at Settings (top-right) -> CBL.</b></p>` : ``}
+ ${dtpsLMS.dtech ? `<p style="color: var(--text);"><b>As of October 2026, all d.tech-specific features, including CBL grade calculation, have been removed from Power+.</b></p>` : ``}
</div>
${dtpsLMS.isDemoLMS ? /*html*/`
@@ -417,13 +332,7 @@
//Check for LMS config
if (!window.dtpsLMS) {
- throw "Error: No DTPS LMS configuration found";
- }
-
- //Determine if changelog should be shown
- if (Number(window.localStorage.dtps) < dtps.ver) {
- dtps.log("New release");
- dtps.popup = "changelog";
+ throw new Error("No DTPS LMS configuration found");
}
//Determine if this is the first time loading DTPS
@@ -458,41 +367,11 @@
//Begin loading static DTPS HTML
dtps.render();
- //Fetch remote config and JavaScript modules
- Promise.all([
- new Promise((r) => {
- jQuery.getJSON('https://jottocraft-dtps-default-rtdb.firebaseio.com/config.json', (remoteConfig) => {
- if (remoteConfig) {
- Object.keys(remoteConfig).forEach(k => {
- var val = remoteConfig[k];
-
- dtps.remoteConfig[k] = val;
- });
- }
- r();
- }).fail(() => r());
- }),
- dtps.JS()
- ]).then(() => {
- //dev env remote config overrides
- if (dtps.env == "dev") {
- Object.keys(dtps.remoteConfig).forEach(k => {
- if (window.localStorage.getItem("dtpsRemoteConfig-" + k)) {
- val = window.localStorage.getItem("dtpsRemoteConfig-" + k);
-
- if (val == "true") val = true;
- if (val == "false") val = false;
-
- dtps.remoteConfig[k] = val;
- }
- });
- }
-
+ //Fetch JavaScript modules
+ dtps.JS().then(() => {
//Fetch user and class data
return dtpsLMS.fetchUser();
}).then(data => {
- if (dtps.remoteConfig.loadingAlert) window.alert(dtps.remoteConfig.loadingAlert);
-
//Prevent resetting the user if the user is already set (for parent accounts)
dtps.user = data;
@@ -527,20 +406,6 @@
} else {
return dtpsLMS.fetchClasses(dtps.user.id);
}
- }).then((rawClasses) => {
- return new Promise((resolve, reject) => {
- if (dtpsLMS.institutionSpecific && dtpsLMS.updateClasses) {
- //Using an institution-specific script, make any nessasary changes and return updated classes
- dtpsLMS.updateClasses(rawClasses).then((updatedClasses) => {
- resolve(updatedClasses);
- }).catch((e) => {
- reject(e);
- });
- } else {
- //No institution-specific script, return classes as-is
- resolve(rawClasses);
- }
- });
}).then(classData => {
//Store classData to dtps.classes
dtps.classes = classData;
@@ -581,18 +446,9 @@
lightBrown: "#928871"
});
- //Loop over each class to update the color and check for grade calculation
+ //Loop over each class to update the color
dtps.classes.forEach(course => {
course.color = course.color ? nearestCourseColor(course.color).value : "gray";
-
- const classGradeCalcAllowed = dtpsLMS.gradeCalculationAllowlist ? dtpsLMS.gradeCalculationAllowlist.includes(course.id) : true;
- if (dtpsLMS.calculateGrade && classGradeCalcAllowed && dtps.remoteConfig.gradeCalculationEnabled) {
- //This LMS/Institution supports grade calculation, show loading indicator for grade
- //Grade will be calculated once assignments are fetched
-
- course.letter = "..."; //Setting this to ... shows the loading indicator
- course.grade = undefined;
- }
});
//Fluid UI screens
@@ -609,19 +465,7 @@
//Begin fetching class assignments
var fetchedAnnouncements = [];
dtps.classes.forEach((course, courseIndex) => {
- dtpsLMS.fetchAssignments(course.userID, course.lmsID).then((rawAssignments) => {
- return new Promise((resolve, reject) => {
- if (dtpsLMS.institutionSpecific && dtpsLMS.updateAssignments) {
- //Using an institution-specific script, make any nessasary changes and return updated assignments
- dtpsLMS.updateAssignments(rawAssignments, course).then(updatedAssignments => {
- resolve(updatedAssignments);
- }).catch(reject);
- } else {
- //No institution-specific script, return assignments as-is
- resolve(rawAssignments);
- }
- });
- }).then(assignments => {
+ dtpsLMS.fetchAssignments(course.userID, course.lmsID).then(assignments => {
//Map due date array
const dueDates = assignments.map(a => dtps.dayTimeMinutes(a.dueAt)).filter(d => d !== null).sort((a, b) => a - b);
@@ -661,40 +505,11 @@
//Keep only the 15 most recent updates
if (dtps.updates.length > 15) dtps.updates.length = 15;
- //Calculate class grade if supported
- const classGradeCalcAllowed = dtpsLMS.gradeCalculationAllowlist ? dtpsLMS.gradeCalculationAllowlist.includes(course.id) : true;
- if (dtpsLMS.calculateGrade && classGradeCalcAllowed && dtps.remoteConfig.gradeCalculationEnabled) {
- let gradeCalcResults = dtpsLMS.calculateGrade(course, assignments);
-
- if (gradeCalcResults) {
- //This class has a grade
-
- //Set course letter and grade to grade calc results
- course.letter = gradeCalcResults.letter;
- course.grade = gradeCalcResults.grade;
-
- //Save raw results object to the course so it can be accessed by the gradebook
- course.gradeCalculation = gradeCalcResults;
- } else {
- //No grade for this class
- course.letter = null;
- course.grade = null;
- }
-
- //Force re-render sidebar to show grades only if the user isn't on pages or discussions
- if ((dtps.selectedContent !== "pages") && (dtps.selectedContent !== "discuss")) {
- dtps.showClasses(true);
- }
- }
-
//Grade history and gradebook
if ((course.letter || course.grade) && (course.letter !== "...")) {
//Enable gradebook for this class
course.hasGradebook = true;
- //Save grade history
- dtps.logGrades(courseIndex);
-
//If the class is selected, call dtps.presentClass again to show the grades tab
if (courseIndex == dtps.selectedClass) {
dtps.presentClass(courseIndex);
@@ -711,9 +526,6 @@
}
}
- //Render grades tab in settings
- dtps.renderGradesInSettings();
-
//Re-render screen if the dashboard or stream is selected
if ((dtps.selectedClass == "dash") || ((dtps.selectedContent == "stream") && (dtps.selectedClass == course.num))) {
fluid.screen();
@@ -760,9 +572,6 @@
//Load popup if needed
if (dtps.popup == "firstrun") {
dtps.firstrun();
- } else if (dtps.popup == "changelog") {
- //Changelog will only show if the release notes are on dev.jottocraft.com
- dtps.changelog(Number(window.localStorage.dtps));
}
//Render inbox
@@ -988,7 +797,7 @@
//Update title to show class name
//If the dashboard is selected, this is just "Dashboard". Otherwise, this is Class.subject
$("#headText span").text(classNum == "dash" ? "Dashboard" : classNum == "search" ? "Search Results" : dtps.classes[classNum] && dtps.classes[classNum].subject);
- var icon = classNum == "dash" ? "dashboard" : classNum == "search" ? "search" : dtps.classes[classNum] && dtps.classes[classNum].icon
+ var icon = classNum == "dash" ? "dashboard" : classNum == "search" ? "search" : dtps.classes[classNum] && dtps.classes[classNum].icon;
if (icon) {
$("#headText i").text(icon);
$("#headText i").show();
@@ -1040,8 +849,7 @@
}
//Show gradebook if the LMS and the class supports it, otherwise, hide it
- const courseLMSGradebookAllowed = dtpsLMS.lmsGradebookAllowlist ? dtpsLMS.lmsGradebookAllowlist.includes(dtps.classes[classNum].id) : true;
- if ((dtpsLMS.genericGradebook || (dtpsLMS.gradebook && courseLMSGradebookAllowed)) && dtps.classes[classNum].hasGradebook) {
+ if (dtps.classes[classNum].hasGradebook) {
$(".btns .btn.grades").show();
} else {
$(".btns .btn.grades").hide();
@@ -1154,59 +962,6 @@
}
/**
- * Shows the gradebook using HTML from dtpsLMS.gradebook
- *
- * @param {string} classID Class ID
- */
-dtps.showLMSGradebook = function (classID) {
- //Get class index and set as selected class
- var classNum = dtps.classes.map(course => course.id).indexOf(classID);
- dtps.selectedClass = classNum;
-
- //Set stream as the selected content
- dtps.selectedContent = "grades";
- $("#dtpsTabBar .btn").removeClass("active");
- $("#dtpsTabBar .btn.grades").addClass("active");
-
- //Load class color, name, etc.
- dtps.presentClass(classNum);
-
- //Ensure classes are shown in the sidebar
- dtps.showClasses();
-
- if (classNum == -1) {
- //Class does not exist
- dtps.error("The selected class doesn't exist", "classNum check failed @ dtps.showLMSGradebook");
- }
-
- //Show loading indicator
- if ((dtps.selectedContent == "grades") && (dtps.selectedClass == classNum)) {
- jQuery(".classContent").html(`<div class="spinner"></div>`);
- }
-
- //Function to load gradebook HTML
- function renderGradebook() {
- dtpsLMS.gradebook(dtps.classes[classNum]).then(html => {
- if (html && (dtps.selectedClass == classNum) && (dtps.selectedContent == "grades")) {
- $(".classContent").html(html);
- if (dtpsLMS.gradebookDidRender) dtpsLMS.gradebookDidRender(dtps.classes[classNum]);
- }
- }).catch(function (err) {
- dtps.error("Could not load the gradebook", "Caught promise rejection @ dtps.showLMSGradebook", err);
- });
- }
-
- if (!fluid.externalScreens.stream) {
- //Load assignment functions first
- jQuery.getScript(dtps.baseURL + "/scripts/assignments.js", () => {
- renderGradebook();
- })
- } else {
- renderGradebook();
- }
-}
-
-/**
* Shows a URL in the iFrame card
*
* @param {string} url The URL to load
@@ -1266,38 +1021,6 @@
}
/**
- * Stores grade data locally for the previous grade feature
- *
- * @param classNum Class number to log grade
- */
-dtps.logGrades = function (classNum) {
- /*
- Grade change vars:
- gradeHistory-ID: current|previous (e.g. "A|B+" represents a change of B+ -> A)
- if there is only one grade, it is the current one
- */
- if (!dtps.classes[classNum].letter || (dtps.classes[classNum].letter == "...") || (dtps.classes[classNum].letter == "ERROR")) return;
- if (window.localStorage.getItem("gradeHistory-" + dtps.classes[classNum].id)) {
- var savedCurrent = window.localStorage.getItem("gradeHistory-" + dtps.classes[classNum].id).split("|")[0];
- var savedPrevious = window.localStorage.getItem("gradeHistory-" + dtps.classes[classNum].id).split("|")[1];
-
- if (savedCurrent !== dtps.classes[classNum].letter) {
- //Grade change
- window.localStorage.setItem("gradeHistory-" + dtps.classes[classNum].id, dtps.classes[classNum].letter + "|" + savedCurrent);
- dtps.classes[classNum].previousLetter = savedCurrent;
- }
-
- if ((savedCurrent == dtps.classes[classNum].letter) && savedPrevious) {
- //Previous grade is already saved
- dtps.classes[classNum].previousLetter = savedPrevious;
- }
- } else {
- //No history yet, store current grade
- window.localStorage.setItem("gradeHistory-" + dtps.classes[classNum].id, dtps.classes[classNum].letter);
- }
-}
-
-/**
* Opens the settings page
*
* @param {boolean} [forceRerenderDashboard] If this is true, the dashboard settings will be re-rendered
@@ -1335,9 +1058,6 @@
$("#leftDashboardColumn").attr("loaded", "true");
}
- //Render grades tab in settings
- dtps.renderGradesInSettings();
-
fluid.cards('.settingsCard');
}
@@ -1349,119 +1069,6 @@
}
/**
- * Prompts for dangerous CBL enablement
- *
- * @param {boolean} [accepted] True if the disclaimer has been accepted
- */
-dtps.dangerousCBLPrompt = function (accepted) {
- const dangerousCBLEnabled = fluid.get("pref-dangerousCBL") == "true";
- if (dangerousCBLEnabled) {
- fluid.set("pref-dangerousCBL", "false");
- dtps.settingsReloadWarning();
- } else if (accepted) {
- fluid.set("pref-dangerousCBL", "true");
- dtps.settingsReloadWarning();
- } else {
- //Prompt for acceptance
- fluid.alert("Allow CBL Features", [
- `<style>.card.alert .body {max-height: none !important;}</style>`,
- `<p>You must read and accept the following disclaimers to allow the usage of d.tech CBL features:</p>`,
- `<ol style="line-height: 1.5;">`,
- `<li>Starting June 2022, CBL features in Power+ are no longer actively updated. CBL features continue to be provided as-is for use at your own discretion.</li>`,
- `<li>Power+ does not guarantee that CBL features will be up-to-date with the d.tech CBL spec. By proceeding, you accept all risks resulting from the usage of a potentially obsolete system.</li>`,
- `<li>You are responsible for checking that the <a href="${dtps.cblSpec}">CBL spec Power+ is using</a> is correct for your use case.</li>`,
- `<li><b>In short, these features may become (or are already) obsolete. <span style="background: red; color: white;">Proceed at your own risk.<span></b></li>`,
- `</ol>`
- ].join(""), "report", [
- { name: "Accept", icon: "warning", action: () => dtps.dangerousCBLPrompt(true) },
- { name: "Cancel", icon: "close", action: () => fluid.exitAlert() }
- ], "red");
- }
-}
-
-/**
- * Renders the grades tab in settings
- */
-dtps.renderGradesInSettings = function () {
- //Render d.tech dangerous CBL settings
- if (dtpsLMS.dtech) {
- $("#classCBLChex").html(dtps.classes.map(course => {
- return (
- `<div>
- <div onclick="fluid.set('pref-enabledCBLFor${course.id}'); dtps.settingsReloadWarning();" class="checkbox pref-enabledCBLFor${course.id}"><i class="fluid-icon">check</i></div>
- <div class="label">${course.name}</div>
- </div><br />`
- );
- }));
- }
-
- //Add CBL area toggle listener
- if (fluid.get("pref-dangerousCBL") == "true") { jQuery('#cblSwitchesArea').show(); }
- document.addEventListener("pref-dangerousCBL", function (e) {
- if ((e.detail == "true") || (e.detail == true)) {
- //dangerous CBL has been enabled, show class toggle area
- jQuery('#cblSwitchesArea').show();
- } else {
- //dangerous has been disabled, hide class toggle area
- jQuery('#cblSwitchesArea').hide();
- }
- });
-
- //Render class grade bars
- $("#classGradeBars").html(dtps.classes.map(course => {
- //Percentages below are for visualization purposes only
- var percentage = 0;
- if (course.letter == "A") percentage = 100;
- if (course.letter == "A-") percentage = 91;
- if (course.letter == "B+") percentage = 88;
- if (course.letter == "B") percentage = 85;
- if (course.letter == "B-") percentage = 81;
- if (course.letter == "C+") percentage = 78;
- if (course.letter == "C") percentage = 75;
-
- return (
- course.letter ? `<div style="cursor: auto; background-color: var(--elements);" class="progressBar big">
- <div style="color: white;" class="progressLabel">${course.subject} (${course.letter})</div>
- <div class="progress" style="background-color: ${course.color}; width: calc(${percentage}% - 300px);"></div></div>` : ""
- )
- }));
-
- //Calculate GPA
- var sum = 0;
- var values = 0;
-
- dtps.classes.forEach(course => {
- if (course.letter == "...") {
- sum = null;
- } else if (course.letter && (sum !== null)) {
- var points = 0;
- if (course.letter == "A") points = 4;
- if (course.letter == "A-") points = 3.7;
- if (course.letter == "B+") points = 3.3;
- if (course.letter == "B") points = 3;
- if (course.letter == "B-") points = 2.7;
- if (course.letter == "C+") points = 2.3;
- if (course.letter == "C") points = 2.0;
- if (course.letter == "I") points = 0;
-
- sum += points;
- values++;
- }
- })
-
- if (sum == null) {
- $("#dtpsGpaText").text("...");
- } else if (values === 0) {
- $("#dtpsGpaText").text("Not available");
- } else {
- $("#dtpsGpaText").text((sum / values).toFixed(1));
- }
-
- //Initialize Fluid UI again
- fluid.init();
-}
-
-/**
* Saves dashboard prefrences
*/
dtps.saveDashboardPrefs = function () {
@@ -1501,24 +1108,6 @@
}
/**
- * Redirects to DTPS classic edition
- */
-dtps.classicEntry = function () {
- var classicName = ["P", "r", "o", "j", "e", "c", "t", " ", "D", "T", "P", "S"];
- var overwrittenHTML = ["P", "o", "w", "e", "r", "+"];
- if (dtps.classicStep == undefined) dtps.classicStep = -10;
- dtps.classicStep++;
-
- if (dtps.classicStep == 12) window.location.href = "/power+?classicEdition=true";
-
- for (var i = 0; i < dtps.classicStep; i++) {
- overwrittenHTML[i] = classicName[i];
- }
-
- $("#dtpsAboutName").html(overwrittenHTML.join(""));
-}
-
-/**
* Loads dashboard prefrences
*/
dtps.loadDashboardPrefs = function () {
@@ -1596,13 +1185,13 @@
<div class="navbar">
<div class="logo">
<img src="${dtps.baseURL + "/icon.svg"}" />
- <h4>${dtps.baseURL == "https://dev.dtps.jottocraft.com" ? "Power+ (dev)" : "Power+"}</h4>
+ <h4>Power+</h4>
</div>
${dtps.unstable && !dtpsLMS.isDemoLMS ? `
<div id="dtpsUnstable" class="navitem">
<i style="font-size: 16px;" class="fluid-icon">warning</i>
- <span style="font-weight: bold; font-size: 10px;">THIS IS AN UNSTABLE VERSION OF POWER+. USE AT YOUR OWN RISK.</span>
+ <span style="font-weight: bold; font-size: 10px;">THIS IS AN UNOFFICIAL VERSION OF POWER+. USE AT YOUR OWN RISK.</span>
</div>
` : ""}
@@ -1699,7 +1288,7 @@
<!-- Settings card (its inner HTML is added later) -->
<div style="height: 100%; overflow: auto !important;" class="card withnav focus close container settingsCard"></div>
- <!-- Changelog card -->
+ <!-- Changelog card (The changelog is removed, but this is also used for the firstrun dialog) -->
<div style="border-radius: 30px;" class="card focus changelog close container">
<i onclick="fluid.cards.close('.card.changelog')" class="fluid-icon close">close</i>
<h3>What's new in Power+</h3>
@@ -1918,14 +1507,6 @@
<div onclick="$('.abtpage').hide();$('.abtpage.theme').show();" class="item">
<i class="fluid-icon">format_paint</i> Theme
</div>
- ${dtpsLMS.dtech ? /*html*/`
- <div onclick="$('.abtpage').hide();$('.abtpage.cblCalc').show();" class="item">
- <i class="fluid-icon">calculate</i> CBL
- </div>
- ` : ``}
- <div onclick="$('.abtpage').hide();$('.abtpage.grades').show();" class="item">
- <i class="fluid-icon">assessment</i> GPA
- </div>
<div onclick="$('.abtpage').hide();$('.abtpage.dashboard').show();" class="item">
<i class="fluid-icon">dashboard</i> Dashboard
</div>
@@ -1933,9 +1514,6 @@
<div onclick="$('.abtpage').hide();$('.abtpage.debugging').show();" class="item">
<i class="fluid-icon">bug_report</i> Debugging
</div>
- <div onclick="$('.abtpage').hide();$('.abtpage.experiments').show();" class="item">
- <i class="fluid-icon">science</i> Experiments
- </div>
` : ``}
<div onclick="$('.abtpage').hide();$('.abtpage.about').show();" class="item abt">
<i class="fluid-icon">info</i> About
@@ -1945,6 +1523,8 @@
<div style="min-height: 100%" class="content">
<div class="abtpage settings">
<h5><b>Settings</b></h5>
+
+ ${dtpsLMS.dtech ? `<p style="color: var(--text);"><b>As of October 2026, all d.tech-specific features, including CBL grade calculation, have been removed from Power+.</b></p>` : ``}
<br />
<p>Sidebar</p>
@@ -1974,36 +1554,17 @@
<div onclick="fluid.set('pref-unusualDueDates'); fluid.screen();" class="switch pref-unusualDueDates active"><span class="head"></span></div>
<div class="label"><i class="fluid-icon">highlight</i> Highlight outlying due dates</div>
- <div id="dtpsPrereleaseTesting" style="${window.localStorage.prereleaseEnabled || (dtps.env == "dev") || window.localStorage.githubRepo || window.localStorage.externalReleaseURL ? "" : "display: none;"}">
+ <div id="dtpsPrereleaseTesting" style="${window.localStorage.prereleaseEnabled || (dtps.env == "dev") ? "" : "display: none;"}">
<br /><br />
- <p>Prerelease testing</p>
+ <p>Release mode</p>
<div>
<div class="btns row small">
<button
onclick="window.localStorage.setItem('dtpsLoaderPref', 'prod')"
- class="btn ${!["dev", "github", "external", "local"].includes(window.localStorage.dtpsLoaderPref) ? "active" : ""}">
+ class="btn ${window.localStorage.dtpsLoaderPref !== "local" ? "active" : ""}">
<i class="fluid-icon">label</i> Production
</button>
- <!-- check dtps.init before uncommenting <button
- onclick="window.localStorage.setItem('dtpsLoaderPref', 'dev')"
- class="btn ${window.localStorage.dtpsLoaderPref == "dev" ? "active" : ""}">
- <i class="fluid-icon">feedback</i> Dev
- </button>-->
- ${window.localStorage.githubRepo ? /*html*/`
- <button
- onclick="window.localStorage.setItem('dtpsLoaderPref', 'github')"
- class="btn ${window.localStorage.dtpsLoaderPref == "github" ? "active" : ""}">
- <i class="fluid-icon">account_tree</i> Branch
- </button>
- ` : ``}
- ${window.localStorage.externalReleaseURL ? /*html*/`
- <button
- onclick="window.localStorage.setItem('dtpsLoaderPref', 'external')"
- class="btn ${window.localStorage.dtpsLoaderPref == "external" ? "active" : ""}">
- <i class="fluid-icon">public</i> External
- </button>
- ` : ``}
<button
onclick="window.localStorage.setItem('dtpsLoaderPref', 'local')"
class="btn ${window.localStorage.dtpsLoaderPref == "local" ? "active" : ""}">
@@ -2021,51 +1582,6 @@
<div class="themeSelectionUI flat"></div>
</div>
- <div style="display: none;" class="abtpage cblCalc">
- <h5><b>d.tech CBL</b></h5>
-
- <div>
- <p><span style="width: 32px; display: inline-block; text-align: center;">⚠️</span> CBL features are no longer actively updated and may become (or are already) obsolete. Use at your own risk.</p>
- <p><span style="width: 32px; display: inline-block; text-align: center;">ℹ️</span> CBL features follow the <a href="${dtps.cblSpec}">August 2021</a> specification.</p>
- </div>
-
- <br />
-
- <div onclick="dtps.dangerousCBLPrompt();" class="switch pref-dangerousCBL"><span class="head"></span></div>
- <div class="label"><i class="fluid-icon">functions</i> Allow CBL features</div>
-
- <br /><br /><br />
-
- <div id="cblSwitchesArea" style="display: none;">
-
- <div class="divider"></div>
-
- <br />
-
- <p>Check the boxes below to opt-in to CBL features for each class you'd like to use them with:</p>
-
- <br />
-
- <div id="classCBLChex"></div>
-
- </div>
- </div>
-
- <div style="display: none;" class="abtpage grades">
- <h5><b>GPA</b></h5>
-
- <br />
-
- <div>
- <h6>Unweighted GPA: <b id="dtpsGpaText">...</b></h6>
- <p style="color: var(--secText);"><i>This GPA calculation is based on the letter grades shown below and is not official.</i></p>
- </div>
-
- <br />
-
- <div id="classGradeBars"></div>
- </div>
-
<div style="display: none;" class="abtpage dashboard">
<h5><b>Dashboard</b></h5>
<p>You can rearrange the items shown on the dashboard by dragging them below. You might have to reload Power+ for changes to take effect.</p>
@@ -2088,53 +1604,17 @@
<button onclick="dtps.firstrun()" class="btn small"><i class="fluid-icon">web_asset</i> Show firstrun screen</button>
</div>
- <div>
- <button onclick="dtps.changelog(undefined, true);" class="btn small"><i class="fluid-icon">description</i> Show draft changelog</button>
- </div>
-
<br /><br />
<h5>Release configuration</h5>
- <button onclick="['dtpsLoaderPref', 'prereleaseEnabled', 'githubRepo', 'externalReleaseURL', 'dtpsLMSOverride'].forEach(k => window.localStorage.removeItem(k)); window.location.reload();" class="btn small"><i class="fluid-icon">cancel</i> Clear release configurations</button>
+ <button onclick="['dtpsLoaderPref', 'prereleaseEnabled', 'dtpsLMSOverride'].forEach(k => window.localStorage.removeItem(k)); window.location.reload();" class="btn small"><i class="fluid-icon">cancel</i> Clear release configurations</button>
<br /><br />
<div>
- <input id="dtpsGithubRepo" value="${window.localStorage.githubRepo || ""}" placeholder="Branch GitHub repo" />
- <button class="btn small" onclick="window.localStorage.setItem('githubRepo', $('#dtpsGithubRepo').val())"><i class="fluid-icon">save</i> Save</button>
- </div>
-
- <div>
- <input id="dtpsExternalReleaseURL" value="${window.localStorage.externalReleaseURL || ""}" placeholder="External release URL" />
- <button class="btn small" onclick="window.localStorage.setItem('externalReleaseURL', $('#dtpsExternalReleaseURL').val())"><i class="fluid-icon">save</i> Save</button>
- </div>
-
- <div>
<input id="dtpsLMSOverride" value="${window.localStorage.dtpsLMSOverride || ""}" placeholder="LMS override" />
<button class="btn small" onclick="window.localStorage.setItem('dtpsLMSOverride', $('#dtpsLMSOverride').val())"><i class="fluid-icon">save</i> Save</button>
</div>
-
- <br />
-
- <h5>Behavior Overrides</h5>
-
- <br />
- <div onclick="fluid.set('pref-debuggingGenericGradebook')" class="switch pref-debuggingGenericGradebook"><span class="head"></span></div>
- <div class="label">Always use the generic gradebook</div>
- </div>
- <div style="display: none;" class="abtpage experiments">
- <h5><b>Experiments</b></h5>
- <p>These settings control how Power+ behaves. Changing these settings may enable unsupported and/or unfinished features that can break Power+. Use at your own risk.</p>
-
- <button onclick="Object.keys(dtps.remoteConfig).forEach(k => window.localStorage.removeItem('dtpsRemoteConfig-' + k));" class="btn small"><i class="fluid-icon">cancel</i> Clear Overrides</button>
- <br /><br />
- ${Object.keys(dtps.remoteConfig).map(k => (`
- <div>
- <p>${k} ${window.localStorage.getItem("dtpsRemoteConfig-" + k) ? " <b>(overridden)</b>" : ""}</p>
- <input value="${dtps.remoteConfig[k]}" placeholder="Value" />
- <button class="btn small" onclick="window.localStorage.setItem('dtpsRemoteConfig-${k}', $(this).siblings('input').val())"><i class="fluid-icon">save</i> Save</button>
- </div>
- `)).join("")}
</div>
` : ``}
@@ -2145,15 +1625,15 @@
<img src="${dtps.baseURL + "/icon.svg"}" style="height: 50px; margin-right: 10px; vertical-align: middle; margin-top: 20px;" />
<div style="display: inline-block; vertical-align: middle;">
- <h4 id="dtpsAboutName" onclick="dtps.classicEntry()" style="font-weight: bold; font-size: 32px; margin-bottom: 0px; user-select: none;">${dtps.baseURL == "https://dev.dtps.jottocraft.com" ? "Power+ (dev)" : "Power+"}</h4>
+ <h4 id="dtpsAboutName" style="font-weight: bold; font-size: 32px; margin-bottom: 0px; user-select: none;">Power+</h4>
<div style="font-size: 16px; margin-top: 5px;">
${dtps.readableVer}
<div style="display: inline-block;margin: 0px 5px;font-size: 12px;">${baseHost !== "powerplus.app" ? `(from ${baseHost})` : ""}</div>
</div>
</div>
- <div style="margin-top: 15px; margin-bottom: 7px;"><a onclick="dtps.changelog();" style="color: var(--lightText); margin: 0px 5px;" href="#"><i class="fluid-icon" style="vertical-align: middle">update</i> Changelog</a>
- <a style="color: var(--lightText); margin: 0px 5px;" href="mailto:[email protected]"><i class="fluid-icon" style="vertical-align: middle">email</i> Contact me: [email protected]</a>
+ <div style="margin-top: 15px; margin-bottom: 7px;">
+ <a style="color: var(--lightText); margin: 0px 5px;" href="https://jottocraft.com/contact"><i class="fluid-icon" style="vertical-align: middle">email</i> Contact me</a>
</div>
</div>
@@ -2198,7 +1678,7 @@
<div style="margin-top: 15px; margin-bottom: 7px;">
<a style="color: var(--lightText); margin: 0px 5px; cursor: pointer;" onclick="dtps.clearData();"><i class="fluid-icon" style="vertical-align: middle">refresh</i> Reset Power+</a>
- <a style="color: var(--lightText); margin: 0px 5px; cursor: pointer;" onclick="if (confirm('Prerelease versions of Power+ are often untested and can break or display incorrect information. Are you sure you want to continue?')) {window.localStorage.prereleaseEnabled = 'true'; $('#dtpsPrereleaseTesting').show(); alert('Prerelease versions can be enabled by going to Settings -> Prerelease testing');}"><i class="fluid-icon" style="vertical-align: middle">feedback</i> Test prerelease versions</a>
+ <a style="color: var(--lightText); margin: 0px 5px; cursor: pointer;" onclick="if (confirm('Only enable Local Development Mode if you are modifying the Power+ source code on your device. Proceeding could allow unauthorized scripts to load, which can cause security issues. Are you sure you want to continue?')) {window.localStorage.prereleaseEnabled = 'true'; $('#dtpsPrereleaseTesting').show(); alert('Local Development Mode can be enabled by going to Settings -> Release mode');}"><i class="fluid-icon" style="vertical-align: middle">code</i> Allow Local Development Mode</a>
</div>
</div>
@@ -2210,7 +1690,7 @@
<img style="height: 38px; margin-right: 10px; vertical-align: middle;" src="https://cdn.jottocraft.com/images/footerImage.png" />
<h5 style="display: inline-block; vertical-align: middle; color: var(--text);">jottocraft</h5>
</a>
- <p>Copyright (c) jottocraft 2018-2026. This project is <a href="https://jottocraft.com/oss">open source</a>.
+ <p>Copyright (c) jottocraft 2018-2026. Power+ is <a href="https://jottocraft.com/oss">open source</a>.
</div>
</div>
</div>
@@ -2250,11 +1730,6 @@
* @property {string} source URL to the LMS integration's source code
* @property {string} [inboxURL] URL to the LMS inbox. Required only if dtpsLMS.fetchUnreadMessageCount count is implemented
* @property {boolean} [dtech] True if this LMS is d.tech
- * @property {boolean} [institutionSpecific] True if the LMS is designed for a specific institution instead of a broader LMS
- * @property {boolean|string[]} [useRubricGrades] True if DTPS should use rubric grades for assignments. If an array is provided, only assignments whose class ID is in the array will use rubric grades.
- * @property {boolean} [genericGradebook] True if DTPS should show the generic gradebook. Ignored if dtpsLMS.gradebook defined.
- * @property {string[]} [gradeCalculationAllowlist] An array of class IDs that will use dtpsLMS.calculateGrade, if provided. All other classes will bypass dtpsLMS.calculateGrade and instead use the default LMS grade.
- * @property {string[]} [lmsGradebookAllowlist] An array of class IDs that will use dtpsLMS.gradebook, if provided. All other classes will bypass dtpsLMS.gradebook and instead use the generic gradebook if enabled.
*/
/**
@@ -2383,30 +1858,6 @@
*/
/**
-* @name dtpsLMS.gradebook
-* @description [OPTIONAL] Renders custom gradebook HTML for unique grading systems or for a more tailored experience. The gradebook only shows for classes with a grade and with at least 1 assignment.
-* @kind function
-* @param {Class} course Class to render the gradebook for. If custom grade calculation is enabled (dtpsLMS.calculateGrade), those results can be accessed at course.gradeCalculation.
-* @return {Promise<string>} A promise which resolves to HTML to render for the class gradebook
-*/
-
-/**
-* @name dtpsLMS.gradebookDidRender
-* @description [OPTIONAL] Called after the HTML returned by dtpsLMS.gradebook has rendered. Runs any initialization needed for the gradebook, such as enabling interactive elements or what-if grades.
-* @kind function
-* @param {Class} course Class the gradebook was rendered for
-*/
-
-/**
-* @name dtpsLMS.calculateGrade
-* @description [OPTIONAL] Calculates class grades with a custom grade calculation formula. Used for unique grading systems.
-* @kind function
-* @param {Class} course Class to calculate grades for [DO NOT USE COURSE.ASSIGNMENTS to access assignments for grade calculation. Use the assignments parameter instead.]
-* @param {Assignment[]} assignments Assignments used for grade calculation. Use this instead of course.assignments for hypothetical/what-if grade calculation.
-* @return {undefined|object} The letter grade should be returned in the "letter" property as a string and the percentage in the "grade" property as a number. Other custom properties can be set if they need to be accessed by dtpsLMS.gradebook. Return undefined if there is no grade for the class.
-*/
-
-/**
* @name dtpsLMS.isUsualDueDate
* @description [OPTIONAL, INSTITUTION ONLY] This function returns true if the due date provided is usual/expected and false if the due date is unusual/expected. If the due date is unusual, it is shown in bold in the UI. For institutions where there is a pattern/standard for due dates between classes.
* @kind function
@@ -2477,10 +1928,8 @@
* @property {string} [color] Class color
* @property {number} [grade] Current percentage grade in the class (a number from 0 to 100)
* @property {string} [letter] Current letter grade in the class
-* @property {string} [previousLetter] Automatically managed by DTPS. The previous letter grade in this class, based on local grade history.
* @property {string} [image] URL to the class background image
* @property {User} [teacher] Class teacher. If the class has multiple teachers, this is the primary teacher.
* @property {boolean} [hasGradebook] Automatically managed by DTPS. True if the class should show the gradebook tab.
-* @property {object} [gradeCalculation] Automatically managed by DTPS. If custom grade calculation is implemented, this will be the results from custom grade calculation returned by dtpsLMS.calculateGrade.
* @property {string} [videoMeetingURL] The URL used to join this class' online meeting. If dtpsLMS.fetchMeetingURL is implemented, DTPS will use it to get the meeting URL if this property is undefined. If this property is null, DTPS will not call dtpsLMS.fetchMeeting URL for the class.
*/