Changeset - f0d9f37354b5
[Not reviewed]
default
0 8 0
Ethan Zonca - 15 years ago 2011-03-24 20:16:20
ez@ethanzonca.com
qTips added on output page to show data, course title inputs made pseudo-invisible. Other minor changes. Cedarville crawler now records course titles.
8 files changed with 42 insertions and 10 deletions:
0 comments (0 inline, 0 general)
inc/class.course.inc
Show inline comments
 
@@ -26,13 +26,13 @@
 

	
 
include_once 'class.section.php';
 

	
 
class Course implements IteratorAggregate
 
{
 
  private $name;	// String
 
  private $title;
 
  private $title;       // String
 
  private $sections;	// Array of sections
 
  private $nsections;	// int
 
  /**
 
   * \brief
 
   *   Other courses that this course depends on.
 
   *
inc/class.page.php
Show inline comments
 
@@ -109,12 +109,13 @@ class page
 
    $this->headCode['schedInput'] = '<script type="text/javascript" src="scripts/scheduleInput.js"></script>';
 
    $this->headCode['outputPrintStyle'] = '<link rel="stylesheet" href="styles/print.css" type="text/css" media="screen" charset="utf-8" />';
 
    $this->headCode['outputStyle'] = '<link rel="stylesheet" href="styles/output.css" type="text/css" media="screen" charset="utf-8" />'; 
 
    $this->headCode['gliderHeadcode'] = '<link rel="stylesheet" href="styles/glider.css" type="text/css" media="screen" charset="utf-8" />'; 
 
    $this->headCode['uiTabsKeyboard'] = '<script type="text/javascript" src="scripts/uiTabsKeyboard.js"></script>';
 
    $this->headCode['displayTables'] = '<script type="text/javascript" src="scripts/displayTables.js"></script>';
 
    $this->headCode['inPlace'] = '<script type="text/javascript" src="scripts/jeip.js"></script>';
 

	
 
    $this->pagetitle = $ntitle;
 
    $this->scripts = $nscripts;
 

	
 
   /* Compliant browsers which care, such as gecko, explicitly request xhtml: */
 
   if(empty($_SERVER['HTTP_ACCEPT'])  /* then the browser doesn't care :-) */
inc/class.schedule.php
Show inline comments
 
@@ -285,13 +285,13 @@ class Schedule
 
    $footcloser = '';
 

	
 
    if(isset($_REQUEST['print']) && $_REQUEST['print'] != ''){
 
      $headcode = array('jQuery', 'jQueryUI', 'uiTabsKeyboard', 'outputStyle', 'outputPrintStyle', 'displayTables');
 
    }
 
    else {
 
      $headcode = array('outputStyle',  'jQuery', 'jQueryUI', 'jAddress', 'uiTabsKeyboard', 'displayTables');
 
      $headcode = array('outputStyle',  'jQuery', 'jQueryUI', 'jAddress', 'uiTabsKeyboard', 'qTip2','displayTables');
 
    }
 
    $outputPage = page::page_create(htmlentities($this->getName()), $headcode);
 
    $outputPage->head();
 

	
 

	
 

	
 
@@ -521,18 +521,20 @@ class Schedule
 

	
 
				      $title = $course->title_get();
 
				      if (empty($title))
 
					$title = '';
 
				      else
 
					$title .= ' ';
 

	
 
				      $carret = '&#013;' . htmlentities("<br />");
 
				      echo '            <td rowspan="' . $rowspan[$dayLoop]
 
					. '" class="' . $single_multi . ' class' . $j
 
					. '" title="' . htmlentities($title, ENT_QUOTES)
 
					. 'prof: ' . htmlentities($section->getProf(), ENT_QUOTES)
 
					. ', room: ' . htmlentities($current_meeting->getLocation(), ENT_QUOTES)
 
					. ', type: ' . htmlentities($current_meeting->type_get(), ENT_QUOTES) . '">'
 
					. '" class="qTipCell ' . $single_multi . ' class' . $j
 
					. '" title="' . htmlentities($title, ENT_QUOTES) . $carret
 
					. 'Prof: ' . htmlentities($section->getProf(), ENT_QUOTES) . $carret
 
					. 'Room: ' . htmlentities($current_meeting->getLocation(), ENT_QUOTES) . $carret
 
					. 'Type: ' . htmlentities($current_meeting->type_get(), ENT_QUOTES) . $carret . '">'
 
					. '<span class="course-title block">' . htmlentities($title) . '</span>' . PHP_EOL
 
					. htmlentities($course->getName(), ENT_QUOTES) . '-'
 
					. htmlentities($section->getLetter(), ENT_QUOTES) . "\n"
 
					. '<span class="prof block">' . htmlentities($section->getProf(), ENT_QUOTES) . "</span>\n"
 
					. '<span class="location block">' . htmlentities($current_meeting->getLocation(), ENT_QUOTES) . "</span>\n"
 
					. '<span class="synonym block">' . htmlentities($section->getSynonym(), ENT_QUOTES) . "</span>\n"
input.php
Show inline comments
 
@@ -21,13 +21,13 @@
 
include_once 'inc' . DIRECTORY_SEPARATOR . 'class.schedule.php';
 
include_once 'inc' . DIRECTORY_SEPARATOR . 'class.course.inc';
 
include_once 'inc' . DIRECTORY_SEPARATOR . 'class.section.php';
 
include_once 'inc' . DIRECTORY_SEPARATOR . 'class.page.php';
 
require_once('inc' . DIRECTORY_SEPARATOR . 'schedule_store.inc');
 

	
 
$scripts = array('jQuery', 'jQueryUI', 'qTip2','schedInput');
 
$scripts = array('jQuery', 'jQueryUI', 'qTip2', 'inPlace', 'schedInput');
 
$inputPage = page::page_create('Scheduler', $scripts, FALSE);
 

	
 
$schedule_store = FALSE;
 
$sch = FALSE;
 
$errors_fix = FALSE;
 
$school = $inputPage->get_school();
school.d/cedarville.crawl.inc
Show inline comments
 
@@ -185,12 +185,13 @@ function cedarville_crawl(array &$semest
 
	      school_crawl_logf($school_crawl_log, 6, "Error parsing section_id. Given `%s'; interpreted as `%s'. Skipping.",
 
				$course_table[1], implode('-', $section_parts));
 
	      continue;
 
	    }
 

	
 
	  $instructor = $course_table[3];
 
          $title = $course_table[2];
 

	
 
	  /*
 
	   * Each course may have multiple meeting times associated
 
	   * with it at Cedarville. We are not sure how to handle this
 
	   * quite, because different class sections may be tied with
 
	   * different lab meetings and stuff...
 
@@ -255,13 +256,13 @@ function cedarville_crawl(array &$semest
 
	      $meetings[] = new SectionMeeting($days, $time_start, $time_end,
 
					       $room, $type);
 
	    }
 

	
 
	  $semester->section_add($section_parts['department'], $section_parts['course'],
 
				 new Section($section_parts['section'], $meetings,
 
					     $synonym, $instructor));
 
					     $synonym, $instructor), $title);
 
	}
 
    }
 

	
 
  $semesters[] = $semester;
 
    }
 

	
scripts/displayTables.js
Show inline comments
 
@@ -118,11 +118,25 @@ jQuery(document).ready( function()
 
        var tab_course_data = eval('(' + tab_course_data_json + ')');
 

	
 
	slate_permutate_load(jQuery('#regDialog-content'), {school_registration_html: true, courses: tab_course_data});
 

	
 
        jQuery("#regDialog").dialog('open');
 

	
 
	
 
	
 
	return false;
 
      });
 

	
 
      jQuery('.qTipCell').qtip(
 
       {
 
          style: {
 
            tip: true,
 
            classes: "ui-tooltip-dark ui-tooltip-shadow ui-tooltip-rounded"
 
          },
 
          position:{
 
            my: 'bottom left',
 
            at: 'center',
 
          }
 
      });  
 
  }
 
);
 

	
scripts/scheduleInput.js
Show inline comments
 
@@ -261,13 +261,13 @@ function add_class_n(course_id, title)
 
	     * content, first remove the empty course.
 
	     */
 
	    if (course_id.length && slate_permutate_course_free != -1)
 
		course_remove(slate_permutate_course_free);
 

	
 
		sectionsOfClass[classNum] = 0; // Initialize at 0
 
		jQuery('#jsrows').append('<tr id="tr-course-' + classNum + '" class="class class' + classNum + ' pclass' + classNum + '"><td class="nameTip"><input type="text" id="input-course-' + classNum + '" class="classRequired defText className'+classNum+' className" title="Class Name" name="postData[' + classNum + '][name]" value="' + course_id + '" /></td><td colspan="10"><label for="postData[' + classNum + '][title]">Course Title:</label><input type="text" name="postData[' + classNum + '][title]" class="course-title-entry" value="' + title + '" /></td><td class="tdInput"><div class="deleteClass"><input type="button" value="Remove" class="gray" /></div></td><td class="none"><button type="button" class="addSection gray">+</button></td></tr>');
 
		jQuery('#jsrows').append('<tr id="tr-course-' + classNum + '" class="class class' + classNum + ' pclass' + classNum + '"><td class="nameTip"><input type="text" id="input-course-' + classNum + '" class="classRequired defText className'+classNum+' className" title="Class Name" name="postData[' + classNum + '][name]" value="' + course_id + '" /></td><td colspan="10"><input type="text" name="postData[' + classNum + '][title]" class="inPlace course-title-entry" value="' + title + '" /></td><td class="tdInput"><div class="deleteClass"><input type="button" value="Remove" class="gray" /></div></td><td class="none"><button type="button" class="addSection gray">+</button></td></tr>');
 

	
 
		/* store classNum as course_i into the <tr />: */
 
		jQuery('#tr-course-' + classNum).data({course_i: classNum});
 

	
 
		var class_elem = jQuery('.className' + classNum);
 

	
 
@@ -572,7 +572,16 @@ jQuery(document).ready(function() {
 
		jQuery('.hidden').hide();
 
		jQuery('#showMore').show();
 
		jQuery('#showLess').hide();
 
	});
 

	
 

	
 
        //-------------------------------------------------
 
        // Style course titles as inputs when clicked
 
        //-------------------------------------------------
 
        jQuery('.course-title-entry').live('click', function() {
 
          jQuery(this).toggleClass('inPlace');
 
        });
 
        jQuery('.course-title-entry').live('blur', function() {
 
          jQuery(this).addClass('inPlace');
 
        });
 
});
styles/general.css
Show inline comments
 
@@ -387,6 +387,11 @@ a:hover {
 

	
 
  background: rgba(80,80,80,.9)!important;
 

	
 
  font: normal bold 1.2em sans-serif;
 
}
 

	
 
.inPlace {
 
  color: #000;
 
  border: none;
 
  background: transparent;
 
}
0 comments (0 inline, 0 general)