Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
settings
  • Loading branch information
jonluca committed Jan 10, 2018
1 parent 0818214 commit fdc414a
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 6 deletions.
7 changes: 6 additions & 1 deletion USC_Schedule_Helper.js
Expand Up @@ -533,7 +533,12 @@ function insertProfessorRating(row, professor_info) {
//long string but needs to be exactly formatted
const location_of_insert = $(row).find('.instr_alt1, .instr_alt0')[0];
//actual contents of rating
const rating_anchor = `<a class="rating" href=${url} target="_blank">Link</a>`;
let rating_anchor = `<a class="rating" href=${url} target="_blank">Link</a>`;
// If you want the rating on the page, just delete the string above and rename the one below this comment to rating_anchor
const rating_anchor_with_score = `<a class="rating" href=${url} target="_blank">${professor_info.rating}</a>`;
if (options.showRatings) {
rating_anchor = rating_anchor_with_score;
}
//long string just to include new
$(location_of_insert).after(`<span class="hours_alt1 text-center col-xs-12 col-sm-12 col-md-1 col-lg-1"><span class="hidden-lg hidden-visible-xs-* visible-sm-* table-headers-xsmall">Prof. Rating: </span>${rating_anchor}</span>`);
/* Very specific edge case - if you have two professors and you could not find the first, it'll insert an empty cell. However, if you can
Expand Down
6 changes: 5 additions & 1 deletion css/style.css
Expand Up @@ -28,5 +28,9 @@ input[type=range]::-webkit-slider-runnable-track {

.footer {
font-size: 60%;
display: inline;
}

}
.secret {
display: inline;
}
6 changes: 3 additions & 3 deletions html/popup.html
Expand Up @@ -9,7 +9,7 @@
width: 400px;
}
</style>
<script src="../js/libs/modernizr-2.7.1.min.js"></script>
<script src="../js/jquery.js"></script>
</head>
<body>
<div class="pretty container">
Expand All @@ -33,10 +33,10 @@
</ul>
</fieldset>
</form>
<p class="footer">&copy; JonLuca DeCaro 2017</p>
<span class="secret footer">&copy;</span><p class="footer"> JonLuca DeCaro 2018</p>
</div>
</div>
<script src="../js/jquery-2.1.1.min.js"></script>
<script src="../js/libs/modernizr-2.7.1.min.js"></script>
<script src="../js/libs/gumby.min.js"></script>
<script src="../js/common.js"></script>
<script src="../js/popup.js"></script>
Expand Down
1 change: 1 addition & 0 deletions js/common.js
Expand Up @@ -12,6 +12,7 @@ function loadOptions(callback) {
options.extensionEnabled = options.hasOwnProperty('extensionEnabled') ? options.extensionEnabled : true;
options.showCalendar = options.hasOwnProperty('showCalendar') ? options.showCalendar : true;
options.showConflicts = options.hasOwnProperty('showConflicts') ? options.showConflicts : true;
options.showRatings = options.hasOwnProperty('showRatings') ? options.showRatings : false;

chrome.storage.sync.set({
'options': options
Expand Down
10 changes: 9 additions & 1 deletion js/popup.js
@@ -1,4 +1,5 @@
var options;
var count = 3;
$(() => {
loadOptions(function(recOptions) {
options = recOptions;
Expand All @@ -10,6 +11,14 @@ $(() => {
$('input').parent().on('gumby.onChange', function() {
changeOption(this);
});
$(".secret").click(function() {
console.log(count);
--count;
if (count == 0) {
options.showRatings = true;
saveOptions();
}
});
});
});

Expand All @@ -25,7 +34,6 @@ function changeOption(elem) {
options.showConflicts = $('#chkConflicts')[0].checked;
break;
}
console.log(options);
saveOptions();
}

Expand Down

0 comments on commit fdc414a

Please sign in to comment.