Skip to content
This repository was archived by the owner on Nov 22, 2024. It is now read-only.

Commit fdc414a

Browse files
committed
settings
1 parent 0818214 commit fdc414a

File tree

5 files changed

+24
-6
lines changed

5 files changed

+24
-6
lines changed

USC_Schedule_Helper.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,12 @@ function insertProfessorRating(row, professor_info) {
533533
//long string but needs to be exactly formatted
534534
const location_of_insert = $(row).find('.instr_alt1, .instr_alt0')[0];
535535
//actual contents of rating
536-
const rating_anchor = `<a class="rating" href=${url} target="_blank">Link</a>`;
536+
let rating_anchor = `<a class="rating" href=${url} target="_blank">Link</a>`;
537+
// If you want the rating on the page, just delete the string above and rename the one below this comment to rating_anchor
538+
const rating_anchor_with_score = `<a class="rating" href=${url} target="_blank">${professor_info.rating}</a>`;
539+
if (options.showRatings) {
540+
rating_anchor = rating_anchor_with_score;
541+
}
537542
//long string just to include new
538543
$(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>`);
539544
/* 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

css/style.css

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,9 @@ input[type=range]::-webkit-slider-runnable-track {
2828

2929
.footer {
3030
font-size: 60%;
31+
display: inline;
32+
}
3133

32-
}
34+
.secret {
35+
display: inline;
36+
}

html/popup.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
width: 400px;
1010
}
1111
</style>
12-
<script src="../js/libs/modernizr-2.7.1.min.js"></script>
12+
<script src="../js/jquery.js"></script>
1313
</head>
1414
<body>
1515
<div class="pretty container">
@@ -33,10 +33,10 @@
3333
</ul>
3434
</fieldset>
3535
</form>
36-
<p class="footer">&copy; JonLuca DeCaro 2017</p>
36+
<span class="secret footer">&copy;</span><p class="footer"> JonLuca DeCaro 2018</p>
3737
</div>
3838
</div>
39-
<script src="../js/jquery-2.1.1.min.js"></script>
39+
<script src="../js/libs/modernizr-2.7.1.min.js"></script>
4040
<script src="../js/libs/gumby.min.js"></script>
4141
<script src="../js/common.js"></script>
4242
<script src="../js/popup.js"></script>

js/common.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ function loadOptions(callback) {
1212
options.extensionEnabled = options.hasOwnProperty('extensionEnabled') ? options.extensionEnabled : true;
1313
options.showCalendar = options.hasOwnProperty('showCalendar') ? options.showCalendar : true;
1414
options.showConflicts = options.hasOwnProperty('showConflicts') ? options.showConflicts : true;
15+
options.showRatings = options.hasOwnProperty('showRatings') ? options.showRatings : false;
1516

1617
chrome.storage.sync.set({
1718
'options': options

js/popup.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
var options;
2+
var count = 3;
23
$(() => {
34
loadOptions(function(recOptions) {
45
options = recOptions;
@@ -10,6 +11,14 @@ $(() => {
1011
$('input').parent().on('gumby.onChange', function() {
1112
changeOption(this);
1213
});
14+
$(".secret").click(function() {
15+
console.log(count);
16+
--count;
17+
if (count == 0) {
18+
options.showRatings = true;
19+
saveOptions();
20+
}
21+
});
1322
});
1423
});
1524

@@ -25,7 +34,6 @@ function changeOption(elem) {
2534
options.showConflicts = $('#chkConflicts')[0].checked;
2635
break;
2736
}
28-
console.log(options);
2937
saveOptions();
3038
}
3139

0 commit comments

Comments
 (0)