619c53392f82fdde1e63f13fed5c43e78622ea33.svn-base 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
  2. "http://www.w3.org/TR/html4/strict.dtd">
  3. <html>
  4. <head>
  5. <title>Dojo Spinner Widget Test</title>
  6. <script type="text/javascript" src="../../../dojo/dojo.js"
  7. djConfig="isDebug: true, parseOnLoad: true, extraLocale: ['de-de', 'en-us']"></script>
  8. <script type="text/javascript" src="../_testCommon.js"></script>
  9. <script type="text/javascript">
  10. dojo.require("dijit.form.NumberSpinner");
  11. dojo.require("dojo.parser"); // scan page for widgets
  12. </script>
  13. <style type="text/css">
  14. @import "../../../dojo/resources/dojo.css";
  15. @import "../css/dijitTests.css";
  16. #integerspinner2 .dojoSpinnerUpArrow {
  17. border-bottom-color: blue;
  18. }
  19. #integerspinner2 .dojoSpinnerDownArrow {
  20. border-top-color: red;
  21. }
  22. #integerspinner2 .dojoSpinnerButton {
  23. background-color: yellow;
  24. }
  25. #integerspinner2 .dojoSpinnerButtonPushed {
  26. background-color: gray;
  27. }
  28. #integerspinner2 .dojoSpinnerButtonPushed .dojoSpinnerDownArrow {
  29. border-top-color: blue;
  30. }
  31. #integerspinner2 .dojoSpinnerButtonPushed .dojoSpinnerUpArrow {
  32. border-bottom-color: red;
  33. }
  34. .dojoInputFieldValidationNormal#integerspinner2 {
  35. color:blue;
  36. background-color:pink;
  37. }
  38. </style>
  39. </head>
  40. <body>
  41. <h1 class="testTitle">Dijit Spinner Test</h1>
  42. Try typing values, and use the up/down arrow keys and/or the arrow push
  43. buttons to spin
  44. <br>
  45. <form id="form1" action="" name="example" method="post">
  46. <h1>number spinner</h1>
  47. <br>
  48. initial value=900, no delta specified, no min specified, max=1550, onChange captured<br>
  49. <label for="integerspinner1">Spinbox #1: </label><br>
  50. <input dojoType="dijit.form.NumberSpinner"
  51. onChange="dojo.byId('oc1').value=arguments[0]"
  52. value="900"
  53. constraints="{max:1550,places:0}"
  54. name="integerspinner1"
  55. id="integerspinner1">
  56. onChange:<input id="oc1" disabled value="not fired yet!" autocomplete="off">
  57. <br>
  58. <br>
  59. initial value=1000, delta=10, min=9 max=1550<br>
  60. <label for="integerspinner2">Spinbox with custom styling (width=50%): </label>
  61. <input dojoType="dijit.form.NumberSpinner"
  62. style="font-size:20pt;border:1px solid blue;width: 50%;"
  63. value="1000"
  64. smallDelta="10"
  65. constraints="{min:9,max:1550,places:0}"
  66. name="integerspinner2"
  67. id="integerspinner2">
  68. <br>
  69. <br>
  70. <label for="integertextbox3">Spinner line break test: </label>initial value not specified, delta not specified, min not specified, max not specified, signed not specified, separator not specified<br>
  71. [verify no line break just after this text]
  72. <input dojoType="dijit.form.NumberSpinner" name="integertextbox3" id="integertextbox3">
  73. [verify no line break just before this text]
  74. <br>
  75. <br>
  76. Move the cursor left and right within the input field to see the effect on the spinner.
  77. <br>
  78. initial value=+1.0, delta=0.1, min=-10.9, max=155, places=1, maxLength=20<br>
  79. <label for="realspinner1">Real Number Spinbox #1: </label><br>
  80. <input dojoType="dijit.form.NumberSpinner"
  81. value="1.0"
  82. smallDelta="0.1"
  83. constraints={min:-10.9,max:155,places:1,round:true}
  84. maxLength="20"
  85. name="realspinner1"
  86. id="realspinner1">
  87. <br>
  88. <script>
  89. function displayData() {
  90. var f = document.getElementById("form1");
  91. var s = "";
  92. for (var i = 0; i < f.elements.length; i++) {
  93. var elem = f.elements[i];
  94. if (elem.name == "button") { continue; }
  95. s += elem.name + ": " + elem.value + "\n";
  96. }
  97. alert(s);
  98. }
  99. </script>
  100. <div>
  101. <button name="button" onclick="displayData(); return false;">view data</button>
  102. <input type="submit" name="submit" />
  103. </div>
  104. </form>
  105. </body>
  106. </html>