mirror of
https://github.com/GuySandler/CanvasRefined.git
synced 2026-11-03 13:57:17 +01:00
canvas notes supressor
This commit is contained in:
parent
cb2867bbb0
commit
8428d86f54
@ -1082,6 +1082,15 @@
|
||||
"next_timeframe": {
|
||||
"message": "Look ahead to the next timeframe"
|
||||
},
|
||||
"notes_suppressor": {
|
||||
"message": "Canvas Notes Suppressor"
|
||||
},
|
||||
"notes_suppressor_desc": {
|
||||
"message": "Hides Canvas' \"Mark unclear / Mark important\" popup that appears when you select text."
|
||||
},
|
||||
"notes_suppressor_info_label": {
|
||||
"message": "Canvas Notes Suppressor info"
|
||||
},
|
||||
"no_auto_detect": {
|
||||
"message": "Don't auto detect canvases"
|
||||
},
|
||||
|
||||
@ -195,6 +195,14 @@
|
||||
<div class="sliderbg"></div>
|
||||
</div><span class="option-name" data-i18n="global_search">Global Canvas Search</span>
|
||||
</div>
|
||||
<div class="option" id="tab_icons">
|
||||
<input type="radio" id="off" name="tab_icons">
|
||||
<input type="radio" id="on" name="tab_icons">
|
||||
<div class="slider">
|
||||
<div class="sliderknob"></div>
|
||||
<div class="sliderbg"></div>
|
||||
</div><span class="option-name" data-i18n="tab_icons">Color coded tab icons</span>
|
||||
</div>
|
||||
<div class="option" id="grade_analytics">
|
||||
<input type="radio" id="off" name="grade_analytics">
|
||||
<input type="radio" id="on" name="grade_analytics">
|
||||
@ -459,14 +467,6 @@
|
||||
</div>
|
||||
<span class="option-name" data-i18n="full_width">Full Width Fix</span>
|
||||
</div>
|
||||
<div class="option" id="tab_icons">
|
||||
<input type="radio" id="off" name="tab_icons">
|
||||
<input type="radio" id="on" name="tab_icons">
|
||||
<div class="slider">
|
||||
<div class="sliderknob"></div>
|
||||
<div class="sliderbg"></div>
|
||||
</div><span class="option-name" data-i18n="tab_icons">Color coded tab icons</span>
|
||||
</div>
|
||||
<div class="option" id="hide_new_canvas">
|
||||
<input type="radio" id="off" name="hide_new_canvas">
|
||||
<input type="radio" id="on" name="hide_new_canvas">
|
||||
@ -483,6 +483,18 @@
|
||||
<div class="sliderbg"></div>
|
||||
</div><span class="option-name" data-i18n="hide_sequence_footer">Hide Next/Previous Buttons</span>
|
||||
</div>
|
||||
<div class="option" id="notes_suppressor">
|
||||
<input type="radio" id="off" name="notes_suppressor">
|
||||
<input type="radio" id="on" name="notes_suppressor">
|
||||
<div class="slider">
|
||||
<div class="sliderknob"></div>
|
||||
<div class="sliderbg"></div>
|
||||
</div><span class="option-name" data-i18n="notes_suppressor">Canvas Notes Suppressor</span>
|
||||
<span class="cr-info-bubble" tabindex="0" role="button" data-i18n-aria-label="notes_suppressor_info_label" aria-label="Canvas Notes Suppressor info">
|
||||
<svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="12" y1="16" x2="12" y2="12"/><line x1="12" y1="8" x2="12.01" y2="8"/></svg>
|
||||
<span class="cr-info-bubble-text" data-i18n="notes_suppressor_desc">Hides Canvas' "Mark unclear / Mark important" popup that appears when you select text.</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@ -76,6 +76,7 @@ function setupNavigationListener() {
|
||||
watchSequenceFooter();
|
||||
applyHideSidebar();
|
||||
applyHideAssignmentSidebar();
|
||||
applyNotesSuppressor();
|
||||
watchSubmissionPageButton();
|
||||
watchProfileLogoutPageButton();
|
||||
watchGradeAnalytics();
|
||||
@ -1084,6 +1085,7 @@ function startExtension() {
|
||||
checkDashboardReady();
|
||||
loadCustomFont();
|
||||
applyAestheticChanges();
|
||||
applyNotesSuppressor();
|
||||
watchNewCanvasButton();
|
||||
changeFavicon();
|
||||
updateReminders();
|
||||
@ -1529,6 +1531,9 @@ function applyOptionsChanges(changes) {
|
||||
// Feature gating changes on quiz pages; reload to apply cleanly.
|
||||
if (isQuizPage()) window.location.reload();
|
||||
break;
|
||||
case "notes_suppressor":
|
||||
applyNotesSuppressor();
|
||||
break;
|
||||
case "sidebar_scale": {
|
||||
const existingSidebar = document.getElementById("better-sidebar-container");
|
||||
if (existingSidebar) {
|
||||
@ -1961,6 +1966,28 @@ async function applyCustomBackground() {
|
||||
document.documentElement.appendChild(style);
|
||||
}
|
||||
|
||||
/*
|
||||
Canvas Notes Suppressor
|
||||
|
||||
Canvas' built-in notes feature pops a "Mark unclear / Mark important" toolbar
|
||||
(#notebook-inline-reaction-menu) over selected text. On by default (notes_suppressor);
|
||||
a plain stylesheet toggle hides it, and quiz safe mode yields to default Canvas.
|
||||
*/
|
||||
function applyNotesSuppressor() {
|
||||
const on = options.notes_suppressor !== false && !quizSafeModeActive();
|
||||
let style = document.getElementById("canvasrefined-notes-suppressor");
|
||||
if (!on) {
|
||||
if (style) style.remove();
|
||||
return;
|
||||
}
|
||||
if (!style) {
|
||||
style = document.createElement("style");
|
||||
style.id = "canvasrefined-notes-suppressor";
|
||||
document.documentElement.appendChild(style);
|
||||
}
|
||||
style.textContent = "#notebook-inline-reaction-menu{display:none !important;visibility:hidden !important;}";
|
||||
}
|
||||
|
||||
function applyBetterSidebarLayoutFix() {
|
||||
let style = document.querySelector("#canvasrefined-sidebar-layout-fix") || document.createElement("style");
|
||||
style.id = "canvasrefined-sidebar-layout-fix";
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
const syncedSwitches = ['remind', 'tab_icons', 'dark_mode', 'remlogo', 'full_width', 'auto_dark', 'assignments_due', 'gpa_calc', 'gradient_cards', 'disable_color_overlay', 'dashboard_grades', 'dashboard_notes', 'focus_timer', 'breathing', 'daily_quotes', 'quick_links', 'heatmap', 'better_todo', 'todo_celebrations_enabled', 'better_sidebar', 'condensed_cards', 'hide_new_canvas', 'hide_sequence_footer', 'center_cards', 'quiz_safe_mode', 'global_search', 'grade_analytics', 'hide_personal_details', 'hide_sidebar'];
|
||||
const syncedSwitches = ['remind', 'tab_icons', 'dark_mode', 'remlogo', 'full_width', 'auto_dark', 'assignments_due', 'gpa_calc', 'gradient_cards', 'disable_color_overlay', 'dashboard_grades', 'dashboard_notes', 'focus_timer', 'breathing', 'daily_quotes', 'quick_links', 'heatmap', 'better_todo', 'todo_celebrations_enabled', 'better_sidebar', 'condensed_cards', 'hide_new_canvas', 'hide_sequence_footer', 'center_cards', 'quiz_safe_mode', 'global_search', 'notes_suppressor', 'grade_analytics', 'hide_personal_details', 'hide_sidebar'];
|
||||
const syncedSubOptions = [
|
||||
"grade_analytics_zones",
|
||||
"hide_course_images",
|
||||
@ -242,7 +242,7 @@ const exportWidgets = [
|
||||
];
|
||||
const exportBackground = ["customBackgroundLink", "customBackgroundScale", "customBackgroundDaily", "customBackgroundNasaDaily", "customBackgroundColor", "customBackgroundColorTransparent", "fitImageToScreen", "card_transparency", "bg_opacity", "sidebar_opacity", "bg_blur", "sidebar_blur", "card_opacity", "card_blur"];
|
||||
// Master "On/off toggles": every visual toggle, minus GPA/schedule/productivity.
|
||||
const exportToggles = ["dark_mode", "quiz_safe_mode", "grade_analytics", "grade_analytics_zones"].concat(exportCardColorToggles, exportLayout, exportSidebar, exportTodo);
|
||||
const exportToggles = ["dark_mode", "quiz_safe_mode", "notes_suppressor", "grade_analytics", "grade_analytics_zones"].concat(exportCardColorToggles, exportLayout, exportSidebar, exportTodo);
|
||||
const fontsDropdownStateKey = "fonts_dropdown_open";
|
||||
|
||||
const apiurl = "none";
|
||||
@ -390,6 +390,7 @@ const defaultOptions = {
|
||||
"hide_sidebar": false,
|
||||
"grade_analytics_zones": false,
|
||||
"quiz_safe_mode": false,
|
||||
"notes_suppressor": true,
|
||||
"dark_mode_fix": [],
|
||||
"assignment_states": {},
|
||||
"tab_icons": false,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user