import on course schedule page

This commit is contained in:
sghsri
2018-12-11 13:34:17 -06:00
parent 84630a1292
commit b4f19a0c61
3 changed files with 29 additions and 10 deletions

View File

@@ -1,15 +1,34 @@
var link; var link;
var waitlist;
var sem;
$(function () { $(function () {
//template https://utdirect.utexas.edu/apps/registrar/course_schedule/20189/51475/ //template https://utdirect.utexas.edu/apps/registrar/course_schedule/20189/51475/
var sem = $('[name="s_ccyys"]').val(); console.log(window.location.href);
$("[href='#top']").before("<button class='matbut' id='import' style='margin:10px 0px 20px 0px;'><span style='font-size:small'>Import into </span><b>UT Reg Plus<b></h2></button><br>"); var importbutton = "<button class='matbut' id='import' style='margin:20px 0px 20px 0px;'><span style='font-size:small'>Import into </span><b>UT Reg Plus<b></h2></button><br>";
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("<div id='snackbar'>defaultmessage..</div>"); $("#import").prepend("<div id='snackbar'>defaultmessage..</div>");
$("#import").click(function () { $("#import").click(function () {
$(".tbg").last().find(".tbon>td:first-child").each(function () { if(waitlist){
let unique = $(this).text().replace(/\s/g, ''); $(".tbg").last().find(".tbon>td:first-child").each(function () {
link = `https://utdirect.utexas.edu/apps/registrar/course_schedule/${sem}/${unique}/`; let unique = $(this).text().replace(/\s/g, '');
getInfo(); 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"); $("#import").text("Courses Saved!").css("background-color", "#4CAF50");
setTimeout(function () { setTimeout(function () {
$("#import").html("<span style='font-size:small'>Import into </span><b>UT Reg Plus<b></h2>").css("background-color", "#FF9800"); $("#import").html("<span style='font-size:small'>Import into </span><b>UT Reg Plus<b></h2>").css("background-color", "#FF9800");

View File

@@ -18,7 +18,7 @@
}, { }, {
"css": ["css/styles.css"], "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"], "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*"]
} }
], ],

4
todo
View File

@@ -6,8 +6,8 @@ FEATURES:
- import into and export from UT registration plus - import into and export from UT registration plus
- load all courses on first pages - load all courses on first pages
- work on UT Planner - work on UT Planner
- work on - work on multiple schedules
- - import courses from class schedule screen
BUGS TO FIX: BUGS TO FIX:
- Showing the icon on the flags pages - Showing the icon on the flags pages