Changeset - aea436159b64
[Not reviewed]
default
0 1 0
Ethan Zonca - 15 years ago 2010-10-16 22:17:17
ez@ethanzonca.com
Trivial
1 file changed with 7 insertions and 13 deletions:
0 comments (0 inline, 0 general)
scripts/scheduleInput.js
Show inline comments
 
@@ -66,25 +66,19 @@
 
    // General Input Functions
 
    //--------------------------------------------------
 

	
 
        //--------------------------------------------------
 
        // Custom ID generator - @FIXME: un-abstract
 
        //--------------------------------------------------
 
	function customIds(name){
 
		return '<td class="sectionIdentifier center"><input type="text" size="1" class="required" name="' + name + '" /></td>';
 
	}
 

	
 
	//--------------------------------------------------
 
	// Returns the common inputs for each new section.
 
	//--------------------------------------------------
 
        function getCommonInputs(cnum){
 
		getCommonInputs(cnum,'','','','','','');
 
        function genSectionHtml(cnum){
 
		genSectionHtml(cnum,'','','','','','');
 
	}
 

	
 
	function getCommonInputs(cnum,name,synonym,stime,etime,days,prof) {
 
	/* @TODO: This should select & set items based on args, if the args != '' */
 
	function genSectionHtml(cnum,name,synonym,stime,etime,days,prof) {
 
		var snum = sectionsOfClass[cnum];
 

	
 
		var result = '<tr class="section class' + cnum + '"><td class="none"></td>';
 
	        result = result + customIds('postData[' + cnum + '][' + snum + '][letter]');
 
	        result = result + '<td class="sectionIdentifier center"><input type="text" size="1" class="required" name="postData[' + cnum + '][' + snum + '][letter]" /></td>';
 

	
 
		result = result + '<td><select class="selectRequired" name="postData[' + cnum + '][' + snum + '][start]"><option value="none"></option>\
 
				<option value="700">7:00 am</option><option value="730">7:30 am</option>\
 
@@ -131,10 +125,10 @@
 
        // Add a section to a class
 
        //--------------------------------------------------
 
        function add_section(cnum) {
 
		jQuery('.pclass'+cnum).after(getCommonInputs(cnum));
 
		jQuery('.pclass'+cnum).after(genSectionHtml(cnum));
 
        }
 
	function add_section(cnum,name,synonym,stime,etime,days,prof) {
 
		 jQuery('.pclass'+cnum).after(getCommonInputs(cnum,name,synonym,stime,etime,days,prof));
 
		 jQuery('.pclass'+cnum).after(genSectionHtml(cnum,name,synonym,stime,etime,days,prof));
 
	}
 

	
 
	//--------------------------------------------------
0 comments (0 inline, 0 general)