can change the semester

This commit is contained in:
sghsri
2018-12-12 22:10:57 -06:00
parent 3984c26df6
commit 5bfb5c0865
5 changed files with 44 additions and 8 deletions

View File

@@ -152,13 +152,10 @@ body {
animation: ripple 1s ease-out; animation: ripple 1s ease-out;
} }
input[type=number]{ input{
width: 80px; width: 80px;
font-weight: bold; font-weight: bold;
} }
::placeholder{
};
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { input[type=number]::-webkit-outer-spin-button {
-webkit-appearance: none; -webkit-appearance: none;

View File

@@ -5,6 +5,7 @@ setCourseList();
// var modhtml = '<div class=modal id=myModal><div class=modal-content><span class=close>×</span><div class=card><div class=cardcontainer></div></div></div></div>'; // var modhtml = '<div class=modal id=myModal><div class=modal-content><span class=close>×</span><div class=card><div class=cardcontainer></div></div></div></div>';
// $("#html").prepend(modhtml); // $("#html").prepend(modhtml);
getSemesters();
function setCourseList(){ function setCourseList(){
@@ -175,9 +176,11 @@ $(document).ready(function () {
if($("#search>i").text() == 'close') { if($("#search>i").text() == 'close') {
$("#search>i").text('search'); $("#search>i").text('search');
$("#class_id").hide(); $("#class_id").hide();
$("#semesters").hide();
} else{ } else{
$("#search>i").text('close'); $("#search>i").text('close');
$("#class_id").show(); $("#class_id").show();
$("#semesters").show();
} }
}); });
$('#import').click(function () { $('#import').click(function () {
@@ -198,7 +201,7 @@ $(document).ready(function () {
var unique = $(this).val(); var unique = $(this).val();
if(!isNaN(unique)){ if(!isNaN(unique)){
if(unique.length == 5){ if(unique.length == 5){
getInfo("20192", unique); getInfo($("#semesters").find(":selected").val(), unique);
return; return;
} }
} }
@@ -337,6 +340,39 @@ function clear() {
showEmpty(); showEmpty();
} }
function getSemesters(){
var schedulelist = 'https://registrar.utexas.edu/schedules';
chrome.runtime.sendMessage({
method: "GET",
action: "xhttp",
url: schedulelist,
data: ""
}, function (response) {
if (response) {
var object = $('<div/>').html(response).contents();
object.find('.callout2>ul>li>a').each(function () {
if($(this).text() != "Course Schedule Archive"){
var semname = $(this).text();
chrome.runtime.sendMessage({
method: "GET",
action: "xhttp",
url: $(this).attr('href'),
data: ""
}, function (response) {
if (response) {
var object = $('<div/>').html(response).contents();
object.find('.gobutton>a').each(function () {
var semnum = $(this).attr('href').substring($(this).attr('href').lastIndexOf('/')+1);
$("#semesters").append(`<option value="${semnum}"">${semname}</option>`);
});
}
});
}
});
}
});
}
/*Course object for passing to background*/ /*Course object for passing to background*/
function Course(coursename, unique, profname, datetimearr, status, link, registerlink) { function Course(coursename, unique, profname, datetimearr, status, link, registerlink) {

View File

@@ -9,7 +9,8 @@
"declarativeContent", "declarativeContent",
"storage", "storage",
"*://*.utdirect.utexas.edu/apps/registrar/course_schedule/*", "*://*.utdirect.utexas.edu/apps/registrar/course_schedule/*",
"*://*.catalog.utexas.edu/ribbit/" "*://*.catalog.utexas.edu/ribbit/",
"*://*.registrar.utexas.edu/schedules"
], ],
"content_scripts": [{ "content_scripts": [{
"css": ["css/styles.css"], "css": ["css/styles.css"],

View File

@@ -27,6 +27,8 @@
<div style=" margin-bottom: 0px; display:inline-block"></div> <div style=" margin-bottom: 0px; display:inline-block"></div>
<input type="file" id="importOrig" accept=".json" style="display:none"/> <input type="file" id="importOrig" accept=".json" style="display:none"/>
<div class="settings"> <div class="settings">
<select id="semesters" style="display: none;margin-right: 5px; border-color: #FF9800; margin-top: 3px;">
</select>
<input type="text" id="class_id" name="class_id" maxlength="5" <input type="text" id="class_id" name="class_id" maxlength="5"
style="display:none;text-indent: 10px;border-style: solid; border-color: #FF9800;" placeholder="Unique #?"></input> style="display:none;text-indent: 10px;border-style: solid; border-color: #FF9800;" placeholder="Unique #?"></input>