From: Steve Sutton Date: Tue, 28 Oct 2014 15:55:09 +0000 (-0400) Subject: clean up X-Git-Tag: v1.0.5^2~1 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=b72d300bec7f41dfee33ee876ea1c957a02aff2b;p=web%2FSooLocks.git clean up --- diff --git a/Toolkit/Schedule/js/editSchedule.js b/Toolkit/Schedule/js/editSchedule.js index 9417b8a..f933707 100644 --- a/Toolkit/Schedule/js/editSchedule.js +++ b/Toolkit/Schedule/js/editSchedule.js @@ -10,23 +10,23 @@ var EditSchedule = // setup on change event for schedule_year // we want to update the schedule with new name if updated - $('#schedule_year').change(function(){ - var newYear = $(this).val(); - $.ajax({ - cache: false, - url: glm_baseUrl + "schedules/Edit/updateScheduleYear/", - data: "id=" + glm_scheduleId - + "&year=" + newYear, - statusCode: { - 404: function() { - alert('page not found'); - } - }, - success: function(){ - glm_scheduleYear = newYear; - } - }); - }); +// $('#schedule_year').change(function(){ +// var newYear = $(this).val(); +// $.ajax({ +// cache: false, +// url: glm_baseUrl + "schedules/Edit/updateScheduleYear/", +// data: "id=" + glm_scheduleId +// + "&year=" + newYear, +// statusCode: { +// 404: function() { +// alert('page not found'); +// } +// }, +// success: function(){ +// glm_scheduleYear = newYear; +// } +// }); +// }); // set loading animation to display while ajax $('#loading').ajaxSend(function(){ $('#loading').show(); @@ -238,87 +238,6 @@ var EditSchedule = return true; } } - // for the time edit form - $( "#dialog-form" ).dialog({ - autoOpen: false, - height: 200, - width: 350, - modal: true, - buttons: { - "Edit Time": function() { - var bValid = true; - allFields.removeClass( "ui-state-error" ); - - bValid = bValid && checkLength( depart_time, "Time", 4); - - if (depart_time.val()) { - bValid = bValid && checkRegexp( depart_time, /([0-9]{1,2}:[0-9]{2} [APMapm]{2})$/i, "time in HH:MM AM or PM" ); - } - - if ( bValid ) { - // need to send the data to a php page to save it - var dataVars = "id=" + id.val(); - dataVars += "&depart_time=" + depart_time.val(); - if (id.val()) { - $.ajax({ - cache: false, - type: 'post', - dataType: 'json', - url: glm_baseUrl + "schedules/Edit/saveTime/?id=" + id.val(), - data: allFields.serialize(), - success: function (data){ - $('span[class="form-element"][rel="' + data.id + '"]').html(data.time); - }, - statusCode: { - 404: function() { - alert('Error: 404 Page Not Found!'); - } - } - }); - } else { - $.ajax({ - cache: false, - type: 'post', - dataType: 'json', - url: glm_baseUrl + "schedules/Edit/saveTime/", - data: allFields.serialize(), - success: function (data){ - if (data.dock == 1) { - $('.chxTime.addTime[rel="'+data.departure_id+'"]').before( - '' - ); - } else if (data.dock == 2) { - $('.bviTime.addTime[rel="'+data.departure_id+'"]').before( - '' - ); - } - }, - statusCode: { - 404: function() { - alert('Error: 404 Page Not Found!'); - } - } - }); - } - - $( this ).dialog( "close" ); - } - }, - Cancel: function() { - $( this ).dialog( "close" ); - } - }, - close: function() { - allFields.val( "" ).removeClass( "ui-state-error" ); - } - }); - }, // setup the departures by id setupDepartureById: function(id){