University of Oregon

Used jQuery to add a header for a group of courses

We had a group of courses for Take our Daughter and Sons to Work Day added to Making Tracks that all used the abbreviation of the name in their title: TODSTWD. They didn’t spell out the event name anywhere. So I added a jQuery script to the header that prepended the listing with the full title.
I limited this to course listing pages and confined it to a date range so it stopped running after the event.

Here’s a screenshot of the course list summary with out the jQuery header (before):

And here’s a screenshot of the course list summary with the jQuery header (after):

It also runs on the indiv. course details page.

Here’s the code:

<?php
if(strtotime(date('Y-m-d')) <= strtotime(date('2011-4-29'))){ //display until 4-29-11
	$todstwd_script = <<<javascript
	/* ########## Add TODSWD JS ########## */
	Drupal.behaviors.testBehavior=function(context){
		//run only if there is a context var
		if(typeof context !== 'undefined'){
			/*
			Check the type of the context var and type. Process if context = [object HTMLDocument]
			Note: when context == [object HTMLDocument] then this is page load. You may want some script to run only on page load. Some not and some all the time.
			*/
			if(window.location.href.search(/course_view|course_list/)!==-1){
				$('.courseSummary h3 a').each(function(){
					if($(this).text().search(/TODSTWD/)!==-1){
						$(this).parent().parent().prepend(&#039;<h2 class="todstwd" style="color:#006600">Take Our Daughters and Sons To Work Day - 4-28-2011</h2>');
					}
				});

				$('#t_content h2').each(function(){
					if($(this).text().search(/TODSTWD/)!==-1){
						if(!$('#todstwd').length){
							$('#main').prepend('<h1 id="todstwd" style="color:#006600">Take Our Daughters and Sons To Work Day - 4-28-2011</h1>');
						}
					}
				});
			} //end if(window.location.href.search(/course_view|course_list/)!==-1){
		} //end if(typeof context !== 'undefined'){
	} //end Drupal.behaviors.testBehavior=function(context){
	/* ########## end Add JS ########## */
JAVASCRIPT;
	drupal_add_js($todstwd_script, 'inline');
}
?&gt;

Here’s a link:
Making Tracks | Organizational Development and Training ODT.

Added jQuery browser check for ODT and Skillport eLearning

I noticed a mac user getting frustrated when trying to log in to the eLearning site the other day.
The log in process was hung up on the loading screen for a few minutes:

I pointed out that it said ‘click here’ if it doesn’t load after 40 seconds but I realize that’s not very helpful.
It turns out they were using Firefox, which isn’t one of the supported browsers.

We do have the browser compatibility information on the page but that content is collapsed. So the user would have to look for it.
So I decided to add some browser compatibility tests and display a message to mac / firefox users to save them some trouble.
(more…)

Posted the first expandable field interactive pdf

I worked with Judy today and we posted our first interactive pdf with expandable fields that expand to fit the text.
The first one is a simple one: Performance Improvement Plan Worksheet.
It has been enabled for Acrobat Reader so users can save their content but in testing this I noticed the Apple’s Preview application can’t load the document. I’m guessing it isn’t programmed to understand dynamic pdf’s, But even though Preview is the default PDF viewer, Acrobat Reader is free and works great!

Installed Table Wizard

Installed Table Wizard and will start laying the foundation for running reports for Making Tracks

Updated sort order for session dates in Making Tracks courses

I needed to update the session date order in the Making Tracks course listings so I used a custom sort function and all is well.
Here’s a image of the dates and times for this session sorted correctly:
Screen shot

Previously it was sorted in reverse.
(more…)

Updated Skillport Course Catalog Link Script

Skillport hosts the course catalog on their community site. Which is a restricted site. Only clients have access to that site.
I’ve been using a script to use my authentication to capture the pdf of the course catalog, but they’ve been changing the link for the catalog and I’ve had to make some updates over time. Recently they did a site redesign and now the pdf isn’t accessible via my former efforts so I rewrote my script.
It’s working but it occurred to me that they don’t want their competitors seeing this catalog. So I revised this to work for authenticated users only. That was accomplished by surrounding the link and information with this: .
I won’t post the code here for the same reason.

Migrated OHMAC to odt/ohmac

I migrated the three ohmac pages (main, faq and forms) to ODT and redirected all traffic from the shell account to the ODT site.
Old URL: http://ohmac.uoregon.edu
New URL: http://odt.uoregon.edu/ohmac


Backend info:
The new odt pages are Drupal books. I nested them and relinked them to each other. I also set all the external links to open in new windows.

Enabled php on shell by adding php.cgi and adding this to the .htaccess page:

RemoveHandler .php
AddType application/my-httpd-php .php
Action application/my-httpd-php /~ohmac/php.cgi


# redir ohmac to odt/ohmac
RewriteEngine ON
  RewriteCond %{HTTP_HOST} ^ohmac$ [NC]
  RewriteRule ^(.*)$ http://odt.uoregon.edu/ohmac [R=301]

  RewriteCond %{HTTP_HOST} ^ohmac.uoregon.edu$ [NC]
  RewriteRule ^(.*)$ http://odt.uoregon.edu/ohmac [R=301]

What is the change log

This is a means of documenting site updates and sharing them with all the site administrators.

Back end description, in short:
I post here, taking care to choose the nested categories:

Screen shot

The nested heirarchy of category tags that allows me to customize what updates will be visible on what web site.

Next I create a block in the drupal site that aggregates the rss feed from this category and displays it for administrators.

Screen shot

Here's an example of an included rss feed on the drupal web site

This way the users are kept up-to speed on site updates, changes and modifications.