changes to unique import and styling

This commit is contained in:
Sriram Hariharan
2019-01-10 13:38:29 -06:00
parent c9e0c08a50
commit 2bb4617f87
3 changed files with 62 additions and 24 deletions

View File

@@ -26,18 +26,37 @@ body {
}
.settingsbut {
margin-right: 0px;
border: 0px
margin-right: 2px;
border: 0px;
border-radius: 50%;
transition: 0.3s;
}
.settingsbut:focus {
outline: 0;
}
.settingsbut:hover {
box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.16), 0 4px 15px 0 rgba(0, 0, 0, 0.12);
}
.selected {
box-shadow: 0 0 0 1pt #FF9800;
}
.settingsbut:focus:after:hover {
outline: 0;
transition: 0.3s;
}
ul {
margin-bottom: 20px;
}
i {
padding: 4px 0px;
}
.settings {
position: absolute;
bottom: 0;
@@ -52,9 +71,10 @@ ul {
border-radius: 7px;
}
.settings:hover {
/* .settings:hover {
box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.2), 0 4px 20px 0 rgba(0, 0, 0, 0.19);
}
} */
.matbut {
border: none;
@@ -165,6 +185,7 @@ ul {
animation: ripple 1s ease-out;
}
.card:focus:not(:active)::after {
animation: ripple 1s ease-out;
}
@@ -188,7 +209,8 @@ input[type=number]::-webkit-outer-spin-button {
}
::placeholder {
color: #FF0000;
color: #ffbd9a;
;
}
.select-style {

View File

@@ -178,15 +178,16 @@ $(document).ready(function () {
'url': 'https://registrar.utexas.edu/schedules'
});
});
$("#impexp").click(function () {
if ($("#impexp>i").text() == 'close') {
$('#import').hide();
$('#export').hide();
$("#impexp>i").text('import_export');
// $(this).removeClass('selected');
} else {
$("#impexp>i").text('close');
$('#import').show();
// $(this).addClass('selected');
$('#export').show();
}
});
@@ -196,12 +197,14 @@ $(document).ready(function () {
$("#class_id").hide();
$("#semcon").hide();
$("#semesters").hide();
// $(this).removeClass('selected');
} else {
$("#search>i").text('close');
$("#class_id").show();
$("#semesters").show();
$("#semcon").show();
$('#class_id').focus();
// $(this).addClass('selected');
}
});
$('#import').click(function () {
@@ -381,23 +384,36 @@ function getSemesters() {
}, 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().split(" ")[0].substring(0, 2) + " " + $(this).text().split(" ")[1];
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>`);
});
}
});
object.find('.callout2>ul>li>a').each(function (index) {
if (index < 2) {
if ($(this).text() != "Course Schedule Archive") {
var semname = $(this).text().split(" ")[0].substring(0, 2) + " " + $(this).text().split(" ")[1];
$("#semesters").append(`<option>${semname}</option>`);
chrome.runtime.sendMessage({
method: "GET",
action: "xhttp",
url: $(this).attr('href'),
data: ""
}, function (response) {
if (response) {
var object = $('<div/>').html(response).contents();
var name = object.find(".page-title").text();
name = name.substring(name.lastIndexOf('|') + 1).trim();
name = name.split(" ")[0].substring(0, 2) + " " + name.split(" ")[1];
console.log(name);
object.find('.gobutton>a').each(function () {
var semnum = $(this).attr('href').substring($(this).attr('href').lastIndexOf('/') + 1);
$("option").each(function () {
console.log($(this).text());
if ($(this).text() == name) {
$(this).val(semnum);
console.log($(this).val());
}
})
});
}
});
}
}
});
}

View File

@@ -34,7 +34,7 @@
<input type="text" id="class_id" name="class_id" maxlength="5" style="display:none;text-indent: 10px;border-style: solid; border-color:#FF0000;"
placeholder="Unique #?"></input>
<button title='Search' style="background-color:white;" class="settingsbut" id='search'>
<button title='Search' style="background-color:white;margin-left: 5px;" class="settingsbut" id='search'>
<i style='color:#FF9800' class="material-icons">
search
</i>