Skip to content

Commit

Permalink
Merge pull request #88 from vatz88/gh-pages
Browse files Browse the repository at this point in the history
Check Lab and Theory clash by timing support
  • Loading branch information
vatz88 authored Jun 24, 2018
2 parents 851663a + d2ff07b commit 6ebf51f
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 68 deletions.
130 changes: 65 additions & 65 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,9 @@ <h2>FFCS on The Go</h2>
</header>
<!-- End of container-fluid -->

<div class="container">
<!-- Special Alert Message -->
<div class="row">
<!-- <div class="container"> -->
<!-- Special Alert Message -->
<!-- <div class="row">
<div class="col-xs-12">
<h1>Alerts</h1>
<div class="alert alert-danger" role="alert">
Expand All @@ -168,7 +168,7 @@ <h1>Alerts</h1>
</div>
</div>
</div>
</div>
</div> -->
<!-- End of container -->

<hr>
Expand Down Expand Up @@ -449,90 +449,90 @@ <h5 class="list-group-item-heading">F1+TF1</h5>
<tr>
<!-- IMPORTANT: It's important to maintain the order of class. i.e. A1,F1,D1,.. are 2nd -->
<td class="ColumnOneDays">MON</td>
<td class="TimetableContent A1 L1">A1 / L1</td>
<td class="TimetableContent F1 L2">F1 / L2</td>
<td class="TimetableContent D1 L3">D1 / L3</td>
<td class="TimetableContent TB1 L4">TB1 / L4</td>
<td class="TimetableContent TG1 L5">TG1 / L5</td>
<td class="TimetableContent L6">L6</td>
<td class="TimetableContent A2 L31">A2 / L31</td>
<td class="TimetableContent F2 L32">F2 / L32</td>
<td class="TimetableContent D2 L33">D2 / L33</td>
<td class="TimetableContent TB2 L34">TB2 / L34</td>
<td class="TimetableContent TG2 L35">TG2 / L35</td>
<td class="TimetableContent V3 L36">V3 / L36</td>
<td class="TimetableContent A1 L1 noPostLab">A1 / L1</td>
<td class="TimetableContent F1 L2 noPreTheory">F1 / L2</td>
<td class="TimetableContent D1 L3 noPostLab">D1 / L3</td>
<td class="TimetableContent TB1 L4 noPostLab noPreTheory">TB1 / L4</td>
<td class="TimetableContent TG1 L5 noPostLab noPreTheory">TG1 / L5</td>
<td class="TimetableContent L6 noPreTheory">L6</td>
<td class="TimetableContent A2 L31 noPostLab">A2 / L31</td>
<td class="TimetableContent F2 L32 noPreTheory">F2 / L32</td>
<td class="TimetableContent D2 L33 noPostLab">D2 / L33</td>
<td class="TimetableContent TB2 L34 noPostLab noPreTheory">TB2 / L34</td>
<td class="TimetableContent TG2 L35 noPostLab noPreTheory">TG2 / L35</td>
<td class="TimetableContent V3 L36 noPreTheory">V3 / L36</td>
<!--<td class="TimetableContent H1 L61">H1 / L61</td>
<td class="TimetableContent K1 L62">K1 / L62</td>-->
</tr>
<tr>
<td class="ColumnOneDays">TUE</td>
<td class="TimetableContent B1 L7">B1 / L7</td>
<td class="TimetableContent G1 L8">G1 / L8</td>
<td class="TimetableContent E1 L9">E1 / L9</td>
<td class="TimetableContent TC1 L10">TC1 / L10</td>
<td class="TimetableContent TAA1 L11">TAA1 / L11</td>
<td class="TimetableContent L12">L12</td>
<td class="TimetableContent B2 L37">B2 / L37</td>
<td class="TimetableContent G2 L38">G2 / L38</td>
<td class="TimetableContent E2 L39">E2 / L39</td>
<td class="TimetableContent TC2 L40">TC2 / L40</td>
<td class="TimetableContent TAA2 L41">TAA2 / L41</td>
<td class="TimetableContent V4 L42">V4 / L42</td>
<td class="TimetableContent B1 L7 noPostLab">B1 / L7</td>
<td class="TimetableContent G1 L8 noPreTheory">G1 / L8</td>
<td class="TimetableContent E1 L9 noPostLab">E1 / L9</td>
<td class="TimetableContent TC1 L10 noPostLab noPreTheory">TC1 / L10</td>
<td class="TimetableContent TAA1 L11 noPostLab noPreTheory">TAA1 / L11</td>
<td class="TimetableContent L12 noPreTheory">L12</td>
<td class="TimetableContent B2 L37 noPostLab">B2 / L37</td>
<td class="TimetableContent G2 L38 noPreTheory">G2 / L38</td>
<td class="TimetableContent E2 L39 noPostLab">E2 / L39</td>
<td class="TimetableContent TC2 L40 noPostLab noPreTheory">TC2 / L40</td>
<td class="TimetableContent TAA2 L41 noPostLab noPreTheory">TAA2 / L41</td>
<td class="TimetableContent V4 L42 noPreTheory">V4 / L42</td>
<!--<td class="TimetableContent H2 L63">H2 / L63</td>
<td class="TimetableContent K2 L64">K2 / L64</td>-->
</tr>
<tr>
<td class="ColumnOneDays">WED</td>
<td class="TimetableContent C1 L13">C1 / L13</td>
<td class="TimetableContent A1 L14">A1 / L14</td>
<td class="TimetableContent F1 L15">F1 / L15</td>
<td class="TimetableContent V1 L16">V1 / L16</td>
<td class="TimetableContent V2">V2</td>
<td class="TimetableContent C1 L13 noPostLab">C1 / L13</td>
<td class="TimetableContent A1 L14 noPreTheory">A1 / L14</td>
<td class="TimetableContent F1 L15 noPostLab">F1 / L15</td>
<td class="TimetableContent V1 L16 noPostLab noPreTheory">V1 / L16</td>
<td class="TimetableContent V2 noPostLab noPreTheory">V2</td>
<td class="TimetableContent"></td>
<td class="TimetableContent C2 L43">C2 / L43</td>
<td class="TimetableContent A2 L44">A2 / L44</td>
<td class="TimetableContent F2 L45">F2 / L45</td>
<td class="TimetableContent TD2 L46">TD2 / L46</td>
<td class="TimetableContent TBB2 L47">TBB2 / L47</td>
<td class="TimetableContent V5 L48">V5 / L48</td>
<td class="TimetableContent C2 L43 noPostLab">C2 / L43</td>
<td class="TimetableContent A2 L44 noPreTheory">A2 / L44</td>
<td class="TimetableContent F2 L45 noPostLab">F2 / L45</td>
<td class="TimetableContent TD2 L46 noPostLab noPreTheory">TD2 / L46</td>
<td class="TimetableContent TBB2 L47 noPostLab noPreTheory">TBB2 / L47</td>
<td class="TimetableContent V5 L48 noPreTheory">V5 / L48</td>
<!--<td class="TimetableContent H3 L65">H3 / L65</td>
<td class="TimetableContent K3 L66">K3 / L66</td>-->
</tr>
<tr>
<td class="ColumnOneDays">THU</td>
<td class="TimetableContent D1 L19">D1 / L19</td>
<td class="TimetableContent B1 L20">B1 / L20</td>
<td class="TimetableContent G1 L21">G1 / L21</td>
<td class="TimetableContent TE1 L22">TE1 / L22</td>
<td class="TimetableContent TCC1 L23">TCC1 / L23</td>
<td class="TimetableContent L24">L24</td>
<td class="TimetableContent D2 L49">D2 / L49</td>
<td class="TimetableContent B2 L50">B2 / L50</td>
<td class="TimetableContent G2 L51">G2 / L51</td>
<td class="TimetableContent TE2 L52">TE2 / L52</td>
<td class="TimetableContent TCC2 L53">TCC2 / L53</td>
<td class="TimetableContent V6 L54">V6 / L54</td>
<td class="TimetableContent D1 L19 noPostLab">D1 / L19</td>
<td class="TimetableContent B1 L20 noPreTheory">B1 / L20</td>
<td class="TimetableContent G1 L21 noPostLab">G1 / L21</td>
<td class="TimetableContent TE1 L22 noPostLab noPreTheory">TE1 / L22</td>
<td class="TimetableContent TCC1 L23 noPostLab noPreTheory">TCC1 / L23</td>
<td class="TimetableContent L24 noPreTheory">L24</td>
<td class="TimetableContent D2 L49 noPostLab">D2 / L49</td>
<td class="TimetableContent B2 L50 noPreTheory">B2 / L50</td>
<td class="TimetableContent G2 L51 noPostLab">G2 / L51</td>
<td class="TimetableContent TE2 L52 noPostLab noPreTheory">TE2 / L52</td>
<td class="TimetableContent TCC2 L53 noPostLab noPreTheory">TCC2 / L53</td>
<td class="TimetableContent V6 L54 noPreTheory">V6 / L54</td>
<!--<td class="TimetableContent H4 L67">H4 / L67</td>
<td class="TimetableContent K4 L68">K4 / L68</td>-->
</tr>
<tr>
<td class="ColumnOneDays">FRI</td>
<td class="TimetableContent E1 L25">E1 / L25</td>
<td class="TimetableContent C1 L26">C1 / L26</td>
<td class="TimetableContent TA1 L27">TA1 / L27</td>
<td class="TimetableContent TF1 L28">TF1 / L28</td>
<td class="TimetableContent TD1 L29">TD1 / L29</td>
<td class="TimetableContent L30">L30</td>
<td class="TimetableContent E2 L55">E2 / L55</td>
<td class="TimetableContent C2 L56">C2 / L56</td>
<td class="TimetableContent TA2 L57">TA2 / L57</td>
<td class="TimetableContent TF2 L58">TF2 / L58</td>
<td class="TimetableContent TDD2 L59">TDD2 / L59</td>
<td class="TimetableContent V7 L60">V7 / L60</td>
<td class="TimetableContent E1 L25 noPostLab">E1 / L25</td>
<td class="TimetableContent C1 L26 noPreTheory">C1 / L26</td>
<td class="TimetableContent TA1 L27 noPostLab">TA1 / L27</td>
<td class="TimetableContent TF1 L28 noPostLab noPreTheory">TF1 / L28</td>
<td class="TimetableContent TD1 L29 noPostLab noPreTheory">TD1 / L29</td>
<td class="TimetableContent L30 noPreTheory">L30</td>
<td class="TimetableContent E2 L55 noPostLab">E2 / L55</td>
<td class="TimetableContent C2 L56 noPreTheory">C2 / L56</td>
<td class="TimetableContent TA2 L57 noPostLab">TA2 / L57</td>
<td class="TimetableContent TF2 L58 noPostLab noPreTheory">TF2 / L58</td>
<td class="TimetableContent TDD2 L59 noPostLab noPreTheory">TDD2 / L59</td>
<td class="TimetableContent V7 L60 noPreTheory">V7 / L60</td>
<!--<td class="TimetableContent H5 L69">H5 / L69</td>
<td class="TimetableContent K5 L70">K5 / L70</td>-->
</tr>
<tr>
<!-- <tr>
<td class="ColumnOneDays">SAT</td>
<td class="TimetableContent V8 L71">V8 / L71</td>
<td class="TimetableContent X1 L72">X1 / L72</td>
Expand Down Expand Up @@ -561,7 +561,7 @@ <h5 class="list-group-item-heading">F1+TF1</h5>
<td class="TimetableContent W2 L92">W2 / L92</td>
<td class="TimetableContent W2 L93">W2 / L93</td>
<td class="TimetableContent V11 L94">V11 / L94</td>
</tr>
</tr> -->
</table>
</div>
</div>
Expand Down
9 changes: 6 additions & 3 deletions js/colorChange.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ function addColorChangeEvents() {

function addCourseToTimetable(courseId, courseCode, venue, slotArray, isProject) {
slotArray.forEach(function (slot) {
var $divElement = $('<div data-course="' + 'course' + courseId + '" data-is-project="' + isProject + '">' + courseCode + '-' + venue + '</div>');
var $divElement = $('<div data-course="' + 'course' + courseId + '" data-is-lab="' + (slot[0] === 'L') + '" data-is-project="' + isProject + '">' + courseCode + '-' + venue + '</div>');
$('#timetable tr .' + slot).addClass('highlight').append($divElement);
if ($(".quick-selection ." + slot + "-tile")) {
$(".quick-selection ." + slot + "-tile").addClass("highlight");
Expand Down Expand Up @@ -409,7 +409,10 @@ function checkSlotClash() {
var $highlightedCell = $(this);
var $highlightedCellDivs = $(this).children('div[data-course]');

if ($highlightedCellDivs.length > 1) {
var noPostLabFlag = $(this).hasClass('noPostLab') && $(this).children('div[data-is-lab="false"]').length > 0 && $(this).next().children('div[data-is-lab="true"]').length > 0;
var noPreTheoryFlag = $(this).hasClass('noPreTheory') && $(this).children('div[data-is-lab="true"]').length > 0 && $(this).prev().children('div[data-is-lab="false"]').length > 0;

if ($highlightedCellDivs.length > 1 || noPostLabFlag || noPreTheoryFlag) {
var isClashing = true;

// Check if there are two dissimilar courses or if there is a J
Expand Down Expand Up @@ -656,4 +659,4 @@ function loadCourseData() {
console.error("Failed to load course data.");
});
}
}
}

0 comments on commit 6ebf51f

Please sign in to comment.