87f42f42f02cd638003f7794549fecda2eb4ba43.svn-base 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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>ColorPalette Test</title>
  6. <script type="text/javascript" src="../../dojo/dojo.js"
  7. djConfig="isDebug: true, parseOnLoad: true"></script>
  8. <script type="text/javascript" src="_testCommon.js"></script>
  9. <script language="JavaScript" type="text/javascript">
  10. dojo.require("dijit.ColorPalette");
  11. dojo.require("dojo.parser"); // scan page for widgets and instantiate them
  12. </script>
  13. <script>
  14. var palette;
  15. function init(){
  16. var date0 = new Date();
  17. palette = new dijit.ColorPalette({palette: "7x10", id: "progPalette"}, dojo.byId("programPalette"));
  18. console.log("creation time: " + (new Date() - date0) );
  19. }
  20. dojo.addOnLoad(init);
  21. function setColor(color){
  22. var theSpan = dojo.byId("outputSpan");
  23. theSpan.style.color = color;
  24. theSpan.innerHTML = color;
  25. }
  26. </script>
  27. <style type="text/css">
  28. @import "../../dojo/resources/dojo.css";
  29. @import "css/dijitTests.css";
  30. </style>
  31. </head>
  32. <body>
  33. <h1 class="testTitle">dijit.ColorPalette test:</h1>
  34. <p>Default color palette (7x10):</p>
  35. <div dojoType="dijit.ColorPalette" onChange="setColor(this.value);"></div>
  36. Test color is: <span id="outputSpan"></span>.
  37. <p>Small color palette (3x4):</p>
  38. <div dojoType="dijit.ColorPalette" palette="3x4"></div>
  39. <p>Default color palette (7x10) created via createWidget:</p>
  40. <div id="programPalette"></div>
  41. </body>
  42. </html>