diff --git a/js/import.js b/js/import.js index b449e085..52b86a39 100644 --- a/js/import.js +++ b/js/import.js @@ -1,15 +1,34 @@ var link; +var waitlist; +var sem; $(function () { //template https://utdirect.utexas.edu/apps/registrar/course_schedule/20189/51475/ - var sem = $('[name="s_ccyys"]').val(); - $("[href='#top']").before("
"); + console.log(window.location.href); + var importbutton = "
"; + waitlist = !(window.location.href.includes('https://utdirect.utexas.edu/registration/classlist.WBX')); + if(waitlist){ + sem = $('[name="s_ccyys"]').val(); + $("[href='#top']").before(importbutton); + } else { + sem = $("option[selected='selected']").val(); + $("table").after(importbutton); + } + console.log(sem); $("#import").prepend("
defaultmessage..
"); $("#import").click(function () { - $(".tbg").last().find(".tbon>td:first-child").each(function () { - let unique = $(this).text().replace(/\s/g, ''); - link = `https://utdirect.utexas.edu/apps/registrar/course_schedule/${sem}/${unique}/`; - getInfo(); - }); + if(waitlist){ + $(".tbg").last().find(".tbon>td:first-child").each(function () { + let unique = $(this).text().replace(/\s/g, ''); + link = `https://utdirect.utexas.edu/apps/registrar/course_schedule/${sem}/${unique}/`; + getInfo(); + }); + } else { + $("tr>td:first-child").each(function(){ + let unique = $(this).text().replace(/\s/g, ''); + link = `https://utdirect.utexas.edu/apps/registrar/course_schedule/${sem}/${unique}/`; + getInfo(); + }); + } $("#import").text("Courses Saved!").css("background-color", "#4CAF50"); setTimeout(function () { $("#import").html("Import into UT Reg Plus").css("background-color", "#FF9800"); diff --git a/manifest.json b/manifest.json index 1165ff9b..34705367 100644 --- a/manifest.json +++ b/manifest.json @@ -18,7 +18,7 @@ }, { "css": ["css/styles.css"], "js": ["js/moment.min.js", "js/sql-memory-growth.js", "js/highcharts.js", "js/jquery-3.3.1.min.js", "js/import.js"], - "matches": ["https://utdirect.utexas.edu/registrar/waitlist/wl_see_my_waitlists.WBX"] + "matches": ["https://utdirect.utexas.edu/registrar/waitlist/wl_see_my_waitlists.WBX", "https://utdirect.utexas.edu/registration/classlist.WBX*"] } ], diff --git a/todo b/todo index fc2572df..8ab412a7 100644 --- a/todo +++ b/todo @@ -6,8 +6,8 @@ FEATURES: - import into and export from UT registration plus - load all courses on first pages - work on UT Planner -- work on -- +- work on multiple schedules +- import courses from class schedule screen BUGS TO FIX: - Showing the icon on the flags pages