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 48 insertions and 12 deletions:
0 comments (0 inline, 0 general)
class.schedule.php
Show inline comments
 
@@ -200,10 +200,10 @@ class Schedule
 
    $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);
 

	
 
@@ -241,12 +241,22 @@ class Schedule
 
	    });
 
	    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"
inc/class.page.php
Show inline comments
 
@@ -58,7 +58,8 @@ class page
 
    $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['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;
 

	
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
 
@@ -332,5 +332,5 @@ jQuery(document).ready(function() {
 
		jQuery('.advanced').slideToggle();
 
	});
 

	
 

	
 
	jQuery('#show-box input').change(show_box_change);
 
});
styles/print.css
Show inline comments
 
@@ -55,3 +55,8 @@ div.scroller div.section div.txt {
 
#possiblestats {
 
  text-align: center;
 
}
 

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