mirror of
https://github.com/GuySandler/CanvasRefined.git
synced 2026-11-03 22:07:18 +01:00
more stuff
This commit is contained in:
parent
27dba082cb
commit
6b06321687
@ -1416,7 +1416,7 @@
|
|||||||
"message": "Funktionen suchen..."
|
"message": "Funktionen suchen..."
|
||||||
},
|
},
|
||||||
"search_hint": {
|
"search_hint": {
|
||||||
"message": "Beginne zu tippen, um deine Module und Aufgaben zu durchsuchen. Verwende @kursname, um einen bestimmten Kurs zu durchsuchen, oder @grades, um die Notenseite eines Kurses zu öffnen."
|
"message": "Beginne zu tippen, um deine Module und Aufgaben zu durchsuchen. Verwende @kursname, um einen bestimmten Kurs zu durchsuchen, oder @grades, um die Notenseite eines Kurses zu öffnen, oder @home, um zu deinem Dashboard zu springen."
|
||||||
},
|
},
|
||||||
"search_navigate": {
|
"search_navigate": {
|
||||||
"message": "navigieren"
|
"message": "navigieren"
|
||||||
@ -1472,6 +1472,9 @@
|
|||||||
"search_type_file": {
|
"search_type_file": {
|
||||||
"message": "Datei"
|
"message": "Datei"
|
||||||
},
|
},
|
||||||
|
"search_type_home": {
|
||||||
|
"message": "Startseite"
|
||||||
|
},
|
||||||
"search_type_item": {
|
"search_type_item": {
|
||||||
"message": "Element"
|
"message": "Element"
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1440,7 +1440,7 @@
|
|||||||
"message": "Search features..."
|
"message": "Search features..."
|
||||||
},
|
},
|
||||||
"search_hint": {
|
"search_hint": {
|
||||||
"message": "Start typing to search your modules and assignments. Use @coursename to search a specific course, or @grades to open a course's grades page."
|
"message": "Start typing to search your modules and assignments. Use @coursename to search a specific course, or @grades to open a course's grades page, or @home to jump to your dashboard."
|
||||||
},
|
},
|
||||||
"search_index_count": {
|
"search_index_count": {
|
||||||
"message": "{{COUNT}} items"
|
"message": "{{COUNT}} items"
|
||||||
@ -1523,6 +1523,9 @@
|
|||||||
"search_type_grades": {
|
"search_type_grades": {
|
||||||
"message": "Grades"
|
"message": "Grades"
|
||||||
},
|
},
|
||||||
|
"search_type_home": {
|
||||||
|
"message": "Home"
|
||||||
|
},
|
||||||
"search_type_item": {
|
"search_type_item": {
|
||||||
"message": "Item"
|
"message": "Item"
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1416,7 +1416,7 @@
|
|||||||
"message": "Buscar funciones..."
|
"message": "Buscar funciones..."
|
||||||
},
|
},
|
||||||
"search_hint": {
|
"search_hint": {
|
||||||
"message": "Empieza a escribir para buscar en tus módulos y tareas. Usa @coursename para buscar un curso concreto, o @grades para abrir la página de notas de un curso."
|
"message": "Empieza a escribir para buscar en tus módulos y tareas. Usa @coursename para buscar un curso concreto, o @grades para abrir la página de notas de un curso, o @home para ir a tu panel."
|
||||||
},
|
},
|
||||||
"search_navigate": {
|
"search_navigate": {
|
||||||
"message": "navegar"
|
"message": "navegar"
|
||||||
@ -1472,6 +1472,9 @@
|
|||||||
"search_type_file": {
|
"search_type_file": {
|
||||||
"message": "Archivo"
|
"message": "Archivo"
|
||||||
},
|
},
|
||||||
|
"search_type_home": {
|
||||||
|
"message": "Inicio"
|
||||||
|
},
|
||||||
"search_type_item": {
|
"search_type_item": {
|
||||||
"message": "Elemento"
|
"message": "Elemento"
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1416,7 +1416,7 @@
|
|||||||
"message": "Rechercher des fonctionnalités..."
|
"message": "Rechercher des fonctionnalités..."
|
||||||
},
|
},
|
||||||
"search_hint": {
|
"search_hint": {
|
||||||
"message": "Commencez à taper pour rechercher vos modules et devoirs. Utilisez @nomducours pour chercher un cours précis, ou @grades pour ouvrir la page des notes d'un cours."
|
"message": "Commencez à taper pour rechercher vos modules et devoirs. Utilisez @nomducours pour chercher un cours précis, ou @grades pour ouvrir la page des notes d'un cours, ou @home pour aller à votre tableau de bord."
|
||||||
},
|
},
|
||||||
"search_navigate": {
|
"search_navigate": {
|
||||||
"message": "naviguer"
|
"message": "naviguer"
|
||||||
@ -1472,6 +1472,9 @@
|
|||||||
"search_type_file": {
|
"search_type_file": {
|
||||||
"message": "Fichier"
|
"message": "Fichier"
|
||||||
},
|
},
|
||||||
|
"search_type_home": {
|
||||||
|
"message": "Accueil"
|
||||||
|
},
|
||||||
"search_type_item": {
|
"search_type_item": {
|
||||||
"message": "Élément"
|
"message": "Élément"
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1416,7 +1416,7 @@
|
|||||||
"message": "Cerca funzioni..."
|
"message": "Cerca funzioni..."
|
||||||
},
|
},
|
||||||
"search_hint": {
|
"search_hint": {
|
||||||
"message": "Inizia a digitare per cercare moduli e consegne. Usa @corsonome per cercare un corso specifico o @grades per aprire la pagina dei voti di un corso."
|
"message": "Inizia a digitare per cercare moduli e consegne. Usa @corsonome per cercare un corso specifico o @grades per aprire la pagina dei voti di un corso, oppure @home per andare alla tua dashboard."
|
||||||
},
|
},
|
||||||
"search_navigate": {
|
"search_navigate": {
|
||||||
"message": "naviga"
|
"message": "naviga"
|
||||||
@ -1472,6 +1472,9 @@
|
|||||||
"search_type_file": {
|
"search_type_file": {
|
||||||
"message": "File"
|
"message": "File"
|
||||||
},
|
},
|
||||||
|
"search_type_home": {
|
||||||
|
"message": "Home"
|
||||||
|
},
|
||||||
"search_type_item": {
|
"search_type_item": {
|
||||||
"message": "Elemento"
|
"message": "Elemento"
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1416,7 +1416,7 @@
|
|||||||
"message": "機能を検索..."
|
"message": "機能を検索..."
|
||||||
},
|
},
|
||||||
"search_hint": {
|
"search_hint": {
|
||||||
"message": "モジュールや課題を検索するには入力してください。@コース名で特定のコースを検索、@gradesでコースの成績ページを開けます。"
|
"message": "モジュールや課題を検索するには入力してください。@コース名で特定のコースを検索、@gradesでコースの成績ページを開けます、または @home でダッシュボードに移動できます。"
|
||||||
},
|
},
|
||||||
"search_navigate": {
|
"search_navigate": {
|
||||||
"message": "移動"
|
"message": "移動"
|
||||||
@ -1472,6 +1472,9 @@
|
|||||||
"search_type_file": {
|
"search_type_file": {
|
||||||
"message": "ファイル"
|
"message": "ファイル"
|
||||||
},
|
},
|
||||||
|
"search_type_home": {
|
||||||
|
"message": "ホーム"
|
||||||
|
},
|
||||||
"search_type_item": {
|
"search_type_item": {
|
||||||
"message": "項目"
|
"message": "項目"
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1416,7 +1416,7 @@
|
|||||||
"message": "Pesquisar funcionalidades..."
|
"message": "Pesquisar funcionalidades..."
|
||||||
},
|
},
|
||||||
"search_hint": {
|
"search_hint": {
|
||||||
"message": "Começa a escrever para procurar módulos e trabalhos. Usa @nomedocurso para procurar num curso específico, ou @grades para abrir a página de notas de um curso."
|
"message": "Começa a escrever para procurar módulos e trabalhos. Usa @nomedocurso para procurar num curso específico, ou @grades para abrir a página de notas de um curso, ou @home para ires para o teu painel."
|
||||||
},
|
},
|
||||||
"search_navigate": {
|
"search_navigate": {
|
||||||
"message": "navegar"
|
"message": "navegar"
|
||||||
@ -1472,6 +1472,9 @@
|
|||||||
"search_type_file": {
|
"search_type_file": {
|
||||||
"message": "Ficheiro"
|
"message": "Ficheiro"
|
||||||
},
|
},
|
||||||
|
"search_type_home": {
|
||||||
|
"message": "Início"
|
||||||
|
},
|
||||||
"search_type_item": {
|
"search_type_item": {
|
||||||
"message": "Item"
|
"message": "Item"
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1416,7 +1416,7 @@
|
|||||||
"message": "Поиск функций..."
|
"message": "Поиск функций..."
|
||||||
},
|
},
|
||||||
"search_hint": {
|
"search_hint": {
|
||||||
"message": "Начните вводить текст, чтобы искать модули и задания. Используйте @названиекурса для поиска по конкретному курсу или @grades, чтобы открыть страницу оценок курса."
|
"message": "Начните вводить текст, чтобы искать модули и задания. Используйте @названиекурса для поиска по конкретному курсу или @grades, чтобы открыть страницу оценок курса, или @home, чтобы перейти на главную."
|
||||||
},
|
},
|
||||||
"search_navigate": {
|
"search_navigate": {
|
||||||
"message": "перемещение"
|
"message": "перемещение"
|
||||||
@ -1472,6 +1472,9 @@
|
|||||||
"search_type_file": {
|
"search_type_file": {
|
||||||
"message": "Файл"
|
"message": "Файл"
|
||||||
},
|
},
|
||||||
|
"search_type_home": {
|
||||||
|
"message": "Главная"
|
||||||
|
},
|
||||||
"search_type_item": {
|
"search_type_item": {
|
||||||
"message": "Элемент"
|
"message": "Элемент"
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1416,7 +1416,7 @@
|
|||||||
"message": "Sök funktioner..."
|
"message": "Sök funktioner..."
|
||||||
},
|
},
|
||||||
"search_hint": {
|
"search_hint": {
|
||||||
"message": "Börja skriva för att söka bland moduler och uppgifter. Använd @kursnamn för att söka i en viss kurs, eller @grades för att öppna en kurs betygssida."
|
"message": "Börja skriva för att söka bland moduler och uppgifter. Använd @kursnamn för att söka i en viss kurs, eller @grades för att öppna en kurs betygssida, eller @home för att gå till din översikt."
|
||||||
},
|
},
|
||||||
"search_navigate": {
|
"search_navigate": {
|
||||||
"message": "navigera"
|
"message": "navigera"
|
||||||
@ -1472,6 +1472,9 @@
|
|||||||
"search_type_file": {
|
"search_type_file": {
|
||||||
"message": "Fil"
|
"message": "Fil"
|
||||||
},
|
},
|
||||||
|
"search_type_home": {
|
||||||
|
"message": "Start"
|
||||||
|
},
|
||||||
"search_type_item": {
|
"search_type_item": {
|
||||||
"message": "Objekt"
|
"message": "Objekt"
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1416,7 +1416,7 @@
|
|||||||
"message": "搜索功能..."
|
"message": "搜索功能..."
|
||||||
},
|
},
|
||||||
"search_hint": {
|
"search_hint": {
|
||||||
"message": "开始输入以搜索你的模块和作业。使用 @课程名 搜索特定课程,或使用 @grades 打开课程的成绩页面。"
|
"message": "开始输入以搜索你的模块和作业。使用 @课程名 搜索特定课程,或使用 @grades 打开课程的成绩页面,或输入 @home 跳转到你的仪表板。"
|
||||||
},
|
},
|
||||||
"search_navigate": {
|
"search_navigate": {
|
||||||
"message": "导航"
|
"message": "导航"
|
||||||
@ -1472,6 +1472,9 @@
|
|||||||
"search_type_file": {
|
"search_type_file": {
|
||||||
"message": "文件"
|
"message": "文件"
|
||||||
},
|
},
|
||||||
|
"search_type_home": {
|
||||||
|
"message": "主页"
|
||||||
|
},
|
||||||
"search_type_item": {
|
"search_type_item": {
|
||||||
"message": "项目"
|
"message": "项目"
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1416,7 +1416,7 @@
|
|||||||
"message": "搜尋功能..."
|
"message": "搜尋功能..."
|
||||||
},
|
},
|
||||||
"search_hint": {
|
"search_hint": {
|
||||||
"message": "開始輸入以搜尋你的課程模組和作業。使用 @課程名稱 搜尋特定課程,或使用 @grades 開啟課程的成績頁面。"
|
"message": "開始輸入以搜尋你的課程模組和作業。使用 @課程名稱 搜尋特定課程,或使用 @grades 開啟課程的成績頁面,或輸入 @home 前往你的儀表板。"
|
||||||
},
|
},
|
||||||
"search_navigate": {
|
"search_navigate": {
|
||||||
"message": "瀏覽"
|
"message": "瀏覽"
|
||||||
@ -1472,6 +1472,9 @@
|
|||||||
"search_type_file": {
|
"search_type_file": {
|
||||||
"message": "檔案"
|
"message": "檔案"
|
||||||
},
|
},
|
||||||
|
"search_type_home": {
|
||||||
|
"message": "首頁"
|
||||||
|
},
|
||||||
"search_type_item": {
|
"search_type_item": {
|
||||||
"message": "項目"
|
"message": "項目"
|
||||||
},
|
},
|
||||||
|
|||||||
@ -373,6 +373,7 @@
|
|||||||
.canvasrefined-gs-type-link, .canvasrefined-gs-type-external-tool { background: #fff4d6; color: #7a5b00; border-color: #f1dfab; }
|
.canvasrefined-gs-type-link, .canvasrefined-gs-type-external-tool { background: #fff4d6; color: #7a5b00; border-color: #f1dfab; }
|
||||||
.canvasrefined-gs-type-course { background: #dff3f3; color: #0b6e6e; border-color: #b3dede; }
|
.canvasrefined-gs-type-course { background: #dff3f3; color: #0b6e6e; border-color: #b3dede; }
|
||||||
.canvasrefined-gs-type-grades { background: #e8eefc; color: #1d4ed8; border-color: #c3d2f5; }
|
.canvasrefined-gs-type-grades { background: #e8eefc; color: #1d4ed8; border-color: #c3d2f5; }
|
||||||
|
.canvasrefined-gs-type-home { background: #e7f6ec; color: #1b7a3d; border-color: #c2e6cd; }
|
||||||
.canvasrefined-gs-status {
|
.canvasrefined-gs-status {
|
||||||
display: flex; align-items: center; gap: 10px; padding: 6px 14px;
|
display: flex; align-items: center; gap: 10px; padding: 6px 14px;
|
||||||
border-top: 1px solid var(--bcborders, #e2e6e8);
|
border-top: 1px solid var(--bcborders, #e2e6e8);
|
||||||
|
|||||||
@ -1258,6 +1258,10 @@ hr {
|
|||||||
background: transparent !important;
|
background: transparent !important;
|
||||||
box-shadow: none !important;
|
box-shadow: none !important;
|
||||||
}
|
}
|
||||||
|
/* InstUI flex View ships an opaque surface that stays light in dark mode */
|
||||||
|
.css-43gqe2-view--flex-flex {
|
||||||
|
background: transparent !important;
|
||||||
|
}
|
||||||
/* content span ships a light background + border and sets dark ink */
|
/* content span ships a light background + border and sets dark ink */
|
||||||
.css-1ta5ds2-baseButton__content {
|
.css-1ta5ds2-baseButton__content {
|
||||||
background: var(--bcbackground-1) !important;
|
background: var(--bcbackground-1) !important;
|
||||||
@ -1490,4 +1494,17 @@ input[type="checkbox"]:is([name="turnitin_pledge"], [name="vericite_pledge"]) {
|
|||||||
[data-testid="similarity-pledge"] [class*="-checkboxFacade__facade"]::before {
|
[data-testid="similarity-pledge"] [class*="-checkboxFacade__facade"]::before {
|
||||||
border-color: var(--bclinks) !important;
|
border-color: var(--bclinks) !important;
|
||||||
}
|
}
|
||||||
|
/* the footer's full-width surface leaves a bare strip between Previous and Next */
|
||||||
|
.module-sequence-footer,
|
||||||
|
.module-sequence-footer .module-sequence-footer-content {
|
||||||
|
background: none !important;
|
||||||
|
border-top: none !important;
|
||||||
|
box-shadow: none !important;
|
||||||
|
}
|
||||||
|
/* with the surface gone the buttons need their own outline */
|
||||||
|
.module-sequence-footer .module-sequence-footer-button--previous a,
|
||||||
|
.module-sequence-footer .module-sequence-footer-button--next a {
|
||||||
|
border: 1px solid var(--bcborders) !important;
|
||||||
|
border-radius: 6px !important;
|
||||||
|
}
|
||||||
`;
|
`;
|
||||||
|
|||||||
@ -1442,8 +1442,8 @@
|
|||||||
<button class="big-button back-btn" data-i18n="back">Back</button>
|
<button class="big-button back-btn" data-i18n="back">Back</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="option-container">
|
<div class="option-container">
|
||||||
<h3 class="header-small" id="fontsDropdown" data-i18n="dashboard_font" style="cursor:pointer; display:flex; align-items:center; gap:8px;">
|
<h3 class="header-small" id="fontsDropdown" style="cursor:pointer; display:flex; align-items:center; gap:8px;">
|
||||||
Dashboard Font
|
<span data-i18n="dashboard_font">Dashboard Font</span>
|
||||||
<img id="fontsDropdownArrow" style="transform:rotate(180deg);" src="../icon/dropdownArrow.svg" width="16px" height="16px">
|
<img id="fontsDropdownArrow" style="transform:rotate(180deg);" src="../icon/dropdownArrow.svg" width="16px" height="16px">
|
||||||
<span style="margin-left:auto; display:flex; align-items:center; gap:6px; cursor:pointer;">
|
<span style="margin-left:auto; display:flex; align-items:center; gap:6px; cursor:pointer;">
|
||||||
<input type="checkbox" id="custom_font_skip_p" name="custom_font_skip_p">
|
<input type="checkbox" id="custom_font_skip_p" name="custom_font_skip_p">
|
||||||
|
|||||||
@ -74,6 +74,7 @@ function setupNavigationListener() {
|
|||||||
if (next === current_page) return;
|
if (next === current_page) return;
|
||||||
current_page = next;
|
current_page = next;
|
||||||
watchSequenceFooter();
|
watchSequenceFooter();
|
||||||
|
applyHideAssignmentSidebar();
|
||||||
watchSubmissionPageButton();
|
watchSubmissionPageButton();
|
||||||
watchProfileLogoutPageButton();
|
watchProfileLogoutPageButton();
|
||||||
watchGradeAnalytics();
|
watchGradeAnalytics();
|
||||||
@ -378,6 +379,31 @@ function watchSequenceFooter() {
|
|||||||
applyHideSequenceFooter();
|
applyHideSequenceFooter();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The assignment page's details column repeats what the assignment header already
|
||||||
|
// shows and takes half the width, so it is dropped there. CSS-only, so it survives
|
||||||
|
// Canvas re-renders and SPA navigation; removed again on any other page.
|
||||||
|
function isAssignmentShowPage() {
|
||||||
|
return /^\/courses\/\d+\/assignments\/\d+(?!\/submissions)(?:\/|$)/.test(current_page);
|
||||||
|
}
|
||||||
|
|
||||||
|
function applyHideAssignmentSidebar() {
|
||||||
|
let style = document.getElementById("canvasrefined-hide-assignment-sidebar");
|
||||||
|
if (!isAssignmentShowPage()) {
|
||||||
|
if (style) style.remove();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!style) {
|
||||||
|
style = document.createElement("style");
|
||||||
|
style.id = "canvasrefined-hide-assignment-sidebar";
|
||||||
|
style.textContent = `
|
||||||
|
#right-side-wrapper { display: none !important; }
|
||||||
|
/* the freed column belongs to the page body */
|
||||||
|
#not_right_side { width: 100% !important; max-width: 100% !important; }
|
||||||
|
`;
|
||||||
|
(document.head || document.documentElement).appendChild(style);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Persistent observer keeping both assignment nav buttons mounted;
|
// Persistent observer keeping both assignment nav buttons mounted;
|
||||||
// the delayed re-checks cover React hydration.
|
// the delayed re-checks cover React hydration.
|
||||||
function maintainAssignmentNavButtons() {
|
function maintainAssignmentNavButtons() {
|
||||||
@ -992,6 +1018,7 @@ function startExtension() {
|
|||||||
|
|
||||||
// Watchers start before the async storage callbacks, so a later throw can't block them.
|
// Watchers start before the async storage callbacks, so a later throw can't block them.
|
||||||
setupNavigationListener();
|
setupNavigationListener();
|
||||||
|
applyHideAssignmentSidebar();
|
||||||
watchSubmissionPageButton();
|
watchSubmissionPageButton();
|
||||||
|
|
||||||
toggleDarkMode();
|
toggleDarkMode();
|
||||||
@ -1639,11 +1666,12 @@ async function applyCustomBackground() {
|
|||||||
.page-title {
|
.page-title {
|
||||||
background: none !important;
|
background: none !important;
|
||||||
}
|
}
|
||||||
|
.module-sequence-footer,
|
||||||
.module-sequence-footer .module-sequence-footer-content {
|
.module-sequence-footer .module-sequence-footer-content {
|
||||||
background-color: color-mix(in srgb, var(--bcbackground-0), transparent ${bgTransparent}%) !important;
|
background: none !important;
|
||||||
backdrop-filter: blur(${bgBlur}px) !important;
|
border-top: none !important;
|
||||||
-webkit-backdrop-filter: blur(${bgBlur}px) !important;
|
backdrop-filter: none !important;
|
||||||
border-radius: 5px !important;
|
-webkit-backdrop-filter: none !important;
|
||||||
}
|
}
|
||||||
.item-group-condensed,
|
.item-group-condensed,
|
||||||
.item-group-container {
|
.item-group-container {
|
||||||
@ -1685,6 +1713,10 @@ async function applyCustomBackground() {
|
|||||||
-webkit-backdrop-filter: blur(${bgBlur}px) !important;
|
-webkit-backdrop-filter: blur(${bgBlur}px) !important;
|
||||||
border-radius: 5px !important;
|
border-radius: 5px !important;
|
||||||
}
|
}
|
||||||
|
/* same flex View, other emotion hash: its opaque surface hides the image */
|
||||||
|
.css-43gqe2-view--flex-flex {
|
||||||
|
background: transparent !important;
|
||||||
|
}
|
||||||
/* flatten inner Views to one surface; keep avatars, role pills, buttons */
|
/* flatten inner Views to one surface; keep avatars, role pills, buttons */
|
||||||
.css-fiozi7-view--flex-flex [class*="-view"]:not([class*="-avatar"]):not([data-testid="pill-container"]):not([data-testid="pill-container"] *):not([class*="-baseButton"]) {
|
.css-fiozi7-view--flex-flex [class*="-view"]:not([class*="-avatar"]):not([data-testid="pill-container"]):not([data-testid="pill-container"] *):not([class*="-baseButton"]) {
|
||||||
background: none !important;
|
background: none !important;
|
||||||
@ -10356,6 +10388,7 @@ const GS_KIND_CLASS = {
|
|||||||
externalurl: "link",
|
externalurl: "link",
|
||||||
externaltool: "external-tool",
|
externaltool: "external-tool",
|
||||||
grades: "grades",
|
grades: "grades",
|
||||||
|
home: "home",
|
||||||
};
|
};
|
||||||
|
|
||||||
function gsKindClass(kind) {
|
function gsKindClass(kind) {
|
||||||
@ -10366,6 +10399,7 @@ function gsKindLabel(kind) {
|
|||||||
if (kind === "course") return getMsg("search_type_course", "Course");
|
if (kind === "course") return getMsg("search_type_course", "Course");
|
||||||
if (kind === "module") return getMsg("search_type_module", "Module");
|
if (kind === "module") return getMsg("search_type_module", "Module");
|
||||||
if (kind === "grades") return getMsg("search_type_grades", "Grades");
|
if (kind === "grades") return getMsg("search_type_grades", "Grades");
|
||||||
|
if (kind === "home") return getMsg("search_type_home", "Home");
|
||||||
return prettyModuleItemType(kind);
|
return prettyModuleItemType(kind);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -10969,6 +11003,23 @@ async function runGlobalSearch(query, resultsEl) {
|
|||||||
resultsEl.innerHTML = `<div class="canvasrefined-gs-hint">${getMsg("search_hint", "Start typing to search your modules and assignments. Use @coursename to search a specific course, or @grades to open a course's grades page.")}</div>`;
|
resultsEl.innerHTML = `<div class="canvasrefined-gs-hint">${getMsg("search_hint", "Start typing to search your modules and assignments. Use @coursename to search a specific course, or @grades to open a course's grades page.")}</div>`;
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// "@home" opens the dashboard and needs no index, so it answers before the
|
||||||
|
// empty-index guard below.
|
||||||
|
if (query.trim().toLowerCase() === "@home") {
|
||||||
|
const homeRows = [{
|
||||||
|
kind: "home",
|
||||||
|
cls: "home",
|
||||||
|
type: gsKindLabel("home"),
|
||||||
|
title: getMsg("dashboard", "Dashboard"),
|
||||||
|
course: "",
|
||||||
|
courseId: null,
|
||||||
|
url: `${domain}/`,
|
||||||
|
}];
|
||||||
|
resultsEl.innerHTML = homeRows.map((item, i) => globalSearchRowHtml(item, i)).join("");
|
||||||
|
bindGlobalSearchRows(resultsEl, homeRows);
|
||||||
|
return homeRows;
|
||||||
|
}
|
||||||
if (!index.length) {
|
if (!index.length) {
|
||||||
resultsEl.innerHTML = indexing
|
resultsEl.innerHTML = indexing
|
||||||
? `<div class="canvasrefined-gs-loading">${getMsg("search_building", "Building search index…")}</div>`
|
? `<div class="canvasrefined-gs-loading">${getMsg("search_building", "Building search index…")}</div>`
|
||||||
|
|||||||
@ -155,7 +155,11 @@ function applyI18nOverride() {
|
|||||||
document.querySelectorAll('[data-i18n]').forEach(el => {
|
document.querySelectorAll('[data-i18n]').forEach(el => {
|
||||||
const key = el.dataset.i18n;
|
const key = el.dataset.i18n;
|
||||||
const msg = getMsg(key);
|
const msg = getMsg(key);
|
||||||
if (msg) el.textContent = msg;
|
if (!msg) return;
|
||||||
|
// textContent would destroy interactive or non-text children (the font
|
||||||
|
// dropdown's arrow and its "keep font" checkbox live inside a label).
|
||||||
|
if (el.querySelector("input,select,button,a,img,picture,svg,iframe,video,canvas")) return;
|
||||||
|
el.textContent = msg;
|
||||||
});
|
});
|
||||||
document.querySelectorAll('[data-i18n-placeholder]').forEach(el => {
|
document.querySelectorAll('[data-i18n-placeholder]').forEach(el => {
|
||||||
const msg = getMsg(el.dataset.i18nPlaceholder);
|
const msg = getMsg(el.dataset.i18nPlaceholder);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user