I figured out that to add JavaScript code to the theme editor I had to copy/paste the code into a notepad and save it as a file with .js at the end and upload it.
I currently have this JavaScript file uploaded to the theme editor to hide the navigation tab from faculty:
//hides Navigation tab in course settings
var navigationTab = document.getElementById('navigation_tab');
function isAdmin() {
if (window.ENV && Array.isArray(window.ENV.current_user_roles)) {
return window.ENV.current_user_roles.includes('admin') || window.ENV.current_user_roles.includes('root_admin');
}
return false;
}
if (navigationTab && !isAdmin()) {
navigationTab.style.display = 'none';
I would like to also add this JavaScript to hide the Syllabus tool from faculty since we use Simple Syllabus
nav[role="navigation"] a.syllabus,
nav#mobileContextNavContainer a[href$="/assignments/syllabus"] { display: none;}
Where would I add this JavaScript in relation to the first one I shared? Would I just press enter twice at the end of the first one so there is a space between the two and then past ethe code there?