(async function() {
const SERVER_URL = 'https://panorama-api.yuja.com';
const identifierKey = '05c7e04c79c522ff0410ac19d07908ab8dcd5f4698102132f6234623fa90ffc9';
const CDN_URL = 'https://cdn-panorama.yuja.com';
window.CDN_URL = CDN_URL;
window.SERVER_URL = SERVER_URL;
window.identifierKey = identifierKey;
function loadScript(url) {
const script = document.createElement('script');
script.src = url;
document.head.appendChild(script);
}
try {
const response = await fetch(`${SERVER_URL}/panorama-visualizer/canvas`, {cache: 'no-store'});
const scriptUrl = await response.text();
loadScript(scriptUrl);
} catch (e) {
console.error('Failed to load Panorama: ', e);
}
})();
//This will wait until the element is rendered before running our code
function onElementRendered(selector, cb, _attempts) {
var el = $(selector);
_attempts = ++_attempts || 1;
if (el.length) return cb(el);
if (_attempts == 60) return;
setTimeout(function() {
onElementRendered(selector, cb, _attempts);
}, 250);
};
//When element is rendered it will run api call to fill the necessary variables so the survey link changes
onElementRendered('.reset_course_content_button', function(e) {
if($.inArray('admin',ENV['current_user_roles']) == -1) {
$('.reset_course_content_button').hide();
}
});
$(".ic-app-footer__logo-link").hide();
var hccPrivacyPolicy = document.getElementById("footer-links");
hccPrivacyPolicy.innerHTML = hccPrivacyPolicy.innerHTML.replace('Privacy Policy', 'Privacy Policy');
hccPrivacyPolicy.innerHTML = hccPrivacyPolicy.innerHTML.replace('Privacy Policy', 'Privacy Policy');
hccPrivacyPolicy.innerHTML = hccPrivacyPolicy.innerHTML.replace('Privacy Policy', 'Privacy Policy');
hccPrivacyPolicy.innerHTML = hccPrivacyPolicy.innerHTML.replace('Privacy Policy', 'Privacy Policy');
var hccAppropriateUsePolicy = document.getElementById("footer-links");
hccAppropriateUsePolicy.innerHTML = hccAppropriateUsePolicy.innerHTML.replace('Acceptable Use Policy', 'Appropriate Use Policy');
var hccFacebook = document.getElementById("footer-links");
hccFacebook.innerHTML = hccFacebook.innerHTML.replace('Facebook', 'Facebook');
var hccTwitter = document.getElementById("footer-links");
hccTwitter.innerHTML = hccTwitter.innerHTML.replace('Twitter', 'Twitter');