aboutsummaryrefslogtreecommitdiff
path: root/includes/js/dojox/widget/tests/test_FisheyeList.html
blob: 348ea1311e6581b55c76bd4b2b8a77f4977f81c2 (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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
        "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
	<title>FisheyeList Widget Dojo Tests</title>
	<style type="text/css">
		@import "../../../dojo/resources/dojo.css";
		@import "../../../dijit/themes/tundra/tundra.css";
		@import "../../../dijit/themes/dijit.css";
		@import "../../../dijit/tests/css/dijitTests.css"; 
		@import "../FisheyeList/FisheyeList.css";
	</style>

	<script type="text/javascript" src="../../../dojo/dojo.js" djConfig="isDebug:true, parseOnLoad: true"></script>
	<script type="text/javascript" src="../FisheyeList.js"></script>
	<script type="text/javascript">
		//dojo.require("dojox.widget.FisheyeList");
		dojo.require("dojo.parser");	// scan page for widgets and instantiate them

		dojo.addOnLoad(function(){
			fish1 = dijit.byId("fisheye1");
			fish2 = dijit.byId("fisheye2");
		});
		var counter = 1;
		function addToFirstList(){
			var item = new dojox.widget.FisheyeListItem();
			item.label = "Dynamically Added "+counter;
			item.iconSrc = "images/fisheye_"+counter+".png"
			item.postCreate();
			counter++;
			if(counter>4){counter=1;}
			fish1.addChild(item);
			fish1.startup();
			item.startup();
		}
	</script>
</head>
<body class="tundra">
	<h1>dojox.widget.FisheyeList test</h1>
<p>HTML before</p>
<button onclick="addToFirstList();">Add a new item to the first list</button>
<p>HTML before</p>
<p>HTML before</p>
<p>Liberal trigger: move the mouse anywhere near the menu and it will start to expand:</p>
<div dojoType="dojox.widget.FisheyeList"
	itemWidth="40" itemHeight="40"
	itemMaxWidth="150" itemMaxHeight="150"
	orientation="horizontal"
	effectUnits="2"
	itemPadding="10"
	attachEdge="center"
	labelEdge="bottom"
	id="fisheye1"
>

	<div dojoType="dojox.widget.FisheyeListItem"
		id="item1"
		onclick="alert('click on ' + this.label + '(from widget id ' + this.widgetId + ')!');"
		label="Item 1"
		iconSrc="images/fisheye_1.png">
	</div>

	<div dojoType="dojox.widget.FisheyeListItem"
		label="Item 2"
		iconSrc="images/fisheye_2.png">
	</div>

	<div dojoType="dojox.widget.FisheyeListItem"
		label="Item 3"
		iconSrc="images/fisheye_3.png">
	</div>

	<div dojoType="dojox.widget.FisheyeListItem"
		iconSrc="images/fisheye_4.png">
	</div>

	<div dojoType="dojox.widget.FisheyeListItem"
		label="Really Long Item Label"
		iconSrc="images/fisheye_3.png">
	</div>

	<div dojoType="dojox.widget.FisheyeListItem"
		iconSrc="images/fisheye_2.png">
	</div>

	<div dojoType="dojox.widget.FisheyeListItem"
		iconSrc="images/fisheye_1.png">
	</div>
</div>

<p>HTML after</p>
<p>HTML after</p>
<p>HTML after</p>
<p>This one has strict triggering, so you actually have to mouse over the menu to make it start moving:</p>
<div dojoType="dojox.widget.FisheyeList"
	itemWidth="40" itemHeight="40"
	itemMaxWidth="150" itemMaxHeight="150"
	orientation="horizontal"
	effectUnits="2"
	itemPadding="10"
	attachEdge="center"
	labelEdge="bottom"
	conservativeTrigger="true"
	id="fisheye2"
>

	<div dojoType="dojox.widget.FisheyeListItem"
		id="item1b"
		onclick="alert('click on ' + this.label + '(from widget id ' + this.widgetId + ')!');"
		label="Item 1"
		iconSrc="images/fisheye_1.png">
	</div>

	<div dojoType="dojox.widget.FisheyeListItem"
		label="Item 2"
		iconSrc="images/fisheye_2.png">
	</div>

	<div dojoType="dojox.widget.FisheyeListItem"
		label="Item 3"
		iconSrc="images/fisheye_3.png">
	</div>

	<div dojoType="dojox.widget.FisheyeListItem"
		iconSrc="images/fisheye_4.png">
	</div>

	<div dojoType="dojox.widget.FisheyeListItem"
		label="Really Long Item Label"
		iconSrc="images/fisheye_3.png">
	</div>

	<div dojoType="dojox.widget.FisheyeListItem"
		iconSrc="images/fisheye_2.png">
	</div>

	<div dojoType="dojox.widget.FisheyeListItem"
		iconSrc="images/fisheye_1.png">
	</div>
</div>


</body>
</html>