LivePipe has been deprecated and is no longer maintained.
The author now works primarily on Thorax

Control.Selection

Programmable object selection API for Prototype.

Selection tutorial is coming soon.

DOM Modifications

Control.Selection.load() will insert div#control_selection as a child of document.body. Control.Selection.DragProxy.load() will be called if the drag_proxy option in Control.Selection.load() is set to true, and will insert div#control_selection_drag_proxy as a child of document.body.

Class

ReturnNameDescription
nullload([Hash options])
nulladdSelectable(Element selectable [,object related [, mixed activation_targets [,function activation_target_callback]]])See Control.Selection.addSelectable().
nulldeselect()
nulldisable()
nullenable()Must be explicitly called.
nullrecalculateLayout()Call when the page layout changes. Calculates dimensions and position of all selectable elements.
nullremoveSelectable(Element selectable)
nullselect(mixed selection)A single Element, or an array of Elements. Will destroy the existing selection.
boolactive
arrayelementsReturns an array of all selectable elements that are currently selected.
arrayobjectsSee Accessing a Selectable's Related Object

Control.Selection.addSelectable()

related is an object that will become available in the Control.Selection.objects array. activation_targets is an Element, or an array of Elements, all of which interact with the DragProxy. The simplest explanation is in the Windows Explorer/Finder column views. Each file/folder row is selectable, but you must click directly on the file or folder icon & label (activation_targets) to drag the items.

Class Options

Class options are set once during load(), or can be set via Control.Selection.options.option_name = value;

TypeNameDefaultDescription
booldrag_proxyfalse
Hashdrag_proxy_options{}
stringselection_id'control_selection'id of the selection div.
Hashselection_style{zIndex: 999, cursor: 'default', border: '1px dotted #000'}Hash of styles to apply to the selection div.

Events

NameDescription
change(array selectable_elements, array related_objects)Contains all currently selected elements/objects, does not contain the delta.
deselected(Element selectable, mixed related)
selected(Element selectable, mixed related)

Control.Selection.DragProxy Class

ReturnNameDescription
boolactive

Control.Selection.DragProxy Events

NameDescription
start(Element dragproxy_container,array selectable_elements)
stop()