e459915d139cd3074794d00edbd8e5e9545242df.svn-base 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2. <html>
  3. <head>
  4. <title>Dojo DnD selector test</title>
  5. <style type="text/css">
  6. @import "../../resources/dojo.css";
  7. @import "dndDefault.css";
  8. body { padding: 20px; }
  9. </style>
  10. <script type="text/javascript" src="../../dojo.js" djConfig="isDebug: true"></script>
  11. <script type="text/javascript" src="../../dnd/common.js"></script>
  12. <script type="text/javascript" src="../../dnd/Container.js"></script>
  13. <script type="text/javascript" src="../../dnd/Selector.js"></script>
  14. <script type="text/javascript">
  15. //dojo.require("dojo.dnd.Selector");
  16. var c1, c2, c3, c4, c5;
  17. var init = function(){
  18. c1 = new dojo.dnd.Selector(dojo.byId("container1"), {singular: true});
  19. c2 = new dojo.dnd.Selector(dojo.byId("container2"));
  20. c3 = new dojo.dnd.Selector(dojo.byId("container3"));
  21. c4 = new dojo.dnd.Selector(dojo.byId("container4"));
  22. c5 = new dojo.dnd.Selector(dojo.byId("container5"));
  23. };
  24. dojo.addOnLoad(init);
  25. </script>
  26. </head>
  27. <body>
  28. <h1>Dojo DnD selector test</h1>
  29. <p>Containers have a notion of a "current container", and one element can be "current". All containers on this page are selectors that allow to select elements.</p>
  30. <p>Following selection modes are supported by default:</p>
  31. <ul>
  32. <li>Simple click &mdash; selects a single element, all other elements will be unselected.</li>
  33. <li>Ctrl+click &mdash; toggles a selection state of an element (use Meta key on Mac).</li>
  34. <li>Shift+click &mdash; selects a range of elements from the previous anchor to the current element.</li>
  35. <li>Ctrl+Shift+click &mdash; adds a range of elements from the previous anchor to the current element (use Meta key on Mac).</li>
  36. </ul>
  37. <h2>DIV selector</h2>
  38. <p>This selector can select just one element a time. It was specified during the creation time.</p>
  39. <div id="container1" class="container">
  40. <div class="dojoDndItem">Item 1</div>
  41. <div class="dojoDndItem">Item 2</div>
  42. <div class="dojoDndItem">Item 3</div>
  43. </div>
  44. <h2>UL selector</h2>
  45. <ul id="container2" class="container">
  46. <li class="dojoDndItem">Item 1</li>
  47. <li class="dojoDndItem">Item 2</li>
  48. <li class="dojoDndItem">Item 3</li>
  49. </ul>
  50. <h2>OL selector</h2>
  51. <ol id="container3" class="container">
  52. <li class="dojoDndItem">Item 1</li>
  53. <li class="dojoDndItem">Item 2</li>
  54. <li class="dojoDndItem">Item 3</li>
  55. </ol>
  56. <h2>TABLE selector</h2>
  57. <table id="container4" class="container" border="1px solid black">
  58. <tr class="dojoDndItem">
  59. <td>A</td>
  60. <td>row 1</td>
  61. </tr>
  62. <tr class="dojoDndItem">
  63. <td>B</td>
  64. <td>row 2</td>
  65. </tr>
  66. <tr class="dojoDndItem">
  67. <td>C</td>
  68. <td>row 3</td>
  69. </tr>
  70. </table>
  71. <h2>P selector with SPAN elements</h2>
  72. <p>Elements of this container are layed out horizontally.</p>
  73. <p id="container5" class="container">
  74. <span class="dojoDndItem">&nbsp;Item 1&nbsp;</span>
  75. <span class="dojoDndItem">&nbsp;Item 2&nbsp;</span>
  76. <span class="dojoDndItem">&nbsp;Item 3&nbsp;</span>
  77. </p>
  78. </body>
  79. </html>