From: cap2501 Date: Mon, 21 Aug 2006 06:14:43 +0000 (+0000) Subject: Main JS file for topic - ajax course format (still needs a little cleaning though) X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=04b2d74f03d4c75c07c074735ec88c907126d9b9;p=moodle.git Main JS file for topic - ajax course format (still needs a little cleaning though) --- diff --git a/course/format/topics/ajaxcourse-topics.js b/course/format/topics/ajaxcourse-topics.js new file mode 100644 index 0000000000..9fe8f8c139 --- /dev/null +++ b/course/format/topics/ajaxcourse-topics.js @@ -0,0 +1,207 @@ +//set DDM to intersect mode +//YAHOO.util.DDM.mode = YAHOO.util.DDM.INTERSECT; + +//hide content body until done loading(manipulation looks ugly elsewise) +document.getElementById('content').style.display='none'; + +//onload object for handling scripts on page load, this insurses they run in my order +function onload_class(){ + this.scripts = new Array(); + this.debug = false; +} + +onload_class.prototype.add = function(script){ + if(this.debug)YAHOO.log("onload.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("onload.load - loading "+scriptcount+" scripts","info"); + 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); + } + + + + +var main = new main_class(); + + + + +//portal to php data +function php_portal_class(){ + this.id = 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; + + YAHOO.log("instantiated php_portal_class","info"); +} + + + +