Fixed positioning of footer bar on empty course list; updated import-export UI and added auto-close for popups
This commit is contained in:
@@ -85,8 +85,9 @@ i {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.settings {
|
.settings {
|
||||||
position: relative;
|
position: absolute;
|
||||||
float: right;
|
bottom: 0px;
|
||||||
|
right: 0px;
|
||||||
display: flex;
|
display: flex;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
|
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
|
||||||
@@ -245,6 +246,18 @@ input[type=number]::-webkit-outer-spin-button {
|
|||||||
width: 120px;
|
width: 120px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#import-export-popup {
|
||||||
|
background: white;
|
||||||
|
color: #747474;
|
||||||
|
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
|
||||||
|
position: absolute;
|
||||||
|
margin: auto;
|
||||||
|
bottom: 42px;
|
||||||
|
right: 10px;
|
||||||
|
border-radius: inherit;
|
||||||
|
width: 160px;
|
||||||
|
}
|
||||||
|
|
||||||
.flex-container {
|
.flex-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@@ -316,6 +329,37 @@ input[type=number]::-webkit-outer-spin-button {
|
|||||||
margin: 8px 0px;
|
margin: 8px 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.simple-menu-option {
|
||||||
|
display: inline-block;
|
||||||
|
color: rgba(0, 0, 45, 0.48);
|
||||||
|
border: none;
|
||||||
|
font-size: 17px;
|
||||||
|
overflow: hidden;
|
||||||
|
vertical-align: middle;
|
||||||
|
text-align: left;
|
||||||
|
padding: 10px 0px 5px 5px;
|
||||||
|
border-radius: 7px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.simple-menu-option i {
|
||||||
|
font-size: 19px;
|
||||||
|
vertical-align: middle;
|
||||||
|
margin-top: 0px;
|
||||||
|
margin-left: 0px;
|
||||||
|
margin-right: 3px;
|
||||||
|
margin-bottom: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.simple-menu-option:hover {
|
||||||
|
background-color: rgba(177, 175, 175, 0.324);
|
||||||
|
-webkit-transition-duration: 0.4s; /* Safari */
|
||||||
|
transition-duration: 0.4s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.simple-menu-option:focus {
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
.hide {
|
.hide {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
79
js/popup.js
79
js/popup.js
@@ -126,6 +126,7 @@ $(document).ready(function () {
|
|||||||
}).on('mouseleave', '.copybut', function () {
|
}).on('mouseleave', '.copybut', function () {
|
||||||
$(this).removeClass('shadow');
|
$(this).removeClass('shadow');
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#courseList").on('click', '.copybut', function (e) {
|
$("#courseList").on('click', '.copybut', function (e) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
var temp = $("<input>");
|
var temp = $("<input>");
|
||||||
@@ -147,6 +148,7 @@ $(document).ready(function () {
|
|||||||
document.execCommand("copy");
|
document.execCommand("copy");
|
||||||
temp.remove();
|
temp.remove();
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#courseList").on('click', 'li', function () {
|
$("#courseList").on('click', 'li', function () {
|
||||||
$(this).find("#listMoreInfo").click(function () {
|
$(this).find("#listMoreInfo").click(function () {
|
||||||
window.open(courses[$(this).closest("li").attr("id")].link);
|
window.open(courses[$(this).closest("li").attr("id")].link);
|
||||||
@@ -214,49 +216,58 @@ $(document).ready(function () {
|
|||||||
$(this).find('#arrow').css('transform', '');
|
$(this).find('#arrow').css('transform', '');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#clear").click(function () {
|
$("#clear").click(function () {
|
||||||
clear();
|
clear();
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#schedule").click(function () {
|
$("#schedule").click(function () {
|
||||||
chrome.tabs.create({
|
chrome.tabs.create({
|
||||||
'url': 'https://registrar.utexas.edu/schedules'
|
'url': 'https://registrar.utexas.edu/schedules'
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#impexp").click(function () {
|
$("#impexp").click(function () {
|
||||||
|
// Close import export window
|
||||||
if ($("#impexp>i").text() == 'close') {
|
if ($("#impexp>i").text() == 'close') {
|
||||||
$('#import').hide();
|
hideImportExportPopup();
|
||||||
$('#export').hide();
|
|
||||||
$("#impexp>i").text('import_export');
|
|
||||||
// $(this).removeClass('selected');
|
// $(this).removeClass('selected');
|
||||||
} else {
|
} else {
|
||||||
$("#impexp>i").text('close');
|
// Open import export window
|
||||||
$('#import').show();
|
|
||||||
|
// If search window open, close it first to prevent overlap
|
||||||
|
if ($("#search>i").text() == 'close') {
|
||||||
|
hideSearchPopup();
|
||||||
|
}
|
||||||
|
|
||||||
|
showImportExportPopup();
|
||||||
// $(this).addClass('selected');
|
// $(this).addClass('selected');
|
||||||
$('#export').show();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#search").click(function () {
|
$("#search").click(function () {
|
||||||
|
// Close search window
|
||||||
if ($("#search>i").text() == 'close') {
|
if ($("#search>i").text() == 'close') {
|
||||||
$("#search>i").text('search');
|
hideSearchPopup();
|
||||||
$("#class_id_input").hide();
|
|
||||||
$("#semcon").hide();
|
|
||||||
$("#semesters").hide();
|
|
||||||
$("#search-popup").addClass('hide');
|
|
||||||
// $(this).removeClass('selected');
|
// $(this).removeClass('selected');
|
||||||
} else {
|
} else {
|
||||||
$("#search>i").text('close');
|
// Open search window
|
||||||
$("#class_id_input").show();
|
|
||||||
$("#semesters").show();
|
// If import export window open, close it first to prevent overlap
|
||||||
$("#semcon").show();
|
if ($("#impexp>i").text() == 'close') {
|
||||||
$('#class_id_input').focus();
|
hideImportExportPopup();
|
||||||
$("#search-popup").removeClass('hide');
|
}
|
||||||
|
|
||||||
|
showSearchPopup();
|
||||||
// $(this).addClass('selected');
|
// $(this).addClass('selected');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$('#import').click(function () {
|
|
||||||
|
$('#import-class').click(function () {
|
||||||
$("#importOrig").click();
|
$("#importOrig").click();
|
||||||
});
|
});
|
||||||
$('#export').click(function () {
|
|
||||||
|
$('#export-class').click(function () {
|
||||||
chrome.storage.sync.get('savedCourses', function (data) {
|
chrome.storage.sync.get('savedCourses', function (data) {
|
||||||
if (data.savedCourses.length > 0) {
|
if (data.savedCourses.length > 0) {
|
||||||
var exportlink = document.createElement('a');
|
var exportlink = document.createElement('a');
|
||||||
@@ -296,6 +307,7 @@ $(document).ready(function () {
|
|||||||
'url': "calendar.html"
|
'url': "calendar.html"
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#importOrig").change(function (e) {
|
$("#importOrig").change(function (e) {
|
||||||
@@ -526,11 +538,38 @@ function getDtarr(object) {
|
|||||||
return dtarr;
|
return dtarr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Convert time to 24hour format*/
|
/* Convert time to 24hour format */
|
||||||
function convertTime(time) {
|
function convertTime(time) {
|
||||||
var converted = time.replace(/\./g, '').split("-");
|
var converted = time.replace(/\./g, '').split("-");
|
||||||
for (var i = 0; i < 2; i++) {
|
for (var i = 0; i < 2; i++) {
|
||||||
converted[i] = moment(converted[i], ["h:mm A"]).format("HH:mm");
|
converted[i] = moment(converted[i], ["h:mm A"]).format("HH:mm");
|
||||||
}
|
}
|
||||||
return converted;
|
return converted;
|
||||||
|
}
|
||||||
|
|
||||||
|
function hideSearchPopup() {
|
||||||
|
$("#search>i").text('search');
|
||||||
|
$("#class_id_input").hide();
|
||||||
|
$("#semcon").hide();
|
||||||
|
$("#semesters").hide();
|
||||||
|
$("#search-popup").addClass('hide');
|
||||||
|
}
|
||||||
|
|
||||||
|
function showSearchPopup() {
|
||||||
|
$("#search>i").text('close');
|
||||||
|
$("#class_id_input").show();
|
||||||
|
$("#semesters").show();
|
||||||
|
$("#semcon").show();
|
||||||
|
$('#class_id_input').focus();
|
||||||
|
$("#search-popup").removeClass('hide');
|
||||||
|
}
|
||||||
|
|
||||||
|
function hideImportExportPopup() {
|
||||||
|
$("#import-export-popup").addClass('hide');
|
||||||
|
$("#impexp>i").text('import_export');
|
||||||
|
}
|
||||||
|
|
||||||
|
function showImportExportPopup() {
|
||||||
|
$("#impexp>i").text('close');
|
||||||
|
$("#import-export-popup").removeClass('hide');
|
||||||
}
|
}
|
||||||
24
popup.html
24
popup.html
@@ -55,27 +55,25 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button id="search-class" class="matbut">Search</button>
|
<button id="search-class" class="matbut">Search</button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button title='Export' style="background-color:white; display:none;" class="settingsbut" id='export'>
|
|
||||||
<i style='color:#FF0000' class="material-icons">
|
|
||||||
arrow_downward
|
|
||||||
</i>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<button title='Import' style="background-color:white; display:none;" class="settingsbut" id='import'>
|
|
||||||
<i style='color:#FF0000' ; class="material-icons">
|
|
||||||
arrow_upward
|
|
||||||
</i>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<button title='Import/Export' style="background-color:white;" class="settingsbut" id='impexp'>
|
<button title='Import/Export' style="background-color:white;" class="settingsbut" id='impexp'>
|
||||||
<i style='color:#FF9800' class="material-icons">
|
<i style='color:#FF9800' class="material-icons">
|
||||||
import_export
|
import_export
|
||||||
</i>
|
</i>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
<div id="import-export-popup" class="hide">
|
||||||
|
<div class="flex-container">
|
||||||
|
<button id="import-class" class="simple-menu-option">
|
||||||
|
<i class="material-icons">file_upload</i>Import Classes
|
||||||
|
</button>
|
||||||
|
<button id="export-class" class="simple-menu-option">
|
||||||
|
<i class="material-icons">file_download</i>Export Classes
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<button title='Options' style="background-color:white; margin-right: 0px;" class="settingsbut" id='open'>
|
<button title='Options' style="background-color:white; margin-right: 0px;" class="settingsbut" id='open'>
|
||||||
<i style='color:#FF9800' class="material-icons">
|
<i style='color:#FF9800' class="material-icons">
|
||||||
settings
|
settings
|
||||||
|
|||||||
Reference in New Issue
Block a user