From 1ab02bc6ae7d4c1f25b5d5fc40f8c39a4a905a19 Mon Sep 17 00:00:00 2001 From: Bram van der Veen <96aa48@gmail.com> Date: Tue, 16 Jun 2015 15:04:07 +0200 Subject: [PATCH] Added some more comments to explain some difficult code --- schedule.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/schedule.js b/schedule.js index b0b527f..8f53581 100644 --- a/schedule.js +++ b/schedule.js @@ -47,11 +47,11 @@ function to_json(page) { schedule_data[day][hour] = {teacher: [], chamber: [], course: [], changed: []}; for (special_hour = 0; special_hour < amount_of_special_hours; special_hour++) { var selected_hour = schedule.find('table').eq(day).find('tr').eq(special_hour).find('td'); - + //Give the value of the schedule hour to the fitting array. schedule_data[day][hour].teacher[special_hour] = selected_hour.eq(0).html(); schedule_data[day][hour].chamber[special_hour] = selected_hour.eq(2).html(); - schedule_data[day][hour].course[special_hour] = selected_hour.eq(4).html(); - + schedule_data[day][hour].course[special_hour] = selected_hour.eq(4).html( ); + //Check if the hour is 'changed' by the schedule authors, if so set to true. schedule_data[day][hour].changed[special_hour] = selected_hour.eq(0).attr().class == 'tableCellNew' ? true : false; } }