}
}
+
section_class.prototype.init_buttons = function() {
var commandContainer = this.getEl().childNodes[2];
this.viewButton = viewbutton;
}
+
section_class.prototype.add_handle = function() {
var handleRef = main.mk_button('a', '/i/move_2d.gif', [['style','cursor:move']]);
YAHOO.util.Dom.generateId(handleRef, 'sectionHandle');
this.setHandleElId(this.handle.id);
}
+
section_class.prototype.process_section = function() {
this.content_td = this.getEl().childNodes[1];
main.marker = this;
}
- //create holder for display number for access later
+ // Create holder for display number for access later
this.numberDisplay = document.createElement('div');
this.numberDisplay.innerHTML = this.getEl().childNodes[0].innerHTML;
this.sectionId = this.id.replace(/section-/i, ''); // Okay, we will have to change this if we
// ever change the id attributes format
// for the sections.
-
- if (this.debug)YAHOO.log("Creating section "+this.getEl().id+" in position "+this.sectionId);
- //find/edit resources
-
+ if (this.debug) {
+ YAHOO.log("Creating section "+this.getEl().id+" in position "+this.sectionId);
+ }
+
+ // Find/edit resources
this.resources_ul = this.content_td.getElementsByTagName('ul')[0];
if (!this.resources_ul) {
this.resources_ul = document.createElement('ul');
this.summary = YAHOO.util.Dom.getElementsByClassName('summary', null, this.getEl())[0].firstChild.data || '';
}
+
section_class.prototype.startDrag = function(x, y) {
//operates in point mode
YAHOO.util.DDM.mode = YAHOO.util.DDM.POINT;
this.getDragEl().innerHTML = '';
var targets = YAHOO.util.DDM.getRelated(this, true);
- if (this.debug)YAHOO.log(this.id + " startDrag, "+targets.length + " targets");
+
+ if (this.debug) {
+ YAHOO.log(this.id + " startDrag, "+targets.length + " targets");
+ }
}
+
section_class.prototype.onDragDrop = function(e, id) {
// get the drag and drop object that was targeted
var target = YAHOO.util.DDM.getDDById(id);
if (this.debug) {
- YAHOO.log("Section dropped on id="+id+" (I am "+this.getEl().id+") x="+YAHOO.util.Dom.getXY(this.getDragEl()));
+ YAHOO.log("Section dropped on id="+id+" (I am "+this.getEl().id+") x="
+ +YAHOO.util.Dom.getXY(this.getDragEl()));
}
this.move_to_section(target);
//add back to resources group
this.addToGroup('resources');
-}
+}
+
+
section_class.prototype.endDrag = function() {
//nessicary to defeat default action
this.addToGroup('resources');
}
+
section_class.prototype.move_to_section = function(target) {
var tempTd = document.createElement('td');
var tempStore = null;
}
}
+
section_class.prototype.swap_with_section = function(sectionIn) {
var tmpStore = null;
YAHOO.util.DDM.swapNode(this.getEl(), sectionIn.getEl());
}
+
section_class.prototype.toggle_hide = function(e,target,superficial) {
if (this.hidden) {
YAHOO.util.Dom.removeClass(this.getEl(), 'hidden');
}
}
+
section_class.prototype.toggle_highlight = function() {
if (this.highlighted) {
YAHOO.util.Dom.removeClass(this.getEl(), 'current');
}
}
+
section_class.prototype.mk_marker = function() {
if (main.marker != this) {
main.update_marker(this);
}
}
+
section_class.prototype.changeId = function(newId) {
this.sectionId = newId;
this.numberDisplay.firstChild.data = newId;
}
}
+
section_class.prototype.get_resource_index = function(el) {
for (var x=0; x<this.resources.length; x++) {
if (this.resources[x] == el) {
return -1;
}
+
section_class.prototype.remove_resource = function(el) {
var resourceCount = this.resources.length;
this.write_sequence_list();
}
+
section_class.prototype.insert_resource = function(el, targetel) {
var resourcecount = this.resources.length;
var found = false;
el.parentObj = this;
}
+
section_class.prototype.write_sequence_list = function(toReturn) {
var listOutput = '';
}
}
+
resource_class.prototype.init_buttons = function() {
var commandContainer = YAHOO.util.Dom.getElementsByClassName('commands', 'span', this.getEl())[0];
if (commandContainer == null) {
}
}
- if (updateButton == null)
+ if (updateButton == null) {
YAHOO.log('Cannot find updateButton for '+this.getEl().id, 'error');
+ }
commandContainer.innerHTML = '';
this.viewButton = button;
}
+
resource_class.prototype.toggle_hide = function(target, e, superficial, force) {
if (force != null) {
if (this.debug) {
}
}
+
resource_class.prototype.delete_button = function() {
if (this.debug) {
YAHOO.log("Deleting "+this.getEl().id+" from parent "+this.parentObj.getEl().id);
main.connect('DELETE', 'class=resource&id='+this.id);
}
+
resource_class.prototype.update_index = function(index) {
if (this.debug) {
YAHOO.log("Updating Index for resource "+this.getEl().id+" to "+index);
}
}
+
resource_class.prototype.startDrag = function(x, y) {
YAHOO.util.DDM.mode = YAHOO.util.DDM.INTERSECT;
var targets = YAHOO.util.DDM.getRelated(this, true);
if (this.debug) {
YAHOO.log(this.id + " startDrag "+targets.length + " targets");
- /*
- for (var i=0; i<targets.length; i++) {
- YAHOO.log('target '+(i+1)+': '+targets[i].id);
- }
- */
}
}
+
resource_class.prototype.clear_move_markers = function(target) {
if (target.is == 'section') {
resources = target.resources;
}
}
+
resource_class.prototype.onDragOver = function(e, ids) {
var target = YAHOO.util.DDM.getBestMatch(ids);
}
}
+
resource_class.prototype.onDragOut = function(e, ids) {
var target = YAHOO.util.DDM.getBestMatch(ids);
if (target) {
}
}
+
resource_class.prototype.onDragDrop = function(e, ids) {YAHOO.log('onDragDrop');
var target = YAHOO.util.DDM.getBestMatch(ids);
if (!target) {
return;
}
+
resource_class.prototype.endDrag = function() {
// Eliminates default action
}
+
/**
* activity_class extends resource class
*/
}
}
+
activity_class.prototype.groupImages = ['/t/groupn.gif', '/t/groups.gif', '/t/groupv.gif'];
+
activity_class.prototype.init_activity_button = function() {
var button = main.mk_button('a', this.groupImages[this.currentGroup]);
YAHOO.util.Event.addListener(button,'click',this.toggle_group,this,true);
this.groupButton = button;
}
+
activity_class.prototype.get_current_group = function(id) {
if (document.getElementById(id) == null) {
return;
return 0;
}
+
activity_class.prototype.toggle_group = function() {
this.currentGroup++;
if (this.currentGroup > 2) {