mirror of
https://github.com/GuySandler/CanvasRefined.git
synced 2026-06-22 02:19:53 +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>
|
<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>
|
<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;">
|
<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>
|
<span>Date</span>
|
||||||
</div>
|
</div>
|
||||||
<div style="display: flex; gap: 10px; align-items: center;">
|
<div style="display: flex; gap: 10px; align-items: center;">
|
||||||
|
|||||||
@ -365,16 +365,13 @@ function getCardsFromDashboard() {
|
|||||||
dashboard_cards.forEach(card => {
|
dashboard_cards.forEach(card => {
|
||||||
const id = card.querySelector(".ic-DashboardCard__link").href.split("courses/")[1];
|
const id = card.querySelector(".ic-DashboardCard__link").href.split("courses/")[1];
|
||||||
if (count >= (options["card_limit"] || 25)) return;
|
if (count >= (options["card_limit"] || 25)) return;
|
||||||
|
|
||||||
if (!cards || !cards[id]) {
|
if (!cards || !cards[id]) {
|
||||||
console.log("adding to custom_cards");
|
console.log("adding to custom_cards");
|
||||||
newCards = true;
|
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 };
|
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 };
|
||||||
} /*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 = "";
|
|
||||||
} */
|
|
||||||
if (!cards_2 || !cards_2[id]) {
|
if (!cards_2 || !cards_2[id]) {
|
||||||
console.log("adding to custom_cards_2");
|
console.log("adding to custom_cards_2");
|
||||||
newCards = true;
|
newCards = true;
|
||||||
|
|||||||
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() {
|
function setup() {
|
||||||
|
|
||||||
const menu = {
|
const menu = {
|
||||||
"switches": syncedSwitches,
|
"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": {
|
"tabs": {
|
||||||
"advanced-settings": { "setup": displayAdvancedCards, "tab": ".advanced" },
|
"advanced-settings": { "setup": displayAdvancedCards, "tab": ".advanced" },
|
||||||
"gpa-bounds-btn": { "setup": displayGPABounds, "tab": ".gpa-bounds-container" },
|
"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": "auto_dark_end", "setup": (initial) => setupAutoDarkInput(initial, "auto_dark_end") },
|
||||||
{ "identifier": "num_assignments", "setup": (initial) => setupAssignmentsSlider(initial) },
|
{ "identifier": "num_assignments", "setup": (initial) => setupAssignmentsSlider(initial) },
|
||||||
{ "identifier": "num_todo_items", "setup": (initial) => setupTodoSlider(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 => {
|
chrome.storage.sync.get(menu.switches, sync => {
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
"manifest_version": 3,
|
"manifest_version": 3,
|
||||||
"name": "Better Canvas",
|
"name": "Better Canvas",
|
||||||
"description": "Feature packed extension for Canvas.",
|
"description": "Feature packed extension for Canvas.",
|
||||||
"version": "5.11.2",
|
"version": "5.11.3",
|
||||||
"icons": {
|
"icons": {
|
||||||
"16": "icon/icon-16.png",
|
"16": "icon/icon-16.png",
|
||||||
"32": "icon/icon-32.png",
|
"32": "icon/icon-32.png",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user