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 rel="stylesheet" type="text/css" href="../../../../build/cssreset/reset-min.css">
8
<link type="text/css" rel="stylesheet" href="../../../../build/cssfonts/fonts-min.css">
10
<script src="../../../../build/yui/yui.js"></script>
22
.steps li{margin-bottom:1em;}
23
.steps li a {margin-right:2em; border:solid 1px #dddddd; background-color:#eeeeee; padding:3px 6px; cursor:pointer;}
24
#myOtherNode {margin-bottom: 1em;}
28
<body class="yui3-skin-night">
29
<span id="dial_container">This is a Dial Widget. It supports keyboard input and screen readers.</span>
31
<li><a class="xx d_min">-minor</a><a class="xx i_min">+minor</a></li>
32
<li><a class="xx d_maj">-major</a><a class="xx i_maj">+major</a></li>
33
<li><a class="xx min">min</a><a class="xx max">max</a></li>
34
<li><a class="xx orig">origin</a></li>
36
<input id="myOtherNode" value="hello">
38
<span id="dial_container_big">test a larger size. <p>increment controls don't affect this one.</p></span>
39
<span id="dial_container_small">test a small size. </span>
40
<p>test min max _______________________</p>
47
// YUI({ skin:{defaultSkin: 'night'}}).use
48
YUI({lang:'es', filter:'raw', skin:{defaultSkin: 'night'}}).use("dial", function(Y) { //, filter:'raw' this make it really hard to clear cache on iPad
50
var dial = new Y.Dial({
53
stepsPerRevolution:100,
58
dial.render("#dial_container");
66
Y.on('click', function(e){
67
if(e.target.hasClass('i_min')){
70
if(e.target.hasClass('d_min')){
73
if(e.target.hasClass('i_maj')){
76
if(e.target.hasClass('d_maj')){
81
if(e.target.hasClass('min')){
84
if(e.target.hasClass('max')){
88
if(e.target.hasClass('orig')){
95
// update value of the Dial from another object's value when it gets a keyup event
96
Y.on('keyup', function(e){
97
dial.set('value', e.target.get('value') - 0);
100
// update the value of another object when the Dial changes value
101
dial.after('valueChange', function(e){
102
// Y.one('#myOtherNode').set('value', e.target.get('value').toFixed(e.target.get('decimalPlaces')));
103
Y.one('#myOtherNode').set('value', e.target.get('value'));
104
// Y.log('dial._angle: ' + dial._angle + '... prevAng: ' + dial._prevAng + '...wrapping: ' + dial._timesWrapped);