// Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
// (c) 2005, 2006 Sammi Williams (http://www.oriontransfer.co.nz, sammi@oriontransfer.co.nz)
//
// script.aculo.us is freely distributable under the terms of an MIT-style license.
// For details, see the script.aculo.us web site: http://script.aculo.us/
if(typeof Effect == 'undefined')
throw("dragdrop.js requires including script.aculo.us' effects.js library");
var Droppables = {
drops: [],
},
greedy: true,
hoverclass: null,
tree: false
}, arguments[1] || {});
// cache containers
if(options.containment) {
options._containers = [];
if((typeof containment == 'object') &&
(containment.constructor == Array)) {
} else {
}
}
},
findDeepestChild: function(drops) {
return deepest;
},
var containmentNode;
} else {
}
},
return (
((!drop._containers) ||
},
deactivate: function(drop) {
if(drop.hoverclass)
this.last_active = null;
},
if(drop.hoverclass)
this.last_active = drop;
},
var affected = [];
});
}
},
if(!this.last_active) return;
if (this.last_active.onDrop)
},
reset: function() {
if(this.last_active)
this.deactivate(this.last_active);
}
}
var Draggables = {
drags: [],
observers: [],
}
},
unregister: function(draggable) {
}
},
this._timeout = setTimeout(function() {
Draggables._timeout = null;
} else {
this.activeDraggable = draggable;
}
},
deactivate: function() {
this.activeDraggable = null;
},
updateDrag: function(event) {
if(!this.activeDraggable) return;
// Mozilla-based browsers fire successive mousemove events with
// the same coordinates, prevent needless redrawing (moz bug?)
this._lastPointer = pointer;
},
if(this._timeout) {
clearTimeout(this._timeout);
this._timeout = null;
}
if(!this.activeDraggable) return;
this._lastPointer = null;
this.activeDraggable = null;
},
if(this.activeDraggable)
},
addObserver: function(observer) {
this._cacheObserverCallbacks();
},
this._cacheObserverCallbacks();
},
});
},
_cacheObserverCallbacks: function() {
function(o) { return o[eventName]; }
).length;
});
}
}
/*--------------------------------------------------------------------------*/
initialize: function(element) {
var defaults = {
handle: false,
});
},
afterFinish: function(){
}
});
},
zindex: 1000,
revert: false,
scroll: false,
scrollSensitivity: 20,
scrollSpeed: 15,
snap: false, // false, or xy or [x,y] or function(x,y){ return [x,y] }
delay: 0
};
starteffect: function(element) {
}
});
}
this.delta = this.currentDelta();
this.dragging = false;
Draggables.register(this);
},
destroy: function() {
Draggables.unregister(this);
},
currentDelta: function() {
return([
},
// abort on form elements, fixes a Firefox issue
Draggables.activate(this);
}
},
this.dragging = true;
}
}
} else {
}
}
},
this.stopScrolling();
var p;
} else {
}
if(pointer[0] < (p[0]+this.options.scrollSensitivity)) speed[0] = pointer[0]-(p[0]+this.options.scrollSensitivity);
if(pointer[1] < (p[1]+this.options.scrollSensitivity)) speed[1] = pointer[1]-(p[1]+this.options.scrollSensitivity);
if(pointer[0] > (p[2]-this.options.scrollSensitivity)) speed[0] = pointer[0]-(p[2]-this.options.scrollSensitivity);
if(pointer[1] > (p[3]-this.options.scrollSensitivity)) speed[1] = pointer[1]-(p[3]-this.options.scrollSensitivity);
this.startScrolling(speed);
}
// fix AppleWebKit rendering
},
this.dragging = false;
this._clone = null;
}
var d = this.currentDelta();
} else {
this.delta = d;
}
Draggables.deactivate(this);
Droppables.reset();
},
this.finishDrag(event, false);
},
if(!this.dragging) return;
this.stopScrolling();
this.finishDrag(event, true);
},
}
var d = this.currentDelta();
}
}.bind(this));
} else {
p = p.map( function(v, i) {
} else {
p = p.map( function(v) {
}
}}
},
stopScrolling: function() {
if(this.scrollInterval) {
clearInterval(this.scrollInterval);
this.scrollInterval = null;
Draggables._lastScrollPointer = null;
}
},
startScrolling: function(speed) {
this.lastScrolled = new Date();
},
scroll: function() {
var current = new Date();
this.lastScrolled = current;
var d = delta / 1000;
}
}
} else {
}
if (this._isScrollChild) {
}
},
_getWindowScroll: function(w) {
var T, L, W, H;
with (w.document) {
T = documentElement.scrollTop;
L = body.scrollLeft;
}
if (w.innerWidth) {
W = w.innerWidth;
H = w.innerHeight;
} else {
W = body.offsetWidth;
H = body.offsetHeight
}
}
}
}
/*--------------------------------------------------------------------------*/
},
onStart: function() {
},
onEnd: function() {
}
}
var Sortable = {
sortables: {},
_findRootElement: function(element) {
}
},
if(!element) return;
},
if(s) {
}
},
dropOnEmpty: false,
tree: false,
treeTag: 'ul',
handle: false, // or a CSS class
only: false,
delay: 0,
hoverclass: null,
ghosting: false,
scroll: false,
scrollSensitivity: 20,
scrollSpeed: 15,
format: this.SERIALIZE_RULE,
}, arguments[1] || {});
// clear any old sortable with same element
// build options for the draggables
var options_for_draggable = {
revert: true,
if(options.starteffect)
if(options.reverteffect)
else
};
// build options for the droppables
var options_for_droppable = {
}
var options_for_tree = {
}
// fix for gecko engine
options.draggables = [];
options.droppables = [];
// drop on empty handling
}
// handles are per-draggable
});
});
}
// keep reference
// for onupdate
},
// return all suitable-for-sortable elements in a guaranteed order
return Element.findChildren(
},
return Element.findChildren(
},
return;
} else if(overlap>0.5) {
}
} else {
if(nextElement != element) {
}
}
},
var index;
var child = null;
if(children) {
break;
} else {
break;
}
}
}
}
},
unmark: function() {
},
// mark on ghosting only
}
if(position=='after')
else
},
if (!match) continue;
var child = {
children: [],
}
/* Get the element containing the children and recurse over it */
}
return parent;
},
}, arguments[1] || {});
var root = {
id: null,
parent: null,
children: [],
position: 0
}
},
/* Construct a [i] index for a particular node */
_constructIndex: function(node) {
var index = '';
do {
return index;
},
});
},
var nodeMap = {};
n.parentNode.removeChild(n);
});
if (n) {
}
});
},
} else {
}).join('&');
}
}
}
// Returns true if child is contained within element
}
if(!element.hasChildNodes()) return null;
var elements = [];
if(recursive) {
}
});
}
}