| 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 sortable 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 | <link rel="stylesheet" href="../test.css" type="text/css" /> |
|---|
| 11 | </head> |
|---|
| 12 | <body> |
|---|
| 13 | |
|---|
| 14 | <div id="container_div"> |
|---|
| 15 | |
|---|
| 16 | </div> |
|---|
| 17 | |
|---|
| 18 | <script type="text/javascript" language="javascript" charset="utf-8"> |
|---|
| 19 | // <![CDATA[ |
|---|
| 20 | var new_ul_id = 'new_id_123'; |
|---|
| 21 | var ul = document.createElement("ul"); |
|---|
| 22 | var ul_id = document.createAttribute("id"); |
|---|
| 23 | ul_id.nodeValue = new_ul_id; |
|---|
| 24 | ul.setAttributeNode(ul_id); |
|---|
| 25 | |
|---|
| 26 | var li = document.createElement("li"); |
|---|
| 27 | li.setAttribute("id", "test_1"); |
|---|
| 28 | li.appendChild(document.createTextNode("blah1")); |
|---|
| 29 | ul.appendChild(li); |
|---|
| 30 | |
|---|
| 31 | var li2 = document.createElement("li"); |
|---|
| 32 | li2.setAttribute("id", "test_2"); |
|---|
| 33 | li2.appendChild(document.createTextNode("blah2")); |
|---|
| 34 | ul.appendChild(li2); |
|---|
| 35 | |
|---|
| 36 | $('container_div').appendChild(ul); |
|---|
| 37 | |
|---|
| 38 | Sortable.create(new_ul_id, { onUpdate: function() { alert(Sortable.serialize('new_id_123')); } }); |
|---|
| 39 | // ]]> |
|---|
| 40 | </script> |
|---|
| 41 | |
|---|
| 42 | </body> |
|---|
| 43 | </html> |
|---|