Permalink
Browse files

settings

  • Loading branch information...
jonluca committed Jan 10, 2018
1 parent 0818214 commit fdc414ab9ffc5f25df857e5be42cc13701bde283
Showing with 24 additions and 6 deletions.
  1. +6 −1 USC_Schedule_Helper.js
  2. +5 −1 css/style.css
  3. +3 −3 html/popup.html
  4. +1 −0 js/common.js
  5. +9 −1 js/popup.js
@@ -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
@@ -28,5 +28,9 @@ input[type=range]::-webkit-slider-runnable-track {

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

}
.secret {
display: inline;
}
@@ -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">
@@ -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>
@@ -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
@@ -1,4 +1,5 @@
var options;
var count = 3;
$(() => {
loadOptions(function(recOptions) {
options = recOptions;
@@ -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();
}
});
});
});

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

0 comments on commit fdc414a

Please sign in to comment.