1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
---|
2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
---|
3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
---|
4 | <head> |
---|
5 | <title>script.aculo.us Drag and drop functional test file</title> |
---|
6 | <meta http-equiv="content-type" content="text/html; charset=utf-8" /> |
---|
7 | <script src="../../lib/prototype.js" type="text/javascript"></script> |
---|
8 | <script src="../../src/scriptaculous.js" type="text/javascript"></script> |
---|
9 | <script src="../../src/unittest.js" type="text/javascript"></script> |
---|
10 | <style type="text/css" media="screen"> |
---|
11 | #thelist li { background: green; margin:5px; padding: 30px; } |
---|
12 | #thelist2 li { background: #ffb; margin:2px; padding: 2px; } |
---|
13 | #revertbox2 { position:absolute;top:40px;left:50px;z-index:1000;width:150px;height:150px;background:#bbf; } |
---|
14 | </style> |
---|
15 | </head> |
---|
16 | <body> |
---|
17 | <h1>script.aculo.us Drag and drop functional test file</h1> |
---|
18 | |
---|
19 | <h2>Draggables/Droppables</h2> |
---|
20 | |
---|
21 | <a href="#" onclick="alert($H(Sortable.sortables).inspect());return false">inspect sortables</a> |
---|
22 | |
---|
23 | <div id="revertbox1" class="box1" style="opacity:0.5;z-index:1000;width:150px;height:150px;background:#bfb;"> |
---|
24 | <span class="handle1">drag here</span> |
---|
25 | <span class="handle1">(but not here)</span><br/> |
---|
26 | <input type="checkbox" id="shouldrevert1"/> Revert? |
---|
27 | </div> |
---|
28 | |
---|
29 | <div id="revertbox2" class="box"> |
---|
30 | <span id="handle2">drag here</span><br/> |
---|
31 | <input type="checkbox" id="shouldrevert2"/> Revert? |
---|
32 | </div> |
---|
33 | |
---|
34 | <div id="xxxx">testtest</div> |
---|
35 | |
---|
36 | <script type="text/javascript" language="javascript" charset="utf-8"> |
---|
37 | // <![CDATA[ |
---|
38 | new Draggable('revertbox1',{scroll:window,zindex:-5,handle:'handle1',revert:function(element){return ($('shouldrevert1').checked)}}); |
---|
39 | new Draggable('revertbox2',{scroll:window,handle:'handle2',revert:function(element){return ($('shouldrevert2').checked)}}); |
---|
40 | Droppables.add('xxxx',{accept:['box1','box2'],onDrop:function(){alert('drop!')}}); |
---|
41 | // ]]> |
---|
42 | </script> |
---|
43 | |
---|
44 | |
---|
45 | |
---|
46 | |
---|
47 | <ul id="thelist" style="padding: 10px; position: absolute; top:20px; left:200px;z-index:1000;"> |
---|
48 | <li id="thelist_4">Hey there! I'm absolutely positioned</li> |
---|
49 | <li id="thelist_1">one<br/><form id="form1"><input type="checkbox" onclick="this.checked = !this.checked" value="x" name="x" id="xyz"/><input type="text" id="xxx"></input></form></li> |
---|
50 | <li id="thelist_2">two<br/><form id="form2"><input type="text" id="xyx"></input></form></li> |
---|
51 | <li id="thelist_3">three<br/><form id="form3"><input type="text" id="xu3"></input></form></li> |
---|
52 | </ul> |
---|
53 | |
---|
54 | <ul id="thelist2" style="padding: 2px; background:red;"> |
---|
55 | <li>Relatively here!</li> |
---|
56 | <li><input onclick="this.checked = !this.checked" name="x" id="x" type="checkbox"/>one</li> |
---|
57 | <li>one</li> |
---|
58 | <li>one</li> |
---|
59 | <li>one</li> |
---|
60 | <li>one</li> |
---|
61 | <li>one</li> |
---|
62 | <li>one</li> |
---|
63 | <li>one</li> |
---|
64 | <li>one</li> |
---|
65 | <li>one</li> |
---|
66 | <li>one</li> |
---|
67 | <li>one</li> |
---|
68 | <li>one</li> |
---|
69 | <li>one</li> |
---|
70 | <li>one</li> |
---|
71 | <li>one</li> |
---|
72 | <li>one</li> |
---|
73 | <li>one</li> |
---|
74 | <li>one</li> |
---|
75 | <li>one</li> |
---|
76 | <li>one</li> |
---|
77 | <li>one</li> |
---|
78 | <li>one</li> |
---|
79 | <li>one</li> |
---|
80 | <li>one</li> |
---|
81 | <li>one</li> |
---|
82 | <li>one</li> |
---|
83 | <li>one</li> |
---|
84 | <li>one</li> |
---|
85 | <li>one</li> |
---|
86 | <li>one</li> |
---|
87 | <li>one</li> |
---|
88 | <li>one</li> |
---|
89 | <li>one</li> |
---|
90 | <li>one</li> |
---|
91 | <li>one</li> |
---|
92 | <li>one</li> |
---|
93 | <li>one</li> |
---|
94 | <li>one</li> |
---|
95 | <li>one</li> |
---|
96 | <li>one</li> |
---|
97 | <li>one</li> |
---|
98 | <li>one</li> |
---|
99 | <li>one</li> |
---|
100 | <li>one</li> |
---|
101 | <li>one</li> |
---|
102 | <li>one</li> |
---|
103 | <li>one</li> |
---|
104 | <li>one</li> |
---|
105 | <li>one</li> |
---|
106 | </ul> |
---|
107 | |
---|
108 | |
---|
109 | |
---|
110 | <script type="text/javascript" language="javascript" charset="utf-8"> |
---|
111 | // <![CDATA[ |
---|
112 | // Sortable.create('thelist', {overlap: 'horizontal', constraint: false}); |
---|
113 | Sortable.create('thelist'); |
---|
114 | Sortable.create('thelist2'); |
---|
115 | |
---|
116 | // ]]> |
---|
117 | </script> |
---|
118 | |
---|
119 | </body> |
---|
120 | </html> |
---|