~ubuntu-branches/ubuntu/raring/maas/raring-updates

« back to all changes in this revision

Viewing changes to src/maasserver/static/jslibs/yui/3.4.1/tests/dial/tests/manual/dial.html

  • Committer: Package Import Robot
  • Author(s): Andres Rodriguez
  • Date: 2012-07-03 17:42:37 UTC
  • mfrom: (1.1.13)
  • Revision ID: package-import@ubuntu.com-20120703174237-p8l0keuuznfg721k
Tags: 0.1+bzr709+dfsg-0ubuntu1
* New Upstream release
* debian/control:
  - Depends on python-celery, python-tempita, libjs-yui3-{full,min},
    libjs-raphael
* debian/maas.install:
  - Install apiclient, celeryconfig.py, maas-import-pxe-files, preseeds_v2.
  - Update to install various files from chroot, rather tha manually copy
    them from the source.
* debian/maas.links: symlink celeryconfig.py
* debian/maas.maas-celery.upstart: Add job.
* debian/rules:
  - Install celery upstart job.
  - Do not install jslibs as packages are now used.
  - Drop copying of maas_local_settings_sample.py as source now ships
    a maas_local_settings.py
* debian/patches:
  - 04-maas-http-fix.patch: Drop. Merged upstream.
  - 01-fix-database-settings.patch: Refreshed.
  - 99_enums_js.patch: Added until creation of enum.js / build process
    is fixed.
* debian/maas.postinst: Update bzr version to correctly handle upgrades.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2
 
<html>
3
 
<head>
4
 
<title>Dial Widget Manual Test</title>
5
 
 
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" />
9
 
 
10
 
<!-- get from 3.3.0 Release
11
 
<script src="http://yui.yahooapis.com/3.3.0/build/yui/yui-min.js"></script> -->
12
 
 
13
 
<!-- get from lastSuccessful
14
 
<script type="text/javascript" src="http://yuibuild.corp.yahoo.com/yui3/lastSuccessful/build/yui/yui-min.js"></script>-->
15
 
 
16
 
<!-- get from local copy of 3.3.0 
17
 
<script src="../yui_3.3.0/yui/build/yui/yui.js"></script>-->
18
 
 
19
 
 
20
 
<!-- get all from gitroot
21
 
<script src="file:///C|/dev/gitroot/yui3/build/yui/yui.js"></script> -->
22
 
 
23
 
<!-- get all from gitroot -->
24
 
<script src="../../../../build/yui/yui.js"></script>
25
 
 
26
 
<!-- get just dial from a local js dir 
27
 
<script src="js/dial_local.js"></script>-->
28
 
 
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" />
33
 
-->
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 -->
38
 
                
39
 
 
40
 
<!-- ///////////////////////////////////////////////////////////////////////////////////////-->
41
 
 
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" />-->
45
 
 
46
 
<style>
47
 
.intro-sentence{
48
 
    margin:3em;
49
 
}
50
 
body{
51
 
    margin-top:30px;
52
 
}
53
 
.steps{
54
 
        margin:20px;
55
 
}
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;}
59
 
p{margin:40px;}
60
 
</style>
61
 
</head>
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>
64
 
        <ul class="steps">
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>
69
 
        </ul>
70
 
        <input id="myOtherNode" value="hello">
71
 
    <br>
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>
75
 
        <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>
80
 
        <p></p>
81
 
        
82
 
</body>
83
 
</html>
84
 
<script>
85
 
    YUI({lang:'es', filter:'raw'}).use("dial", function(Y) {
86
 
 
87
 
        var dial = new Y.Dial({
88
 
                        min:-220,
89
 
                        max:220,
90
 
                        stepsPerRevolution:100,
91
 
                        value: 60,
92
 
                        diameter: 100
93
 
        });
94
 
        dial.render("#dial_container");
95
 
 
96
 
        var dialBig = new Y.Dial({
97
 
                        min:-220,
98
 
                        max:220,
99
 
                        stepsPerRevolution:100,
100
 
                        value: 0,
101
 
                        diameter: 439,
102
 
                        centerButtonDiameter: 0.2,
103
 
                        handleDiameter: 0.4,
104
 
                        markerDiameter: 0.02,
105
 
                        handleDistance: 0.5
106
 
        });
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");
109
 
 
110
 
        var dialSmall = new Y.Dial({
111
 
                        min:-220,
112
 
                        max:220,
113
 
                        stepsPerRevolution:100,
114
 
                        value: 80,
115
 
                        diameter: 37,
116
 
                        strings: {label: 'My small pre-render label', resetStr: 'Reset Long', tooltipHandle: 'Drag small handle to set value'}
117
 
        });
118
 
        dialSmall.render("#dial_container_small");
119
 
///////////// check min max issues ////////////////////////////////
120
 
        var dialOne = new Y.Dial({
121
 
                        min:2,
122
 
                        max:99,
123
 
                        stepsPerRevolution:100,
124
 
                        value: 5,
125
 
                        diameter: 100,
126
 
                        strings: {label: '2...99', resetStr: 'Reset', tooltipHandle: 'Drag handle to set value'}
127
 
        });
128
 
        dialOne.render("#dial_one");
129
 
 
130
 
        var dialTwo = new Y.Dial({
131
 
                        min:-2,
132
 
                        max:5,
133
 
                        stepsPerRevolution:100,
134
 
                        value: 3,
135
 
                        diameter: 100,
136
 
                        strings: {label: '-2...5', resetStr: 'Reset', tooltipHandle: 'Drag handle to set value'}
137
 
        });
138
 
        dialTwo.render("#dial_two");
139
 
 
140
 
        var dialThree = new Y.Dial({
141
 
                        min:-48,
142
 
                        max:40,
143
 
                        stepsPerRevolution:100,
144
 
                        value: 35,
145
 
                        diameter: 100,
146
 
                        decimalPlaces: 3,
147
 
                        strings: {label: '-48...40', resetStr: 'Reset', tooltipHandle: 'Drag handle to set value'}
148
 
        });
149
 
        dialThree.render("#dial_three");
150
 
 
151
 
        var dialFour = new Y.Dial({
152
 
                        min:-28,
153
 
                        max:28,
154
 
                        stepsPerRevolution:10,
155
 
                        value: 60,
156
 
                        diameter: 100,
157
 
                        strings: {label: '-28...28', resetStr: 'Reset', tooltipHandle: 'Drag handle to set value'}
158
 
        });
159
 
        dialFour.render("#dial_four");
160
 
 
161
 
 
162
 
 
163
 
 
164
 
 
165
 
 
166
 
                Y.on('click', function(e){
167
 
                        if(e.target.hasClass('i_min')){
168
 
                                dial._incrMinor();
169
 
                        }
170
 
                        if(e.target.hasClass('d_min')){
171
 
                                dial._decrMinor();
172
 
                        }
173
 
                        if(e.target.hasClass('i_maj')){
174
 
                                dial._incrMajor();
175
 
                        }
176
 
                        if(e.target.hasClass('d_maj')){
177
 
                                dial._decrMajor();
178
 
                        }
179
 
        
180
 
        
181
 
                        if(e.target.hasClass('min')){
182
 
                                dial._setToMin();
183
 
                        }
184
 
                        if(e.target.hasClass('max')){
185
 
                                dial._setToMax();
186
 
                        }
187
 
        
188
 
                        if(e.target.hasClass('orig')){
189
 
                                dial._resetDial();
190
 
                        }
191
 
        
192
 
        
193
 
                }, '.xx');
194
 
        
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);
198
 
                }, '#myOtherNode');
199
 
        
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);  
204
 
                });
205
 
                
206
 
                
207
 
    }); 
208
 
</script>