From 3be8e78fa2ae67cfcbaaefa771cb3244f0d9a7f9 Mon Sep 17 00:00:00 2001 From: VaTz88 Date: Mon, 26 Dec 2016 11:07:34 +0530 Subject: [PATCH] venue to timetable added fixed #17 --- appcache.manifest | 2 +- css/style.css | 1 + index.html | 14 ++++++++++---- js/autocomplete_course.js | 1 + js/colorChange.js | 36 ++++++++++++++++++++---------------- js/enjoyhintsetup.js | 2 +- 6 files changed, 34 insertions(+), 22 deletions(-) diff --git a/appcache.manifest b/appcache.manifest index 53f0f46..a873ae7 100644 --- a/appcache.manifest +++ b/appcache.manifest @@ -1,5 +1,5 @@ CACHE MANIFEST -# 2016-12-25 +# 2016-12-26 css/style.css js/script.js diff --git a/css/style.css b/css/style.css index 4d64acb..ebeac1a 100644 --- a/css/style.css +++ b/css/style.css @@ -381,6 +381,7 @@ input { #inputCourseTitle, #inputSlotString, #inputFaculty, +#inputVenue, .list-group-item { text-transform: uppercase; } diff --git a/index.html b/index.html index af88a07..34c96e2 100644 --- a/index.html +++ b/index.html @@ -353,19 +353,25 @@

Add Courses To Timetable

-
+
-
+
-
+
+ +
+ +
+
+
@@ -457,4 +463,4 @@

Add Courses To Timetable

- + \ No newline at end of file diff --git a/js/autocomplete_course.js b/js/autocomplete_course.js index 80a0b22..8227512 100644 --- a/js/autocomplete_course.js +++ b/js/autocomplete_course.js @@ -24,6 +24,7 @@ function slotSelectionBtnClicked(value) { value = value.split('|'); $('#inputSlotString').val(value[0]); $('#inputFaculty').val(value[1]); + $('#inputVenue').val(value[3]); $('#inputCourseCredits').val(value[4]); } diff --git a/js/colorChange.js b/js/colorChange.js index ce07da4..59b864f 100644 --- a/js/colorChange.js +++ b/js/colorChange.js @@ -6,10 +6,11 @@ var totalCredits = 0; var CRM = (function () { - function CourseRecord(slots, title, code, fac, credits, $li) { + function CourseRecord(slots, title, code, venue, fac, credits, $li) { this.slots = slots; this.title = title; this.code = code; + this.venue = venue; this.fac = fac; this.credits = credits; this.$li = $li; @@ -29,9 +30,9 @@ var CRM = (function () { var CRM = { courses: [], - add: function (slots, title, code, fac, credits, $li) { + add: function (slots, title, code, venue, fac, credits, $li) { slots = this.expandSlots(slots); - var record = new CourseRecord(slots, title, code, fac, credits, $li); + var record = new CourseRecord(slots, title, code, venue, fac, credits, $li); var clashes = this.getClashingSlots(record); if (clashes.length()) { record.isClashing = true; @@ -99,7 +100,7 @@ var CRM = (function () { record.slots.forEach(function (slot) { this.highlight(slot); - this.appendCourseCode(slot, record.code); + this.appendCourseCode(slot, record.code, record.venue); }, this); if (record.isClashing) { @@ -118,11 +119,11 @@ var CRM = (function () { $("." + slot).addClass("highlight"); }, - appendCourseCode: function (slot, code) { + appendCourseCode: function (slot, code, venue) { var $slot = $("." + slot); if (!~$slot.text().indexOf(code)) { - $slot.append('' + code + ''); + $slot.append('' + code + '
' + venue + '
'); } }, @@ -201,6 +202,7 @@ var CRM = (function () { var courseInput = $("#inputCourseTitle"); var creditsInput = $("#inputCourseCredits"); var courseCodeInput = $("#inputCourseCode"); + var venueInput = $("#inputVenue"); var slotInput = $("#inputSlotString"); var totalContainer = $("#slot-sel-area .list-group li.total"); var totalSpan = totalContainer.find(".badge"); @@ -216,25 +218,26 @@ var CRM = (function () { faculty = facultyInput.val().trim(); course = courseInput.val().trim(); courseCode = courseCodeInput.val().trim(); + venue = venueInput.val().trim(); credits = Number(creditsInput.val()); slotArray = slot.split(/\s*\+\s*/); - normSlotString = slotArray.join(" + "); - li = $('
  • ' + + + li = $('
  • ' + '
    ' + - '
    ' + normSlotString + '
    ' + - '
    ' + course + '
    ' + - '
    ' + faculty + '
    ' + - '
    ' + - '
    ' + + '
    ' + normSlotString + '
    ' + + '
    ' + courseCode + '
    ' + + '' + + '
    ' + faculty + '
    ' + + '' + + '' + - '
    ' + + '
    ' + '×' + '
    ' + - '
    ' + '
    ' + '
  • '); @@ -252,13 +255,14 @@ var CRM = (function () { } courseCodeInput.val(""); + venueInput.val(""); facultyInput.val(""); courseInput.val(""); slotInput.val(""); creditsInput.val(""); $('#insertSlotBtn').html(''); - CRM.add(slotArray, course, courseCode, faculty, credits, li); + CRM.add(slotArray, course, courseCode, venue, faculty, credits, li); } $("#slot-sel-area .panel-body #markBtn").click(submitSlotData); diff --git a/js/enjoyhintsetup.js b/js/enjoyhintsetup.js index 6db2dc1..d306af3 100644 --- a/js/enjoyhintsetup.js +++ b/js/enjoyhintsetup.js @@ -7,7 +7,7 @@ var enjoyhint_script_steps = [{ }, { "next .B1-tile": "

    Use quick selection to select all at once

    " }, { - "next .panel-heading": "

    Add courses to timetable

    " + "next .panel-heading": "

    Search and add courses to timetable

    " }, { "next #takeScreenShot": "

    Take timetable screenshot to share with friends

    " }, {