/* * library for ajaxcourse formats, the classes and related functions for drag and drop blocks * * this library requires a 'main' object created in calling document * */ //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){ this.init_block(id,group,config); } YAHOO.extend(block_class, YAHOO.util.DDProxy); block_class.prototype.debug = true; block_class.prototype.init_block = function(id, sGroup, config){ if (!id) { return; } //Drag and Drop this.init(id, sGroup, config); this.initFrame(); this.createFrame(); this.is = 'block'; this.instanceId = this.getEl().id.replace(/inst/i,''); this.addInvalidHandleType('a'); var s = this.getEl().style; s.opacity = 0.76; s.filter = "alpha(opacity=76)"; // specify that this is not currently a drop target this.isTarget = false; this.region = YAHOO.util.Region.getRegion(this.getEl()); this.type = block_class.TYPE; //DHTML this.viewbutton = null; this.originalClass = this.getEl().className; this.init_buttons(); } block_class.prototype.startDrag = function(x, y) { //operates in intersect mode YAHOO.util.DDM.mode = YAHOO.util.DDM.INTERSECT; YAHOO.log(this.id + " startDrag"); var dragEl = this.getDragEl(); var clickEl = this.getEl(); dragEl.innerHTML = clickEl.innerHTML; dragEl.className = clickEl.className; dragEl.style.color = this.DDM.getStyle(clickEl, "color");; dragEl.style.backgroundColor = this.DDM.getStyle(clickEl, "backgroundColor"); dragEl.style.border = '0px'; var s = clickEl.style; s.opacity = .1; s.filter = "alpha(opacity=10)"; var targets = YAHOO.util.DDM.getRelated(this, true); YAHOO.log(targets.length + " targets"); //restyle side boxes to highlight for (var i=0; i