var next = $("#next_nav_link"); var bottom; var semesterCode; var doneLoading = true; var curr_course = {} //This extension may be super lit, but you know what's even more lit? //Matthew Tran's twitter and insta: @MATTHEWTRANN and @matthew.trann console.log('UT Registration Plus is running on this page.'); semesterCode = new URL(window.location.href).pathname.split('/')[4]; $(window).scroll(function () { if ($(document).height() <= $(window).scrollTop() + $(window).height() + 150) { loadNextPages(); } }); if (next) { chrome.storage.sync.get('loadAll', function (data) { if (data.loadAll) { $('[title*="next listing"]').remove(); } }); } //make heading and modal if (!$("#kw_results_table").length) { $("table thead th:last-child").after('
There was an error. Please refresh the page and/or log back in using your UT EID and password.
" return description; } function displayDescription(description) { $("#description").animate({ 'opacity': 0 }, 200, function () { $(this).html(description).animate({ 'opacity': 1 }, 200); }); } /*Get the course description from the profurl and highlight the important elements, as well as set the eCIS, and rmp links.*/ function getDescription(course_info) { console.log('getting description for ') $.ajax({ url: course_info["individual"], success: function (response) { if (response) { response_node = $('').html(response).contents(); description_lines = response_node.find('#details > p').toArray().map(x => $(x).text()); displayDescription(buildFormattedDescription(description_lines)); let first_name = extractFirstName(response_node); updateLinks(course_info, first_name); } else { description = "You have been logged out. Please refresh the page and log back in using your UT EID and password.
" displayDescription(description); } } }); } function updateLinks(course_info, first_name) { let { prof_name, number } = course_info; course_info["first_name"] = first_name; course_info["links"]["rate_my_prof"] = `http://www.ratemyprofessors.com/search.jsp?queryBy=teacherName&schoolName=university+of+texas+at+austin&queryoption=HEADER&query=${first_name} ${prof_name};&facetSearch=true`; course_info["links"]["ecis"] = profname ? `http://utdirect.utexas.edu/ctl/ecis/results/index.WBX?&s_in_action_sw=S&s_in_search_type_sw=N&s_in_search_name=${prof_name}%2C%20${first_name}` : `http://utdirect.utexas.edu/ctl/ecis/results/index.WBX?s_in_action_sw=S&s_in_search_type_sw=C&s_in_max_nbr_return=10&s_in_search_course_dept=${department}&s_in_search_course_num=${number}`; } function extractFirstName(response_node) { let full_name = response_node.find('td[data-th="Instructor"]').text().split(', '); let first = full_name[full_name.length - 1]; first = first.indexOf(' ') > 0 ? first.split(' ')[0] : first; return capitalizeString(first); }