summaryrefslogtreecommitdiffstatshomepage
path: root/includes/js/dijit/tests/test_ColorPalette.html
blob: 38675eaecdec04d4be29fb88a6cee496b7221ea6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
		"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
	<title>ColorPalette Test</title>

	<style type="text/css">
		@import "../../dojo/resources/dojo.css";
		@import "css/dijitTests.css";
	</style>

	<script type="text/javascript" src="../../dojo/dojo.js"
		djConfig="isDebug: true, parseOnLoad: true"></script>
	<script type="text/javascript" src="_testCommon.js"></script>

	<script language="JavaScript" type="text/javascript">
		dojo.require("dijit.ColorPalette");
		dojo.require("dojo.parser");	// scan page for widgets and instantiate them

		var palette;
		function init(){
            var date0 = new Date();
            palette = new dijit.ColorPalette({palette: "7x10", id: "progPalette"}, dojo.byId("programPalette"));
            console.log("creation time: " + (new Date() - date0) );
        }

		dojo.addOnLoad(init);

		function setColor(color){
			var theSpan = dojo.byId("outputSpan");
			theSpan.style.color = color;
			theSpan.innerHTML = color;
		}
	</script>
</head>

<body>

	<h1 class="testTitle">dijit.ColorPalette test:</h1>

	<p>Default color palette (7x10):</p>
	<div dojoType="dijit.ColorPalette" onChange="setColor(this.value);"></div>

	Test color is: <span id="outputSpan"></span>.

	<p>Small color palette (3x4):</p>
	<div dojoType="dijit.ColorPalette" palette="3x4"></div>

	<p>Default color palette (7x10) created via createWidget:</p>
	<div id="programPalette"></div>

</body>
</html>