window.ALLY_CFG = { 'baseUrl': 'https://prod.ally.ac', 'clientId': 11731, 'lti13Id': '118780000000000121' }; $.getScript(ALLY_CFG.baseUrl + '/integration/canvas/ally.js'); var BLUE_CANVAS_SETUP={connectorUrl:"https://crowder.bluera.com/crowderBlueConnector",canvasAPI:window.location.origin,domainName:"com.explorance",consumerID:"uneAb3wY2QaWRG4D4S117w==",defaultLanguage:"en-us"},BlueCanvasJS=document.createElement("script");BlueCanvasJS.setAttribute("type","text/javascript");BlueCanvasJS.setAttribute("src","https://crowder.bluera.com/crowderBlueConnector/Scripts/Canvas/BlueCanvas.min.js");document.getElementsByTagName("head")[0].appendChild(BlueCanvasJS); function loadJSON(path, success, error) { var xhr = new XMLHttpRequest(); xhr.onreadystatechange = function() { if (xhr.readyState === XMLHttpRequest.DONE) { if (xhr.status === 200) { if (success){ success(JSON.parse(xhr.responseText)); } } else { if (error) error(xhr); } } }; xhr.open("GET", path, true); xhr.send(); } $(document).ready(function() { if (window.location.pathname == '/login/ldap') { //loadJSON('https://api.flickr.com/services/rest/?method=flickr.photosets.getPhotos&api_key=ea2cdd224b27c96f1539060fb725dd5d&photoset_id=72157715197154167&user_id=189411613@N07&extras=url_o&format=json&nojsoncallback=1', loadJSON('https://www.flickr.com/services/rest/?method=flickr.groups.pools.getPhotos&api_key=ea2cdd224b27c96f1539060fb725dd5d&group_id=14743811%40N23&extras=url_l&format=json&nojsoncallback=1', function(data) { obj = data.photos; photos = obj.photo; var imageList = []; //document.write(photos[1].url_o) for (i = 0; i < photos.length; i++) { //document.write(photos[i].url_o + ", ") imageList.push(photos[i].url_l) } var image = imageList[Math.floor(Math.random() * imageList.length)] $('body').css('background-image', 'url('+ image +')', 'background-size(cover)', 'background-repeat: no-repeat'); }, function(xhr) { console.error(xhr); } ); } }); //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); }; //This code will pull the Canvas IDs for users and courses and change the link for the survey // onElementRendered('a[href*="showSurvey.aspx', function(e) { // var userSISID = ENV.current_user_id; // var courseID = window.location.pathname.split('/')[2]; // $('a[href*="showSurvey.aspx"]').attr('href', 'http://enterprise.principals.ca/Survey/showSurvey.aspx' + '?evalID=232&userID=' + userSISID + "&eelD=" + courseID); // }); // Check if the user has role "Admin" if($.inArray("root_admin", ENV.current_user_roles) == -1) { //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) { $('.reset_course_content_button').hide(); }); onElementRendered('.selectContent', function(e) { $('div[class="radio"]:first').attr('style','display: none;'); $('div[class="radio"]:nth-child(2)').attr('style','padding-top: 5px;'); }); onElementRendered('[name="selective_import"]', function(e) { $('input[name="selective_import"]:first').remove(); $('label[for="RadioInput___0"]:first').remove(); }); }