~ubuntu-branches/ubuntu/precise/maas/precise-updates

« back to all changes in this revision

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

Tags: 1.2+bzr1373+dfsg-0ubuntu1~12.04.4
* SECURITY UPDATE: failure to authenticate downloaded content (LP: #1039513)
  - debian/patches/CVE-2013-1058.patch: Authenticate downloaded files with
    GnuPG and MD5SUM files. Thanks to Julian Edwards.
  - CVE-2013-1058
* SECURITY UPDATE: configuration options may be loaded from current working
  directory (LP: #1158425)
  - debian/patches/CVE-2013-1057-1-2.patch: Do not load configuration
    options from the current working directory. Thanks to Julian Edwards.
  - CVE-2013-1057

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
 
        <style type="text/css">
5
 
            
6
 
        .yui3-scrollview-loading {
7
 
            visibility:hidden;
8
 
            height:0;
9
 
            *height:auto;
10
 
        }
11
 
 
12
 
        .container {
13
 
            margin:20px;
14
 
            padding:0;
15
 
            border:1px solid #000;
16
 
            vertical-align:top;
17
 
            display:inline-block;
18
 
            *display:inline;
19
 
            *zoom:1;
20
 
        }
21
 
 
22
 
        .container .hd {
23
 
            font:13px/1.231 arial,helvetica,clean,sans-serif;
24
 
            font-size:108%;
25
 
            font-weight:bold;
26
 
            padding:10px;
27
 
            text-align:center;
28
 
            color:#fff;
29
 
            background-color:#6d83a1;
30
 
            background: -webkit-gradient(
31
 
                linear,
32
 
                left top,
33
 
                left bottom,
34
 
                from(#d8dee6),
35
 
                color-stop(0.01, #b0bccc),
36
 
                color-stop(0.49, #889bb3),
37
 
                color-stop(0.50, #8094ae),
38
 
                to(#6d83a1)     
39
 
            );
40
 
        }
41
 
 
42
 
        .vert-container {
43
 
            width:200px;
44
 
        }
45
 
 
46
 
        .horiz-container {
47
 
            width:300px;
48
 
        }
49
 
 
50
 
        .horiz-content ul, .vert-content ul {
51
 
            font:13px/1.231 arial,helvetica,clean,sans-serif;            
52
 
            margin:0;
53
 
            padding:0;
54
 
            list-style:none;
55
 
            white-space:nowrap;
56
 
            *zoom:1;
57
 
        }
58
 
 
59
 
        .vert-content ul li {
60
 
            width:198px;
61
 
            height:298px;
62
 
            line-height:298px;
63
 
            margin:0;
64
 
            *zoom:1;
65
 
        }
66
 
 
67
 
        .horiz-content ul li {
68
 
            width:298px;
69
 
            height:198px;
70
 
            line-height:198px;
71
 
            margin:0;
72
 
            display:inline-block;
73
 
            *display:inline;
74
 
            *zoom:1;
75
 
        }
76
 
 
77
 
        .horiz-content ul li,
78
 
        .vert-content ul li {
79
 
            padding:0;
80
 
            border:1px solid #00ff00;
81
 
            background:#eee;
82
 
            font-size:150px;
83
 
            text-align:center;
84
 
            vertical-align:middle;
85
 
        }
86
 
 
87
 
        #state div {
88
 
            margin:10px 3px;
89
 
            border:1px solid #000;
90
 
            background-color:#ccc;
91
 
            color:#aaa;
92
 
            padding:2px 5px;
93
 
            display:inline-block;
94
 
            *display:inline;
95
 
            *zoom:1;
96
 
        }
97
 
 
98
 
        #state div.true {
99
 
            background-color:#a00;
100
 
            color:#000;
101
 
        }
102
 
 
103
 
        </style>
104
 
        <script src="../../../../build/yui/yui.js" type="text/javascript" charset="utf-8"></script>
105
 
        <!--script src="http://yui.yahooapis.com/3.4.0/build/yui/yui.js" type="text/javascript" charset="utf-8"></script-->
106
 
    </head>
107
 
    <body class="yui3-skin-sam">
108
 
 
109
 
        <div class="container vert-container">
110
 
            <div class="hd">Vertical</div>
111
 
 
112
 
            <!-- SV starts here -->        
113
 
            <div id="sv-vert-content" class="vert-content yui3-scrollview-loading">
114
 
                <ul><li>1</li><li>2</li><li>3</li><li>4</li></ul>
115
 
            </div>
116
 
        </div>
117
 
 
118
 
        <div class="container horiz-container">
119
 
            <div class="hd">Horizonal</div>
120
 
 
121
 
            <!-- SV starts here -->
122
 
            <div id="sv-horiz-content" class="horiz-content yui3-scrollview-loading">
123
 
                <ul><li>1</li><li>2</li><li>3</li><li>4</li></ul>
124
 
            </div>
125
 
        </div>
126
 
 
127
 
        <div class="container vert-container">
128
 
            <div class="hd">Vertical Paged</div>
129
 
 
130
 
            <!-- SV starts here -->
131
 
            <div id="sv-vert-paged-content" class="vert-content yui3-scrollview-loading">
132
 
                <ul><li>1</li><li>2</li><li>3</li><li>4</li></ul>
133
 
            </div>
134
 
        </div>
135
 
 
136
 
        <div class="container horiz-container">
137
 
            <div class="hd">Horizonal Paged</div>
138
 
 
139
 
            <!-- SV starts here -->
140
 
            <div id="sv-horiz-paged-content" class="horiz-content yui3-scrollview-loading">
141
 
                <ul><li>1</li><li>2</li><li>3</li><li>4</li></ul>
142
 
            </div>
143
 
        </div>
144
 
 
145
 
        <div id="state">
146
 
            <div id="disabled">Disabled</div>
147
 
            <div id="flickDisabled">Flick Disabled</div>
148
 
            <div id="dragDisabled">Drag Disabled</div>
149
 
        </div>
150
 
 
151
 
        <div id="toolbar">
152
 
            <p>
153
 
                <button id="scrollTo">Scroll To</button>
154
 
            </p>
155
 
            <p>
156
 
                <button id="add">Add Content</button>
157
 
                <button id="remove">Remove Content</button>
158
 
                <span>(scrollTo somewhere non-0,0 first, to test translate fix)</span>
159
 
            </p>
160
 
            <p>
161
 
                <button id="disable">Disable</button>
162
 
                <button id="enable">Enable</button>
163
 
            </p>
164
 
            <p>
165
 
                <button id="disableFlick">Disable Flick</button>
166
 
                <button id="enableFlick">Enable Flick</button>
167
 
            </p>
168
 
            <p>
169
 
                <button id="disableDrag">Disable Drag</button>
170
 
                <button id="enableDrag">Enable Drag</button>
171
 
            </p>
172
 
        </div>
173
 
 
174
 
        <script type="text/javascript">
175
 
 
176
 
            var svHoriz, svVert, svHorizPaged, svVertPaged;
177
 
 
178
 
            YUI({filter:"raw"}).use("scrollview", "scrollview-paginator", function(Y) {
179
 
 
180
 
                svHoriz = new Y.ScrollView({
181
 
                    id:"svHoriz",
182
 
                    srcNode:"#sv-horiz-content",
183
 
                    height:200,
184
 
                    width:300,
185
 
                    flick: {
186
 
                        minDistance: 10,
187
 
                        minVelocity:0.3,
188
 
                        axis:"x"
189
 
                    },
190
 
                    render:true
191
 
                });
192
 
 
193
 
                svVert = new Y.ScrollView({
194
 
                    id:"svVert",
195
 
                    srcNode:"#sv-vert-content",
196
 
                    height:300,
197
 
                    width:200,
198
 
                    flick: {
199
 
                        minDistance: 10,
200
 
                        minVelocity:0.3,
201
 
                        axis:"y"
202
 
                    },                    
203
 
                    render:true
204
 
                });
205
 
 
206
 
                svHorizPaged = new Y.ScrollView({
207
 
                    id:"svHorizPaged",
208
 
                    srcNode:"#sv-horiz-paged-content",
209
 
                    height:200,
210
 
                    width:300,
211
 
                    flick: {
212
 
                        minDistance: 10,
213
 
                        minVelocity:0.3,
214
 
                        axis:"x"
215
 
                    },
216
 
                    plugins: [{
217
 
                        fn:Y.Plugin.ScrollViewPaginator, 
218
 
                        cfg:{
219
 
                            selector:">ul>li"
220
 
                        }
221
 
                    }],    
222
 
                    render:true
223
 
                });
224
 
 
225
 
                svVertPaged = new Y.ScrollView({
226
 
                    id:"svVertPaged",
227
 
                    srcNode:"#sv-vert-paged-content",
228
 
                    height:300,
229
 
                    width:200,
230
 
                    flick: {
231
 
                        minDistance: 10,
232
 
                        minVelocity:0.3,
233
 
                        axis:"y"
234
 
                    },
235
 
                    plugins: [{
236
 
                        fn:Y.Plugin.ScrollViewPaginator, 
237
 
                        cfg:{
238
 
                            selector:">ul>li"
239
 
                        }
240
 
                    }],                    
241
 
                    render:true
242
 
                });
243
 
                
244
 
                svHoriz._origFlick = svHoriz.get("flick");
245
 
                svVert._origFlick = svVert.get("flick");
246
 
                svVertPaged._origFlick = svVertPaged.get("flick");
247
 
                svHorizPaged._origFlick = svHorizPaged.get("flick");
248
 
 
249
 
                var state = Y.one("#state");
250
 
 
251
 
                var clickMap = {
252
 
 
253
 
                    _scrollPositions : [ 200, 75, 450, 600, 0 ],
254
 
 
255
 
                    _scrollToNonZero : function(sv) {
256
 
                        var scrollDim = (sv._scrollsHorizontal) ?  "scrollX" : "scrollY",
257
 
                            position = sv.get(scrollDim);
258
 
 
259
 
                        position = (position === 250) ? 100 : 250;
260
 
 
261
 
                        sv.set(scrollDim, position, {duration:350});                            
262
 
                    },
263
 
 
264
 
                    add: function(sv) {
265
 
                        var list = sv.get("contentBox").one("ul");
266
 
                        var children = list.get("children");
267
 
 
268
 
                        sv.once("scrollEnd", function() {
269
 
                            list.append("<li>" + (children.size() + 1) + "</li>");
270
 
                            sv.syncUI();
271
 
                        });
272
 
 
273
 
                        this._scrollToNonZero(sv);
274
 
                    },
275
 
                    remove: function(sv) {
276
 
                        var list = sv.get("contentBox").one("ul");                        
277
 
                        var children = list.get("children");
278
 
                        var lastItem;
279
 
 
280
 
                        if (children.size() > 3) {
281
 
 
282
 
                            sv.once("scrollEnd", function() {
283
 
                                children.pop().remove(true);
284
 
                                sv.syncUI();
285
 
                            });
286
 
 
287
 
                            this._scrollToNonZero(sv);
288
 
                        }
289
 
                    },
290
 
                    disable: function(sv) {
291
 
                        sv.disable();
292
 
                        state.one("#disabled").addClass("true");
293
 
                    },
294
 
                    enable: function(sv) {
295
 
                        sv.enable();
296
 
                        state.one("#disabled").removeClass("true");
297
 
                    },
298
 
                    disableFlick: function(sv) {
299
 
                        sv.set("flick", false);
300
 
                        state.one("#flickDisabled").addClass("true");
301
 
                    },
302
 
                    enableFlick: function(sv) {
303
 
                        sv.set("flick", sv._origFlick);
304
 
                        state.one("#flickDisabled").removeClass("true");
305
 
                    },
306
 
                    disableDrag: function(sv) {
307
 
                        sv.set("drag", false);
308
 
                        state.one("#dragDisabled").addClass("true");
309
 
                    },
310
 
                    enableDrag: function(sv) {
311
 
                        sv.set("drag", true);
312
 
                        state.one("#dragDisabled").removeClass("true");
313
 
                    },
314
 
                    scrollTo: function(sv) {
315
 
 
316
 
                        var positions = this._scrollPositions.length,
317
 
                            i = sv._scrollPositionIndex || 0,
318
 
                            position = this._scrollPositions[(i % positions)];
319
 
                            sv._scrollPositionIndex = i+1;
320
 
 
321
 
                        if (sv._scrollsHorizontal) {
322
 
                            sv.set("scrollX", position, {duration:350});    
323
 
                        } else {
324
 
                            sv.set("scrollY", position, {duration:350});
325
 
                        }
326
 
                    }
327
 
                };
328
 
 
329
 
                var pagedClickMap = Y.mix(Y.Object(clickMap), {
330
 
 
331
 
                    _scrollToNonZero: function(sv) {
332
 
                        var index = (sv.pages.get("index") == 2) ? 1 : 2;
333
 
                        sv.pages.set("index", index);
334
 
                    },
335
 
    
336
 
                    scrollTo: function(sv) {
337
 
                        var pages = sv.pages.get("total"),
338
 
                            current = sv.pages.get("index"),
339
 
                            position = (current + 1) % pages;
340
 
 
341
 
                        sv.pages.set("index", position);    
342
 
                    }
343
 
                }, true);
344
 
 
345
 
                Y.one("#toolbar").delegate("click", function(e) {
346
 
                    var method = e.currentTarget.get("id");
347
 
 
348
 
                    clickMap[method](svVert);
349
 
                    clickMap[method](svHoriz);
350
 
 
351
 
                    pagedClickMap[method](svVertPaged);
352
 
                    pagedClickMap[method](svHorizPaged);
353
 
 
354
 
                }, "button");
355
 
 
356
 
            });
357
 
        </script>
358
 
    </body>
359
 
</html>
 
 
b'\\ No newline at end of file'