From 2bb4617f87407c62a139c082e482698e837f8494 Mon Sep 17 00:00:00 2001 From: Sriram Hariharan Date: Thu, 10 Jan 2019 13:38:29 -0600 Subject: [PATCH] changes to unique import and styling --- css/popup.css | 32 ++++++++++++++++++++++++++----- js/popup.js | 52 +++++++++++++++++++++++++++++++++------------------ popup.html | 2 +- 3 files changed, 62 insertions(+), 24 deletions(-) diff --git a/css/popup.css b/css/popup.css index 5fb3fb5d..1c02006e 100644 --- a/css/popup.css +++ b/css/popup.css @@ -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 { diff --git a/js/popup.js b/js/popup.js index 7e3aeba3..b3811d0d 100644 --- a/js/popup.js +++ b/js/popup.js @@ -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 = $('
').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 = $('
').html(response).contents(); - object.find('.gobutton>a').each(function () { - var semnum = $(this).attr('href').substring($(this).attr('href').lastIndexOf('/') + 1); - $("#semesters").append(``); - }); - } - }); + 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(``); + chrome.runtime.sendMessage({ + method: "GET", + action: "xhttp", + url: $(this).attr('href'), + data: "" + }, function (response) { + if (response) { + var object = $('
').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()); + } + }) + }); + } + }); + } } }); } diff --git a/popup.html b/popup.html index d87f51aa..8c1b2760 100644 --- a/popup.html +++ b/popup.html @@ -34,7 +34,7 @@ -