Skip to content

Instantly share code, notes, and snippets.

@sijpkes
Last active June 22, 2017 04:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sijpkes/d80e21db66320379d581ccd93afca42e to your computer and use it in GitHub Desktop.
Save sijpkes/d80e21db66320379d581ccd93afca42e to your computer and use it in GitHub Desktop.
Host this somewhere to load into your blackboard item (see bb_item.html)
(function(){
"use strict";
var cssId = "aHR0cHM6Ly91b25saW5lLm5ld2Nhc3RsZS5lZHUuYXUvYmJjc3dlYmRhdi94aWQtMTEwNzQwOTJfMQ==";
if (!document.getElementById(cssId))
{
var role = $("role").value;
var url = $("styurl").readAttribute("href");
var head = document.getElementsByTagName("head")[0];
var link = document.createElement("link");
link.id = cssId;
link.rel = "stylesheet";
link.type = "text/css";
link.href = url;
link.media = "all";
head.appendChild(link);
/* set this to whatever your team's role is in Blackboard.*/
if(role !== "MY_TEAM_ROLE") {
var $element = $("bold_script"); // you change this id in the item if you wish.
var closest = $element.match("li") ? $element : $element.up("li.clearfix");
closest.writeAttribute("style", "display: none");
}
}
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment