Changeset - 711d3e94b78e
[Not reviewed]
default
0 5 0
Nathan Brink (binki) - 15 years ago 2010-10-25 02:26:56
ohnobinki@ohnopublishing.net
Add the ability to hide/show room and professor information about classes.
5 files changed with 50 insertions and 14 deletions:
0 comments (0 inline, 0 general)
class.schedule.php
Show inline comments
 
@@ -191,28 +191,28 @@ class Schedule
 
  //--------------------------------------------------
 
  // Prints out the possible permutations in tables.
 
  //--------------------------------------------------
 
  function writeoutTables()
 
  {
 
    $table = "";
 
    $filled = false;
 
    $time = array(700,730,800,830,900,930,1000,1030,1100,1130,1200,1230,1300,1330,1400,1430,1500,1530,1600,1630,1700,1730,1800,1830,1900,1930,2000,2030,2100,2130, 2200);
 

	
 
    $footcloser = '';
 

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

	
 

	
 

	
 
    if(isset($_REQUEST['print'])){
 
 
 
     echo '<script type="text/javascript">';
 
      echo 'jQuery(document).ready( function() {';
 
 
 
      /* If user entered items to print */
 
      if($_REQUEST['print'] != 'all'){
 
@@ -232,30 +232,40 @@ class Schedule
 
      echo '<script type="text/javascript">';
 
      echo 'jQuery(document).ready( function() {';
 
      echo 'jQuery("#tabs").tabs();';
 
      echo 'jQuery("#sharedialog").dialog({ modal: true, width: 550, resizable: false, draggable: false, autoOpen: false });';
 
      echo 'jQuery("#share").click( function() {
 
              jQuery("#sharedialog").dialog("open");
 
            });';
 
      echo 'jQuery(\'#printItems\').click( function() {
 
		window.location = "'.$_SERVER['SCRIPT_NAME'].'?s='.$this->id_get().'&amp;print=" + (jQuery(\'#tabs\').tabs(\'option\',\'selected\') + 1);
 
	    });
 
	    jQuery(\'#cancelItems\').click( function() {
 
		jQuery(\'#selectItemsInput\').hide();
 
	    });';
 
	    });
 
';
 
      echo '});</script>'; /* Close document.ready for jquery */
 
      echo '<div id="sharedialog" title="Share Schedule"><p>You can share your schedule with the URL below:</p><p><!--http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'].'-->'.$outputPage->gen_share_url($this->id_get()).'</p></div>';
 
      echo '<p><span id="printItems"><a href="#">Print</a></span> :: <span id="share"><a href="#">Share</a></span> :: <a href="input.php">Home</a></p><p class="centeredtext">Having problems? <a href="feedback.php">Let us know</a>.</p><p class="centeredtext graytext"><em>Keyboard Shortcut: Left and right arrow keys switch between schedules</em></p>';
 
    }		
 

	
 
    echo "\n";
 
    echo '<div id="show-box" class="gray righttext" style="float: right;">
 
  <form>
 
     <h3>Display</h3>
 
     <div><input id="show-prof" name="show-prof" type="checkbox" checked="checked" /><label for="show-prof">Professor</label></div>
 
     <div><input id="show-location" name="show-location" type="checkbox" checked="checked" /><label for="show-location">Room</label></div>
 
  </form>
 
  </div> <!-- id="details" -->';
 

	
 
    if($this->nPermutations > 0)
 
      {
 
	$table .= "<div id=\"tabs\">\n"
 
	  . "  <ul>\n";
 
			
 
	for($nn = 1; $nn <= $this->nPermutations; $nn++)
 
	  {
 
	    $table .= "<li><a href=\"#tabs-" . $nn . "\">&nbsp;" . $nn . "&nbsp;</a></li>\n";
 
	  }
 
			
 
	$table .= "    </ul><div class=\"clear\"><p> </p> </div>\n  \n"
 
	  . "  <div class=\"scroller\">\n"
inc/class.page.php
Show inline comments
 
@@ -49,27 +49,28 @@ class page
 
    global $ga_trackers;
 

	
 
    require_once('school.inc');
 

	
 
    // Scripts and styles available to include
 
    $this->headCode['jQuery'] = '<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript" />';
 
    $this->headCode['jQueryUI'] = '<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.min.js" type="text/javascript" /><link rel="stylesheet" href="styles/jqueryui.css" type="text/css" media="screen" charset="utf-8" />';
 
    $this->headCode['jValidate'] = '<script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery.validate/1.7/jquery.validate.pack.js"></script>';
 
    $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->pagetitle = $ntitle;
 
   $this->scripts = $nscripts;
 
    $this->headCode['uiTabsKeyboard'] = '<script type="text/javascript" src="scripts/uiTabsKeyboard.js" />';
 
    $this->headCode['displayTables'] = '<script type="text/javascript" src="scripts/displayTables.js" />';
 
    $this->pagetitle = $ntitle;
 
    $this->scripts = $nscripts;
 

	
 
   /* compliant browsers which care, such as gecko, explicitly request xhtml: */
 
   if(!empty($_SERVER['HTTP_ACCEPT'])
 
      && strpos($_SERVER['HTTP_ACCEPT'], 'application/xhtml+xml') !== FALSE
 
      || !strlen($_SERVER['HTTP_ACCEPT']) /* then the browser doesn't care :-) */)
 
     {
 
       $this->xhtml = TRUE;
 
       header('Content-type: application/xhtml+xml');
 
     }
 

	
 
   if (count($ga_trackers))
 
     {
scripts/displayTables.js
Show inline comments
 
$(document).ready(function() {
 
/**
 
 * \brief
 
 *   Handle changes to the input elements under #show-box.
 
 */
 
function show_box_change()
 
{
 
    var name = jQuery(this).attr('name');
 
    if (name && name.indexOf('-'))
 
	{
 
	    /* convert from 'show-prof' back to 'prof' */
 
	    var css_class = name.substr(name.indexOf('-') + 1);
 
	    if (jQuery('#' + name + ':checked').size())
 
		{
 
		    jQuery('.' + css_class).show();
 
		}
 
	    else
 
		{
 
		    jQuery('.' + css_class).hide();
 
		}
 
	}
 

	
 
function hideAllButFirst(){
 
	jQuery('.week').hide();
 
};
 
    return false;
 
}
 

	
 
hideAllButFirst();
 

	
 
}
 
\ No newline at end of file
 
jQuery(document).ready( function()
 
  {
 
      jQuery('#show-box input').change(show_box_change);
 
  }
 
);
scripts/scheduleInput.js
Show inline comments
 
@@ -323,14 +323,14 @@ jQuery(document).ready(function() {
 
	});
 
	jQuery(".defText").blur();
 

	
 
	//--------------------------------------------------
 
	// Show/Hide advanced items
 
	//--------------------------------------------------
 
	jQuery('.advanced').hide();    
 
	jQuery('#showadvanced').click( function() {
 
		jQuery('#showadvanced').hide();
 
		jQuery('.advanced').slideToggle();
 
	});
 

	
 

	
 
	jQuery('#show-box input').change(show_box_change);
 
});
styles/print.css
Show inline comments
 
@@ -46,12 +46,17 @@ div.scroller div.section div.txt {
 
}
 
#leftfoot {
 
  display: none; 
 
}
 

	
 

	
 
#rightfoot {
 
  text-align: right!important;
 
}
 
#possiblestats {
 
  text-align: center;
 
}
 

	
 
#show-box
 
{ 
 
  display: none;
 
}
0 comments (0 inline, 0 general)