From: vyshane Date: Tue, 24 Oct 2006 08:11:38 +0000 (+0000) Subject: Merged from 1.7 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=2469f7ea852db36176036691683d72f2ef244693;p=moodle.git Merged from 1.7 --- diff --git a/lib/ajax/ajaxcourse.js b/lib/ajax/ajaxcourse.js index fd0a60262b..d0d18c6d4a 100644 --- a/lib/ajax/ajaxcourse.js +++ b/lib/ajax/ajaxcourse.js @@ -6,65 +6,65 @@ //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 +//onload object for handling scripts on page load, this insures they run in my order function onload_class() { this.scripts = new Array(); - this.debug = false; + this.debug = true; } onload_class.prototype.add = function(script) { - if(this.debug)YAHOO.log("onload.add - adding "+script, "junk"); + 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("onload.load - loading "+scriptcount+" scripts", "info"); - for (i=0;i\n"; + $output .= "\n"; + if ($translatelist[$list[$i]] == '/lib/yui/logger/logger.js') { + // Special case. We need the css. + $output .= ""; + } } else { - echo "\n"; + $output .= "\n"; } } - /* - if (debugging('', DEBUG_DEVELOPER)) { - echo "\n"; - - // Dependencies for the logger. - echo ""; - - // FIXME: Below might get included more than once. - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - ?> - - blocks); $i++) { - $blocksoutput .= "['".$this->blocks[$i][0]."','".$this->blocks[$i][1]."','".$this->blocks[$i][2]."']"; - if ($i != (count($this->blocks)-1)) { + $blocksoutput .= "['".$this->blocks[$i][0]."', + '".$this->blocks[$i][1]."', + '".$this->blocks[$i][2]."']"; + + if ($i != (count($this->blocks) - 1)) { $blocksoutput .= ','; } } - $output .= ""; - echo $output; + if ($return) { + return $output; + } else { + echo $output; + } } -} +} ?> \ No newline at end of file diff --git a/lib/ajax/block_classes.js b/lib/ajax/block_classes.js index 56865f2b8a..74ae6c88a5 100644 --- a/lib/ajax/block_classes.js +++ b/lib/ajax/block_classes.js @@ -1,17 +1,17 @@ -/* +/** * library for ajaxcourse formats, the classes and related functions for drag and drop blocks * * this library requires a 'main' object created in calling document * - * $Id$ - * + * $Id$ */ - //set Drag and Drop to Intersect mode: - YAHOO.util.DDM.mode = YAHOO.util.DDM.INTERSECT; +//set Drag and Drop to Intersect mode: +YAHOO.util.DDM.mode = YAHOO.util.DDM.INTERSECT; -/* + +/** * class for draggable block, extends YAHOO.util.DDProxy */ function block_class(id,group,config){ diff --git a/lib/ajax/section_classes.js b/lib/ajax/section_classes.js index 689b9cb2f9..32b558f3c9 100755 --- a/lib/ajax/section_classes.js +++ b/lib/ajax/section_classes.js @@ -212,7 +212,7 @@ section_class.prototype.move_to_section = function(target) { //move on backend main.connect('post','class=section&field=move',null,'id='+this.sectionId+'&value=' - +(target.sectionId-this.sectionId)); + +(target.sectionId - this.sectionId)); //move on front end for (var i=loopStart; eval(loopCondition); eval(loopInc)) { @@ -375,14 +375,15 @@ section_class.prototype.insert_resource = function(el, targetel) { var tempStore = nextStore = null; //update in backend - targetId = ''; + var targetId = ''; if (targetel) { targetId = targetel.id; } - + if (this.debug) { + YAHOO.log('id='+el.id+', beforeId='+targetId+', sectionId='+this.sectionId); + } main.connect('post', 'class=resource&field=move', null, - 'id='+el.id+'&beforeId='+targetId - +'§ionId='+this.sectionId); + 'id='+el.id+'&beforeId='+targetId+'§ionId='+this.sectionId); //if inserting into a hidden resource hide if (this.hidden) { @@ -493,7 +494,7 @@ resource_class.prototype.init_resource = function(id, group, config, parentObj) resource_class.prototype.init_buttons = function() { var commandContainer = YAHOO.util.Dom.getElementsByClassName('commands', 'span', this.getEl())[0]; - if ( commandContainer == null) { + if (commandContainer == null) { YAHOO.log('Cannot find command container for '+this.getEl().id, 'error'); return; } @@ -588,7 +589,7 @@ resource_class.prototype.update_index = function(index) { } } -resource_class.prototype.startDrag = function(x, y) { +resource_class.prototype.startDrag = function(x, y) { YAHOO.util.DDM.mode = YAHOO.util.DDM.INTERSECT; //reinitialize dd element @@ -597,6 +598,11 @@ resource_class.prototype.startDrag = function(x, y) { var targets = YAHOO.util.DDM.getRelated(this, true); if (this.debug) { YAHOO.log(this.id + " startDrag "+targets.length + " targets"); + /* + for (var i=0; i