can change the semester
This commit is contained in:
@@ -152,13 +152,10 @@ body {
|
||||
animation: ripple 1s ease-out;
|
||||
}
|
||||
|
||||
input[type=number]{
|
||||
input{
|
||||
width: 80px;
|
||||
font-weight: bold;
|
||||
}
|
||||
::placeholder{
|
||||
|
||||
};
|
||||
input[type=number]::-webkit-inner-spin-button,
|
||||
input[type=number]::-webkit-outer-spin-button {
|
||||
-webkit-appearance: none;
|
||||
|
||||
@@ -235,4 +235,4 @@ function updateStatus() {
|
||||
});
|
||||
// console.log("updated status' and registerlinks");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
40
js/popup.js
40
js/popup.js
@@ -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>';
|
||||
// $("#html").prepend(modhtml);
|
||||
getSemesters();
|
||||
|
||||
|
||||
function setCourseList(){
|
||||
@@ -172,12 +173,14 @@ $(document).ready(function () {
|
||||
}
|
||||
});
|
||||
$("#search").click(function(){
|
||||
if($("#search>i").text() == 'close'){
|
||||
if($("#search>i").text() == 'close') {
|
||||
$("#search>i").text('search');
|
||||
$("#class_id").hide();
|
||||
$("#semesters").hide();
|
||||
} else{
|
||||
$("#search>i").text('close');
|
||||
$("#class_id").show();
|
||||
$("#semesters").show();
|
||||
}
|
||||
});
|
||||
$('#import').click(function () {
|
||||
@@ -198,7 +201,7 @@ $(document).ready(function () {
|
||||
var unique = $(this).val();
|
||||
if(!isNaN(unique)){
|
||||
if(unique.length == 5){
|
||||
getInfo("20192", unique);
|
||||
getInfo($("#semesters").find(":selected").val(), unique);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -337,6 +340,39 @@ function clear() {
|
||||
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*/
|
||||
function Course(coursename, unique, profname, datetimearr, status, link, registerlink) {
|
||||
|
||||
@@ -9,7 +9,8 @@
|
||||
"declarativeContent",
|
||||
"storage",
|
||||
"*://*.utdirect.utexas.edu/apps/registrar/course_schedule/*",
|
||||
"*://*.catalog.utexas.edu/ribbit/"
|
||||
"*://*.catalog.utexas.edu/ribbit/",
|
||||
"*://*.registrar.utexas.edu/schedules"
|
||||
],
|
||||
"content_scripts": [{
|
||||
"css": ["css/styles.css"],
|
||||
|
||||
@@ -27,6 +27,8 @@
|
||||
<div style=" margin-bottom: 0px; display:inline-block"></div>
|
||||
<input type="file" id="importOrig" accept=".json" style="display:none"/>
|
||||
<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"
|
||||
style="display:none;text-indent: 10px;border-style: solid; border-color: #FF9800;" placeholder="Unique #?"></input>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user