@@ -186,49 +186,49 @@ function add_section_n(cnum, name, synon
genOptionHtml("1520", "3:20 pm", etime) + genOptionHtml("1550", "3:50 pm", etime) +
genOptionHtml("1620", "4:20 pm", etime) + genOptionHtml("1650", "4:50 pm", etime) +
genOptionHtml("1720", "5:20 pm", etime) + genOptionHtml("1750", "5:50 pm", etime) +
genOptionHtml("1820", "6:20 pm", etime) + genOptionHtml("1850", "6:50 pm", etime) +
genOptionHtml("1920", "7:20 pm", etime) + genOptionHtml("1950", "7:50 pm", etime) +
genOptionHtml("2020", "8:20 pm", etime) + genOptionHtml("2050", "8:50 pm", etime) +
genOptionHtml("2120", "9:20 pm", etime) + genOptionHtml('2150', '9:50 pm', etime);
if (etime.length > 0)
{
var etime_end = etime.substr(2);
var etime_begin = etime.substr(0, 2);
if (etime_end != '50' && etime_end != '20'
|| etime_begin < 7 || etime_begin > 21)
section_html = section_html + genOptionHtml(etime, prettyTime(etime), etime);
}
section_html = section_html + '</select></td>\
<td class="cbrow"><input type="checkbox" class="daysRequired" name="postData[' + cnum + '][' + snum + '][days][0]" value="1" ' + (days.m ? 'checked="checked"' : '') + ' /></td>\
<td class="cbrow"><input type="checkbox" class="daysRequired" name="postData[' + cnum + '][' + snum + '][days][1]" value="1" ' + (days.t ? 'checked="checked"' : '') + ' /></td>\
<td class="cbrow"><input type="checkbox" class="daysRequired" name="postData[' + cnum + '][' + snum + '][days][2]" value="1" ' + (days.w ? 'checked="checked"' : '') + ' /></td>\
<td class="cbrow"><input type="checkbox" class="daysRequired" name="postData[' + cnum + '][' + snum + '][days][3]" value="1" ' + (days.h ? 'checked="checked"' : '') + ' /></td>\
<td class="cbrow"><input type="checkbox" class="daysRequired" name="postData[' + cnum + '][' + snum + '][days][4]" value="1" ' + (days.f ? 'checked="checked"' : '') + ' /></td>\
<td class="cbrow"><input type="checkbox" class="daysRequired" name="postData[' + cnum + '][' + snum + '][days][5]" value="1" ' + (days.s ? 'checked="checked"' : '') + ' /></td>' +
'<td class="removeCell"><div class="deleteSection"><input type="button" value="x" class="gray" /></div></td><td class="emptyCell">' +
'<td class="removeCell"><div><button class="gray section-meeting-delete">x</button></div></td><td class="emptyCell">' +
'<input class="section-location-entry" type="hidden" name="postData[' + cnum + '][' + snum + '][location]" />' +
'<input class="section-type-entry" type="hidden" name="postData[' + cnum + '][' + snum + '][type]" />' +
'<input class="section-credit-hours-entry" type="hidden" name="postData[' + cnum + '][' + snum + '][credit_hours]" />' +
'</td></tr>';
/*
* Try to append this section to the last section in its
* associated CourseSlot...
*/
last_tr = jQuery('tr.class' + cnum + '.' + safe_css_class('slot-' + slot) + ':last');
if (!last_tr.length)
/* Also append a a new ``we are this slot'' row... */
course_add_slot_row(cnum, slot);
last_tr = jQuery('tr.class' + cnum + ':last');
last_tr.after(section_html);
sectionsOfClass[cnum] ++;
var section_tr = jQuery('#tr-section-' + String(snum));
/* store course_i in a place the newly added section will look for it */
section_tr.data({course_i: cnum});
@@ -796,73 +796,59 @@ function credit_hours_change(course_i)
//--------------------------------------------------
// Items bound to pageload/events
jQuery(document).ready(function() {
// Deletes the selected class from input
jQuery('.deleteClass').live('click', function() {
/* The user is not allowed to interactively delete the one empty course */
var course_i = jQuery(this).parent().parent().data('course_i');
if (slate_permutate_course_free == course_i)
return false;
if(confirm('Delete class and all sections of this class?')) {
/* The one empty course may have became this course in that time */
course_remove(course_i);
});
// Deletes the selected section from the input
jQuery('.deleteSection').live('click', function() {
// Decreases the total number of classes
// Find the ID cell of the row we're in
var row = jQuery(this).parent().parent().find(".sectionIdentifier");
// The first input is the one containing the section ID
var toMatch = jQuery(row).find("input").val();
// This gets the second class of the row, "class#"
var classClass = "." + jQuery(row).parent().attr("class").split(" ")[1];
// Iterate over each section of this class
jQuery(classClass).each( function() {
// If this section has the same course ID as the item clicked, remove it.
if(jQuery(this).find("input").val() == toMatch) {
jQuery(this).remove();
sectionsOfClass[course_i]--;
course_free_check(course_i);
/**
* \brief
* Delete the selected section from the input
jQuery('.section-meeting-delete').live('click', function() {
var section_tr = jQuery(this).parents('.section').first();
var course_i = section_tr.data('course_i');
section_tr.remove();
/* section meeting accounting. */
jQuery('.className').live('change', course_free_check).live('keyup', course_free_check);
// Bind the section-adding method
jQuery('.addSection').live('click', function() {
add_section(course_i);
// Default text
jQuery(".defText").focus(function(srcc)
if (jQuery(this).val() == jQuery(this)[0].title)
jQuery(this).removeClass("defaultTextActive");
jQuery(this).val("");
jQuery(".defText").blur(function()
Status change: