mirror of
https://github.com/GuySandler/CanvasRefined.git
synced 2026-06-21 09:59:55 +02:00
5.11.3
This commit is contained in:
parent
076e9aa479
commit
3b04a2dfbd
@ -760,7 +760,7 @@
|
||||
<h3 class="header-small">Card method</h3>
|
||||
<p><b style="font-weight:600">This is an experimental feature.</b> You shouldn't need these on.</p>
|
||||
<div style="display: flex; gap: 10px; align-items: center;margin-top: 5px;">
|
||||
<input type="checkbox" id="card_method_creation"></input>
|
||||
<input type="checkbox" id="card_method_date"></input>
|
||||
<span>Date</span>
|
||||
</div>
|
||||
<div style="display: flex; gap: 10px; align-items: center;">
|
||||
|
||||
@ -365,16 +365,13 @@ function getCardsFromDashboard() {
|
||||
dashboard_cards.forEach(card => {
|
||||
const id = card.querySelector(".ic-DashboardCard__link").href.split("courses/")[1];
|
||||
if (count >= (options["card_limit"] || 25)) return;
|
||||
|
||||
if (!cards || !cards[id]) {
|
||||
console.log("adding to custom_cards");
|
||||
newCards = true;
|
||||
cards[id] = { "default": card.querySelector(".ic-DashboardCard__header-subtitle").textContent.substring(0, 20), "name": "", "code": "", "img": "", "hidden": false, "weight": "regular", "credits": 1, "eid": options["card_limit"] - count, "gr": null };
|
||||
} /*else if (cards && cards[id]) {
|
||||
newCards = true;
|
||||
if (!cards[id].default) cards[id].default = card.querySelector(".ic-DashboardCard__header-subtitle").textContent.substring(0, 20);
|
||||
if (!cards[id].eid) cards[id].eid = options["card_limit"] - count;
|
||||
if (!cards[id].code) cards[id].code = "";
|
||||
} */
|
||||
cards[id] = { "default": card.querySelector(".ic-DashboardCard__header-subtitle").textContent.substring(0, 20), "name": "", "code": "", "img": "", "hidden": false, "weight": "regular", "credits": 1, "eid": 100000 - count, "gr": null };
|
||||
}
|
||||
|
||||
if (!cards_2 || !cards_2[id]) {
|
||||
console.log("adding to custom_cards_2");
|
||||
newCards = true;
|
||||
@ -1426,7 +1423,7 @@ function getCardId(card) {
|
||||
|
||||
// has ~ but dashboard card method is used
|
||||
if (options["custom_cards"][id]) return id;
|
||||
|
||||
|
||||
// weird case, some canvases replace consecutive 0s with a ~ in the id
|
||||
// but the number of 0s isn't consistent between schools
|
||||
id = id.split("~");
|
||||
|
||||
14
js/popup.js
14
js/popup.js
@ -169,11 +169,19 @@ function setupCardLimitSlider(initial) {
|
||||
})
|
||||
}
|
||||
|
||||
function setupDashboardMethod(initial) {
|
||||
let el = document.querySelector("#card_method_dashboard");
|
||||
el.checked = initial;
|
||||
el.addEventListener("change", (e) => {
|
||||
chrome.storage.sync.set({ "custom_cards": {}, "custom_cards_2": {}, "custom_cards_3": {}, "card_method_dashboard": e.target.checked });
|
||||
});
|
||||
}
|
||||
|
||||
function setup() {
|
||||
|
||||
const menu = {
|
||||
"switches": syncedSwitches,
|
||||
"checkboxes": ['card_method_dashboard', 'card_method_date', 'show_updates', 'todo_colors', 'device_dark', 'relative_dues', 'card_overdues', 'todo_overdues', 'gpa_calc_prepend', 'auto_dark', 'assignment_date_format', 'todo_hr24', 'grade_hover', 'hide_completed', 'hover_preview'],
|
||||
"checkboxes": ['card_method_date', 'show_updates', 'todo_colors', 'device_dark', 'relative_dues', 'card_overdues', 'todo_overdues', 'gpa_calc_prepend', 'auto_dark', 'assignment_date_format', 'todo_hr24', 'grade_hover', 'hide_completed', 'hover_preview'],
|
||||
"tabs": {
|
||||
"advanced-settings": { "setup": displayAdvancedCards, "tab": ".advanced" },
|
||||
"gpa-bounds-btn": { "setup": displayGPABounds, "tab": ".gpa-bounds-container" },
|
||||
@ -189,7 +197,9 @@ function setup() {
|
||||
{ "identifier": "auto_dark_end", "setup": (initial) => setupAutoDarkInput(initial, "auto_dark_end") },
|
||||
{ "identifier": "num_assignments", "setup": (initial) => setupAssignmentsSlider(initial) },
|
||||
{ "identifier": "num_todo_items", "setup": (initial) => setupTodoSlider(initial) },
|
||||
{ "identifier": "card_limit", "setup": (initial) => setupCardLimitSlider(initial) }],
|
||||
{ "identifier": "card_limit", "setup": (initial) => setupCardLimitSlider(initial) },
|
||||
{ "identifier": "card_method_dashboard", "setup": (initial) => setupDashboardMethod(initial) }
|
||||
],
|
||||
}
|
||||
|
||||
chrome.storage.sync.get(menu.switches, sync => {
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
"manifest_version": 3,
|
||||
"name": "Better Canvas",
|
||||
"description": "Feature packed extension for Canvas.",
|
||||
"version": "5.11.2",
|
||||
"version": "5.11.3",
|
||||
"icons": {
|
||||
"16": "icon/icon-16.png",
|
||||
"32": "icon/icon-32.png",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user