1318 |
alexandre_ |
1 |
/*
|
|
|
2 |
Copyright (c) 2004-2006, The Dojo Foundation
|
|
|
3 |
All Rights Reserved.
|
|
|
4 |
|
|
|
5 |
Licensed under the Academic Free License version 2.1 or above OR the
|
|
|
6 |
modified BSD license. For more information on Dojo licensing, see:
|
|
|
7 |
|
|
|
8 |
http://dojotoolkit.org/community/licensing.shtml
|
|
|
9 |
*/
|
|
|
10 |
|
1422 |
alexandre_ |
11 |
|
|
|
12 |
|
1318 |
alexandre_ |
13 |
dojo.require("dojo.lang.common");
|
|
|
14 |
dojo.require("dojo.lang.func");
|
|
|
15 |
dojo.require("dojo.lang.declare");
|
|
|
16 |
dojo.provide("dojo.dnd.DragAndDrop");
|
|
|
17 |
dojo.declare("dojo.dnd.DragSource", null, {type:"", onDragEnd:function (evt) {
|
|
|
18 |
}, onDragStart:function (evt) {
|
|
|
19 |
}, onSelected:function (evt) {
|
|
|
20 |
}, unregister:function () {
|
|
|
21 |
dojo.dnd.dragManager.unregisterDragSource(this);
|
|
|
22 |
}, reregister:function () {
|
|
|
23 |
dojo.dnd.dragManager.registerDragSource(this);
|
|
|
24 |
}});
|
|
|
25 |
dojo.declare("dojo.dnd.DragObject", null, {type:"", register:function () {
|
|
|
26 |
var dm = dojo.dnd.dragManager;
|
|
|
27 |
if (dm["registerDragObject"]) {
|
|
|
28 |
dm.registerDragObject(this);
|
|
|
29 |
}
|
|
|
30 |
}, onDragStart:function (evt) {
|
|
|
31 |
}, onDragMove:function (evt) {
|
|
|
32 |
}, onDragOver:function (evt) {
|
|
|
33 |
}, onDragOut:function (evt) {
|
|
|
34 |
}, onDragEnd:function (evt) {
|
|
|
35 |
}, onDragLeave:dojo.lang.forward("onDragOut"), onDragEnter:dojo.lang.forward("onDragOver"), ondragout:dojo.lang.forward("onDragOut"), ondragover:dojo.lang.forward("onDragOver")});
|
|
|
36 |
dojo.declare("dojo.dnd.DropTarget", null, {acceptsType:function (type) {
|
|
|
37 |
if (!dojo.lang.inArray(this.acceptedTypes, "*")) {
|
|
|
38 |
if (!dojo.lang.inArray(this.acceptedTypes, type)) {
|
|
|
39 |
return false;
|
|
|
40 |
}
|
|
|
41 |
}
|
|
|
42 |
return true;
|
|
|
43 |
}, accepts:function (dragObjects) {
|
|
|
44 |
if (!dojo.lang.inArray(this.acceptedTypes, "*")) {
|
|
|
45 |
for (var i = 0; i < dragObjects.length; i++) {
|
|
|
46 |
if (!dojo.lang.inArray(this.acceptedTypes, dragObjects[i].type)) {
|
|
|
47 |
return false;
|
|
|
48 |
}
|
|
|
49 |
}
|
|
|
50 |
}
|
|
|
51 |
return true;
|
|
|
52 |
}, unregister:function () {
|
|
|
53 |
dojo.dnd.dragManager.unregisterDropTarget(this);
|
|
|
54 |
}, onDragOver:function (evt) {
|
|
|
55 |
}, onDragOut:function (evt) {
|
|
|
56 |
}, onDragMove:function (evt) {
|
|
|
57 |
}, onDropStart:function (evt) {
|
|
|
58 |
}, onDrop:function (evt) {
|
|
|
59 |
}, onDropEnd:function () {
|
|
|
60 |
}}, function () {
|
|
|
61 |
this.acceptedTypes = [];
|
|
|
62 |
});
|
|
|
63 |
dojo.dnd.DragEvent = function () {
|
|
|
64 |
this.dragSource = null;
|
|
|
65 |
this.dragObject = null;
|
|
|
66 |
this.target = null;
|
|
|
67 |
this.eventStatus = "success";
|
|
|
68 |
};
|
|
|
69 |
dojo.declare("dojo.dnd.DragManager", null, {selectedSources:[], dragObjects:[], dragSources:[], registerDragSource:function (source) {
|
|
|
70 |
}, dropTargets:[], registerDropTarget:function (target) {
|
|
|
71 |
}, lastDragTarget:null, currentDragTarget:null, onKeyDown:function () {
|
|
|
72 |
}, onMouseOut:function () {
|
|
|
73 |
}, onMouseMove:function () {
|
|
|
74 |
}, onMouseUp:function () {
|
|
|
75 |
}});
|
|
|
76 |
|