1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
4
<title>Dial Widget Manual Test</title>
6
<!-- Source File and Seed for YUI3-->
7
<link type="text/css" rel="stylesheet" href="http://yui.yahooapis.com/3.3.0/build/cssfonts/fonts-min.css" />
8
<link type="text/css" rel="stylesheet" href="http://yui.yahooapis.com/3.3.0/build/cssfonts/reset-min.css" />
10
<!-- get from 3.3.0 Release
11
<script src="http://yui.yahooapis.com/3.3.0/build/yui/yui-min.js"></script> -->
13
<!-- get from lastSuccessful
14
<script type="text/javascript" src="http://yuibuild.corp.yahoo.com/yui3/lastSuccessful/build/yui/yui-min.js"></script>-->
16
<!-- get from local copy of 3.3.0
17
<script src="../yui_3.3.0/yui/build/yui/yui.js"></script>-->
20
<!-- get all from gitroot
21
<script src="file:///C|/dev/gitroot/yui3/build/yui/yui.js"></script> -->
23
<!-- get all from gitroot -->
24
<script src="../../../../build/yui/yui.js"></script>
26
<!-- get just dial from a local js dir
27
<script src="js/dial_local.js"></script>-->
29
<!-- /////////////////// for iPad (not on vger network) need these ////////////////////////-->
30
<!-- conniffcolletion need these new CSS files when using post 3.3.0 Dial.js re-architecture (no ...handle-user class)
31
<link type="text/css" rel="stylesheet" href="http://conniffcollection.com/dial/assets/dial-core.css" />
32
<link type="text/css" rel="stylesheet" href="http://conniffcollection.com/dial/assets/skins/sam/dial-skin.css" />
34
<!-- get just dial from conniffcollection/dial/js dir **** MUST BE UPDATED FTP **** -->
35
<!--<script src="http://conniffcollection.com/dial/js/yui.js"></script>-->
36
<!--<script src="http://conniffcollection.com/dial/js/dial.js"></script>-->
37
<!--<script src="http://conniffcollection.com/build/yui/yui-min.js"></script> ftp'd the whole build subdir over to conniffco -->
40
<!-- ///////////////////////////////////////////////////////////////////////////////////////-->
42
<!-- need these new CSS files when using post 3.3.0 Dial.js re-architecture (no ...handle-user class)
43
<link type="text/css" rel="stylesheet" href="assets/dial-core.css" />
44
<link type="text/css" rel="stylesheet" href="assets/skins/sam/dial-skin.css" />-->
56
.steps li{margin-bottom:1em;}
57
.steps li a {margin-right:2em; border:solid 1px #dddddd; background-color:#eeeeee; padding:3px 6px; cursor:pointer;}
58
#myOtherNode {margin-bottom: 1em;}
62
<body class="yui3-skin-sam">
63
<span id="dial_container">This is a Dial Widget. It supports keyboard input and screen readers. done?</span>
65
<li><a class="xx d_min">-minor</a><a class="xx i_min">+minor</a></li>
66
<li><a class="xx d_maj">-major</a><a class="xx i_maj">+major</a></li>
67
<li><a class="xx min">min</a><a class="xx max">max</a></li>
68
<li><a class="xx orig">origin</a></li>
70
<input id="myOtherNode" value="hello">
72
<span id="dial_container_big">test a larger size. <p>increment controls don't affect this one.</p></span>
73
<span id="dial_container_small">test a small size. </span>
74
<p>test min max _______________________</p>
76
<span id="dial_one"></span>
77
<span id="dial_two"></span>
78
<span id="dial_three"></span>
79
<span id="dial_four"></span>
85
YUI({lang:'es', filter:'raw'}).use("dial", function(Y) {
87
var dial = new Y.Dial({
90
stepsPerRevolution:100,
94
dial.render("#dial_container");
96
var dialBig = new Y.Dial({
99
stepsPerRevolution:100,
102
centerButtonDiameter: 0.2,
104
markerDiameter: 0.02,
107
dialBig.set('strings', {'label':'Label change using Dial.set', 'resetStr': 'set back to orig', 'tooltipHandle': 'test change tooltip'});
108
dialBig.render("#dial_container_big");
110
var dialSmall = new Y.Dial({
113
stepsPerRevolution:100,
116
strings: {label: 'My small pre-render label', resetStr: 'Reset Long', tooltipHandle: 'Drag small handle to set value'}
118
dialSmall.render("#dial_container_small");
119
///////////// check min max issues ////////////////////////////////
120
var dialOne = new Y.Dial({
123
stepsPerRevolution:100,
126
strings: {label: '2...99', resetStr: 'Reset', tooltipHandle: 'Drag handle to set value'}
128
dialOne.render("#dial_one");
130
var dialTwo = new Y.Dial({
133
stepsPerRevolution:100,
136
strings: {label: '-2...5', resetStr: 'Reset', tooltipHandle: 'Drag handle to set value'}
138
dialTwo.render("#dial_two");
140
var dialThree = new Y.Dial({
143
stepsPerRevolution:100,
147
strings: {label: '-48...40', resetStr: 'Reset', tooltipHandle: 'Drag handle to set value'}
149
dialThree.render("#dial_three");
151
var dialFour = new Y.Dial({
154
stepsPerRevolution:10,
157
strings: {label: '-28...28', resetStr: 'Reset', tooltipHandle: 'Drag handle to set value'}
159
dialFour.render("#dial_four");
166
Y.on('click', function(e){
167
if(e.target.hasClass('i_min')){
170
if(e.target.hasClass('d_min')){
173
if(e.target.hasClass('i_maj')){
176
if(e.target.hasClass('d_maj')){
181
if(e.target.hasClass('min')){
184
if(e.target.hasClass('max')){
188
if(e.target.hasClass('orig')){
195
// update value of the Dial from another object's value when it gets a keyup event
196
Y.on('keyup', function(e){
197
dial.set('value', e.target.get('value') - 0);
200
// update the value of another object when the Dial changes value
201
dial.after('valueChange', function(e){
202
Y.one('#myOtherNode').set('value', e.target.get('value'));
203
Y.log('dial._angle: ' + dial._angle + '... prevAng: ' + dial._prevAng + '...wrapping: ' + dial._timesWrapped);