From 286e1f0e189ffb3413f2ab319ca984ef0164446b Mon Sep 17 00:00:00 2001 From: vyshane Date: Fri, 20 Oct 2006 03:18:06 +0000 Subject: [PATCH] Merged from 1.7 --- lib/ajax/ajaxcourse.js | 141 ++++++++++++++++++++++------------------- 1 file changed, 76 insertions(+), 65 deletions(-) diff --git a/lib/ajax/ajaxcourse.js b/lib/ajax/ajaxcourse.js index 2cf7aa8b86..fd0a60262b 100644 --- a/lib/ajax/ajaxcourse.js +++ b/lib/ajax/ajaxcourse.js @@ -1,12 +1,13 @@ -/* - * Contains Main class and supporting functions for topic ajax course layout +/** + * Contains Main class and supporting functions for ajax course layout * * $Id$ */ //hide content body until done loading (manipulation looks ugly elsewise) -document.getElementById('content').style.display='none'; +document.getElementById('content').style.display = 'none'; + //onload object for handling scripts on page load, this insurses they run in my order function onload_class() { @@ -14,24 +15,26 @@ function onload_class() { this.debug = false; } + onload_class.prototype.add = function(script) { - if(this.debug)YAHOO.log("onload.add - adding "+script,"junk"); + if(this.debug)YAHOO.log("onload.add - adding "+script, "junk"); this.scripts[this.scripts.length] = script; } -onload_class.prototype.load = function(){ +onload_class.prototype.load = function() { var scriptcount = this.scripts.length; - if(this.debug)YAHOO.log("onload.load - loading "+scriptcount+" scripts","info"); + if(this.debug)YAHOO.log("onload.load - loading "+scriptcount+" scripts", "info"); for (i=0;i= main.connectQueue.length) { return; } - var callback = { -success: function(){ - main.connectQueue_fireNext(); - } + success: function(){ + main.connectQueue_fireNext(); + } } - - main.connectQueueConnection = main.connect(main.connectQueue[head]['method'],main.connectQueue[head]['urlStub'],callback,main.connectQueue[head]['body']) - + 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){ + +main_class.prototype.update_marker = function(newMarker) { if (this.marker != null) { this.marker.toggle_highlight(); } @@ -207,19 +215,22 @@ main_class.prototype.update_marker = function(newMarker){ this.marker = newMarker; this.marker.toggle_highlight(); - this.connect('post','class=course&field=marker',null,'value='+this.marker.sectionId); -} + this.connect('post', 'class=course&field=marker', null, 'value='+this.marker.sectionId); +} + + +main_class.prototype.getString = function(title,variable) { + if(this.portal.strings[title]) { + return this.portal.strings[title].replace(/_var_/, variable); + } +} -main_class.prototype.getString = function(title,variable){ - if(this.portal.strings[title]) - return this.portal.strings[title].replace(/_var_/,variable); - } var main = new main_class(); -function php_portal_class(){ - //portal to php data +function php_portal_class() { + //portal to php data this.id = null; //array of id's of blocks set at end of page load by php @@ -232,5 +243,5 @@ function php_portal_class(){ //strings this.strings = []; - YAHOO.log("instantiated php_portal_class","info"); + YAHOO.log("Instantiated php_portal_class", "info"); } -- 2.39.5