/** * Contains Main class and supporting functions for ajax course layout */ //hide content body until done loading (manipulation looks ugly elsewise) //document.getElementById('content').style.display = 'none'; // If firebug console is undefined, define a fake one here if (window.console) { console.vardump = function(data) { retval = ''; for (key in data) { retval += key+' = '+data[key] + "\n"; } console.log(retval); }; } //onload object for handling scripts on page load, this insures they run in my order function onload_class() { this.scripts = new Array(); this.debug = true; } onload_class.prototype.add = function(script) { if (this.debug) { YAHOO.log("onloadobj.add - adding "+script, "junk"); } this.scripts[this.scripts.length] = script; } onload_class.prototype.load = function() { var scriptcount = this.scripts.length; if (this.debug) { YAHOO.log("onloadobj.load - loading "+scriptcount+" scripts", "info"); } for (i=0; i 0) { var sectiontitle = YAHOO.util.Selector.query('#section-'+ct+' h3.weekdates')[0]; if (undefined !== sectiontitle) { // Only save date for weekly format this.sectiondates[ct] = sectiontitle.innerHTML; } } } //ct++; } if (this.debug) { YAHOO.log("Processed "+ct+" sections"); } this.adminBlock = YAHOO.util.Dom.getElementsByClassName('block_adminblock')[0]; this.tempBlock = YAHOO.util.Dom.getElementsByClassName('tempblockhandler')[0]; } main_class.prototype.mk_safe_for_transport = function(input) { return input.replace(/&/i, '_.amp._'); } //return block by id main_class.prototype.get_block_index = function(el) { var blockcount = this.blocks.length; for (i=0; i= main.connectQueue.length) { return; } var callback = { success: function(){ main.connectQueue_fireNext(); } } main.connectQueueConnection = main.connect(main.connectQueue[head]['method'], main.connectQueue[head]['urlStub'], callback, main.connectQueue[head]['body']); main.connectQueueHead++; } main_class.prototype.update_marker = function(newMarker) { if (this.marker != null) { this.marker.toggle_highlight(); } this.marker = newMarker; this.marker.toggle_highlight(); this.connect('post', 'class=course&field=marker', null, 'value='+this.marker.sectionId); } main_class.prototype.getString = function(identifier, variable) { if (this.portal.strings[identifier]) { return this.portal.strings[identifier].replace(/_var_/, variable); } } main_class.prototype.is_ie = function() { var agent = navigator.userAgent.toLowerCase(); if ((agent.indexOf('msie') != -1)) { return true; } return false; } var main = new main_class(); function php_portal_class() { //portal to php data this.id = null; this.debug = null; //array of id's of blocks set at end of page load by php this.blocks = new Array(); this.imagePath = null; //flag for week fomat this.isWeek = false; //strings this.strings = []; //icons this.icons = []; YAHOO.log("Instantiated php_portal_class", "info"); }