Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Benjadahl/UDPlus-Plus
Browse files Browse the repository at this point in the history
  • Loading branch information
rkjar18 committed May 1, 2017
2 parents e96f901 + b3c5536 commit 8facfc8
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 23 deletions.
5 changes: 1 addition & 4 deletions UD++Functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ function getSchedule(startDate, endDate, callback) {
cacheScheduleFetch(startDate, endDate, scheduleReturn);
callback(scheduleReturn, message);
}).fail(function(XMLHttpRequest, textStatus, errorThrown) {
console.log("Request failed", errorThrown);
debugLog("Request failed", errorThrown);
message = 'Something went wrong getting the schedule.';
//TODO: Oversæt
if (XMLHttpRequest.status === 401) {
Expand Down Expand Up @@ -268,6 +268,3 @@ String.prototype.hashCode = function(){
return hash;
}

function myXOR(a,b) {
return ( a || b ) && !( a && b );
}
2 changes: 1 addition & 1 deletion dashboard/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ function openSearchResult(number) {

$("#searchBox").keydown(function(e) {
if (e.which == 13) {
console.log("Ayy");
debugLog("Ayy");
var searchResults = $("#searchResults > li");
if (searchResults.length === 1) {
openSearchResult(1);
Expand Down
2 changes: 1 addition & 1 deletion jasmine/spec/assignments.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe("Assignment Page", function() {
url: "https://www.uddataplus.dk/opgave/?id=id_opgave",
active: false,
}, function(tab) {
chrome.tabs.executeScript(tab.id, {code: "setTimeout(function(){sortTasks(2);}, 5000); setTimeout(function() { hideTasks(true); chrome.runtime.sendMessage({action: 'testing', page: 'assignment', hideTask : $('#gwt-uid-10').is(':checked'), sortBy : $('thead > tr').children().eq(2).hasClass('sorting_asc'), filterTime : myXOR($( '#timeFilter' ).length > 0, timeFilterTextHide) } ); window.close(); }, 10000);"});
chrome.tabs.executeScript(tab.id, {code: "setTimeout(function(){sortTasks(2);}, 5000); setTimeout(function() { hideTasks(true); chrome.runtime.sendMessage({action: 'testing', page: 'assignment', hideTask : $('#gwt-uid-10').is(':checked'), sortBy : $('thead > tr').children().eq(2).hasClass('sorting_asc'), filterTime : $( '#timeFilter' ).length > 0 || timeFilterTextHide } ); window.close(); }, 10000);"});
});
});

Expand Down
14 changes: 7 additions & 7 deletions options/customTheme/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ $("#btnSave").click(function (){
for(var T in customTemplate){
if($("#" + T).val() != ""){
themeObj[T] = $("#" + T).val();
console.log("#" + T + " " + $("#" + T).val())
debugLog("#" + T + " " + $("#" + T).val())
}else{
delete themeObj[T];
}
Expand Down Expand Up @@ -130,7 +130,7 @@ $("#btnSave").click(function (){
$("#btnExport").click(function() {

//Making new var for themes so you dont overwrite evertime you change something
console.log("Clicked");
debugLog("Clicked");
var themeObj = {};

//Loading the theme name
Expand All @@ -140,7 +140,7 @@ $("#btnExport").click(function() {
for(var T in customTemplate){
if($("#" + T).val() != ""){
themeObj[T] = $("#" + T).val();
console.log("#" + T + " " + $("#" + T).val())
debugLog("#" + T + " " + $("#" + T).val())
}else{
delete themeObj[T];
}
Expand All @@ -153,8 +153,8 @@ $("#btnExport").click(function() {
//Adds or changes the new custom theme
obj[name] = themeObj;

console.log(obj);
console.log(JSON.stringify(obj));
debugLog(obj);
debugLog(JSON.stringify(obj));
$("#textIO").val(JSON.stringify(obj[name]));

});
Expand All @@ -163,15 +163,15 @@ $("#btnImport").click(function() {

var themeString = $("#textIO").val();

console.log(themeString);
debugLog(themeString);

if (!themeString.includes("</style>")) {



try {
var importTheme = JSON.parse(themeString); // this is how you parse a string into JSON
console.log(importTheme);
debugLog(importTheme);

//Then cleans all the textboxes
for(var T in customTemplate){
Expand Down
2 changes: 1 addition & 1 deletion options/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ navigator.webkitPersistentStorage.queryUsageAndQuota (
function(usedBytes, grantedBytes) {
$("#usedStorage").text(formatSizeUnits(usedBytes));
},
function(e) { console.log('Error', e); }
function(e) { debugLog('Error', e); }
);

function setDevVisible(vis) {
Expand Down
4 changes: 0 additions & 4 deletions pageScripts/assignmentPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ getStorage('hideTask', function (obj) {

getStorage('TooEarly', function (obj) {
if (!chrome.runtime.error) {
console.log(obj.TooEarly);
if (typeof obj.TooEarly != "undefined") {
filterTime = obj.TooEarly;
}
Expand Down Expand Up @@ -151,11 +150,9 @@ var readAssignments = [];

getStorage('readAssignments', function(obj) {
if (typeof obj.readAssignments !== 'undefined') readAssignments = obj.readAssignments;
console.log(readAssignments);
});

function saveRead() {
console.log("Saving");
setStorage({'readAssignments': readAssignments});
}

Expand Down Expand Up @@ -193,7 +190,6 @@ function markUnreadAssignments() {
function addListeners() {
$("button.btn.btn-mini:contains(T)").unbind();
$("button.btn.btn-mini:contains(T)").click(function() {
console.log("Test");
window.setTimeout(onAssignmentPageLoad, 1000);
});
}
Expand Down
6 changes: 3 additions & 3 deletions pageScripts/grades.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ function addAverage() {
});

var grade = $("table > tbody >tr:last-child > td:nth-child(" + (i+1) + ") > div");
console.log(totalGrades);
console.log(totalWeight);
debugLog(totalGrades);
debugLog(totalWeight);
//The reason we have this weird rounding is so we can round it to one decimal by multiplying the number to ten, rounding it to an integer, and dividing by ten again.
var average = Math.round(10*totalGrades / totalWeight) / 10;

if (average < 15 && average > -3) {
console.log(totalGrades);
debugLog(totalGrades);
grade.html("<b>" + average + "</b>");
} else {
grade.html("");
Expand Down
1 change: 0 additions & 1 deletion pageScripts/schedule.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ function getSelectors() {
var classes = $("th[class]:not([class$=r]):visible").attr("class");
if (typeof classes !== 'undefined') {
var selector = classes.split(" ")[1];
console.log(selector);
if (obj.tableTopActiveSelector != selector && selector !== 'undefined') setStorage({"tableTopActiveSelector": "." + selector});
}
});
Expand Down
2 changes: 1 addition & 1 deletion theming/runTheme.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function runTheme(theme, page){
applySelector(customTemplate[T][X], customTheme[theme][T], page);
}

console.log(customTemplate[T][X]);
debugLog(customTemplate[T][X]);

}
}
Expand Down

0 comments on commit 8facfc8

Please sign in to comment.