MDL-20700 coding style cleanup - cvs keywords removed, closign php tag removed, trailing whitespace cleanup
This commit is contained in:
+52
-52
@@ -1,12 +1,12 @@
|
||||
/**
|
||||
* 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;
|
||||
//set Drag and Drop to Intersect mode:
|
||||
YAHOO.util.DDM.mode = YAHOO.util.DDM.INTERSECT;
|
||||
|
||||
|
||||
/**
|
||||
@@ -60,7 +60,7 @@ block_class.prototype.init_block = function(id, sGroup, config) {
|
||||
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();
|
||||
@@ -78,12 +78,12 @@ block_class.prototype.startDrag = function(x, y) {
|
||||
|
||||
var targets = YAHOO.util.DDM.getRelated(this, true);
|
||||
YAHOO.log(targets.length + " targets");
|
||||
|
||||
|
||||
//restyle side boxes to highlight
|
||||
for (var i=0; i<targets.length; i++) {
|
||||
|
||||
|
||||
var targetEl = targets[i].getEl();
|
||||
|
||||
|
||||
targetEl.style.background = "#fefff0";
|
||||
targetEl.opacity = .3;
|
||||
targetEl.filter = "alpha(opacity=30)";
|
||||
@@ -102,7 +102,7 @@ block_class.prototype.endDrag = function() {
|
||||
block_class.prototype.onDragDrop = function(e, id) {
|
||||
// get the drag and drop object that was targeted
|
||||
var oDD;
|
||||
|
||||
|
||||
if ("string" == typeof id) {
|
||||
oDD = YAHOO.util.DDM.getDDById(id);
|
||||
} else {
|
||||
@@ -110,7 +110,7 @@ block_class.prototype.onDragDrop = function(e, id) {
|
||||
}
|
||||
|
||||
var el = this.getEl();
|
||||
|
||||
|
||||
if (this.debug) {
|
||||
YAHOO.log("id="+id+" el="+e+" x="+YAHOO.util.Dom.getXY(this.getDragEl()));
|
||||
}
|
||||
@@ -118,21 +118,21 @@ block_class.prototype.onDragDrop = function(e, id) {
|
||||
|
||||
this.move_block(id);
|
||||
//YAHOO.util.DDM.moveToEl(el, oDD.getEl());
|
||||
|
||||
|
||||
this.resetTargets();
|
||||
}
|
||||
|
||||
|
||||
block_class.prototype.find_target = function(column){
|
||||
var collisions = column.find_sub_collision(YAHOO.util.Region.getRegion(this.getDragEl()));
|
||||
|
||||
|
||||
//determine position
|
||||
var insertbefore = null;
|
||||
if(collisions.length == 0)
|
||||
return;
|
||||
|
||||
insertbefore = column.blocks[collisions[0][0]];
|
||||
|
||||
|
||||
insertbefore = column.blocks[collisions[0][0]];
|
||||
|
||||
return insertbefore;
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ block_class.prototype.resetTargets = function() {
|
||||
var targetEl = targets[i].getEl();
|
||||
targetEl.style.background = "";
|
||||
targetEl.opacity = 1;
|
||||
targetEl.filter = "alpha(opacity=100)";
|
||||
targetEl.filter = "alpha(opacity=100)";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -154,40 +154,40 @@ block_class.prototype.move_block = function(columnid){
|
||||
var inserttarget = this.find_target(column);
|
||||
|
||||
if(this.debug && inserttarget != null)YAHOO.log("moving "+this.getEl().id+" before "+inserttarget.getEl().id+" - parentNode="+this.getEl().parentNode.id);
|
||||
|
||||
|
||||
if(this == inserttarget){
|
||||
if(this.debug)YAHOO.log("Dropping on self, resetting");
|
||||
this.endDrag();
|
||||
return;
|
||||
}
|
||||
|
||||
//remove from document
|
||||
|
||||
//remove from document
|
||||
if(this.getEl().parentNode != null)
|
||||
this.getEl().parentNode.removeChild(this.getEl());
|
||||
|
||||
this.getEl().parentNode.removeChild(this.getEl());
|
||||
|
||||
//insert into correct place
|
||||
if(inserttarget != null ){
|
||||
inserttarget.getEl().parentNode.insertBefore(this.getEl(),inserttarget.getEl());
|
||||
|
||||
|
||||
}else if(column == main.rightcolumn){//if right side insert before admin block
|
||||
column.getEl().insertBefore(this.getEl(),main.adminBlock);
|
||||
|
||||
}else{
|
||||
column.getEl().appendChild(this.getEl());
|
||||
column.getEl().insertBefore(this.getEl(),main.adminBlock);
|
||||
|
||||
}else{
|
||||
column.getEl().appendChild(this.getEl());
|
||||
}
|
||||
|
||||
|
||||
this.reset_regions();
|
||||
|
||||
|
||||
//remove block from current array
|
||||
if(main.rightcolumn.has_block(this))
|
||||
main.rightcolumn.remove_block(this);
|
||||
|
||||
|
||||
else if(main.leftcolumn.has_block(this))
|
||||
main.leftcolumn.remove_block(this);
|
||||
|
||||
|
||||
//insert into new array
|
||||
column.insert_block(this,inserttarget);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -257,7 +257,7 @@ block_class.prototype.delete_button = function() {
|
||||
|
||||
// Remove from remote model.
|
||||
main.connect('POST', 'class=block&action=DELETE&instanceId='+this.instanceId);
|
||||
|
||||
|
||||
// Remove from view
|
||||
main.blocks.splice(main.get_block_index(this), 1);
|
||||
this.getEl().parentNode.removeChild(this.getEl());
|
||||
@@ -292,13 +292,13 @@ column_class.prototype.debug = false;
|
||||
|
||||
column_class.prototype.init_column = function(id, group,config,ident){
|
||||
if (!id) { return; }
|
||||
|
||||
|
||||
this.initTarget(id,group,config);
|
||||
this.blocks = new Array();
|
||||
this.ident = ident;
|
||||
|
||||
|
||||
// YAHOO.log("init_column "+id+"-"+el.id);
|
||||
this.region = YAHOO.util.Region.getRegion(id);
|
||||
this.region = YAHOO.util.Region.getRegion(id);
|
||||
|
||||
}
|
||||
|
||||
@@ -318,7 +318,7 @@ column_class.prototype.find_sub_collision = function(dragRegion){
|
||||
if(this.debug)YAHOO.log(index+" Collides with "+this.blocks[i].getEl().id+" area" + collisions[index][1].getArea());
|
||||
}
|
||||
}
|
||||
return collisions;
|
||||
return collisions;
|
||||
}
|
||||
|
||||
column_class.prototype.add_block = function(el){
|
||||
@@ -333,22 +333,22 @@ column_class.prototype.insert_block = function(el,targetel){
|
||||
if(found > 0){
|
||||
tempStore = this.blocks[i];
|
||||
this.blocks[i] = nextStore;
|
||||
nextStore = tempStore;
|
||||
|
||||
nextStore = tempStore;
|
||||
|
||||
}else if(this.blocks[i] == targetel){
|
||||
found = i;
|
||||
nextStore = this.blocks[i];
|
||||
this.blocks[i] = el;
|
||||
this.blocks[i] = el;
|
||||
blockcount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(found<0){//insert at end
|
||||
found = this.blocks.length;
|
||||
this.add_block(el);
|
||||
|
||||
found = this.blocks.length;
|
||||
this.add_block(el);
|
||||
|
||||
}
|
||||
|
||||
|
||||
el.updatePosition(found,this.ident);
|
||||
}
|
||||
|
||||
@@ -359,8 +359,8 @@ column_class.prototype.has_block = function(el){
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
column_class.prototype.remove_block = function(el){
|
||||
var blockcount = this.blocks.length;
|
||||
var found = false;
|
||||
@@ -368,16 +368,16 @@ column_class.prototype.remove_block = function(el){
|
||||
if(this.blocks[i]==el || found){
|
||||
if(!found)
|
||||
found = true;
|
||||
|
||||
|
||||
if(i < blockcount-1){
|
||||
this.blocks[i] = this.blocks[i+1];
|
||||
this.blocks[i] = this.blocks[i+1];
|
||||
}else{
|
||||
this.blocks.pop();
|
||||
this.blocks.pop();
|
||||
}
|
||||
}
|
||||
}
|
||||
YAHOO.log("column "+this.indent+" has "+blockcount+"blocks");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ section_class.prototype.init_buttons = function() {
|
||||
YAHOO.util.Event.addListener(highlightbutton, 'click', this.mk_marker, this, true);
|
||||
commandContainer.appendChild(highlightbutton);
|
||||
this.highlightButton = highlightbutton;
|
||||
}
|
||||
}
|
||||
if (this.sectionId > 0 ) {
|
||||
var viewbutton = main.mk_button('div', main.portal.icons['hide'], main.getString('hidesection', this.sectionId),
|
||||
[['title', main.portal.strings['hide'] ]]);
|
||||
@@ -172,7 +172,7 @@ section_class.prototype.startDrag = function(x, y) {
|
||||
}
|
||||
|
||||
|
||||
section_class.prototype.onDragDrop = function(e, id) {
|
||||
section_class.prototype.onDragDrop = function(e, id) {
|
||||
// get the drag and drop object that was targeted
|
||||
var target = YAHOO.util.DDM.getDDById(id);
|
||||
|
||||
@@ -228,7 +228,7 @@ section_class.prototype.move_to_section = function(target) {
|
||||
//move on front end
|
||||
for (var i=loopStart; eval(loopCondition); eval(loopInc)) {
|
||||
|
||||
if ((main.sections[i] == this) && !found) {
|
||||
if ((main.sections[i] == this) && !found) {
|
||||
//encounter with original node
|
||||
if (this.debug) {
|
||||
YAHOO.log("Found Original "+main.sections[i].getEl().id);
|
||||
@@ -242,7 +242,7 @@ section_class.prototype.move_to_section = function(target) {
|
||||
YAHOO.log("Found target "+main.sections[i].getEl().id);
|
||||
}
|
||||
main.sections[i].swap_with_section(main.sections[eval(loopmodifier)]);
|
||||
main.sections[i].swap_dates(main.sections[eval(loopmodifier)]);
|
||||
main.sections[i].swap_dates(main.sections[eval(loopmodifier)]);
|
||||
found = false;
|
||||
break;
|
||||
} else if (found) {
|
||||
|
||||
@@ -67,7 +67,7 @@ class xmldb_file extends xmldb_object {
|
||||
}
|
||||
|
||||
/**
|
||||
* This function will check/validate the XML file for correctness
|
||||
* This function will check/validate the XML file for correctness
|
||||
* Dinamically if will use the best available checker/validator
|
||||
* (expat syntax checker or DOM schema validator
|
||||
*/
|
||||
@@ -117,7 +117,7 @@ class xmldb_file extends xmldb_object {
|
||||
/// Create one structure to store errors
|
||||
$structure = new xmldb_structure($this->path);
|
||||
/// Add error to structure
|
||||
$structure->errormsg = sprintf("XML Error: %s at line %d",
|
||||
$structure->errormsg = sprintf("XML Error: %s at line %d",
|
||||
xml_error_string(xml_get_error_code($parser)),
|
||||
xml_get_current_line_number($parser));
|
||||
/// Add structure to file
|
||||
|
||||
Reference in New Issue
Block a user