1
|
|
2
|
|
3
|
|
4
|
|
5
|
|
6
|
|
7
|
|
8
|
if ( typeof YAHOO == "undefined" || !YAHOO ) {
|
9
|
var YAHOO = {};
|
10
|
}
|
11
|
YAHOO.namespace = function() {
|
12
|
var A = arguments,
|
13
|
E = null,
|
14
|
C, B, D;
|
15
|
for ( C = 0; C < A.length; C = C + 1 ) {
|
16
|
D = ( "" + A[ C ] ).split( "." );
|
17
|
E = YAHOO;
|
18
|
for ( B = ( D[ 0 ] == "YAHOO" ) ? 1 : 0; B < D.length; B = B + 1 ) {
|
19
|
E[ D[ B ] ] = E[ D[ B ] ] || {};
|
20
|
E = E[ D[ B ] ];
|
21
|
}
|
22
|
}
|
23
|
return E;
|
24
|
};
|
25
|
YAHOO.log = function( D, A, C ) {
|
26
|
var B = YAHOO.widget.Logger;
|
27
|
if ( B && B.log ) {
|
28
|
return B.log( D, A, C );
|
29
|
} else {
|
30
|
return false;
|
31
|
}
|
32
|
};
|
33
|
YAHOO.register = function( A, E, D ) {
|
34
|
var I = YAHOO.env.modules,
|
35
|
B, H, G, F, C;
|
36
|
if ( !I[ A ] ) {
|
37
|
I[ A ] = { versions: [], builds: [] };
|
38
|
}
|
39
|
B = I[ A ];
|
40
|
H = D.version;
|
41
|
G = D.build;
|
42
|
F = YAHOO.env.listeners;
|
43
|
B.name = A;
|
44
|
B.version = H;
|
45
|
B.build = G;
|
46
|
B.versions.push( H );
|
47
|
B.builds.push( G );
|
48
|
B.mainClass = E;
|
49
|
for ( C = 0; C < F.length; C = C + 1 ) {
|
50
|
F[ C ]( B );
|
51
|
}
|
52
|
if ( E ) {
|
53
|
E.VERSION = H;
|
54
|
E.BUILD = G;
|
55
|
} else {
|
56
|
YAHOO.log( "mainClass is undefined for module " + A, "warn" );
|
57
|
}
|
58
|
};
|
59
|
YAHOO.env = YAHOO.env || { modules: [], listeners: [] }; YAHOO.env.getVersion = function( A ) {
|
60
|
return YAHOO.env.modules[ A ] || null;
|
61
|
};
|
62
|
YAHOO.env.ua = function() {
|
63
|
var C = { ie: 0, opera: 0, gecko: 0, webkit: 0, mobile: null, air: 0, caja: 0 },
|
64
|
B = navigator.userAgent,
|
65
|
A; if ( ( /KHTML/ ).test( B ) ) {
|
66
|
C.webkit = 1;
|
67
|
}
|
68
|
A = B.match( /AppleWebKit\/([^\s]*)/ );
|
69
|
if ( A && A[ 1 ] ) {
|
70
|
C.webkit = parseFloat( A[ 1 ] );
|
71
|
if ( / Mobile\//.test( B ) ) {
|
72
|
C.mobile = "Apple";
|
73
|
} else {
|
74
|
A = B.match( /NokiaN[^\/]*/ );
|
75
|
if ( A ) {
|
76
|
C.mobile = A[ 0 ];
|
77
|
}
|
78
|
}
|
79
|
A = B.match( /AdobeAIR\/([^\s]*)/ );
|
80
|
if ( A ) {
|
81
|
C.air = A[ 0 ];
|
82
|
}
|
83
|
}
|
84
|
if ( !C.webkit ) {
|
85
|
A = B.match( /Opera[\s\/]([^\s]*)/ );
|
86
|
if ( A && A[ 1 ] ) {
|
87
|
C.opera = parseFloat( A[ 1 ] );
|
88
|
A = B.match( /Opera Mini[^;]*/ );
|
89
|
if ( A ) {
|
90
|
C.mobile = A[ 0 ];
|
91
|
}
|
92
|
} else {
|
93
|
A = B.match( /MSIE\s([^;]*)/ );
|
94
|
if ( A && A[ 1 ] ) {
|
95
|
C.ie = parseFloat( A[ 1 ] );
|
96
|
} else {
|
97
|
A = B.match( /Gecko\/([^\s]*)/ );
|
98
|
if ( A ) {
|
99
|
C.gecko = 1;
|
100
|
A = B.match( /rv:([^\s\)]*)/ );
|
101
|
if ( A && A[ 1 ] ) {
|
102
|
C.gecko = parseFloat( A[ 1 ] );
|
103
|
}
|
104
|
}
|
105
|
}
|
106
|
}
|
107
|
}
|
108
|
A = B.match( /Caja\/([^\s]*)/ );
|
109
|
if ( A && A[ 1 ] ) {
|
110
|
C.caja = parseFloat( A[ 1 ] );
|
111
|
}
|
112
|
return C;
|
113
|
}();
|
114
|
(function() {
|
115
|
YAHOO.namespace( "util", "widget", "example" );
|
116
|
if ( "undefined" !== typeof YAHOO_config ) {
|
117
|
var B = YAHOO_config.listener,
|
118
|
A = YAHOO.env.listeners,
|
119
|
D = true,
|
120
|
C;
|
121
|
if ( B ) {
|
122
|
for ( C = 0; C < A.length; C = C + 1 ) {
|
123
|
if ( A[ C ] == B ) {
|
124
|
D = false;
|
125
|
break;
|
126
|
}
|
127
|
}
|
128
|
if ( D ) {
|
129
|
A.push( B );
|
130
|
}
|
131
|
}
|
132
|
}
|
133
|
})();
|
134
|
YAHOO.lang = YAHOO.lang || {};
|
135
|
(function() {
|
136
|
var B = YAHOO.lang,
|
137
|
F = "[object Array]",
|
138
|
C = "[object Function]",
|
139
|
A = Object.prototype,
|
140
|
E = [ "toString", "valueOf" ],
|
141
|
D = {
|
142
|
isArray: function( G ) {
|
143
|
return A.toString.apply( G ) === F;
|
144
|
},
|
145
|
isBoolean: function( G ) {
|
146
|
return typeof G === "boolean";
|
147
|
},
|
148
|
isFunction: function( G ) {
|
149
|
return A.toString.apply( G ) === C;
|
150
|
},
|
151
|
isNull: function( G ) {
|
152
|
return G === null;
|
153
|
},
|
154
|
isNumber: function( G ) {
|
155
|
return typeof G === "number" && isFinite( G );
|
156
|
},
|
157
|
isObject: function( G ) {
|
158
|
return ( G && ( typeof G === "object" || B.isFunction( G ) ) ) || false;
|
159
|
},
|
160
|
isString: function( G ) {
|
161
|
return typeof G === "string";
|
162
|
},
|
163
|
isUndefined: function( G ) {
|
164
|
return typeof G === "undefined";
|
165
|
},
|
166
|
_IEEnumFix: ( YAHOO.env.ua.ie ) ?
|
167
|
function( I, H ) {
|
168
|
var G, K, J; for ( G = 0; G < E.length; G = G + 1 ) {
|
169
|
K = E[ G ];
|
170
|
J = H[ K ];
|
171
|
if ( B.isFunction( J ) && J != A[ K ] ) {
|
172
|
I[ K ] = J;
|
173
|
}
|
174
|
}
|
175
|
} : function() {},
|
176
|
extend: function( J, K, I ) {
|
177
|
if ( !K || !J ) {
|
178
|
throw new Error( "extend failed, please check that " + "all dependencies are included." );
|
179
|
}
|
180
|
var H = function() {},
|
181
|
G;
|
182
|
H.prototype = K.prototype;
|
183
|
J.prototype = new H();
|
184
|
J.prototype.constructor = J;
|
185
|
J.superclass = K.prototype;
|
186
|
if ( K.prototype.constructor == A.constructor ) {
|
187
|
K.prototype.constructor = K;
|
188
|
}
|
189
|
if ( I ) {
|
190
|
for ( G in I ) {
|
191
|
if ( B.hasOwnProperty( I, G ) ) {
|
192
|
J.prototype[ G ] = I[ G ];
|
193
|
}
|
194
|
}
|
195
|
B._IEEnumFix( J.prototype, I );
|
196
|
}
|
197
|
},
|
198
|
augmentObject: function( K, J ) {
|
199
|
if ( !J || !K ) {
|
200
|
throw new Error( "Absorb failed, verify dependencies." );
|
201
|
}
|
202
|
var G = arguments,
|
203
|
I, L,
|
204
|
H = G[ 2 ];
|
205
|
if ( H && H !== true ) {
|
206
|
for ( I = 2; I < G.length; I = I + 1 ) {
|
207
|
K[ G[ I ] ] = J[ G[ I ] ];
|
208
|
}
|
209
|
} else {
|
210
|
for ( L in J ) {
|
211
|
if ( H || !( L in K ) ) {
|
212
|
K[ L ] = J[ L ];
|
213
|
}
|
214
|
}
|
215
|
B._IEEnumFix( K, J );
|
216
|
}
|
217
|
},
|
218
|
augmentProto: function( J, I ) {
|
219
|
if ( !I || !J ) {
|
220
|
throw new Error( "Augment failed, verify dependencies." );
|
221
|
}
|
222
|
var G = [ J.prototype, I.prototype ],
|
223
|
H;
|
224
|
for ( H = 2; H < arguments.length; H = H + 1 ) {
|
225
|
G.push( arguments[ H ] );
|
226
|
}
|
227
|
B.augmentObject.apply( this, G );
|
228
|
},
|
229
|
dump: function( G, L ) {
|
230
|
var I, K,
|
231
|
N = [],
|
232
|
O = "{...}",
|
233
|
H = "f(){...}",
|
234
|
M = ", ",
|
235
|
J = " => ";
|
236
|
if ( !B.isObject( G ) ) {
|
237
|
return G + "";
|
238
|
} else {
|
239
|
if ( G instanceof Date || ( "nodeType" in G && "tagName" in G ) ) {
|
240
|
return G;
|
241
|
} else {
|
242
|
if ( B.isFunction( G ) ) {
|
243
|
return H;
|
244
|
}
|
245
|
}
|
246
|
}
|
247
|
L = ( B.isNumber( L ) ) ? L : 3;
|
248
|
if ( B.isArray( G ) ) {
|
249
|
N.push( "[" );
|
250
|
for ( I = 0, K = G.length; I < K; I = I + 1 ) {
|
251
|
if ( B.isObject( G[ I ] ) ) {
|
252
|
N.push( ( L > 0 ) ? B.dump( G[ I ], L - 1 ) : O );
|
253
|
} else {
|
254
|
N.push( G[ I ] );
|
255
|
}
|
256
|
N.push( M );
|
257
|
}
|
258
|
if ( N.length > 1 ) {
|
259
|
N.pop();
|
260
|
}
|
261
|
N.push( "]" );
|
262
|
} else {
|
263
|
N.push( "{" );
|
264
|
for ( I in G ) {
|
265
|
if ( B.hasOwnProperty( G, I ) ) {
|
266
|
N.push( I + J );
|
267
|
if ( B.isObject( G[ I ] ) ) {
|
268
|
N.push( ( L > 0 ) ? B.dump( G[ I ], L - 1 ) : O );
|
269
|
} else {
|
270
|
N.push( G[ I ] );
|
271
|
}
|
272
|
N.push( M );
|
273
|
}
|
274
|
}
|
275
|
if ( N.length > 1 ) {
|
276
|
N.pop();
|
277
|
}
|
278
|
N.push( "}" );
|
279
|
}
|
280
|
return N.join( "" );
|
281
|
},
|
282
|
substitute: function( V, H, O ) {
|
283
|
var L, K, J, R, S, U,
|
284
|
Q = [],
|
285
|
I,
|
286
|
M = "dump",
|
287
|
P = " ",
|
288
|
G = "{",
|
289
|
T = "}",
|
290
|
N;
|
291
|
for ( ;; ) {
|
292
|
L = V.lastIndexOf( G );
|
293
|
if ( L < 0 ) {
|
294
|
break;
|
295
|
}
|
296
|
K = V.indexOf( T, L );
|
297
|
if ( L + 1 >= K ) {
|
298
|
break;
|
299
|
}
|
300
|
I = V.substring( L + 1, K );
|
301
|
R = I;
|
302
|
U = null;
|
303
|
J = R.indexOf( P );
|
304
|
if ( J > -1 ) {
|
305
|
U = R.substring( J + 1 );
|
306
|
R = R.substring( 0, J );
|
307
|
}
|
308
|
S = H[ R ];
|
309
|
if ( O ) {
|
310
|
S = O( R, S, U );
|
311
|
}
|
312
|
if ( B.isObject( S ) ) {
|
313
|
if ( B.isArray( S ) ) {
|
314
|
S = B.dump( S, parseInt( U, 10 ) );
|
315
|
} else {
|
316
|
U = U || "";
|
317
|
N = U.indexOf( M );
|
318
|
if ( N > -1 ) {
|
319
|
U = U.substring( 4 );
|
320
|
}
|
321
|
if ( S.toString === A.toString || N > -1 ) {
|
322
|
S = B.dump( S, parseInt( U, 10 ) );
|
323
|
} else {
|
324
|
S = S.toString();
|
325
|
}
|
326
|
}
|
327
|
} else {
|
328
|
if ( !B.isString( S ) && !B.isNumber( S ) ) {
|
329
|
S = "~-" + Q.length + "-~";
|
330
|
Q[ Q.length ] = I;
|
331
|
}
|
332
|
}
|
333
|
V = V.substring( 0, L ) + S + V.substring( K + 1 );
|
334
|
}
|
335
|
for ( L = Q.length - 1; L >= 0; L = L - 1 ) {
|
336
|
V = V.replace( new RegExp( "~-" + L + "-~" ), "{" + Q[ L ] + "}", "g" );
|
337
|
}
|
338
|
return V;
|
339
|
},
|
340
|
trim: function( G ) {
|
341
|
try {
|
342
|
return G.replace( /^\s+|\s+$/g, "" );
|
343
|
} catch ( H ) {
|
344
|
return G;
|
345
|
}
|
346
|
},
|
347
|
merge: function() {
|
348
|
var J = {},
|
349
|
H = arguments,
|
350
|
G = H.length,
|
351
|
I;
|
352
|
for ( I = 0; I < G; I = I + 1 ) {
|
353
|
B.augmentObject( J, H[ I ], true );
|
354
|
}
|
355
|
return J;
|
356
|
},
|
357
|
later: function( N, H, O, J, K ) {
|
358
|
N = N || 0; H = H || {};
|
359
|
var I = O,
|
360
|
M = J,
|
361
|
L, G;
|
362
|
if ( B.isString( O ) ) {
|
363
|
I = H[ O ];
|
364
|
}
|
365
|
if ( !I ) {
|
366
|
throw new TypeError( "method undefined" );
|
367
|
}
|
368
|
if ( !B.isArray( M ) ) {
|
369
|
M = [ J ];
|
370
|
}
|
371
|
L = function() {
|
372
|
I.apply( H, M );
|
373
|
};
|
374
|
G = ( K ) ? setInterval( L, N ) : setTimeout( L, N );
|
375
|
return {
|
376
|
interval: K, cancel: function() {
|
377
|
if ( this.interval ) {
|
378
|
clearInterval( G );
|
379
|
} else {
|
380
|
clearTimeout( G );
|
381
|
}
|
382
|
} };
|
383
|
},
|
384
|
isValue: function( G ) {
|
385
|
return ( B.isObject( G ) || B.isString( G ) || B.isNumber( G ) || B.isBoolean( G ) );
|
386
|
} }; B.hasOwnProperty = ( A.hasOwnProperty ) ?
|
387
|
function( G, H ) {
|
388
|
return G && G.hasOwnProperty( H );
|
389
|
} : function( G, H ) {
|
390
|
return !B.isUndefined( G[ H ] ) && G.constructor.prototype[ H ] !== G[ H ];
|
391
|
};
|
392
|
D.augmentObject( B, D, true );
|
393
|
YAHOO.util.Lang = B;
|
394
|
B.augment = B.augmentProto;
|
395
|
YAHOO.augment = B.augmentProto;
|
396
|
YAHOO.extend = B.extend;
|
397
|
})();
|
398
|
YAHOO.register( "yahoo", YAHOO, { version: "2.7.0", build: "1796" } );
|
399
|
(function() {
|
400
|
YAHOO.env._id_counter = YAHOO.env._id_counter || 0;
|
401
|
var E = YAHOO.util,
|
402
|
L = YAHOO.lang,
|
403
|
m = YAHOO.env.ua,
|
404
|
A = YAHOO.lang.trim,
|
405
|
d = {},
|
406
|
h = {},
|
407
|
N = /^t(?:able|d|h)$/i,
|
408
|
X = /color$/i,
|
409
|
K = window.document,
|
410
|
W = K.documentElement,
|
411
|
e = "ownerDocument",
|
412
|
n = "defaultView",
|
413
|
v = "documentElement",
|
414
|
t = "compatMode",
|
415
|
b = "offsetLeft",
|
416
|
P = "offsetTop",
|
417
|
u = "offsetParent",
|
418
|
Z = "parentNode",
|
419
|
l = "nodeType",
|
420
|
C = "tagName",
|
421
|
O = "scrollLeft",
|
422
|
i = "scrollTop",
|
423
|
Q = "getBoundingClientRect",
|
424
|
w = "getComputedStyle",
|
425
|
a = "currentStyle",
|
426
|
M = "CSS1Compat",
|
427
|
c = "BackCompat",
|
428
|
g = "class",
|
429
|
F = "className",
|
430
|
J = "",
|
431
|
B = " ",
|
432
|
s = "(?:^|\\s)",
|
433
|
k = "(?= |$)",
|
434
|
U = "g",
|
435
|
p = "position",
|
436
|
f = "fixed",
|
437
|
V = "relative",
|
438
|
j = "left",
|
439
|
o = "top",
|
440
|
r = "medium",
|
441
|
q = "borderLeftWidth",
|
442
|
R = "borderTopWidth",
|
443
|
D = m.opera,
|
444
|
I = m.webkit,
|
445
|
H = m.gecko,
|
446
|
T = m.ie;
|
447
|
E.Dom = {
|
448
|
CUSTOM_ATTRIBUTES: ( !W.hasAttribute ) ? { "for": "htmlFor", "class": F } : { "htmlFor": "for", "className": g },
|
449
|
get: function( y ) {
|
450
|
var AA, Y, z, x, G; if ( y ) {
|
451
|
if ( y[ l ] || y.item ) {
|
452
|
return y;
|
453
|
}
|
454
|
if ( typeof y === "string" ) {
|
455
|
AA = y;
|
456
|
y = K.getElementById( y );
|
457
|
if ( y && y.id === AA ) {
|
458
|
return y;
|
459
|
} else {
|
460
|
if ( y && K.all ) {
|
461
|
y = null;
|
462
|
Y = K.all[ AA ];
|
463
|
for ( x = 0, G = Y.length; x < G; ++x ) {
|
464
|
if ( Y[ x ].id === AA ) {
|
465
|
return Y[ x ];
|
466
|
}
|
467
|
}
|
468
|
}
|
469
|
}
|
470
|
return y;
|
471
|
}
|
472
|
if ( y.DOM_EVENTS ) {
|
473
|
y = y.get( "element" );
|
474
|
}
|
475
|
if ( "length" in y ) {
|
476
|
z = [];
|
477
|
for ( x = 0, G = y.length; x < G; ++x ) {
|
478
|
z[ z.length ] = E.Dom.get( y[ x ] );
|
479
|
}
|
480
|
return z;
|
481
|
}
|
482
|
return y;
|
483
|
}
|
484
|
return null;
|
485
|
},
|
486
|
getComputedStyle: function( G, Y ) {
|
487
|
if ( window[ w ] ) {
|
488
|
return G[ e ][ n ][ w ]( G, null )[ Y ];
|
489
|
} else {
|
490
|
if ( G[ a ] ) {
|
491
|
return E.Dom.IE_ComputedStyle.get( G, Y );
|
492
|
}
|
493
|
}
|
494
|
},
|
495
|
getStyle: function( G, Y ) {
|
496
|
return E.Dom.batch( G, E.Dom._getStyle, Y );
|
497
|
},
|
498
|
_getStyle: function() {
|
499
|
if ( window[ w ] ) {
|
500
|
return function( G, y ) {
|
501
|
y = ( y === "float" ) ? y = "cssFloat" : E.Dom._toCamel( y );
|
502
|
var x = G.style[ y ],
|
503
|
Y;
|
504
|
if ( !x ) {
|
505
|
Y = G[ e ][ n ][ w ]( G, null );
|
506
|
if ( Y ) {
|
507
|
x = Y[ y ];
|
508
|
}
|
509
|
}
|
510
|
return x;
|
511
|
};
|
512
|
} else {
|
513
|
if ( W[ a ] ) {
|
514
|
return function( G, y ) {
|
515
|
var x;
|
516
|
switch ( y ) {
|
517
|
case "opacity":
|
518
|
x = 100;
|
519
|
try {
|
520
|
x = G.filters[ "DXImageTransform.Microsoft.Alpha" ].opacity;
|
521
|
} catch ( z ) {
|
522
|
try {
|
523
|
x = G.filters( "alpha" ).opacity;
|
524
|
} catch ( Y ) {}
|
525
|
}
|
526
|
return x / 100;case "float":
|
527
|
y = "styleFloat";default:
|
528
|
y = E.Dom._toCamel( y );
|
529
|
x = G[ a ] ? G[ a ][ y ] : null;
|
530
|
return ( G.style[ y ] || x );
|
531
|
}
|
532
|
};
|
533
|
}
|
534
|
}
|
535
|
}(), setStyle: function( G, Y, x ) {
|
536
|
E.Dom.batch( G, E.Dom._setStyle, { prop: Y, val: x } );
|
537
|
},
|
538
|
_setStyle: function() {
|
539
|
if ( T ) {
|
540
|
return function( Y, G ) {
|
541
|
var x = E.Dom._toCamel( G.prop ),
|
542
|
y = G.val;
|
543
|
if ( Y ) {
|
544
|
switch ( x ) {
|
545
|
case "opacity":
|
546
|
if ( L.isString( Y.style.filter ) ) {
|
547
|
Y.style.filter = "alpha(opacity=" + y * 100 + ")";
|
548
|
if ( !Y[ a ] || !Y[ a ].hasLayout ) {
|
549
|
Y.style.zoom = 1;
|
550
|
}
|
551
|
}
|
552
|
break;case "float":
|
553
|
x = "styleFloat";default:
|
554
|
Y.style[ x ] = y;
|
555
|
}
|
556
|
} else {}
|
557
|
};
|
558
|
} else {
|
559
|
return function( Y, G ) {
|
560
|
var x = E.Dom._toCamel( G.prop ),
|
561
|
y = G.val;
|
562
|
if ( Y ) {
|
563
|
if ( x == "float" ) {
|
564
|
x = "cssFloat";
|
565
|
}
|
566
|
Y.style[ x ] = y;
|
567
|
} else {}
|
568
|
};
|
569
|
}
|
570
|
}(), getXY: function( G ) {
|
571
|
return E.Dom.batch( G, E.Dom._getXY );
|
572
|
},
|
573
|
_canPosition: function( G ) {
|
574
|
return ( E.Dom._getStyle( G, "display" ) !== "none" && E.Dom._inDoc( G ) );
|
575
|
},
|
576
|
_getXY: function() {
|
577
|
if ( K[ v ][ Q ] ) {
|
578
|
return function( y ) {
|
579
|
var z, Y, AA, AF, AE, AD, AC, G, x,
|
580
|
AB = Math.floor,
|
581
|
AG = false;
|
582
|
if ( E.Dom._canPosition( y ) ) {
|
583
|
AA = y[ Q ]();
|
584
|
AF = y[ e ];
|
585
|
z = E.Dom.getDocumentScrollLeft( AF );
|
586
|
Y = E.Dom.getDocumentScrollTop( AF );
|
587
|
AG = [ AB( AA[ j ] ), AB( AA[ o ] ) ];
|
588
|
if ( T && m.ie < 8 ) {
|
589
|
AE = 2;
|
590
|
AD = 2;
|
591
|
AC = AF[ t ];
|
592
|
G = S( AF[ v ], q );
|
593
|
x = S( AF[ v ], R );
|
594
|
if ( m.ie === 6 ) {
|
595
|
if ( AC !== c ) {
|
596
|
AE = 0;
|
597
|
AD = 0;
|
598
|
}
|
599
|
}
|
600
|
if ( ( AC == c ) ) {
|
601
|
if ( G !== r ) {
|
602
|
AE = parseInt( G, 10 );
|
603
|
}
|
604
|
if ( x !== r ) {
|
605
|
AD = parseInt( x, 10 );
|
606
|
}
|
607
|
}
|
608
|
AG[ 0 ] -= AE;
|
609
|
AG[ 1 ] -= AD;
|
610
|
}
|
611
|
if ( ( Y || z ) ) {
|
612
|
AG[ 0 ] += z;
|
613
|
AG[ 1 ] += Y;
|
614
|
}
|
615
|
AG[ 0 ] = AB( AG[ 0 ] );
|
616
|
AG[ 1 ] = AB( AG[ 1 ] );
|
617
|
} else {}
|
618
|
return AG;
|
619
|
};
|
620
|
} else {
|
621
|
return function( y ) {
|
622
|
var x, Y, AA, AB, AC,
|
623
|
z = false,
|
624
|
G = y;
|
625
|
if ( E.Dom._canPosition( y ) ) {
|
626
|
z = [ y[ b ], y[ P ] ];
|
627
|
x = E.Dom.getDocumentScrollLeft( y[ e ] );
|
628
|
Y = E.Dom.getDocumentScrollTop( y[ e ] );
|
629
|
AC = ( ( H || m.webkit > 519 ) ? true : false );
|
630
|
while ( ( G = G[ u ] ) ) {
|
631
|
z[ 0 ] += G[ b ];
|
632
|
z[ 1 ] += G[ P ];
|
633
|
if ( AC ) {
|
634
|
z = E.Dom._calcBorders( G, z );
|
635
|
}
|
636
|
}
|
637
|
if ( E.Dom._getStyle( y, p ) !== f ) {
|
638
|
G = y;
|
639
|
while ( ( G = G[ Z ] ) && G[ C ] ) {
|
640
|
AA = G[ i ];
|
641
|
AB = G[ O ];
|
642
|
if ( H && ( E.Dom._getStyle( G, "overflow" ) !== "visible" ) ) {
|
643
|
z = E.Dom._calcBorders( G, z );
|
644
|
}
|
645
|
if ( AA || AB ) {
|
646
|
z[ 0 ] -= AB;
|
647
|
z[ 1 ] -= AA;
|
648
|
}
|
649
|
}
|
650
|
z[ 0 ] += x;
|
651
|
z[ 1 ] += Y;
|
652
|
} else {
|
653
|
if ( D ) {
|
654
|
z[ 0 ] -= x;
|
655
|
z[ 1 ] -= Y;
|
656
|
} else {
|
657
|
if ( I || H ) {
|
658
|
z[ 0 ] += x;
|
659
|
z[ 1 ] += Y;
|
660
|
}
|
661
|
}
|
662
|
}
|
663
|
z[ 0 ] = Math.floor( z[ 0 ] );
|
664
|
z[ 1 ] = Math.floor( z[ 1 ] );
|
665
|
} else {}
|
666
|
return z;
|
667
|
};
|
668
|
}
|
669
|
}(), getX: function( G ) {
|
670
|
var Y = function( x ) {
|
671
|
return E.Dom.getXY( x )[ 0 ];
|
672
|
};
|
673
|
return E.Dom.batch( G, Y, E.Dom, true );
|
674
|
},
|
675
|
getY: function( G ) {
|
676
|
var Y = function( x ) {
|
677
|
return E.Dom.getXY( x )[ 1 ];
|
678
|
};
|
679
|
return E.Dom.batch( G, Y, E.Dom, true );
|
680
|
},
|
681
|
setXY: function( G, x, Y ) {
|
682
|
E.Dom.batch( G, E.Dom._setXY, { pos: x, noRetry: Y } );
|
683
|
},
|
684
|
_setXY: function( G, z ) {
|
685
|
var AA = E.Dom._getStyle( G, p ),
|
686
|
y = E.Dom.setStyle,
|
687
|
AD = z.pos,
|
688
|
Y = z.noRetry,
|
689
|
AB = [ parseInt( E.Dom.getComputedStyle( G, j ), 10 ), parseInt( E.Dom.getComputedStyle( G, o ), 10 ) ],
|
690
|
AC, x;
|
691
|
if ( AA == "static" ) {
|
692
|
AA = V;
|
693
|
y( G, p, AA );
|
694
|
}
|
695
|
AC = E.Dom._getXY( G );
|
696
|
if ( !AD || AC === false ) {
|
697
|
return false;
|
698
|
}
|
699
|
if ( isNaN( AB[ 0 ] ) ) {
|
700
|
AB[ 0 ] = ( AA == V ) ? 0 : G[ b ];
|
701
|
}
|
702
|
if ( isNaN( AB[ 1 ] ) ) {
|
703
|
AB[ 1 ] = ( AA == V ) ? 0 : G[ P ];
|
704
|
}
|
705
|
if ( AD[ 0 ] !== null ) {
|
706
|
y( G, j, AD[ 0 ] - AC[ 0 ] + AB[ 0 ] + "px" );
|
707
|
}
|
708
|
if ( AD[ 1 ] !== null ) {
|
709
|
y( G, o, AD[ 1 ] - AC[ 1 ] + AB[ 1 ] + "px" );
|
710
|
}
|
711
|
if ( !Y ) {
|
712
|
x = E.Dom._getXY( G );
|
713
|
if ( ( AD[ 0 ] !== null && x[ 0 ] != AD[ 0 ] ) || ( AD[ 1 ] !== null && x[ 1 ] != AD[ 1 ] ) ) {
|
714
|
E.Dom._setXY( G, { pos: AD, noRetry: true } );
|
715
|
}
|
716
|
}
|
717
|
},
|
718
|
setX: function( Y, G ) {
|
719
|
E.Dom.setXY( Y, [ G, null ] );
|
720
|
},
|
721
|
setY: function( G, Y ) {
|
722
|
E.Dom.setXY( G, [ null, Y ] );
|
723
|
},
|
724
|
getRegion: function( G ) {
|
725
|
var Y = function( x ) {
|
726
|
var y = false;
|
727
|
if ( E.Dom._canPosition( x ) ) {
|
728
|
y = E.Region.getRegion( x );
|
729
|
} else {}
|
730
|
return y;
|
731
|
};
|
732
|
return E.Dom.batch( G, Y, E.Dom, true );
|
733
|
},
|
734
|
getClientWidth: function() {
|
735
|
return E.Dom.getViewportWidth();
|
736
|
},
|
737
|
getClientHeight: function() {
|
738
|
return E.Dom.getViewportHeight();
|
739
|
},
|
740
|
getElementsByClassName: function( AB, AF, AC, AE, x, AD ) {
|
741
|
AB = L.trim( AB );
|
742
|
AF = AF || "*";
|
743
|
AC = ( AC ) ? E.Dom.get( AC ) : null || K;
|
744
|
if ( !AC ) {
|
745
|
return [];
|
746
|
}
|
747
|
var Y = [],
|
748
|
G = AC.getElementsByTagName( AF ),
|
749
|
z = E.Dom.hasClass;
|
750
|
for ( var y = 0, AA = G.length; y < AA; ++y ) {
|
751
|
if ( z( G[ y ], AB ) ) {
|
752
|
Y[ Y.length ] = G[ y ];
|
753
|
}
|
754
|
}
|
755
|
if ( AE ) {
|
756
|
E.Dom.batch( Y, AE, x, AD );
|
757
|
}
|
758
|
return Y;
|
759
|
},
|
760
|
hasClass: function( Y, G ) {
|
761
|
return E.Dom.batch( Y, E.Dom._hasClass, G );
|
762
|
},
|
763
|
_hasClass: function( x, Y ) {
|
764
|
var G = false,
|
765
|
y; if ( x && Y ) {
|
766
|
y = E.Dom.getAttribute( x, F ) || J;
|
767
|
if ( Y.exec ) {
|
768
|
G = Y.test( y );
|
769
|
} else {
|
770
|
G = Y && ( B + y + B ).indexOf( B + Y + B ) > -1;
|
771
|
}
|
772
|
} else {}
|
773
|
return G;
|
774
|
},
|
775
|
addClass: function( Y, G ) {
|
776
|
return E.Dom.batch( Y, E.Dom._addClass, G );
|
777
|
},
|
778
|
_addClass: function( x, Y ) {
|
779
|
var G = false,
|
780
|
y; if ( x && Y ) {
|
781
|
y = E.Dom.getAttribute( x, F ) || J;
|
782
|
if ( !E.Dom._hasClass( x, Y ) ) {
|
783
|
E.Dom.setAttribute( x, F, A( y + B + Y ) );
|
784
|
G = true;
|
785
|
}
|
786
|
} else {}
|
787
|
return G;
|
788
|
},
|
789
|
removeClass: function( Y, G ) {
|
790
|
return E.Dom.batch( Y, E.Dom._removeClass, G );
|
791
|
},
|
792
|
_removeClass: function( y, x ) {
|
793
|
var Y = false,
|
794
|
AA, z, G; if ( y && x ) {
|
795
|
AA = E.Dom.getAttribute( y, F ) || J;
|
796
|
E.Dom.setAttribute( y, F, AA.replace( E.Dom._getClassRegex( x ), J ) );
|
797
|
z = E.Dom.getAttribute( y, F );
|
798
|
if ( AA !== z ) {
|
799
|
E.Dom.setAttribute( y, F, A( z ) );
|
800
|
Y = true;
|
801
|
if ( E.Dom.getAttribute( y, F ) === "" ) {
|
802
|
G = ( y.hasAttribute && y.hasAttribute( g ) ) ? g : F;
|
803
|
y.removeAttribute( G );
|
804
|
}
|
805
|
}
|
806
|
} else {}
|
807
|
return Y;
|
808
|
},
|
809
|
replaceClass: function( x, Y, G ) {
|
810
|
return E.Dom.batch( x, E.Dom._replaceClass, { from: Y, to: G } );
|
811
|
},
|
812
|
_replaceClass: function( y, x ) {
|
813
|
var Y, AB, AA,
|
814
|
G = false,
|
815
|
z; if ( y && x ) {
|
816
|
AB = x.from;
|
817
|
AA = x.to;
|
818
|
if ( !AA ) {
|
819
|
G = false;
|
820
|
} else {
|
821
|
if ( !AB ) {
|
822
|
G = E.Dom._addClass( y, x.to );
|
823
|
} else {
|
824
|
if ( AB !== AA ) {
|
825
|
z = E.Dom.getAttribute( y, F ) || J;
|
826
|
Y = ( B + z.replace( E.Dom._getClassRegex( AB ), B + AA ) ).split( E.Dom._getClassRegex( AA ) );
|
827
|
Y.splice( 1, 0, B + AA );
|
828
|
E.Dom.setAttribute( y, F, A( Y.join( J ) ) );
|
829
|
G = true;
|
830
|
}
|
831
|
}
|
832
|
}
|
833
|
} else {}
|
834
|
return G;
|
835
|
},
|
836
|
generateId: function( G, x ) {
|
837
|
x = x || "yui-gen"; var Y = function( y ) {
|
838
|
if ( y && y.id ) {
|
839
|
return y.id;
|
840
|
}
|
841
|
var z = x + YAHOO.env._id_counter++;
|
842
|
if ( y ) {
|
843
|
if ( y[ e ].getElementById( z ) ) {
|
844
|
return E.Dom.generateId( y, z + x );
|
845
|
}
|
846
|
y.id = z;
|
847
|
}
|
848
|
return z;
|
849
|
};
|
850
|
return E.Dom.batch( G, Y, E.Dom, true ) || Y.apply( E.Dom, arguments );
|
851
|
},
|
852
|
isAncestor: function( Y, x ) {
|
853
|
Y = E.Dom.get( Y );
|
854
|
x = E.Dom.get( x );
|
855
|
var G = false;
|
856
|
if ( ( Y && x ) && ( Y[ l ] && x[ l ] ) ) {
|
857
|
if ( Y.contains && Y !== x ) {
|
858
|
G = Y.contains( x );
|
859
|
} else {
|
860
|
if ( Y.compareDocumentPosition ) {
|
861
|
G = !!( Y.compareDocumentPosition( x ) & 16 );
|
862
|
}
|
863
|
}
|
864
|
} else {}
|
865
|
return G;
|
866
|
},
|
867
|
inDocument: function( G, Y ) {
|
868
|
return E.Dom._inDoc( E.Dom.get( G ), Y );
|
869
|
},
|
870
|
_inDoc: function( Y, x ) {
|
871
|
var G = false; if ( Y && Y[ C ] ) {
|
872
|
x = x || Y[ e ];
|
873
|
G = E.Dom.isAncestor( x[ v ], Y );
|
874
|
} else {}
|
875
|
return G;
|
876
|
},
|
877
|
getElementsBy: function( Y, AF, AB, AD, y, AC, AE ) {
|
878
|
AF = AF || "*"; AB = ( AB ) ? E.Dom.get( AB ) : null || K;
|
879
|
if ( !AB ) {
|
880
|
return [];
|
881
|
}
|
882
|
var x = [],
|
883
|
G = AB.getElementsByTagName( AF );
|
884
|
for ( var z = 0, AA = G.length; z < AA; ++z ) {
|
885
|
if ( Y( G[ z ] ) ) {
|
886
|
if ( AE ) {
|
887
|
x = G[ z ];
|
888
|
break;
|
889
|
} else {
|
890
|
x[ x.length ] = G[ z ];
|
891
|
}
|
892
|
}
|
893
|
}
|
894
|
if ( AD ) {
|
895
|
E.Dom.batch( x, AD, y, AC );
|
896
|
}
|
897
|
return x;
|
898
|
},
|
899
|
getElementBy: function( x, G, Y ) {
|
900
|
return E.Dom.getElementsBy( x, G, Y, null, null, null, true );
|
901
|
},
|
902
|
batch: function( x, AB, AA, z ) {
|
903
|
var y = [],
|
904
|
Y = ( z ) ? AA : window;
|
905
|
x = ( x && ( x[ C ] || x.item ) ) ? x : E.Dom.get( x );
|
906
|
if ( x && AB ) {
|
907
|
if ( x[ C ] || x.length === undefined ) {
|
908
|
return AB.call( Y, x, AA );
|
909
|
}
|
910
|
for ( var G = 0; G < x.length; ++G ) {
|
911
|
y[ y.length ] = AB.call( Y, x[ G ], AA );
|
912
|
}
|
913
|
} else {
|
914
|
return false;
|
915
|
}
|
916
|
return y;
|
917
|
},
|
918
|
getDocumentHeight: function() {
|
919
|
var Y = ( K[ t ] != M || I ) ? K.body.scrollHeight : W.scrollHeight,
|
920
|
G = Math.max( Y, E.Dom.getViewportHeight() );
|
921
|
return G;
|
922
|
},
|
923
|
getDocumentWidth: function() {
|
924
|
var Y = ( K[ t ] != M || I ) ? K.body.scrollWidth : W.scrollWidth,
|
925
|
G = Math.max( Y, E.Dom.getViewportWidth() );
|
926
|
return G;
|
927
|
},
|
928
|
getViewportHeight: function() {
|
929
|
var G = self.innerHeight,
|
930
|
Y = K[ t ];
|
931
|
if ( ( Y || T ) && !D ) {
|
932
|
G = ( Y == M ) ? W.clientHeight : K.body.clientHeight;
|
933
|
}
|
934
|
return G;
|
935
|
},
|
936
|
getViewportWidth: function() {
|
937
|
var G = self.innerWidth,
|
938
|
Y = K[ t ];
|
939
|
if ( Y || T ) {
|
940
|
G = ( Y == M ) ? W.clientWidth : K.body.clientWidth;
|
941
|
}
|
942
|
return G;
|
943
|
},
|
944
|
getAncestorBy: function( G, Y ) {
|
945
|
while ( ( G = G[ Z ] ) ) {
|
946
|
if ( E.Dom._testElement( G, Y ) ) {
|
947
|
return G;
|
948
|
}
|
949
|
}
|
950
|
return null;
|
951
|
},
|
952
|
getAncestorByClassName: function( Y, G ) {
|
953
|
Y = E.Dom.get( Y );
|
954
|
if ( !Y ) {
|
955
|
return null;
|
956
|
}
|
957
|
var x = function( y ) {
|
958
|
return E.Dom.hasClass( y, G );
|
959
|
};
|
960
|
return E.Dom.getAncestorBy( Y, x );
|
961
|
},
|
962
|
getAncestorByTagName: function( Y, G ) {
|
963
|
Y = E.Dom.get( Y );
|
964
|
if ( !Y ) {
|
965
|
return null;
|
966
|
}
|
967
|
var x = function( y ) {
|
968
|
return y[ C ] && y[ C ].toUpperCase() == G.toUpperCase();
|
969
|
};
|
970
|
return E.Dom.getAncestorBy( Y, x );
|
971
|
},
|
972
|
getPreviousSiblingBy: function( G, Y ) {
|
973
|
while ( G ) {
|
974
|
G = G.previousSibling;
|
975
|
if ( E.Dom._testElement( G, Y ) ) {
|
976
|
return G;
|
977
|
}
|
978
|
}
|
979
|
return null;
|
980
|
},
|
981
|
getPreviousSibling: function( G ) {
|
982
|
G = E.Dom.get( G );
|
983
|
if ( !G ) {
|
984
|
return null;
|
985
|
}
|
986
|
return E.Dom.getPreviousSiblingBy( G );
|
987
|
},
|
988
|
getNextSiblingBy: function( G, Y ) {
|
989
|
while ( G ) {
|
990
|
G = G.nextSibling;
|
991
|
if ( E.Dom._testElement( G, Y ) ) {
|
992
|
return G;
|
993
|
}
|
994
|
}
|
995
|
return null;
|
996
|
},
|
997
|
getNextSibling: function( G ) {
|
998
|
G = E.Dom.get( G );
|
999
|
if ( !G ) {
|
1000
|
return null;
|
1001
|
}
|
1002
|
return E.Dom.getNextSiblingBy( G );
|
1003
|
},
|
1004
|
getFirstChildBy: function( G, x ) {
|
1005
|
var Y = ( E.Dom._testElement( G.firstChild, x ) ) ? G.firstChild : null;
|
1006
|
return Y || E.Dom.getNextSiblingBy( G.firstChild, x );
|
1007
|
},
|
1008
|
getFirstChild: function( G, Y ) {
|
1009
|
G = E.Dom.get( G );
|
1010
|
if ( !G ) {
|
1011
|
return null;
|
1012
|
}
|
1013
|
return E.Dom.getFirstChildBy( G );
|
1014
|
},
|
1015
|
getLastChildBy: function( G, x ) {
|
1016
|
if ( !G ) {
|
1017
|
return null;
|
1018
|
}
|
1019
|
var Y = ( E.Dom._testElement( G.lastChild, x ) ) ? G.lastChild : null;
|
1020
|
return Y || E.Dom.getPreviousSiblingBy( G.lastChild, x );
|
1021
|
},
|
1022
|
getLastChild: function( G ) {
|
1023
|
G = E.Dom.get( G );
|
1024
|
return E.Dom.getLastChildBy( G );
|
1025
|
},
|
1026
|
getChildrenBy: function( Y, y ) {
|
1027
|
var x = E.Dom.getFirstChildBy( Y, y ),
|
1028
|
G = x ? [ x ] : [];
|
1029
|
E.Dom.getNextSiblingBy( x, function( z ) {
|
1030
|
if ( !y || y( z ) ) {
|
1031
|
G[ G.length ] = z;
|
1032
|
}
|
1033
|
return false;
|
1034
|
});
|
1035
|
return G;
|
1036
|
},
|
1037
|
getChildren: function( G ) {
|
1038
|
G = E.Dom.get( G );
|
1039
|
if ( !G ) {}
|
1040
|
return E.Dom.getChildrenBy( G );
|
1041
|
},
|
1042
|
getDocumentScrollLeft: function( G ) {
|
1043
|
G = G || K; return Math.max( G[ v ].scrollLeft, G.body.scrollLeft );
|
1044
|
},
|
1045
|
getDocumentScrollTop: function( G ) {
|
1046
|
G = G || K; return Math.max( G[ v ].scrollTop, G.body.scrollTop );
|
1047
|
},
|
1048
|
insertBefore: function( Y, G ) {
|
1049
|
Y = E.Dom.get( Y );
|
1050
|
G = E.Dom.get( G );
|
1051
|
if ( !Y || !G || !G[ Z ] ) {
|
1052
|
return null;
|
1053
|
}
|
1054
|
return G[ Z ].insertBefore( Y, G );
|
1055
|
},
|
1056
|
insertAfter: function( Y, G ) {
|
1057
|
Y = E.Dom.get( Y );
|
1058
|
G = E.Dom.get( G );
|
1059
|
if ( !Y || !G || !G[ Z ] ) {
|
1060
|
return null;
|
1061
|
}
|
1062
|
if ( G.nextSibling ) {
|
1063
|
return G[ Z ].insertBefore( Y, G.nextSibling );
|
1064
|
} else {
|
1065
|
return G[ Z ].appendChild( Y );
|
1066
|
}
|
1067
|
},
|
1068
|
getClientRegion: function() {
|
1069
|
var x = E.Dom.getDocumentScrollTop(),
|
1070
|
Y = E.Dom.getDocumentScrollLeft(),
|
1071
|
y = E.Dom.getViewportWidth() + Y,
|
1072
|
G = E.Dom.getViewportHeight() + x;
|
1073
|
return new E.Region( x, y, G, Y );
|
1074
|
},
|
1075
|
setAttribute: function( Y, G, x ) {
|
1076
|
G = E.Dom.CUSTOM_ATTRIBUTES[ G ] || G;
|
1077
|
Y.setAttribute( G, x );
|
1078
|
},
|
1079
|
getAttribute: function( Y, G ) {
|
1080
|
G = E.Dom.CUSTOM_ATTRIBUTES[ G ] || G;
|
1081
|
return Y.getAttribute( G );
|
1082
|
},
|
1083
|
_toCamel: function( Y ) {
|
1084
|
var x = d;
|
1085
|
|
1086
|
function G( y, z ) {
|
1087
|
return z.toUpperCase();
|
1088
|
}
|
1089
|
return x[ Y ] || ( x[ Y ] = Y.indexOf( "-" ) === -1 ? Y : Y.replace( /-([a-z])/gi, G ) );
|
1090
|
},
|
1091
|
_getClassRegex: function( Y ) {
|
1092
|
var G; if ( Y !== undefined ) {
|
1093
|
if ( Y.exec ) {
|
1094
|
G = Y;
|
1095
|
} else {
|
1096
|
G = h[ Y ];
|
1097
|
if ( !G ) {
|
1098
|
Y = Y.replace( E.Dom._patterns.CLASS_RE_TOKENS, "\\$1" );
|
1099
|
G = h[ Y ] = new RegExp( s + Y + k, U );
|
1100
|
}
|
1101
|
}
|
1102
|
}
|
1103
|
return G;
|
1104
|
},
|
1105
|
_patterns: { ROOT_TAG: /^body|html$/i, CLASS_RE_TOKENS: /([\.\(\)\^\$\*\+\?\|\[\]\{\}])/g },
|
1106
|
_testElement: function( G, Y ) {
|
1107
|
return G && G[ l ] == 1 && ( !Y || Y( G ) );
|
1108
|
},
|
1109
|
_calcBorders: function( x, y ) {
|
1110
|
var Y = parseInt( E.Dom[ w ]( x, R ), 10 ) || 0,
|
1111
|
G = parseInt( E.Dom[ w ]( x, q ), 10 ) || 0;
|
1112
|
if ( H ) {
|
1113
|
if ( N.test( x[ C ] ) ) {
|
1114
|
Y = 0;
|
1115
|
G = 0;
|
1116
|
}
|
1117
|
}
|
1118
|
y[ 0 ] += G;
|
1119
|
y[ 1 ] += Y;
|
1120
|
return y;
|
1121
|
} }; var S = E.Dom[ w ];
|
1122
|
if ( m.opera ) {
|
1123
|
E.Dom[ w ] = function( Y, G ) {
|
1124
|
var x = S( Y, G );
|
1125
|
if ( X.test( G ) ) {
|
1126
|
x = E.Dom.Color.toRGB( x );
|
1127
|
}
|
1128
|
return x;
|
1129
|
};
|
1130
|
}
|
1131
|
if ( m.webkit ) {
|
1132
|
E.Dom[ w ] = function( Y, G ) {
|
1133
|
var x = S( Y, G );
|
1134
|
if ( x === "rgba(0, 0, 0, 0)" ) {
|
1135
|
x = "transparent";
|
1136
|
}
|
1137
|
return x;
|
1138
|
};
|
1139
|
}
|
1140
|
})();
|
1141
|
YAHOO.util.Region = function( C, D, A, B ) {
|
1142
|
this.top = C;
|
1143
|
this.y = C;
|
1144
|
this[ 1 ] = C;
|
1145
|
this.right = D;
|
1146
|
this.bottom = A;
|
1147
|
this.left = B;
|
1148
|
this.x = B;
|
1149
|
this[ 0 ] = B;
|
1150
|
this.width = this.right - this.left;
|
1151
|
this.height = this.bottom - this.top;
|
1152
|
};
|
1153
|
YAHOO.util.Region.prototype.contains = function( A ) {
|
1154
|
return ( A.left >= this.left && A.right <= this.right && A.top >= this.top && A.bottom <= this.bottom );
|
1155
|
};
|
1156
|
YAHOO.util.Region.prototype.getArea = function() {
|
1157
|
return ( ( this.bottom - this.top ) * ( this.right - this.left ) );
|
1158
|
};
|
1159
|
YAHOO.util.Region.prototype.intersect = function( E ) {
|
1160
|
var C = Math.max( this.top, E.top ),
|
1161
|
D = Math.min( this.right, E.right ),
|
1162
|
A = Math.min( this.bottom, E.bottom ),
|
1163
|
B = Math.max( this.left, E.left );
|
1164
|
if ( A >= C && D >= B ) {
|
1165
|
return new YAHOO.util.Region( C, D, A, B );
|
1166
|
} else {
|
1167
|
return null;
|
1168
|
}
|
1169
|
};
|
1170
|
YAHOO.util.Region.prototype.union = function( E ) {
|
1171
|
var C = Math.min( this.top, E.top ),
|
1172
|
D = Math.max( this.right, E.right ),
|
1173
|
A = Math.max( this.bottom, E.bottom ),
|
1174
|
B = Math.min( this.left, E.left );
|
1175
|
return new YAHOO.util.Region( C, D, A, B );
|
1176
|
};
|
1177
|
YAHOO.util.Region.prototype.toString = function() {
|
1178
|
return ( "Region {" + "top: " + this.top + ", right: " + this.right + ", bottom: " + this.bottom + ", left: " + this.left + ", height: " + this.height + ", width: " + this.width + "}" );
|
1179
|
};
|
1180
|
YAHOO.util.Region.getRegion = function( D ) {
|
1181
|
var F = YAHOO.util.Dom.getXY( D ),
|
1182
|
C = F[ 1 ],
|
1183
|
E = F[ 0 ] + D.offsetWidth,
|
1184
|
A = F[ 1 ] + D.offsetHeight,
|
1185
|
B = F[ 0 ];
|
1186
|
return new YAHOO.util.Region( C, E, A, B );
|
1187
|
};
|
1188
|
YAHOO.util.Point = function( A, B ) {
|
1189
|
if ( YAHOO.lang.isArray( A ) ) {
|
1190
|
B = A[ 1 ];
|
1191
|
A = A[ 0 ];
|
1192
|
}
|
1193
|
YAHOO.util.Point.superclass.constructor.call( this, B, A, B, A );
|
1194
|
};
|
1195
|
YAHOO.extend( YAHOO.util.Point, YAHOO.util.Region );
|
1196
|
(function() {
|
1197
|
var B = YAHOO.util,
|
1198
|
A = "clientTop",
|
1199
|
F = "clientLeft",
|
1200
|
J = "parentNode",
|
1201
|
K = "right",
|
1202
|
W = "hasLayout",
|
1203
|
I = "px",
|
1204
|
U = "opacity",
|
1205
|
L = "auto",
|
1206
|
D = "borderLeftWidth",
|
1207
|
G = "borderTopWidth",
|
1208
|
P = "borderRightWidth",
|
1209
|
V = "borderBottomWidth",
|
1210
|
S = "visible",
|
1211
|
Q = "transparent",
|
1212
|
N = "height",
|
1213
|
E = "width",
|
1214
|
H = "style",
|
1215
|
T = "currentStyle",
|
1216
|
R = /^width|height$/,
|
1217
|
O = /^(\d[.\d]*)+(em|ex|px|gd|rem|vw|vh|vm|ch|mm|cm|in|pt|pc|deg|rad|ms|s|hz|khz|%){1}?/i,
|
1218
|
M = {
|
1219
|
get: function( X, Z ) {
|
1220
|
var Y = "",
|
1221
|
a = X[ T ][ Z ];
|
1222
|
if ( Z === U ) {
|
1223
|
Y = B.Dom.getStyle( X, U );
|
1224
|
} else {
|
1225
|
if ( !a || ( a.indexOf && a.indexOf( I ) > -1 ) ) {
|
1226
|
Y = a;
|
1227
|
} else {
|
1228
|
if ( B.Dom.IE_COMPUTED[ Z ] ) {
|
1229
|
Y = B.Dom.IE_COMPUTED[ Z ]( X, Z );
|
1230
|
} else {
|
1231
|
if ( O.test( a ) ) {
|
1232
|
Y = B.Dom.IE.ComputedStyle.getPixel( X, Z );
|
1233
|
} else {
|
1234
|
Y = a;
|
1235
|
}
|
1236
|
}
|
1237
|
}
|
1238
|
}
|
1239
|
return Y;
|
1240
|
},
|
1241
|
getOffset: function( Z, e ) {
|
1242
|
var b = Z[ T ][ e ],
|
1243
|
X = e.charAt( 0 ).toUpperCase() + e.substr( 1 ),
|
1244
|
c = "offset" + X,
|
1245
|
Y = "pixel" + X,
|
1246
|
a = "",
|
1247
|
d;
|
1248
|
if ( b == L ) {
|
1249
|
d = Z[ c ];
|
1250
|
if ( d === undefined ) {
|
1251
|
a = 0;
|
1252
|
}
|
1253
|
a = d;
|
1254
|
if ( R.test( e ) ) {
|
1255
|
Z[ H ][ e ] = d;
|
1256
|
if ( Z[ c ] > d ) {
|
1257
|
a = d - ( Z[ c ] - d );
|
1258
|
}
|
1259
|
Z[ H ][ e ] = L;
|
1260
|
}
|
1261
|
} else {
|
1262
|
if ( !Z[ H ][ Y ] && !Z[ H ][ e ] ) {
|
1263
|
Z[ H ][ e ] = b;
|
1264
|
}
|
1265
|
a = Z[ H ][ Y ];
|
1266
|
}
|
1267
|
return a + I;
|
1268
|
},
|
1269
|
getBorderWidth: function( X, Z ) {
|
1270
|
var Y = null; if ( !X[ T ][ W ] ) {
|
1271
|
X[ H ].zoom = 1;
|
1272
|
}
|
1273
|
switch ( Z ) {
|
1274
|
case G:
|
1275
|
Y = X[ A ];
|
1276
|
break;case V:
|
1277
|
Y = X.offsetHeight - X.clientHeight - X[ A ];
|
1278
|
break;case D:
|
1279
|
Y = X[ F ];
|
1280
|
break;case P:
|
1281
|
Y = X.offsetWidth - X.clientWidth - X[ F ];
|
1282
|
break;
|
1283
|
}
|
1284
|
return Y + I;
|
1285
|
},
|
1286
|
getPixel: function( Y, X ) {
|
1287
|
var a = null,
|
1288
|
b = Y[ T ][ K ],
|
1289
|
Z = Y[ T ][ X ];
|
1290
|
Y[ H ][ K ] = Z;
|
1291
|
a = Y[ H ].pixelRight;
|
1292
|
Y[ H ][ K ] = b;
|
1293
|
return a + I;
|
1294
|
},
|
1295
|
getMargin: function( Y, X ) {
|
1296
|
var Z; if ( Y[ T ][ X ] == L ) {
|
1297
|
Z = 0 + I;
|
1298
|
} else {
|
1299
|
Z = B.Dom.IE.ComputedStyle.getPixel( Y, X );
|
1300
|
}
|
1301
|
return Z;
|
1302
|
},
|
1303
|
getVisibility: function( Y, X ) {
|
1304
|
var Z; while ( ( Z = Y[ T ] ) && Z[ X ] == "inherit" ) {
|
1305
|
Y = Y[ J ];
|
1306
|
}
|
1307
|
return ( Z ) ? Z[ X ] : S;
|
1308
|
},
|
1309
|
getColor: function( Y, X ) {
|
1310
|
return B.Dom.Color.toRGB( Y[ T ][ X ] ) || Q;
|
1311
|
},
|
1312
|
getBorderColor: function( Y, X ) {
|
1313
|
var Z = Y[ T ],
|
1314
|
a = Z[ X ] || Z.color;
|
1315
|
return B.Dom.Color.toRGB( B.Dom.Color.toHex( a ) );
|
1316
|
} },
|
1317
|
C = {};
|
1318
|
C.top = C.right = C.bottom = C.left = C[ E ] = C[ N ] = M.getOffset;
|
1319
|
C.color = M.getColor;
|
1320
|
C[ G ] = C[ P ] = C[ V ] = C[ D ] = M.getBorderWidth;
|
1321
|
C.marginTop = C.marginRight = C.marginBottom = C.marginLeft = M.getMargin;
|
1322
|
C.visibility = M.getVisibility;
|
1323
|
C.borderColor = C.borderTopColor = C.borderRightColor = C.borderBottomColor = C.borderLeftColor = M.getBorderColor;
|
1324
|
B.Dom.IE_COMPUTED = C;
|
1325
|
B.Dom.IE_ComputedStyle = M;
|
1326
|
})();
|
1327
|
(function() {
|
1328
|
var C = "toString",
|
1329
|
A = parseInt,
|
1330
|
B = RegExp,
|
1331
|
D = YAHOO.util;
|
1332
|
D.Dom.Color = {
|
1333
|
KEYWORDS: { black: "000", silver: "c0c0c0", gray: "808080", white: "fff", maroon: "800000", red: "f00", purple: "800080", fuchsia: "f0f", green: "008000", lime: "0f0", olive: "808000", yellow: "ff0", navy: "000080", blue: "00f", teal: "008080", aqua: "0ff" },
|
1334
|
re_RGB: /^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i, re_hex: /^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i, re_hex3: /([0-9A-F])/gi, toRGB: function( E ) {
|
1335
|
if ( !D.Dom.Color.re_RGB.test( E ) ) {
|
1336
|
E = D.Dom.Color.toHex( E );
|
1337
|
}
|
1338
|
if ( D.Dom.Color.re_hex.exec( E ) ) {
|
1339
|
E = "rgb(" + [ A( B.$1, 16 ), A( B.$2, 16 ), A( B.$3, 16 ) ].join( ", " ) + ")";
|
1340
|
}
|
1341
|
return E;
|
1342
|
},
|
1343
|
toHex: function( H ) {
|
1344
|
H = D.Dom.Color.KEYWORDS[ H ] || H;
|
1345
|
if ( D.Dom.Color.re_RGB.exec( H ) ) {
|
1346
|
var G = ( B.$1.length === 1 ) ? "0" + B.$1 : Number( B.$1 ),
|
1347
|
F = ( B.$2.length === 1 ) ? "0" + B.$2 : Number( B.$2 ),
|
1348
|
E = ( B.$3.length === 1 ) ? "0" + B.$3 : Number( B.$3 );
|
1349
|
H = [ G[ C ]( 16 ), F[ C ]( 16 ), E[ C ]( 16 ) ].join( "" );
|
1350
|
}
|
1351
|
if ( H.length < 6 ) {
|
1352
|
H = H.replace( D.Dom.Color.re_hex3, "$1$1" );
|
1353
|
}
|
1354
|
if ( H !== "transparent" && H.indexOf( "#" ) < 0 ) {
|
1355
|
H = "#" + H;
|
1356
|
}
|
1357
|
return H.toLowerCase();
|
1358
|
} };
|
1359
|
}() );
|
1360
|
YAHOO.register( "dom", YAHOO.util.Dom, { version: "2.7.0", build: "1796" } );
|
1361
|
YAHOO.util.CustomEvent = function( D, C, B, A ) {
|
1362
|
this.type = D;
|
1363
|
this.scope = C || window;
|
1364
|
this.silent = B;
|
1365
|
this.signature = A || YAHOO.util.CustomEvent.LIST;
|
1366
|
this.subscribers = [];
|
1367
|
if ( !this.silent ) {}
|
1368
|
var E = "_YUICEOnSubscribe";
|
1369
|
if ( D !== E ) {
|
1370
|
this.subscribeEvent = new YAHOO.util.CustomEvent( E, this, true );
|
1371
|
}
|
1372
|
this.lastError = null;
|
1373
|
};
|
1374
|
YAHOO.util.CustomEvent.LIST = 0;
|
1375
|
YAHOO.util.CustomEvent.FLAT = 1;
|
1376
|
YAHOO.util.CustomEvent.prototype = {
|
1377
|
subscribe: function( A, B, C ) {
|
1378
|
if ( !A ) {
|
1379
|
throw new Error( "Invalid callback for subscriber to '" + this.type + "'" );
|
1380
|
}
|
1381
|
if ( this.subscribeEvent ) {
|
1382
|
this.subscribeEvent.fire( A, B, C );
|
1383
|
}
|
1384
|
this.subscribers.push( new YAHOO.util.Subscriber( A, B, C ) );
|
1385
|
},
|
1386
|
unsubscribe: function( D, F ) {
|
1387
|
if ( !D ) {
|
1388
|
return this.unsubscribeAll();
|
1389
|
}
|
1390
|
var E = false;
|
1391
|
for ( var B = 0, A = this.subscribers.length; B < A; ++B ) {
|
1392
|
var C = this.subscribers[ B ];
|
1393
|
if ( C && C.contains( D, F ) ) {
|
1394
|
this._delete( B );
|
1395
|
E = true;
|
1396
|
}
|
1397
|
}
|
1398
|
return E;
|
1399
|
},
|
1400
|
fire: function() {
|
1401
|
this.lastError = null; var K = [],
|
1402
|
E = this.subscribers.length;
|
1403
|
if ( !E && this.silent ) {
|
1404
|
return true;
|
1405
|
}
|
1406
|
var I = [].slice.call( arguments, 0 ),
|
1407
|
G = true,
|
1408
|
D,
|
1409
|
J = false;
|
1410
|
if ( !this.silent ) {}
|
1411
|
var C = this.subscribers.slice(),
|
1412
|
A = YAHOO.util.Event.throwErrors;
|
1413
|
for ( D = 0; D < E; ++D ) {
|
1414
|
var M = C[ D ];
|
1415
|
if ( !M ) {
|
1416
|
J = true;
|
1417
|
} else {
|
1418
|
if ( !this.silent ) {}
|
1419
|
var L = M.getScope( this.scope );
|
1420
|
if ( this.signature == YAHOO.util.CustomEvent.FLAT ) {
|
1421
|
var B = null;
|
1422
|
if ( I.length > 0 ) {
|
1423
|
B = I[ 0 ];
|
1424
|
}
|
1425
|
try {
|
1426
|
G = M.fn.call( L, B, M.obj );
|
1427
|
} catch ( F ) {
|
1428
|
this.lastError = F;
|
1429
|
if ( A ) {
|
1430
|
throw F;
|
1431
|
}
|
1432
|
}
|
1433
|
} else {
|
1434
|
try {
|
1435
|
G = M.fn.call( L, this.type, I, M.obj );
|
1436
|
} catch ( H ) {
|
1437
|
this.lastError = H;
|
1438
|
if ( A ) {
|
1439
|
throw H;
|
1440
|
}
|
1441
|
}
|
1442
|
}
|
1443
|
if ( false === G ) {
|
1444
|
if ( !this.silent ) {}
|
1445
|
break;
|
1446
|
}
|
1447
|
}
|
1448
|
}
|
1449
|
return ( G !== false );
|
1450
|
},
|
1451
|
unsubscribeAll: function() {
|
1452
|
var A = this.subscribers.length,
|
1453
|
B; for ( B = A - 1; B > -1; B-- ) {
|
1454
|
this._delete( B );
|
1455
|
}
|
1456
|
this.subscribers = [];
|
1457
|
return A;
|
1458
|
},
|
1459
|
_delete: function( A ) {
|
1460
|
var B = this.subscribers[ A ];
|
1461
|
if ( B ) {
|
1462
|
delete B.fn;
|
1463
|
delete B.obj;
|
1464
|
}
|
1465
|
this.subscribers.splice( A, 1 );
|
1466
|
},
|
1467
|
toString: function() {
|
1468
|
return "CustomEvent: " + "'" + this.type + "', " + "context: " + this.scope;
|
1469
|
} }; YAHOO.util.Subscriber = function( A, B, C ) {
|
1470
|
this.fn = A;
|
1471
|
this.obj = YAHOO.lang.isUndefined( B ) ? null : B;
|
1472
|
this.overrideContext = C;
|
1473
|
};
|
1474
|
YAHOO.util.Subscriber.prototype.getScope = function( A ) {
|
1475
|
if ( this.overrideContext ) {
|
1476
|
if ( this.overrideContext === true ) {
|
1477
|
return this.obj;
|
1478
|
} else {
|
1479
|
return this.overrideContext;
|
1480
|
}
|
1481
|
}
|
1482
|
return A;
|
1483
|
};
|
1484
|
YAHOO.util.Subscriber.prototype.contains = function( A, B ) {
|
1485
|
if ( B ) {
|
1486
|
return ( this.fn == A && this.obj == B );
|
1487
|
} else {
|
1488
|
return ( this.fn == A );
|
1489
|
}
|
1490
|
};
|
1491
|
YAHOO.util.Subscriber.prototype.toString = function() {
|
1492
|
return "Subscriber { obj: " + this.obj + ", overrideContext: " + ( this.overrideContext || "no" ) + " }";
|
1493
|
};
|
1494
|
if ( !YAHOO.util.Event ) {
|
1495
|
YAHOO.util.Event = function() {
|
1496
|
var H = false;
|
1497
|
var I = [];
|
1498
|
var J = [];
|
1499
|
var G = [];
|
1500
|
var E = [];
|
1501
|
var C = 0;
|
1502
|
var F = [];
|
1503
|
var B = [];
|
1504
|
var A = 0;
|
1505
|
var D = { 63232: 38, 63233: 40, 63234: 37, 63235: 39, 63276: 33, 63277: 34, 25: 9 }; var K = YAHOO.env.ua.ie ? "focusin" : "focus"; var L = YAHOO.env.ua.ie ? "focusout" : "blur"; return {
|
1506
|
POLL_RETRYS: 2000, POLL_INTERVAL: 20, EL: 0, TYPE: 1, FN: 2, WFN: 3, UNLOAD_OBJ: 3, ADJ_SCOPE: 4, OBJ: 5, OVERRIDE: 6, lastError: null, isSafari: YAHOO.env.ua.webkit, webkit: YAHOO.env.ua.webkit, isIE: YAHOO.env.ua.ie, _interval: null, _dri: null, DOMReady: false, throwErrors: false, startInterval: function() {
|
1507
|
if ( !this._interval ) {
|
1508
|
var M = this;
|
1509
|
var N = function() {
|
1510
|
M._tryPreloadAttach();
|
1511
|
};
|
1512
|
this._interval = setInterval( N, this.POLL_INTERVAL );
|
1513
|
}
|
1514
|
},
|
1515
|
onAvailable: function( S, O, Q, R, P ) {
|
1516
|
var M = ( YAHOO.lang.isString( S ) ) ? [ S ] : S;
|
1517
|
for ( var N = 0; N < M.length; N = N + 1 ) {
|
1518
|
F.push({ id: M[ N ], fn: O, obj: Q, overrideContext: R, checkReady: P } );
|
1519
|
}
|
1520
|
C = this.POLL_RETRYS;
|
1521
|
this.startInterval();
|
1522
|
},
|
1523
|
onContentReady: function( P, M, N, O ) {
|
1524
|
this.onAvailable( P, M, N, O, true );
|
1525
|
},
|
1526
|
onDOMReady: function( M, N, O ) {
|
1527
|
if ( this.DOMReady ) {
|
1528
|
setTimeout( function() {
|
1529
|
var P = window;
|
1530
|
if ( O ) {
|
1531
|
if ( O === true ) {
|
1532
|
P = N;
|
1533
|
} else {
|
1534
|
P = O;
|
1535
|
}
|
1536
|
}
|
1537
|
M.call( P, "DOMReady", [], N );
|
1538
|
}, 0 );
|
1539
|
} else {
|
1540
|
this.DOMReadyEvent.subscribe( M, N, O );
|
1541
|
}
|
1542
|
},
|
1543
|
_addListener: function( O, M, Y, S, W, b ) {
|
1544
|
if ( !Y || !Y.call ) {
|
1545
|
return false;
|
1546
|
}
|
1547
|
if ( this._isValidCollection( O ) ) {
|
1548
|
var Z = true;
|
1549
|
for ( var T = 0, V = O.length; T < V; ++T ) {
|
1550
|
Z = this.on( O[ T ], M, Y, S, W ) && Z;
|
1551
|
}
|
1552
|
return Z;
|
1553
|
} else {
|
1554
|
if ( YAHOO.lang.isString( O ) ) {
|
1555
|
var R = this.getEl( O );
|
1556
|
if ( R ) {
|
1557
|
O = R;
|
1558
|
} else {
|
1559
|
this.onAvailable( O, function() {
|
1560
|
YAHOO.util.Event.on( O, M, Y, S, W );
|
1561
|
});
|
1562
|
return true;
|
1563
|
}
|
1564
|
}
|
1565
|
}
|
1566
|
if ( !O ) {
|
1567
|
return false;
|
1568
|
}
|
1569
|
if ( "unload" == M && S !== this ) {
|
1570
|
J[ J.length ] = [ O, M, Y, S, W ];
|
1571
|
return true;
|
1572
|
}
|
1573
|
var N = O;
|
1574
|
if ( W ) {
|
1575
|
if ( W === true ) {
|
1576
|
N = S;
|
1577
|
} else {
|
1578
|
N = W;
|
1579
|
}
|
1580
|
}
|
1581
|
var P = function( c ) {
|
1582
|
return Y.call( N, YAHOO.util.Event.getEvent( c, O ), S );
|
1583
|
};
|
1584
|
var a = [ O, M, Y, P, N, S, W ];
|
1585
|
var U = I.length;
|
1586
|
I[ U ] = a;
|
1587
|
if ( this.useLegacyEvent( O, M ) ) {
|
1588
|
var Q = this.getLegacyIndex( O, M );
|
1589
|
if ( Q == -1 || O != G[ Q ][ 0 ] ) {
|
1590
|
Q = G.length;
|
1591
|
B[ O.id + M ] = Q;
|
1592
|
G[ Q ] = [ O, M, O[ "on" + M ] ];
|
1593
|
E[ Q ] = [];
|
1594
|
O[ "on" + M ] = function( c ) {
|
1595
|
YAHOO.util.Event.fireLegacyEvent( YAHOO.util.Event.getEvent( c ), Q );
|
1596
|
};
|
1597
|
}
|
1598
|
E[ Q ].push( a );
|
1599
|
} else {
|
1600
|
try {
|
1601
|
this._simpleAdd( O, M, P, b );
|
1602
|
} catch ( X ) {
|
1603
|
this.lastError = X;
|
1604
|
this.removeListener( O, M, Y );
|
1605
|
return false;
|
1606
|
}
|
1607
|
}
|
1608
|
return true;
|
1609
|
},
|
1610
|
addListener: function( N, Q, M, O, P ) {
|
1611
|
return this._addListener( N, Q, M, O, P, false );
|
1612
|
},
|
1613
|
addFocusListener: function( N, M, O, P ) {
|
1614
|
return this._addListener( N, K, M, O, P, true );
|
1615
|
},
|
1616
|
removeFocusListener: function( N, M ) {
|
1617
|
return this.removeListener( N, K, M );
|
1618
|
},
|
1619
|
addBlurListener: function( N, M, O, P ) {
|
1620
|
return this._addListener( N, L, M, O, P, true );
|
1621
|
},
|
1622
|
removeBlurListener: function( N, M ) {
|
1623
|
return this.removeListener( N, L, M );
|
1624
|
},
|
1625
|
fireLegacyEvent: function( R, P ) {
|
1626
|
var T = true,
|
1627
|
M, V, U, N, S; V = E[ P ].slice();
|
1628
|
for ( var O = 0, Q = V.length; O < Q; ++O ) {
|
1629
|
U = V[ O ];
|
1630
|
if ( U && U[ this.WFN ] ) {
|
1631
|
N = U[ this.ADJ_SCOPE ];
|
1632
|
S = U[ this.WFN ].call( N, R );
|
1633
|
T = ( T && S );
|
1634
|
}
|
1635
|
}
|
1636
|
M = G[ P ];
|
1637
|
if ( M && M[ 2 ] ) {
|
1638
|
M[ 2 ]( R );
|
1639
|
}
|
1640
|
return T;
|
1641
|
},
|
1642
|
getLegacyIndex: function( N, O ) {
|
1643
|
var M = this.generateId( N ) + O;
|
1644
|
if ( typeof B[ M ] == "undefined" ) {
|
1645
|
return -1;
|
1646
|
} else {
|
1647
|
return B[ M ];
|
1648
|
}
|
1649
|
},
|
1650
|
useLegacyEvent: function( M, N ) {
|
1651
|
return ( this.webkit && this.webkit < 419 && ( "click" == N || "dblclick" == N ) );
|
1652
|
},
|
1653
|
removeListener: function( N, M, V ) {
|
1654
|
var Q, T, X; if ( typeof N == "string" ) {
|
1655
|
N = this.getEl( N );
|
1656
|
} else {
|
1657
|
if ( this._isValidCollection( N ) ) {
|
1658
|
var W = true;
|
1659
|
for ( Q = N.length - 1; Q > -1; Q-- ) {
|
1660
|
W = ( this.removeListener( N[ Q ], M, V ) && W );
|
1661
|
}
|
1662
|
return W;
|
1663
|
}
|
1664
|
}
|
1665
|
if ( !V || !V.call ) {
|
1666
|
return this.purgeElement( N, false, M );
|
1667
|
}
|
1668
|
if ( "unload" == M ) {
|
1669
|
for ( Q = J.length - 1; Q > -1; Q-- ) {
|
1670
|
X = J[ Q ];
|
1671
|
if ( X && X[ 0 ] == N && X[ 1 ] == M && X[ 2 ] == V ) {
|
1672
|
J.splice( Q, 1 );
|
1673
|
return true;
|
1674
|
}
|
1675
|
}
|
1676
|
return false;
|
1677
|
}
|
1678
|
var R = null;
|
1679
|
var S = arguments[ 3 ];
|
1680
|
if ( "undefined" === typeof S ) {
|
1681
|
S = this._getCacheIndex( N, M, V );
|
1682
|
}
|
1683
|
if ( S >= 0 ) {
|
1684
|
R = I[ S ];
|
1685
|
}
|
1686
|
if ( !N || !R ) {
|
1687
|
return false;
|
1688
|
}
|
1689
|
if ( this.useLegacyEvent( N, M ) ) {
|
1690
|
var P = this.getLegacyIndex( N, M );
|
1691
|
var O = E[ P ];
|
1692
|
if ( O ) {
|
1693
|
for ( Q = 0, T = O.length; Q < T; ++Q ) {
|
1694
|
X = O[ Q ];
|
1695
|
if ( X && X[ this.EL ] == N && X[ this.TYPE ] == M && X[ this.FN ] == V ) {
|
1696
|
O.splice( Q, 1 );
|
1697
|
break;
|
1698
|
}
|
1699
|
}
|
1700
|
}
|
1701
|
} else {
|
1702
|
try {
|
1703
|
this._simpleRemove( N, M, R[ this.WFN ], false );
|
1704
|
} catch ( U ) {
|
1705
|
this.lastError = U;
|
1706
|
return false;
|
1707
|
}
|
1708
|
}
|
1709
|
delete I[ S ][ this.WFN ];
|
1710
|
delete I[ S ][ this.FN ];
|
1711
|
I.splice( S, 1 );
|
1712
|
return true;
|
1713
|
},
|
1714
|
getTarget: function( O, N ) {
|
1715
|
var M = O.target || O.srcElement; return this.resolveTextNode( M );
|
1716
|
},
|
1717
|
resolveTextNode: function( N ) {
|
1718
|
try {
|
1719
|
if ( N && 3 == N.nodeType ) {
|
1720
|
return N.parentNode;
|
1721
|
}
|
1722
|
} catch ( M ) {}
|
1723
|
return N;
|
1724
|
},
|
1725
|
getPageX: function( N ) {
|
1726
|
var M = N.pageX; if ( !M && 0 !== M ) {
|
1727
|
M = N.clientX || 0;
|
1728
|
if ( this.isIE ) {
|
1729
|
M += this._getScrollLeft();
|
1730
|
}
|
1731
|
}
|
1732
|
return M;
|
1733
|
},
|
1734
|
getPageY: function( M ) {
|
1735
|
var N = M.pageY; if ( !N && 0 !== N ) {
|
1736
|
N = M.clientY || 0;
|
1737
|
if ( this.isIE ) {
|
1738
|
N += this._getScrollTop();
|
1739
|
}
|
1740
|
}
|
1741
|
return N;
|
1742
|
},
|
1743
|
getXY: function( M ) {
|
1744
|
return [ this.getPageX( M ), this.getPageY( M ) ];
|
1745
|
},
|
1746
|
getRelatedTarget: function( N ) {
|
1747
|
var M = N.relatedTarget; if ( !M ) {
|
1748
|
if ( N.type == "mouseout" ) {
|
1749
|
M = N.toElement;
|
1750
|
} else {
|
1751
|
if ( N.type == "mouseover" ) {
|
1752
|
M = N.fromElement;
|
1753
|
}
|
1754
|
}
|
1755
|
}
|
1756
|
return this.resolveTextNode( M );
|
1757
|
},
|
1758
|
getTime: function( O ) {
|
1759
|
if ( !O.time ) {
|
1760
|
var N = new Date().getTime();
|
1761
|
try {
|
1762
|
O.time = N;
|
1763
|
} catch ( M ) {
|
1764
|
this.lastError = M;
|
1765
|
return N;
|
1766
|
}
|
1767
|
}
|
1768
|
return O.time;
|
1769
|
},
|
1770
|
stopEvent: function( M ) {
|
1771
|
this.stopPropagation( M );
|
1772
|
this.preventDefault( M );
|
1773
|
},
|
1774
|
stopPropagation: function( M ) {
|
1775
|
if ( M.stopPropagation ) {
|
1776
|
M.stopPropagation();
|
1777
|
} else {
|
1778
|
M.cancelBubble = true;
|
1779
|
}
|
1780
|
},
|
1781
|
preventDefault: function( M ) {
|
1782
|
if ( M.preventDefault ) {
|
1783
|
M.preventDefault();
|
1784
|
} else {
|
1785
|
M.returnValue = false;
|
1786
|
}
|
1787
|
},
|
1788
|
getEvent: function( O, M ) {
|
1789
|
var N = O || window.event; if ( !N ) {
|
1790
|
var P = this.getEvent.caller;
|
1791
|
while ( P ) {
|
1792
|
N = P.arguments[ 0 ];
|
1793
|
if ( N && Event == N.constructor ) {
|
1794
|
break;
|
1795
|
}
|
1796
|
P = P.caller;
|
1797
|
}
|
1798
|
}
|
1799
|
return N;
|
1800
|
},
|
1801
|
getCharCode: function( N ) {
|
1802
|
var M = N.keyCode || N.charCode || 0; if ( YAHOO.env.ua.webkit && ( M in D ) ) {
|
1803
|
M = D[ M ];
|
1804
|
}
|
1805
|
return M;
|
1806
|
},
|
1807
|
_getCacheIndex: function( Q, R, P ) {
|
1808
|
for ( var O = 0, N = I.length; O < N; O = O + 1 ) {
|
1809
|
var M = I[ O ];
|
1810
|
if ( M && M[ this.FN ] == P && M[ this.EL ] == Q && M[ this.TYPE ] == R ) {
|
1811
|
return O;
|
1812
|
}
|
1813
|
}
|
1814
|
return -1;
|
1815
|
},
|
1816
|
generateId: function( M ) {
|
1817
|
var N = M.id; if ( !N ) {
|
1818
|
N = "yuievtautoid-" + A;
|
1819
|
++A;
|
1820
|
M.id = N;
|
1821
|
}
|
1822
|
return N;
|
1823
|
},
|
1824
|
_isValidCollection: function( N ) {
|
1825
|
try {
|
1826
|
return ( N && typeof N !== "string" && N.length && !N.tagName && !N.alert && typeof N[ 0 ] !== "undefined" );
|
1827
|
} catch ( M ) {
|
1828
|
return false;
|
1829
|
}
|
1830
|
},
|
1831
|
elCache: {},
|
1832
|
getEl: function( M ) {
|
1833
|
return ( typeof M === "string" ) ? document.getElementById( M ) : M;
|
1834
|
},
|
1835
|
clearCache: function() {},
|
1836
|
DOMReadyEvent: new YAHOO.util.CustomEvent( "DOMReady", this ), _load: function( N ) {
|
1837
|
if ( !H ) {
|
1838
|
H = true;
|
1839
|
var M = YAHOO.util.Event;
|
1840
|
M._ready();
|
1841
|
M._tryPreloadAttach();
|
1842
|
}
|
1843
|
},
|
1844
|
_ready: function( N ) {
|
1845
|
var M = YAHOO.util.Event; if ( !M.DOMReady ) {
|
1846
|
M.DOMReady = true;
|
1847
|
M.DOMReadyEvent.fire();
|
1848
|
M._simpleRemove( document, "DOMContentLoaded", M._ready );
|
1849
|
}
|
1850
|
},
|
1851
|
_tryPreloadAttach: function() {
|
1852
|
if ( F.length === 0 ) {
|
1853
|
C = 0;
|
1854
|
if ( this._interval ) {
|
1855
|
clearInterval( this._interval );
|
1856
|
this._interval = null;
|
1857
|
}
|
1858
|
return;
|
1859
|
}
|
1860
|
if ( this.locked ) {
|
1861
|
return;
|
1862
|
}
|
1863
|
if ( this.isIE ) {
|
1864
|
if ( !this.DOMReady ) {
|
1865
|
this.startInterval();
|
1866
|
return;
|
1867
|
}
|
1868
|
}
|
1869
|
this.locked = true;
|
1870
|
var S = !H;
|
1871
|
if ( !S ) {
|
1872
|
S = ( C > 0 && F.length > 0 );
|
1873
|
}
|
1874
|
var R = [];
|
1875
|
var T = function( V, W ) {
|
1876
|
var U = V;
|
1877
|
if ( W.overrideContext ) {
|
1878
|
if ( W.overrideContext === true ) {
|
1879
|
U = W.obj;
|
1880
|
} else {
|
1881
|
U = W.overrideContext;
|
1882
|
}
|
1883
|
}
|
1884
|
W.fn.call( U, W.obj );
|
1885
|
};
|
1886
|
var N, M, Q, P,
|
1887
|
O = [];
|
1888
|
for ( N = 0, M = F.length; N < M; N = N + 1 ) {
|
1889
|
Q = F[ N ];
|
1890
|
if ( Q ) {
|
1891
|
P = this.getEl( Q.id );
|
1892
|
if ( P ) {
|
1893
|
if ( Q.checkReady ) {
|
1894
|
if ( H || P.nextSibling || !S ) {
|
1895
|
O.push( Q );
|
1896
|
F[ N ] = null;
|
1897
|
}
|
1898
|
} else {
|
1899
|
T( P, Q );
|
1900
|
F[ N ] = null;
|
1901
|
}
|
1902
|
} else {
|
1903
|
R.push( Q );
|
1904
|
}
|
1905
|
}
|
1906
|
}
|
1907
|
for ( N = 0, M = O.length; N < M; N = N + 1 ) {
|
1908
|
Q = O[ N ];
|
1909
|
T( this.getEl( Q.id ), Q );
|
1910
|
}
|
1911
|
C--;
|
1912
|
if ( S ) {
|
1913
|
for ( N = F.length - 1; N > -1; N-- ) {
|
1914
|
Q = F[ N ];
|
1915
|
if ( !Q || !Q.id ) {
|
1916
|
F.splice( N, 1 );
|
1917
|
}
|
1918
|
}
|
1919
|
this.startInterval();
|
1920
|
} else {
|
1921
|
if ( this._interval ) {
|
1922
|
clearInterval( this._interval );
|
1923
|
this._interval = null;
|
1924
|
}
|
1925
|
}
|
1926
|
this.locked = false;
|
1927
|
},
|
1928
|
purgeElement: function( Q, R, T ) {
|
1929
|
var O = ( YAHOO.lang.isString( Q ) ) ? this.getEl( Q ) : Q;
|
1930
|
var S = this.getListeners( O, T ),
|
1931
|
P, M;
|
1932
|
if ( S ) {
|
1933
|
for ( P = S.length - 1; P > -1; P-- ) {
|
1934
|
var N = S[ P ];
|
1935
|
this.removeListener( O, N.type, N.fn );
|
1936
|
}
|
1937
|
}
|
1938
|
if ( R && O && O.childNodes ) {
|
1939
|
for ( P = 0, M = O.childNodes.length; P < M; ++P ) {
|
1940
|
this.purgeElement( O.childNodes[ P ], R, T );
|
1941
|
}
|
1942
|
}
|
1943
|
},
|
1944
|
getListeners: function( O, M ) {
|
1945
|
var R = [],
|
1946
|
N;
|
1947
|
if ( !M ) {
|
1948
|
N = [ I, J ];
|
1949
|
} else {
|
1950
|
if ( M === "unload" ) {
|
1951
|
N = [ J ];
|
1952
|
} else {
|
1953
|
N = [ I ];
|
1954
|
}
|
1955
|
}
|
1956
|
var T = ( YAHOO.lang.isString( O ) ) ? this.getEl( O ) : O;
|
1957
|
for ( var Q = 0; Q < N.length; Q = Q + 1 ) {
|
1958
|
var V = N[ Q ];
|
1959
|
if ( V ) {
|
1960
|
for ( var S = 0, U = V.length; S < U; ++S ) {
|
1961
|
var P = V[ S ];
|
1962
|
if ( P && P[ this.EL ] === T && ( !M || M === P[ this.TYPE ] ) ) {
|
1963
|
R.push({ type: P[ this.TYPE ], fn: P[ this.FN ], obj: P[ this.OBJ ], adjust: P[ this.OVERRIDE ], scope: P[ this.ADJ_SCOPE ], index: S } );
|
1964
|
}
|
1965
|
}
|
1966
|
}
|
1967
|
}
|
1968
|
return ( R.length ) ? R : null;
|
1969
|
},
|
1970
|
_unload: function( T ) {
|
1971
|
var N = YAHOO.util.Event,
|
1972
|
Q, P, O, S, R,
|
1973
|
U = J.slice(),
|
1974
|
M;
|
1975
|
for ( Q = 0, S = J.length; Q < S; ++Q ) {
|
1976
|
O = U[ Q ];
|
1977
|
if ( O ) {
|
1978
|
M = window;
|
1979
|
if ( O[ N.ADJ_SCOPE ] ) {
|
1980
|
if ( O[ N.ADJ_SCOPE ] === true ) {
|
1981
|
M = O[ N.UNLOAD_OBJ ];
|
1982
|
} else {
|
1983
|
M = O[ N.ADJ_SCOPE ];
|
1984
|
}
|
1985
|
}
|
1986
|
O[ N.FN ].call( M, N.getEvent( T, O[ N.EL ] ), O[ N.UNLOAD_OBJ ] );
|
1987
|
U[ Q ] = null;
|
1988
|
}
|
1989
|
}
|
1990
|
O = null;
|
1991
|
M = null;
|
1992
|
J = null;
|
1993
|
if ( I ) {
|
1994
|
for ( P = I.length - 1; P > -1; P-- ) {
|
1995
|
O = I[ P ];
|
1996
|
if ( O ) {
|
1997
|
N.removeListener( O[ N.EL ], O[ N.TYPE ], O[ N.FN ], P );
|
1998
|
}
|
1999
|
}
|
2000
|
O = null;
|
2001
|
}
|
2002
|
G = null;
|
2003
|
N._simpleRemove( window, "unload", N._unload );
|
2004
|
},
|
2005
|
_getScrollLeft: function() {
|
2006
|
return this._getScroll()[ 1 ];
|
2007
|
},
|
2008
|
_getScrollTop: function() {
|
2009
|
return this._getScroll()[ 0 ];
|
2010
|
},
|
2011
|
_getScroll: function() {
|
2012
|
var M = document.documentElement,
|
2013
|
N = document.body; if ( M && ( M.scrollTop || M.scrollLeft ) ) {
|
2014
|
return [ M.scrollTop, M.scrollLeft ];
|
2015
|
} else {
|
2016
|
if ( N ) {
|
2017
|
return [ N.scrollTop, N.scrollLeft ];
|
2018
|
} else {
|
2019
|
return [ 0, 0 ];
|
2020
|
}
|
2021
|
}
|
2022
|
},
|
2023
|
regCE: function() {},
|
2024
|
_simpleAdd: function() {
|
2025
|
if ( window.addEventListener ) {
|
2026
|
return function( O, P, N, M ) {
|
2027
|
O.addEventListener( P, N, ( M ) );
|
2028
|
};
|
2029
|
} else {
|
2030
|
if ( window.attachEvent ) {
|
2031
|
return function( O, P, N, M ) {
|
2032
|
O.attachEvent( "on" + P, N );
|
2033
|
};
|
2034
|
} else {
|
2035
|
return function() {};
|
2036
|
}
|
2037
|
}
|
2038
|
}(), _simpleRemove: function() {
|
2039
|
if ( window.removeEventListener ) {
|
2040
|
return function( O, P, N, M ) {
|
2041
|
O.removeEventListener( P, N, ( M ) );
|
2042
|
};
|
2043
|
} else {
|
2044
|
if ( window.detachEvent ) {
|
2045
|
return function( N, O, M ) {
|
2046
|
N.detachEvent( "on" + O, M );
|
2047
|
};
|
2048
|
} else {
|
2049
|
return function() {};
|
2050
|
}
|
2051
|
}
|
2052
|
}() };
|
2053
|
}();
|
2054
|
(function() {
|
2055
|
var EU = YAHOO.util.Event;
|
2056
|
EU.on = EU.addListener;
|
2057
|
EU.onFocus = EU.addFocusListener;
|
2058
|
EU.onBlur = EU.addBlurListener;
|
2059
|
|
2060
|
if ( EU.isIE ) {
|
2061
|
YAHOO.util.Event.onDOMReady( YAHOO.util.Event._tryPreloadAttach, YAHOO.util.Event, true );
|
2062
|
var n = document.createElement( "p" );
|
2063
|
EU._dri = setInterval( function() {
|
2064
|
try {
|
2065
|
n.doScroll( "left" );
|
2066
|
clearInterval( EU._dri );
|
2067
|
EU._dri = null;
|
2068
|
EU._ready();
|
2069
|
n = null;
|
2070
|
} catch ( ex ) {}
|
2071
|
}, EU.POLL_INTERVAL );
|
2072
|
} else {
|
2073
|
if ( EU.webkit && EU.webkit < 525 ) {
|
2074
|
EU._dri = setInterval( function() {
|
2075
|
var rs = document.readyState;
|
2076
|
if ( "loaded" == rs || "complete" == rs ) {
|
2077
|
clearInterval( EU._dri );
|
2078
|
EU._dri = null;
|
2079
|
EU._ready();
|
2080
|
}
|
2081
|
}, EU.POLL_INTERVAL );
|
2082
|
} else {
|
2083
|
EU._simpleAdd( document, "DOMContentLoaded", EU._ready );
|
2084
|
}
|
2085
|
}
|
2086
|
EU._simpleAdd( window, "load", EU._load );
|
2087
|
EU._simpleAdd( window, "unload", EU._unload );
|
2088
|
EU._tryPreloadAttach();
|
2089
|
})();
|
2090
|
}
|
2091
|
YAHOO.util.EventProvider = function() {};
|
2092
|
YAHOO.util.EventProvider.prototype = {
|
2093
|
__yui_events: null, __yui_subscribers: null, subscribe: function( A, C, F, E ) {
|
2094
|
this.__yui_events = this.__yui_events || {};
|
2095
|
var D = this.__yui_events[ A ];
|
2096
|
if ( D ) {
|
2097
|
D.subscribe( C, F, E );
|
2098
|
} else {
|
2099
|
this.__yui_subscribers = this.__yui_subscribers || {};
|
2100
|
var B = this.__yui_subscribers;
|
2101
|
if ( !B[ A ] ) {
|
2102
|
B[ A ] = [];
|
2103
|
}
|
2104
|
B[ A ].push({ fn: C, obj: F, overrideContext: E } );
|
2105
|
}
|
2106
|
},
|
2107
|
unsubscribe: function( C, E, G ) {
|
2108
|
this.__yui_events = this.__yui_events || {};
|
2109
|
var A = this.__yui_events;
|
2110
|
if ( C ) {
|
2111
|
var F = A[ C ];
|
2112
|
if ( F ) {
|
2113
|
return F.unsubscribe( E, G );
|
2114
|
}
|
2115
|
} else {
|
2116
|
var B = true;
|
2117
|
for ( var D in A ) {
|
2118
|
if ( YAHOO.lang.hasOwnProperty( A, D ) ) {
|
2119
|
B = B && A[ D ].unsubscribe( E, G );
|
2120
|
}
|
2121
|
}
|
2122
|
return B;
|
2123
|
}
|
2124
|
return false;
|
2125
|
},
|
2126
|
unsubscribeAll: function( A ) {
|
2127
|
return this.unsubscribe( A );
|
2128
|
},
|
2129
|
createEvent: function( G, D ) {
|
2130
|
this.__yui_events = this.__yui_events || {};
|
2131
|
var A = D || {};
|
2132
|
var I = this.__yui_events;
|
2133
|
if ( I[ G ] ) {} else {
|
2134
|
var H = A.scope || this;
|
2135
|
var E = ( A.silent );
|
2136
|
var B = new YAHOO.util.CustomEvent( G, H, E, YAHOO.util.CustomEvent.FLAT );
|
2137
|
I[ G ] = B;
|
2138
|
if ( A.onSubscribeCallback ) {
|
2139
|
B.subscribeEvent.subscribe( A.onSubscribeCallback );
|
2140
|
}
|
2141
|
this.__yui_subscribers = this.__yui_subscribers || {};
|
2142
|
var F = this.__yui_subscribers[ G ];
|
2143
|
if ( F ) {
|
2144
|
for ( var C = 0; C < F.length; ++C ) {
|
2145
|
B.subscribe( F[ C ].fn, F[ C ].obj, F[ C ].overrideContext );
|
2146
|
}
|
2147
|
}
|
2148
|
}
|
2149
|
return I[ G ];
|
2150
|
},
|
2151
|
fireEvent: function( E, D, A, C ) {
|
2152
|
this.__yui_events = this.__yui_events || {};
|
2153
|
var G = this.__yui_events[ E ];
|
2154
|
if ( !G ) {
|
2155
|
return null;
|
2156
|
}
|
2157
|
var B = [];
|
2158
|
for ( var F = 1; F < arguments.length; ++F ) {
|
2159
|
B.push( arguments[ F ] );
|
2160
|
}
|
2161
|
return G.fire.apply( G, B );
|
2162
|
},
|
2163
|
hasEvent: function( A ) {
|
2164
|
if ( this.__yui_events ) {
|
2165
|
if ( this.__yui_events[ A ] ) {
|
2166
|
return true;
|
2167
|
}
|
2168
|
}
|
2169
|
return false;
|
2170
|
} };
|
2171
|
(function() {
|
2172
|
var A = YAHOO.util.Event,
|
2173
|
C = YAHOO.lang;
|
2174
|
YAHOO.util.KeyListener = function( D, I, E, F ) {
|
2175
|
if ( !D ) {} else {
|
2176
|
if ( !I ) {} else {
|
2177
|
if ( !E ) {}
|
2178
|
}
|
2179
|
}
|
2180
|
if ( !F ) {
|
2181
|
F = YAHOO.util.KeyListener.KEYDOWN;
|
2182
|
}
|
2183
|
var G = new YAHOO.util.CustomEvent( "keyPressed" );
|
2184
|
this.enabledEvent = new YAHOO.util.CustomEvent( "enabled" );
|
2185
|
this.disabledEvent = new YAHOO.util.CustomEvent( "disabled" );
|
2186
|
if ( C.isString( D ) ) {
|
2187
|
D = document.getElementById( D );
|
2188
|
}
|
2189
|
if ( C.isFunction( E ) ) {
|
2190
|
G.subscribe( E );
|
2191
|
} else {
|
2192
|
G.subscribe( E.fn, E.scope, E.correctScope );
|
2193
|
}
|
2194
|
function H( O, N ) {
|
2195
|
if ( !I.shift ) {
|
2196
|
I.shift = false;
|
2197
|
}
|
2198
|
if ( !I.alt ) {
|
2199
|
I.alt = false;
|
2200
|
}
|
2201
|
if ( !I.ctrl ) {
|
2202
|
I.ctrl = false;
|
2203
|
}
|
2204
|
if ( O.shiftKey == I.shift && O.altKey == I.alt && O.ctrlKey == I.ctrl ) {
|
2205
|
var J,
|
2206
|
M = I.keys,
|
2207
|
L;
|
2208
|
if ( YAHOO.lang.isArray( M ) ) {
|
2209
|
for ( var K = 0; K < M.length; K++ ) {
|
2210
|
J = M[ K ];
|
2211
|
L = A.getCharCode( O );
|
2212
|
if ( J == L ) {
|
2213
|
G.fire( L, O );
|
2214
|
break;
|
2215
|
}
|
2216
|
}
|
2217
|
} else {
|
2218
|
L = A.getCharCode( O );
|
2219
|
if ( M == L ) {
|
2220
|
G.fire( L, O );
|
2221
|
}
|
2222
|
}
|
2223
|
}
|
2224
|
}
|
2225
|
this.enable = function() {
|
2226
|
if ( !this.enabled ) {
|
2227
|
A.on( D, F, H );
|
2228
|
this.enabledEvent.fire( I );
|
2229
|
}
|
2230
|
this.enabled = true;
|
2231
|
};
|
2232
|
this.disable = function() {
|
2233
|
if ( this.enabled ) {
|
2234
|
A.removeListener( D, F, H );
|
2235
|
this.disabledEvent.fire( I );
|
2236
|
}
|
2237
|
this.enabled = false;
|
2238
|
};
|
2239
|
this.toString = function() {
|
2240
|
return "KeyListener [" + I.keys + "] " + D.tagName + ( D.id ? "[" + D.id + "]" : "" );
|
2241
|
};
|
2242
|
};
|
2243
|
var B = YAHOO.util.KeyListener;
|
2244
|
B.KEYDOWN = "keydown";
|
2245
|
B.KEYUP = "keyup";
|
2246
|
B.KEY = { ALT: 18, BACK_SPACE: 8, CAPS_LOCK: 20, CONTROL: 17, DELETE: 46, DOWN: 40, END: 35, ENTER: 13, ESCAPE: 27, HOME: 36, LEFT: 37, META: 224, NUM_LOCK: 144, PAGE_DOWN: 34, PAGE_UP: 33, PAUSE: 19, PRINTSCREEN: 44, RIGHT: 39, SCROLL_LOCK: 145, SHIFT: 16, SPACE: 32, TAB: 9, UP: 38 };
|
2247
|
})();
|
2248
|
YAHOO.register( "event", YAHOO.util.Event, { version: "2.7.0", build: "1796" } );
|
2249
|
YAHOO.register( "yahoo-dom-event", YAHOO, { version: "2.7.0", build: "1796" } );
|
2250
|
|
2251
|
|
2252
|
|
2253
|
|
2254
|
|
2255
|
|
2256
|
if ( !YAHOO.util.DragDropMgr ) {
|
2257
|
YAHOO.util.DragDropMgr = function() {
|
2258
|
var A = YAHOO.util.Event,
|
2259
|
B = YAHOO.util.Dom;
|
2260
|
return {
|
2261
|
useShim: false, _shimActive: false, _shimState: false, _debugShim: false, _createShim: function() {
|
2262
|
var C = document.createElement( "div" );
|
2263
|
C.id = "yui-ddm-shim";
|
2264
|
if ( document.body.firstChild ) {
|
2265
|
document.body.insertBefore( C, document.body.firstChild );
|
2266
|
} else {
|
2267
|
document.body.appendChild( C );
|
2268
|
}
|
2269
|
C.style.display = "none";
|
2270
|
C.style.backgroundColor = "red";
|
2271
|
C.style.position = "absolute";
|
2272
|
C.style.zIndex = "99999";
|
2273
|
B.setStyle( C, "opacity", "0" );
|
2274
|
this._shim = C;
|
2275
|
A.on( C, "mouseup", this.handleMouseUp, this, true );
|
2276
|
A.on( C, "mousemove", this.handleMouseMove, this, true );
|
2277
|
A.on( window, "scroll", this._sizeShim, this, true );
|
2278
|
},
|
2279
|
_sizeShim: function() {
|
2280
|
if ( this._shimActive ) {
|
2281
|
var C = this._shim;
|
2282
|
C.style.height = B.getDocumentHeight() + "px";
|
2283
|
C.style.width = B.getDocumentWidth() + "px";
|
2284
|
C.style.top = "0";
|
2285
|
C.style.left = "0";
|
2286
|
}
|
2287
|
},
|
2288
|
_activateShim: function() {
|
2289
|
if ( this.useShim ) {
|
2290
|
if ( !this._shim ) {
|
2291
|
this._createShim();
|
2292
|
}
|
2293
|
this._shimActive = true;
|
2294
|
var C = this._shim,
|
2295
|
D = "0";
|
2296
|
if ( this._debugShim ) {
|
2297
|
D = ".5";
|
2298
|
}
|
2299
|
B.setStyle( C, "opacity", D );
|
2300
|
this._sizeShim();
|
2301
|
C.style.display = "block";
|
2302
|
}
|
2303
|
},
|
2304
|
_deactivateShim: function() {
|
2305
|
this._shim.style.display = "none"; this._shimActive = false;
|
2306
|
},
|
2307
|
_shim: null, ids: {},
|
2308
|
handleIds: {},
|
2309
|
dragCurrent: null, dragOvers: {},
|
2310
|
deltaX: 0, deltaY: 0, preventDefault: true, stopPropagation: true, initialized: false, locked: false, interactionInfo: null, init: function() {
|
2311
|
this.initialized = true;
|
2312
|
},
|
2313
|
POINT: 0, INTERSECT: 1, STRICT_INTERSECT: 2, mode: 0, _execOnAll: function( E, D ) {
|
2314
|
for ( var F in this.ids ) {
|
2315
|
for ( var C in this.ids[ F ] ) {
|
2316
|
var G = this.ids[ F ][ C ];
|
2317
|
if ( !this.isTypeOfDD( G ) ) {
|
2318
|
continue;
|
2319
|
}
|
2320
|
G[ E ].apply( G, D );
|
2321
|
}
|
2322
|
}
|
2323
|
},
|
2324
|
_onLoad: function() {
|
2325
|
this.init();
|
2326
|
A.on( document, "mouseup", this.handleMouseUp, this, true );
|
2327
|
A.on( document, "mousemove", this.handleMouseMove, this, true );
|
2328
|
A.on( window, "unload", this._onUnload, this, true );
|
2329
|
A.on( window, "resize", this._onResize, this, true );
|
2330
|
},
|
2331
|
_onResize: function( C ) {
|
2332
|
this._execOnAll( "resetConstraints", [] );
|
2333
|
},
|
2334
|
lock: function() {
|
2335
|
this.locked = true;
|
2336
|
},
|
2337
|
unlock: function() {
|
2338
|
this.locked = false;
|
2339
|
},
|
2340
|
isLocked: function() {
|
2341
|
return this.locked;
|
2342
|
},
|
2343
|
locationCache: {},
|
2344
|
useCache: true, clickPixelThresh: 3, clickTimeThresh: 1000, dragThreshMet: false, clickTimeout: null, startX: 0, startY: 0, fromTimeout: false, regDragDrop: function( D, C ) {
|
2345
|
if ( !this.initialized ) {
|
2346
|
this.init();
|
2347
|
}
|
2348
|
if ( !this.ids[ C ] ) {
|
2349
|
this.ids[ C ] = {};
|
2350
|
}
|
2351
|
this.ids[ C ][ D.id ] = D;
|
2352
|
},
|
2353
|
removeDDFromGroup: function( E, C ) {
|
2354
|
if ( !this.ids[ C ] ) {
|
2355
|
this.ids[ C ] = {};
|
2356
|
}
|
2357
|
var D = this.ids[ C ];
|
2358
|
if ( D && D[ E.id ] ) {
|
2359
|
delete D[ E.id ];
|
2360
|
}
|
2361
|
},
|
2362
|
_remove: function( E ) {
|
2363
|
for ( var D in E.groups ) {
|
2364
|
if ( D ) {
|
2365
|
var C = this.ids[ D ];
|
2366
|
if ( C && C[ E.id ] ) {
|
2367
|
delete C[ E.id ];
|
2368
|
}
|
2369
|
}
|
2370
|
}
|
2371
|
delete this.handleIds[ E.id ];
|
2372
|
},
|
2373
|
regHandle: function( D, C ) {
|
2374
|
if ( !this.handleIds[ D ] ) {
|
2375
|
this.handleIds[ D ] = {};
|
2376
|
}
|
2377
|
this.handleIds[ D ][ C ] = C;
|
2378
|
},
|
2379
|
isDragDrop: function( C ) {
|
2380
|
return ( this.getDDById( C ) ) ? true : false;
|
2381
|
},
|
2382
|
getRelated: function( H, D ) {
|
2383
|
var G = [];
|
2384
|
for ( var F in H.groups ) {
|
2385
|
for ( var E in this.ids[ F ] ) {
|
2386
|
var C = this.ids[ F ][ E ];
|
2387
|
if ( !this.isTypeOfDD( C ) ) {
|
2388
|
continue;
|
2389
|
}
|
2390
|
if ( !D || C.isTarget ) {
|
2391
|
G[ G.length ] = C;
|
2392
|
}
|
2393
|
}
|
2394
|
}
|
2395
|
return G;
|
2396
|
},
|
2397
|
isLegalTarget: function( G, F ) {
|
2398
|
var D = this.getRelated( G, true );
|
2399
|
for ( var E = 0, C = D.length; E < C; ++E ) {
|
2400
|
if ( D[ E ].id == F.id ) {
|
2401
|
return true;
|
2402
|
}
|
2403
|
}
|
2404
|
return false;
|
2405
|
},
|
2406
|
isTypeOfDD: function( C ) {
|
2407
|
return ( C && C.__ygDragDrop );
|
2408
|
},
|
2409
|
isHandle: function( D, C ) {
|
2410
|
return ( this.handleIds[ D ] && this.handleIds[ D ][ C ] );
|
2411
|
},
|
2412
|
getDDById: function( D ) {
|
2413
|
for ( var C in this.ids ) {
|
2414
|
if ( this.ids[ C ][ D ] ) {
|
2415
|
return this.ids[ C ][ D ];
|
2416
|
}
|
2417
|
}
|
2418
|
return null;
|
2419
|
},
|
2420
|
handleMouseDown: function( E, D ) {
|
2421
|
this.currentTarget = YAHOO.util.Event.getTarget( E );
|
2422
|
this.dragCurrent = D;
|
2423
|
var C = D.getEl();
|
2424
|
this.startX = YAHOO.util.Event.getPageX( E );
|
2425
|
this.startY = YAHOO.util.Event.getPageY( E );
|
2426
|
this.deltaX = this.startX - C.offsetLeft;
|
2427
|
this.deltaY = this.startY - C.offsetTop;
|
2428
|
this.dragThreshMet = false;
|
2429
|
this.clickTimeout = setTimeout( function() {
|
2430
|
var F = YAHOO.util.DDM;
|
2431
|
F.startDrag( F.startX, F.startY );
|
2432
|
F.fromTimeout = true;
|
2433
|
}, this.clickTimeThresh );
|
2434
|
},
|
2435
|
startDrag: function( C, E ) {
|
2436
|
if ( this.dragCurrent && this.dragCurrent.useShim ) {
|
2437
|
this._shimState = this.useShim;
|
2438
|
this.useShim = true;
|
2439
|
}
|
2440
|
this._activateShim();
|
2441
|
clearTimeout( this.clickTimeout );
|
2442
|
var D = this.dragCurrent;
|
2443
|
if ( D && D.events.b4StartDrag ) {
|
2444
|
D.b4StartDrag( C, E );
|
2445
|
D.fireEvent( "b4StartDragEvent", { x: C, y: E } );
|
2446
|
}
|
2447
|
if ( D && D.events.startDrag ) {
|
2448
|
D.startDrag( C, E );
|
2449
|
D.fireEvent( "startDragEvent", { x: C, y: E } );
|
2450
|
}
|
2451
|
this.dragThreshMet = true;
|
2452
|
},
|
2453
|
handleMouseUp: function( C ) {
|
2454
|
if ( this.dragCurrent ) {
|
2455
|
clearTimeout( this.clickTimeout );
|
2456
|
if ( this.dragThreshMet ) {
|
2457
|
if ( this.fromTimeout ) {
|
2458
|
this.fromTimeout = false;
|
2459
|
this.handleMouseMove( C );
|
2460
|
}
|
2461
|
this.fromTimeout = false;
|
2462
|
this.fireEvents( C, true );
|
2463
|
} else {}
|
2464
|
this.stopDrag( C );
|
2465
|
this.stopEvent( C );
|
2466
|
}
|
2467
|
},
|
2468
|
stopEvent: function( C ) {
|
2469
|
if ( this.stopPropagation ) {
|
2470
|
YAHOO.util.Event.stopPropagation( C );
|
2471
|
}
|
2472
|
if ( this.preventDefault ) {
|
2473
|
YAHOO.util.Event.preventDefault( C );
|
2474
|
}
|
2475
|
},
|
2476
|
stopDrag: function( E, D ) {
|
2477
|
var C = this.dragCurrent; if ( C && !D ) {
|
2478
|
if ( this.dragThreshMet ) {
|
2479
|
if ( C.events.b4EndDrag ) {
|
2480
|
C.b4EndDrag( E );
|
2481
|
C.fireEvent( "b4EndDragEvent", { e: E } );
|
2482
|
}
|
2483
|
if ( C.events.endDrag ) {
|
2484
|
C.endDrag( E );
|
2485
|
C.fireEvent( "endDragEvent", { e: E } );
|
2486
|
}
|
2487
|
}
|
2488
|
if ( C.events.mouseUp ) {
|
2489
|
C.onMouseUp( E );
|
2490
|
C.fireEvent( "mouseUpEvent", { e: E } );
|
2491
|
}
|
2492
|
}
|
2493
|
if ( this._shimActive ) {
|
2494
|
this._deactivateShim();
|
2495
|
if ( this.dragCurrent && this.dragCurrent.useShim ) {
|
2496
|
this.useShim = this._shimState;
|
2497
|
this._shimState = false;
|
2498
|
}
|
2499
|
}
|
2500
|
this.dragCurrent = null;
|
2501
|
this.dragOvers = {};
|
2502
|
},
|
2503
|
handleMouseMove: function( F ) {
|
2504
|
var C = this.dragCurrent; if ( C ) {
|
2505
|
if ( YAHOO.util.Event.isIE && !F.button ) {
|
2506
|
this.stopEvent( F );
|
2507
|
return this.handleMouseUp( F );
|
2508
|
} else {
|
2509
|
if ( F.clientX < 0 || F.clientY < 0 ) {}
|
2510
|
}
|
2511
|
if ( !this.dragThreshMet ) {
|
2512
|
var E = Math.abs( this.startX - YAHOO.util.Event.getPageX( F ) );
|
2513
|
var D = Math.abs( this.startY - YAHOO.util.Event.getPageY( F ) );
|
2514
|
if ( E > this.clickPixelThresh || D > this.clickPixelThresh ) {
|
2515
|
this.startDrag( this.startX, this.startY );
|
2516
|
}
|
2517
|
}
|
2518
|
if ( this.dragThreshMet ) {
|
2519
|
if ( C && C.events.b4Drag ) {
|
2520
|
C.b4Drag( F );
|
2521
|
C.fireEvent( "b4DragEvent", { e: F } );
|
2522
|
}
|
2523
|
if ( C && C.events.drag ) {
|
2524
|
C.onDrag( F );
|
2525
|
C.fireEvent( "dragEvent", { e: F } );
|
2526
|
}
|
2527
|
if ( C ) {
|
2528
|
this.fireEvents( F, false );
|
2529
|
}
|
2530
|
}
|
2531
|
this.stopEvent( F );
|
2532
|
}
|
2533
|
},
|
2534
|
fireEvents: function( V, L ) {
|
2535
|
var a = this.dragCurrent; if ( !a || a.isLocked() || a.dragOnly ) {
|
2536
|
return;
|
2537
|
}
|
2538
|
var N = YAHOO.util.Event.getPageX( V ),
|
2539
|
M = YAHOO.util.Event.getPageY( V ),
|
2540
|
P = new YAHOO.util.Point( N, M ),
|
2541
|
K = a.getTargetCoord( P.x, P.y ),
|
2542
|
F = a.getDragEl(),
|
2543
|
E = [ "out", "over", "drop", "enter" ],
|
2544
|
U = new YAHOO.util.Region( K.y, K.x + F.offsetWidth, K.y + F.offsetHeight, K.x ),
|
2545
|
I = [],
|
2546
|
D = {},
|
2547
|
Q = [],
|
2548
|
c = { outEvts: [], overEvts: [], dropEvts: [], enterEvts: [] }; for ( var S in this.dragOvers ) {
|
2549
|
var d = this.dragOvers[ S ];
|
2550
|
if ( !this.isTypeOfDD( d ) ) {
|
2551
|
continue;
|
2552
|
}
|
2553
|
if ( !this.isOverTarget( P, d, this.mode, U ) ) {
|
2554
|
c.outEvts.push( d );
|
2555
|
}
|
2556
|
I[ S ] = true;
|
2557
|
delete this.dragOvers[ S ];
|
2558
|
}
|
2559
|
for ( var R in a.groups ) {
|
2560
|
if ( "string" != typeof R ) {
|
2561
|
continue;
|
2562
|
}
|
2563
|
for ( S in this.ids[ R ] ) {
|
2564
|
var G = this.ids[ R ][ S ];
|
2565
|
if ( !this.isTypeOfDD( G ) ) {
|
2566
|
continue;
|
2567
|
}
|
2568
|
if ( G.isTarget && !G.isLocked() && G != a ) {
|
2569
|
if ( this.isOverTarget( P, G, this.mode, U ) ) {
|
2570
|
D[ R ] = true;
|
2571
|
if ( L ) {
|
2572
|
c.dropEvts.push( G );
|
2573
|
} else {
|
2574
|
if ( !I[ G.id ] ) {
|
2575
|
c.enterEvts.push( G );
|
2576
|
} else {
|
2577
|
c.overEvts.push( G );
|
2578
|
}
|
2579
|
this.dragOvers[ G.id ] = G;
|
2580
|
}
|
2581
|
}
|
2582
|
}
|
2583
|
}
|
2584
|
}
|
2585
|
this.interactionInfo = { out: c.outEvts, enter: c.enterEvts, over: c.overEvts, drop: c.dropEvts, point: P, draggedRegion: U, sourceRegion: this.locationCache[ a.id ], validDrop: L }; for ( var C in D ) {
|
2586
|
Q.push( C );
|
2587
|
}
|
2588
|
if ( L && !c.dropEvts.length ) {
|
2589
|
this.interactionInfo.validDrop = false;
|
2590
|
if ( a.events.invalidDrop ) {
|
2591
|
a.onInvalidDrop( V );
|
2592
|
a.fireEvent( "invalidDropEvent", { e: V } );
|
2593
|
}
|
2594
|
}
|
2595
|
for ( S = 0; S < E.length; S++ ) {
|
2596
|
var Y = null;
|
2597
|
if ( c[ E[ S ] + "Evts" ] ) {
|
2598
|
Y = c[ E[ S ] + "Evts" ];
|
2599
|
}
|
2600
|
if ( Y && Y.length ) {
|
2601
|
var H = E[ S ].charAt( 0 ).toUpperCase() + E[ S ].substr( 1 ),
|
2602
|
X = "onDrag" + H,
|
2603
|
J = "b4Drag" + H,
|
2604
|
O = "drag" + H + "Event",
|
2605
|
W = "drag" + H;
|
2606
|
if ( this.mode ) {
|
2607
|
if ( a.events[ J ] ) {
|
2608
|
a[ J ]( V, Y, Q );
|
2609
|
a.fireEvent( J + "Event", { event: V, info: Y, group: Q } );
|
2610
|
}
|
2611
|
if ( a.events[ W ] ) {
|
2612
|
a[ X ]( V, Y, Q );
|
2613
|
a.fireEvent( O, { event: V, info: Y, group: Q } );
|
2614
|
}
|
2615
|
} else {
|
2616
|
for ( var Z = 0, T = Y.length; Z < T; ++Z ) {
|
2617
|
if ( a.events[ J ] ) {
|
2618
|
a[ J ]( V, Y[ Z ].id, Q[ 0 ] );
|
2619
|
a.fireEvent( J + "Event", { event: V, info: Y[ Z ].id, group: Q[ 0 ] } );
|
2620
|
}
|
2621
|
if ( a.events[ W ] ) {
|
2622
|
a[ X ]( V, Y[ Z ].id, Q[ 0 ] );
|
2623
|
a.fireEvent( O, { event: V, info: Y[ Z ].id, group: Q[ 0 ] } );
|
2624
|
}
|
2625
|
}
|
2626
|
}
|
2627
|
}
|
2628
|
}
|
2629
|
},
|
2630
|
getBestMatch: function( E ) {
|
2631
|
var G = null; var D = E.length; if ( D == 1 ) {
|
2632
|
G = E[ 0 ];
|
2633
|
} else {
|
2634
|
for ( var F = 0; F < D; ++F ) {
|
2635
|
var C = E[ F ];
|
2636
|
if ( this.mode == this.INTERSECT && C.cursorIsOver ) {
|
2637
|
G = C;
|
2638
|
break;
|
2639
|
} else {
|
2640
|
if ( !G || !G.overlap || ( C.overlap && G.overlap.getArea() < C.overlap.getArea() ) ) {
|
2641
|
G = C;
|
2642
|
}
|
2643
|
}
|
2644
|
}
|
2645
|
}
|
2646
|
return G;
|
2647
|
},
|
2648
|
refreshCache: function( D ) {
|
2649
|
var F = D || this.ids; for ( var C in F ) {
|
2650
|
if ( "string" != typeof C ) {
|
2651
|
continue;
|
2652
|
}
|
2653
|
for ( var E in this.ids[ C ] ) {
|
2654
|
var G = this.ids[ C ][ E ];
|
2655
|
if ( this.isTypeOfDD( G ) ) {
|
2656
|
var H = this.getLocation( G );
|
2657
|
if ( H ) {
|
2658
|
this.locationCache[ G.id ] = H;
|
2659
|
} else {
|
2660
|
delete this.locationCache[ G.id ];
|
2661
|
}
|
2662
|
}
|
2663
|
}
|
2664
|
}
|
2665
|
},
|
2666
|
verifyEl: function( D ) {
|
2667
|
try {
|
2668
|
if ( D ) {
|
2669
|
var C = D.offsetParent;
|
2670
|
if ( C ) {
|
2671
|
return true;
|
2672
|
}
|
2673
|
}
|
2674
|
} catch ( E ) {}
|
2675
|
return false;
|
2676
|
},
|
2677
|
getLocation: function( H ) {
|
2678
|
if ( !this.isTypeOfDD( H ) ) {
|
2679
|
return null;
|
2680
|
}
|
2681
|
var F = H.getEl(),
|
2682
|
K, E, D, M, L, N, C, J, G;
|
2683
|
try {
|
2684
|
K = YAHOO.util.Dom.getXY( F );
|
2685
|
} catch ( I ) {}
|
2686
|
if ( !K ) {
|
2687
|
return null;
|
2688
|
}
|
2689
|
E = K[ 0 ];
|
2690
|
D = E + F.offsetWidth;
|
2691
|
M = K[ 1 ];
|
2692
|
L = M + F.offsetHeight;
|
2693
|
N = M - H.padding[ 0 ];
|
2694
|
C = D + H.padding[ 1 ];
|
2695
|
J = L + H.padding[ 2 ];
|
2696
|
G = E - H.padding[ 3 ];
|
2697
|
return new YAHOO.util.Region( N, C, J, G );
|
2698
|
},
|
2699
|
isOverTarget: function( K, C, E, F ) {
|
2700
|
var G = this.locationCache[ C.id ];
|
2701
|
if ( !G || !this.useCache ) {
|
2702
|
G = this.getLocation( C );
|
2703
|
this.locationCache[ C.id ] = G;
|
2704
|
}
|
2705
|
if ( !G ) {
|
2706
|
return false;
|
2707
|
}
|
2708
|
C.cursorIsOver = G.contains( K );
|
2709
|
var J = this.dragCurrent;
|
2710
|
if ( !J || ( !E && !J.constrainX && !J.constrainY ) ) {
|
2711
|
return C.cursorIsOver;
|
2712
|
}
|
2713
|
C.overlap = null;
|
2714
|
if ( !F ) {
|
2715
|
var H = J.getTargetCoord( K.x, K.y );
|
2716
|
var D = J.getDragEl();
|
2717
|
F = new YAHOO.util.Region( H.y, H.x + D.offsetWidth, H.y + D.offsetHeight, H.x );
|
2718
|
}
|
2719
|
var I = F.intersect( G );
|
2720
|
if ( I ) {
|
2721
|
C.overlap = I;
|
2722
|
return ( E ) ? true : C.cursorIsOver;
|
2723
|
} else {
|
2724
|
return false;
|
2725
|
}
|
2726
|
},
|
2727
|
_onUnload: function( D, C ) {
|
2728
|
this.unregAll();
|
2729
|
},
|
2730
|
unregAll: function() {
|
2731
|
if ( this.dragCurrent ) {
|
2732
|
this.stopDrag();
|
2733
|
this.dragCurrent = null;
|
2734
|
}
|
2735
|
this._execOnAll( "unreg", [] );
|
2736
|
this.ids = {};
|
2737
|
},
|
2738
|
elementCache: {},
|
2739
|
getElWrapper: function( D ) {
|
2740
|
var C = this.elementCache[ D ];
|
2741
|
if ( !C || !C.el ) {
|
2742
|
C = this.elementCache[ D ] = new this.ElementWrapper( YAHOO.util.Dom.get( D ) );
|
2743
|
}
|
2744
|
return C;
|
2745
|
},
|
2746
|
getElement: function( C ) {
|
2747
|
return YAHOO.util.Dom.get( C );
|
2748
|
},
|
2749
|
getCss: function( D ) {
|
2750
|
var C = YAHOO.util.Dom.get( D );
|
2751
|
return ( C ) ? C.style : null;
|
2752
|
},
|
2753
|
ElementWrapper: function( C ) {
|
2754
|
this.el = C || null; this.id = this.el && C.id; this.css = this.el && C.style;
|
2755
|
},
|
2756
|
getPosX: function( C ) {
|
2757
|
return YAHOO.util.Dom.getX( C );
|
2758
|
},
|
2759
|
getPosY: function( C ) {
|
2760
|
return YAHOO.util.Dom.getY( C );
|
2761
|
},
|
2762
|
swapNode: function( E, C ) {
|
2763
|
if ( E.swapNode ) {
|
2764
|
E.swapNode( C );
|
2765
|
} else {
|
2766
|
var F = C.parentNode;
|
2767
|
var D = C.nextSibling;
|
2768
|
if ( D == E ) {
|
2769
|
F.insertBefore( E, C );
|
2770
|
} else {
|
2771
|
if ( C == E.nextSibling ) {
|
2772
|
F.insertBefore( C, E );
|
2773
|
} else {
|
2774
|
E.parentNode.replaceChild( C, E );
|
2775
|
F.insertBefore( E, D );
|
2776
|
}
|
2777
|
}
|
2778
|
}
|
2779
|
},
|
2780
|
getScroll: function() {
|
2781
|
var E, C,
|
2782
|
F = document.documentElement,
|
2783
|
D = document.body; if ( F && ( F.scrollTop || F.scrollLeft ) ) {
|
2784
|
E = F.scrollTop;
|
2785
|
C = F.scrollLeft;
|
2786
|
} else {
|
2787
|
if ( D ) {
|
2788
|
E = D.scrollTop;
|
2789
|
C = D.scrollLeft;
|
2790
|
} else {}
|
2791
|
}
|
2792
|
return { top: E, left: C };
|
2793
|
},
|
2794
|
getStyle: function( D, C ) {
|
2795
|
return YAHOO.util.Dom.getStyle( D, C );
|
2796
|
},
|
2797
|
getScrollTop: function() {
|
2798
|
return this.getScroll().top;
|
2799
|
},
|
2800
|
getScrollLeft: function() {
|
2801
|
return this.getScroll().left;
|
2802
|
},
|
2803
|
moveToEl: function( C, E ) {
|
2804
|
var D = YAHOO.util.Dom.getXY( E );
|
2805
|
YAHOO.util.Dom.setXY( C, D );
|
2806
|
},
|
2807
|
getClientHeight: function() {
|
2808
|
return YAHOO.util.Dom.getViewportHeight();
|
2809
|
},
|
2810
|
getClientWidth: function() {
|
2811
|
return YAHOO.util.Dom.getViewportWidth();
|
2812
|
},
|
2813
|
numericSort: function( D, C ) {
|
2814
|
return ( D - C );
|
2815
|
},
|
2816
|
_timeoutCount: 0, _addListeners: function() {
|
2817
|
var C = YAHOO.util.DDM; if ( YAHOO.util.Event && document ) {
|
2818
|
C._onLoad();
|
2819
|
} else {
|
2820
|
if ( C._timeoutCount > 2000 ) {} else {
|
2821
|
setTimeout( C._addListeners, 10 );
|
2822
|
if ( document && document.body ) {
|
2823
|
C._timeoutCount += 1;
|
2824
|
}
|
2825
|
}
|
2826
|
}
|
2827
|
},
|
2828
|
handleWasClicked: function( C, E ) {
|
2829
|
if ( this.isHandle( E, C.id ) ) {
|
2830
|
return true;
|
2831
|
} else {
|
2832
|
var D = C.parentNode;
|
2833
|
while ( D ) {
|
2834
|
if ( this.isHandle( E, D.id ) ) {
|
2835
|
return true;
|
2836
|
} else {
|
2837
|
D = D.parentNode;
|
2838
|
}
|
2839
|
}
|
2840
|
}
|
2841
|
return false;
|
2842
|
} };
|
2843
|
}();
|
2844
|
YAHOO.util.DDM = YAHOO.util.DragDropMgr;
|
2845
|
YAHOO.util.DDM._addListeners();
|
2846
|
}( function() {
|
2847
|
var A = YAHOO.util.Event;
|
2848
|
var B = YAHOO.util.Dom;
|
2849
|
YAHOO.util.DragDrop = function( E, C, D ) {
|
2850
|
if ( E ) {
|
2851
|
this.init( E, C, D );
|
2852
|
}
|
2853
|
};
|
2854
|
YAHOO.util.DragDrop.prototype = {
|
2855
|
events: null, on: function() {
|
2856
|
this.subscribe.apply( this, arguments );
|
2857
|
},
|
2858
|
id: null, config: null, dragElId: null, handleElId: null, invalidHandleTypes: null, invalidHandleIds: null, invalidHandleClasses: null, startPageX: 0, startPageY: 0, groups: null, locked: false, lock: function() {
|
2859
|
this.locked = true;
|
2860
|
},
|
2861
|
unlock: function() {
|
2862
|
this.locked = false;
|
2863
|
},
|
2864
|
isTarget: true, padding: null, dragOnly: false, useShim: false, _domRef: null, __ygDragDrop: true, constrainX: false, constrainY: false, minX: 0, maxX: 0, minY: 0, maxY: 0, deltaX: 0, deltaY: 0, maintainOffset: false, xTicks: null, yTicks: null, primaryButtonOnly: true, available: false, hasOuterHandles: false, cursorIsOver: false, overlap: null, b4StartDrag: function( C, D ) {},
|
2865
|
startDrag: function( C, D ) {},
|
2866
|
b4Drag: function( C ) {},
|
2867
|
onDrag: function( C ) {},
|
2868
|
onDragEnter: function( C, D ) {},
|
2869
|
b4DragOver: function( C ) {},
|
2870
|
onDragOver: function( C, D ) {},
|
2871
|
b4DragOut: function( C ) {},
|
2872
|
onDragOut: function( C, D ) {},
|
2873
|
b4DragDrop: function( C ) {},
|
2874
|
onDragDrop: function( C, D ) {},
|
2875
|
onInvalidDrop: function( C ) {},
|
2876
|
b4EndDrag: function( C ) {},
|
2877
|
endDrag: function( C ) {},
|
2878
|
b4MouseDown: function( C ) {},
|
2879
|
onMouseDown: function( C ) {},
|
2880
|
onMouseUp: function( C ) {},
|
2881
|
onAvailable: function() {},
|
2882
|
getEl: function() {
|
2883
|
if ( !this._domRef ) {
|
2884
|
this._domRef = B.get( this.id );
|
2885
|
}
|
2886
|
return this._domRef;
|
2887
|
},
|
2888
|
getDragEl: function() {
|
2889
|
return B.get( this.dragElId );
|
2890
|
},
|
2891
|
init: function( F, C, D ) {
|
2892
|
this.initTarget( F, C, D );
|
2893
|
A.on( this._domRef || this.id, "mousedown", this.handleMouseDown, this, true );
|
2894
|
for ( var E in this.events ) {
|
2895
|
this.createEvent( E + "Event" );
|
2896
|
}
|
2897
|
},
|
2898
|
initTarget: function( E, C, D ) {
|
2899
|
this.config = D || {};
|
2900
|
this.events = {};
|
2901
|
this.DDM = YAHOO.util.DDM;
|
2902
|
this.groups = {};
|
2903
|
if ( typeof E !== "string" ) {
|
2904
|
this._domRef = E;
|
2905
|
E = B.generateId( E );
|
2906
|
}
|
2907
|
this.id = E;
|
2908
|
this.addToGroup( ( C ) ? C : "default" );
|
2909
|
this.handleElId = E;
|
2910
|
A.onAvailable( E, this.handleOnAvailable, this, true );
|
2911
|
this.setDragElId( E );
|
2912
|
this.invalidHandleTypes = { A: "A" }; this.invalidHandleIds = {};
|
2913
|
this.invalidHandleClasses = [];
|
2914
|
this.applyConfig();
|
2915
|
},
|
2916
|
applyConfig: function() {
|
2917
|
this.events = { mouseDown: true, b4MouseDown: true, mouseUp: true, b4StartDrag: true, startDrag: true, b4EndDrag: true, endDrag: true, drag: true, b4Drag: true, invalidDrop: true, b4DragOut: true, dragOut: true, dragEnter: true, b4DragOver: true, dragOver: true, b4DragDrop: true, dragDrop: true }; if ( this.config.events ) {
|
2918
|
for ( var C in this.config.events ) {
|
2919
|
if ( this.config.events[ C ] === false ) {
|
2920
|
this.events[ C ] = false;
|
2921
|
}
|
2922
|
}
|
2923
|
}
|
2924
|
this.padding = this.config.padding || [ 0, 0, 0, 0 ];
|
2925
|
this.isTarget = ( this.config.isTarget !== false );
|
2926
|
this.maintainOffset = ( this.config.maintainOffset );
|
2927
|
this.primaryButtonOnly = ( this.config.primaryButtonOnly !== false );
|
2928
|
this.dragOnly = ( ( this.config.dragOnly === true ) ? true : false );
|
2929
|
this.useShim = ( ( this.config.useShim === true ) ? true : false );
|
2930
|
},
|
2931
|
handleOnAvailable: function() {
|
2932
|
this.available = true; this.resetConstraints();
|
2933
|
this.onAvailable();
|
2934
|
},
|
2935
|
setPadding: function( E, C, F, D ) {
|
2936
|
if ( !C && 0 !== C ) {
|
2937
|
this.padding = [ E, E, E, E ];
|
2938
|
} else {
|
2939
|
if ( !F && 0 !== F ) {
|
2940
|
this.padding = [ E, C, E, C ];
|
2941
|
} else {
|
2942
|
this.padding = [ E, C, F, D ];
|
2943
|
}
|
2944
|
}
|
2945
|
},
|
2946
|
setInitPosition: function( F, E ) {
|
2947
|
var G = this.getEl();
|
2948
|
if ( !this.DDM.verifyEl( G ) ) {
|
2949
|
if ( G && G.style && ( G.style.display == "none" ) ) {} else {}
|
2950
|
return;
|
2951
|
}
|
2952
|
var D = F || 0;
|
2953
|
var C = E || 0;
|
2954
|
var H = B.getXY( G );
|
2955
|
this.initPageX = H[ 0 ] - D;
|
2956
|
this.initPageY = H[ 1 ] - C;
|
2957
|
this.lastPageX = H[ 0 ];
|
2958
|
this.lastPageY = H[ 1 ];
|
2959
|
this.setStartPosition( H );
|
2960
|
},
|
2961
|
setStartPosition: function( D ) {
|
2962
|
var C = D || B.getXY( this.getEl() );
|
2963
|
this.deltaSetXY = null;
|
2964
|
this.startPageX = C[ 0 ];
|
2965
|
this.startPageY = C[ 1 ];
|
2966
|
},
|
2967
|
addToGroup: function( C ) {
|
2968
|
this.groups[ C ] = true;
|
2969
|
this.DDM.regDragDrop( this, C );
|
2970
|
},
|
2971
|
removeFromGroup: function( C ) {
|
2972
|
if ( this.groups[ C ] ) {
|
2973
|
delete this.groups[ C ];
|
2974
|
}
|
2975
|
this.DDM.removeDDFromGroup( this, C );
|
2976
|
},
|
2977
|
setDragElId: function( C ) {
|
2978
|
this.dragElId = C;
|
2979
|
},
|
2980
|
setHandleElId: function( C ) {
|
2981
|
if ( typeof C !== "string" ) {
|
2982
|
C = B.generateId( C );
|
2983
|
}
|
2984
|
this.handleElId = C;
|
2985
|
this.DDM.regHandle( this.id, C );
|
2986
|
},
|
2987
|
setOuterHandleElId: function( C ) {
|
2988
|
if ( typeof C !== "string" ) {
|
2989
|
C = B.generateId( C );
|
2990
|
}
|
2991
|
A.on( C, "mousedown", this.handleMouseDown, this, true );
|
2992
|
this.setHandleElId( C );
|
2993
|
this.hasOuterHandles = true;
|
2994
|
},
|
2995
|
unreg: function() {
|
2996
|
A.removeListener( this.id, "mousedown", this.handleMouseDown );
|
2997
|
this._domRef = null;
|
2998
|
this.DDM._remove( this );
|
2999
|
},
|
3000
|
isLocked: function() {
|
3001
|
return ( this.DDM.isLocked() || this.locked );
|
3002
|
},
|
3003
|
handleMouseDown: function( J, I ) {
|
3004
|
var D = J.which || J.button; if ( this.primaryButtonOnly && D > 1 ) {
|
3005
|
return;
|
3006
|
}
|
3007
|
if ( this.isLocked() ) {
|
3008
|
return;
|
3009
|
}
|
3010
|
var C = this.b4MouseDown( J ),
|
3011
|
F = true;
|
3012
|
if ( this.events.b4MouseDown ) {
|
3013
|
F = this.fireEvent( "b4MouseDownEvent", J );
|
3014
|
}
|
3015
|
var E = this.onMouseDown( J ),
|
3016
|
H = true;
|
3017
|
if ( this.events.mouseDown ) {
|
3018
|
H = this.fireEvent( "mouseDownEvent", J );
|
3019
|
}
|
3020
|
if ( ( C === false ) || ( E === false ) || ( F === false ) || ( H === false ) ) {
|
3021
|
return;
|
3022
|
}
|
3023
|
this.DDM.refreshCache( this.groups );
|
3024
|
var G = new YAHOO.util.Point( A.getPageX( J ), A.getPageY( J ) );
|
3025
|
if ( !this.hasOuterHandles && !this.DDM.isOverTarget( G, this ) ) {} else {
|
3026
|
if ( this.clickValidator( J ) ) {
|
3027
|
this.setStartPosition();
|
3028
|
this.DDM.handleMouseDown( J, this );
|
3029
|
this.DDM.stopEvent( J );
|
3030
|
} else {}
|
3031
|
}
|
3032
|
},
|
3033
|
clickValidator: function( D ) {
|
3034
|
var C = YAHOO.util.Event.getTarget( D );
|
3035
|
return ( this.isValidHandleChild( C ) && ( this.id == this.handleElId || this.DDM.handleWasClicked( C, this.id ) ) );
|
3036
|
},
|
3037
|
getTargetCoord: function( E, D ) {
|
3038
|
var C = E - this.deltaX; var F = D - this.deltaY; if ( this.constrainX ) {
|
3039
|
if ( C < this.minX ) {
|
3040
|
C = this.minX;
|
3041
|
}
|
3042
|
if ( C > this.maxX ) {
|
3043
|
C = this.maxX;
|
3044
|
}
|
3045
|
}
|
3046
|
if ( this.constrainY ) {
|
3047
|
if ( F < this.minY ) {
|
3048
|
F = this.minY;
|
3049
|
}
|
3050
|
if ( F > this.maxY ) {
|
3051
|
F = this.maxY;
|
3052
|
}
|
3053
|
}
|
3054
|
C = this.getTick( C, this.xTicks );
|
3055
|
F = this.getTick( F, this.yTicks );
|
3056
|
return { x: C, y: F };
|
3057
|
},
|
3058
|
addInvalidHandleType: function( C ) {
|
3059
|
var D = C.toUpperCase();
|
3060
|
this.invalidHandleTypes[ D ] = D;
|
3061
|
},
|
3062
|
addInvalidHandleId: function( C ) {
|
3063
|
if ( typeof C !== "string" ) {
|
3064
|
C = B.generateId( C );
|
3065
|
}
|
3066
|
this.invalidHandleIds[ C ] = C;
|
3067
|
},
|
3068
|
addInvalidHandleClass: function( C ) {
|
3069
|
this.invalidHandleClasses.push( C );
|
3070
|
},
|
3071
|
removeInvalidHandleType: function( C ) {
|
3072
|
var D = C.toUpperCase();
|
3073
|
delete this.invalidHandleTypes[ D ];
|
3074
|
},
|
3075
|
removeInvalidHandleId: function( C ) {
|
3076
|
if ( typeof C !== "string" ) {
|
3077
|
C = B.generateId( C );
|
3078
|
}
|
3079
|
delete this.invalidHandleIds[ C ];
|
3080
|
},
|
3081
|
removeInvalidHandleClass: function( D ) {
|
3082
|
for ( var E = 0, C = this.invalidHandleClasses.length; E < C; ++E ) {
|
3083
|
if ( this.invalidHandleClasses[ E ] == D ) {
|
3084
|
delete this.invalidHandleClasses[ E ];
|
3085
|
}
|
3086
|
}
|
3087
|
},
|
3088
|
isValidHandleChild: function( F ) {
|
3089
|
var E = true; var H; try {
|
3090
|
H = F.nodeName.toUpperCase();
|
3091
|
} catch ( G ) {
|
3092
|
H = F.nodeName;
|
3093
|
}
|
3094
|
E = E && !this.invalidHandleTypes[ H ];
|
3095
|
E = E && !this.invalidHandleIds[ F.id ];
|
3096
|
for ( var D = 0, C = this.invalidHandleClasses.length; E && D < C; ++D ) {
|
3097
|
E = !B.hasClass( F, this.invalidHandleClasses[ D ] );
|
3098
|
}
|
3099
|
return E;
|
3100
|
},
|
3101
|
setXTicks: function( F, C ) {
|
3102
|
this.xTicks = [];
|
3103
|
this.xTickSize = C;
|
3104
|
var E = {};
|
3105
|
for ( var D = this.initPageX; D >= this.minX; D = D - C ) {
|
3106
|
if ( !E[ D ] ) {
|
3107
|
this.xTicks[ this.xTicks.length ] = D;
|
3108
|
E[ D ] = true;
|
3109
|
}
|
3110
|
}
|
3111
|
for ( D = this.initPageX; D <= this.maxX; D = D + C ) {
|
3112
|
if ( !E[ D ] ) {
|
3113
|
this.xTicks[ this.xTicks.length ] = D;
|
3114
|
E[ D ] = true;
|
3115
|
}
|
3116
|
}
|
3117
|
this.xTicks.sort( this.DDM.numericSort );
|
3118
|
},
|
3119
|
setYTicks: function( F, C ) {
|
3120
|
this.yTicks = [];
|
3121
|
this.yTickSize = C;
|
3122
|
var E = {};
|
3123
|
for ( var D = this.initPageY; D >= this.minY; D = D - C ) {
|
3124
|
if ( !E[ D ] ) {
|
3125
|
this.yTicks[ this.yTicks.length ] = D;
|
3126
|
E[ D ] = true;
|
3127
|
}
|
3128
|
}
|
3129
|
for ( D = this.initPageY; D <= this.maxY; D = D + C ) {
|
3130
|
if ( !E[ D ] ) {
|
3131
|
this.yTicks[ this.yTicks.length ] = D;
|
3132
|
E[ D ] = true;
|
3133
|
}
|
3134
|
}
|
3135
|
this.yTicks.sort( this.DDM.numericSort );
|
3136
|
},
|
3137
|
setXConstraint: function( E, D, C ) {
|
3138
|
this.leftConstraint = parseInt( E, 10 );
|
3139
|
this.rightConstraint = parseInt( D, 10 );
|
3140
|
this.minX = this.initPageX - this.leftConstraint;
|
3141
|
this.maxX = this.initPageX + this.rightConstraint;
|
3142
|
if ( C ) {
|
3143
|
this.setXTicks( this.initPageX, C );
|
3144
|
}
|
3145
|
this.constrainX = true;
|
3146
|
},
|
3147
|
clearConstraints: function() {
|
3148
|
this.constrainX = false; this.constrainY = false; this.clearTicks();
|
3149
|
},
|
3150
|
clearTicks: function() {
|
3151
|
this.xTicks = null; this.yTicks = null; this.xTickSize = 0; this.yTickSize = 0;
|
3152
|
},
|
3153
|
setYConstraint: function( C, E, D ) {
|
3154
|
this.topConstraint = parseInt( C, 10 );
|
3155
|
this.bottomConstraint = parseInt( E, 10 );
|
3156
|
this.minY = this.initPageY - this.topConstraint;
|
3157
|
this.maxY = this.initPageY + this.bottomConstraint;
|
3158
|
if ( D ) {
|
3159
|
this.setYTicks( this.initPageY, D );
|
3160
|
}
|
3161
|
this.constrainY = true;
|
3162
|
},
|
3163
|
resetConstraints: function() {
|
3164
|
if ( this.initPageX || this.initPageX === 0 ) {
|
3165
|
var D = ( this.maintainOffset ) ? this.lastPageX - this.initPageX : 0;
|
3166
|
var C = ( this.maintainOffset ) ? this.lastPageY - this.initPageY : 0;
|
3167
|
this.setInitPosition( D, C );
|
3168
|
} else {
|
3169
|
this.setInitPosition();
|
3170
|
}
|
3171
|
if ( this.constrainX ) {
|
3172
|
this.setXConstraint( this.leftConstraint, this.rightConstraint, this.xTickSize );
|
3173
|
}
|
3174
|
if ( this.constrainY ) {
|
3175
|
this.setYConstraint( this.topConstraint, this.bottomConstraint, this.yTickSize );
|
3176
|
}
|
3177
|
},
|
3178
|
getTick: function( I, F ) {
|
3179
|
if ( !F ) {
|
3180
|
return I;
|
3181
|
} else {
|
3182
|
if ( F[ 0 ] >= I ) {
|
3183
|
return F[ 0 ];
|
3184
|
} else {
|
3185
|
for ( var D = 0, C = F.length; D < C; ++D ) {
|
3186
|
var E = D + 1;
|
3187
|
if ( F[ E ] && F[ E ] >= I ) {
|
3188
|
var H = I - F[ D ];
|
3189
|
var G = F[ E ] - I;
|
3190
|
return ( G > H ) ? F[ D ] : F[ E ];
|
3191
|
}
|
3192
|
}
|
3193
|
return F[ F.length - 1 ];
|
3194
|
}
|
3195
|
}
|
3196
|
},
|
3197
|
toString: function() {
|
3198
|
return ( "DragDrop " + this.id );
|
3199
|
} }; YAHOO.augment( YAHOO.util.DragDrop, YAHOO.util.EventProvider );
|
3200
|
})();
|
3201
|
YAHOO.util.DD = function( C, A, B ) {
|
3202
|
if ( C ) {
|
3203
|
this.init( C, A, B );
|
3204
|
}
|
3205
|
};
|
3206
|
YAHOO.extend( YAHOO.util.DD, YAHOO.util.DragDrop, {
|
3207
|
scroll: true, autoOffset: function( C, B ) {
|
3208
|
var A = C - this.startPageX; var D = B - this.startPageY; this.setDelta( A, D );
|
3209
|
},
|
3210
|
setDelta: function( B, A ) {
|
3211
|
this.deltaX = B; this.deltaY = A;
|
3212
|
},
|
3213
|
setDragElPos: function( C, B ) {
|
3214
|
var A = this.getDragEl();
|
3215
|
this.alignElWithMouse( A, C, B );
|
3216
|
},
|
3217
|
alignElWithMouse: function( C, G, F ) {
|
3218
|
var E = this.getTargetCoord( G, F );
|
3219
|
if ( !this.deltaSetXY ) {
|
3220
|
var H = [ E.x, E.y ];
|
3221
|
YAHOO.util.Dom.setXY( C, H );
|
3222
|
var D = parseInt( YAHOO.util.Dom.getStyle( C, "left" ), 10 );
|
3223
|
var B = parseInt( YAHOO.util.Dom.getStyle( C, "top" ), 10 );
|
3224
|
this.deltaSetXY = [ D - E.x, B - E.y ];
|
3225
|
} else {
|
3226
|
YAHOO.util.Dom.setStyle( C, "left", ( E.x + this.deltaSetXY[ 0 ] ) + "px" );
|
3227
|
YAHOO.util.Dom.setStyle( C, "top", ( E.y + this.deltaSetXY[ 1 ] ) + "px" );
|
3228
|
}
|
3229
|
this.cachePosition( E.x, E.y );
|
3230
|
var A = this;
|
3231
|
setTimeout( function() {
|
3232
|
A.autoScroll.call( A, E.x, E.y, C.offsetHeight, C.offsetWidth );
|
3233
|
}, 0 );
|
3234
|
},
|
3235
|
cachePosition: function( B, A ) {
|
3236
|
if ( B ) {
|
3237
|
this.lastPageX = B;
|
3238
|
this.lastPageY = A;
|
3239
|
} else {
|
3240
|
var C = YAHOO.util.Dom.getXY( this.getEl() );
|
3241
|
this.lastPageX = C[ 0 ];
|
3242
|
this.lastPageY = C[ 1 ];
|
3243
|
}
|
3244
|
},
|
3245
|
autoScroll: function( J, I, E, K ) {
|
3246
|
if ( this.scroll ) {
|
3247
|
var L = this.DDM.getClientHeight();
|
3248
|
var B = this.DDM.getClientWidth();
|
3249
|
var N = this.DDM.getScrollTop();
|
3250
|
var D = this.DDM.getScrollLeft();
|
3251
|
var H = E + I;
|
3252
|
var M = K + J;
|
3253
|
var G = ( L + N - I - this.deltaY );
|
3254
|
var F = ( B + D - J - this.deltaX );
|
3255
|
var C = 40;
|
3256
|
var A = ( document.all ) ? 80 : 30;
|
3257
|
if ( H > L && G < C ) {
|
3258
|
window.scrollTo( D, N + A );
|
3259
|
}
|
3260
|
if ( I < N && N > 0 && I - N < C ) {
|
3261
|
window.scrollTo( D, N - A );
|
3262
|
}
|
3263
|
if ( M > B && F < C ) {
|
3264
|
window.scrollTo( D + A, N );
|
3265
|
}
|
3266
|
if ( J < D && D > 0 && J - D < C ) {
|
3267
|
window.scrollTo( D - A, N );
|
3268
|
}
|
3269
|
}
|
3270
|
},
|
3271
|
applyConfig: function() {
|
3272
|
YAHOO.util.DD.superclass.applyConfig.call( this );
|
3273
|
this.scroll = ( this.config.scroll !== false );
|
3274
|
},
|
3275
|
b4MouseDown: function( A ) {
|
3276
|
this.setStartPosition();
|
3277
|
this.autoOffset( YAHOO.util.Event.getPageX( A ), YAHOO.util.Event.getPageY( A ) );
|
3278
|
},
|
3279
|
b4Drag: function( A ) {
|
3280
|
this.setDragElPos( YAHOO.util.Event.getPageX( A ), YAHOO.util.Event.getPageY( A ) );
|
3281
|
},
|
3282
|
toString: function() {
|
3283
|
return ( "DD " + this.id );
|
3284
|
} } );
|
3285
|
YAHOO.util.DDProxy = function( C, A, B ) {
|
3286
|
if ( C ) {
|
3287
|
this.init( C, A, B );
|
3288
|
this.initFrame();
|
3289
|
}
|
3290
|
};
|
3291
|
YAHOO.util.DDProxy.dragElId = "ygddfdiv";
|
3292
|
YAHOO.extend( YAHOO.util.DDProxy, YAHOO.util.DD, {
|
3293
|
resizeFrame: true, centerFrame: false, createFrame: function() {
|
3294
|
var B = this,
|
3295
|
A = document.body; if ( !A || !A.firstChild ) {
|
3296
|
setTimeout( function() {
|
3297
|
B.createFrame();
|
3298
|
}, 50 );
|
3299
|
return;
|
3300
|
}
|
3301
|
var F = this.getDragEl(),
|
3302
|
E = YAHOO.util.Dom;
|
3303
|
if ( !F ) {
|
3304
|
F = document.createElement( "div" );
|
3305
|
F.id = this.dragElId;
|
3306
|
var D = F.style;
|
3307
|
D.position = "absolute";
|
3308
|
D.visibility = "hidden";
|
3309
|
D.cursor = "move";
|
3310
|
D.border = "2px solid #aaa";
|
3311
|
D.zIndex = 999;
|
3312
|
D.height = "25px";
|
3313
|
D.width = "25px";
|
3314
|
var C = document.createElement( "div" );
|
3315
|
E.setStyle( C, "height", "100%" );
|
3316
|
E.setStyle( C, "width", "100%" );
|
3317
|
E.setStyle( C, "background-color", "#ccc" );
|
3318
|
E.setStyle( C, "opacity", "0" );
|
3319
|
F.appendChild( C );
|
3320
|
A.insertBefore( F, A.firstChild );
|
3321
|
}
|
3322
|
},
|
3323
|
initFrame: function() {
|
3324
|
this.createFrame();
|
3325
|
},
|
3326
|
applyConfig: function() {
|
3327
|
YAHOO.util.DDProxy.superclass.applyConfig.call( this );
|
3328
|
this.resizeFrame = ( this.config.resizeFrame !== false );
|
3329
|
this.centerFrame = ( this.config.centerFrame );
|
3330
|
this.setDragElId( this.config.dragElId || YAHOO.util.DDProxy.dragElId );
|
3331
|
},
|
3332
|
showFrame: function( E, D ) {
|
3333
|
var C = this.getEl();
|
3334
|
var A = this.getDragEl();
|
3335
|
var B = A.style;
|
3336
|
this._resizeProxy();
|
3337
|
if ( this.centerFrame ) {
|
3338
|
this.setDelta( Math.round( parseInt( B.width, 10 ) / 2 ), Math.round( parseInt( B.height, 10 ) / 2 ) );
|
3339
|
}
|
3340
|
this.setDragElPos( E, D );
|
3341
|
YAHOO.util.Dom.setStyle( A, "visibility", "visible" );
|
3342
|
},
|
3343
|
_resizeProxy: function() {
|
3344
|
if ( this.resizeFrame ) {
|
3345
|
var H = YAHOO.util.Dom;
|
3346
|
var B = this.getEl();
|
3347
|
var C = this.getDragEl();
|
3348
|
var G = parseInt( H.getStyle( C, "borderTopWidth" ), 10 );
|
3349
|
var I = parseInt( H.getStyle( C, "borderRightWidth" ), 10 );
|
3350
|
var F = parseInt( H.getStyle( C, "borderBottomWidth" ), 10 );
|
3351
|
var D = parseInt( H.getStyle( C, "borderLeftWidth" ), 10 );
|
3352
|
if ( isNaN( G ) ) {
|
3353
|
G = 0;
|
3354
|
}
|
3355
|
if ( isNaN( I ) ) {
|
3356
|
I = 0;
|
3357
|
}
|
3358
|
if ( isNaN( F ) ) {
|
3359
|
F = 0;
|
3360
|
}
|
3361
|
if ( isNaN( D ) ) {
|
3362
|
D = 0;
|
3363
|
}
|
3364
|
var E = Math.max( 0, B.offsetWidth - I - D );
|
3365
|
var A = Math.max( 0, B.offsetHeight - G - F );
|
3366
|
H.setStyle( C, "width", E + "px" );
|
3367
|
H.setStyle( C, "height", A + "px" );
|
3368
|
}
|
3369
|
},
|
3370
|
b4MouseDown: function( B ) {
|
3371
|
this.setStartPosition();
|
3372
|
var A = YAHOO.util.Event.getPageX( B );
|
3373
|
var C = YAHOO.util.Event.getPageY( B );
|
3374
|
this.autoOffset( A, C );
|
3375
|
},
|
3376
|
b4StartDrag: function( A, B ) {
|
3377
|
this.showFrame( A, B );
|
3378
|
},
|
3379
|
b4EndDrag: function( A ) {
|
3380
|
YAHOO.util.Dom.setStyle( this.getDragEl(), "visibility", "hidden" );
|
3381
|
},
|
3382
|
endDrag: function( D ) {
|
3383
|
var C = YAHOO.util.Dom; var B = this.getEl();
|
3384
|
var A = this.getDragEl();
|
3385
|
C.setStyle( A, "visibility", "" );
|
3386
|
C.setStyle( B, "visibility", "hidden" );
|
3387
|
YAHOO.util.DDM.moveToEl( B, A );
|
3388
|
C.setStyle( A, "visibility", "hidden" );
|
3389
|
C.setStyle( B, "visibility", "" );
|
3390
|
},
|
3391
|
toString: function() {
|
3392
|
return ( "DDProxy " + this.id );
|
3393
|
} } );
|
3394
|
YAHOO.util.DDTarget = function( C, A, B ) {
|
3395
|
if ( C ) {
|
3396
|
this.initTarget( C, A, B );
|
3397
|
}
|
3398
|
};
|
3399
|
YAHOO.extend( YAHOO.util.DDTarget, YAHOO.util.DragDrop, {
|
3400
|
toString: function() {
|
3401
|
return ( "DDTarget " + this.id );
|
3402
|
} } );
|
3403
|
YAHOO.register( "dragdrop", YAHOO.util.DragDropMgr, { version: "2.7.0", build: "1796" } );
|
3404
|
|
3405
|
|
3406
|
|
3407
|
|
3408
|
|
3409
|
( function() {
|
3410
|
var B = YAHOO.util.Dom.getXY,
|
3411
|
A = YAHOO.util.Event,
|
3412
|
D = Array.prototype.slice;
|
3413
|
|
3414
|
function C( G, E, F, H ) {
|
3415
|
C.ANIM_AVAIL = ( !YAHOO.lang.isUndefined( YAHOO.util.Anim ) );
|
3416
|
if ( G ) {
|
3417
|
this.init( G, E, true );
|
3418
|
this.initSlider( H );
|
3419
|
this.initThumb( F );
|
3420
|
}
|
3421
|
}
|
3422
|
YAHOO.lang.augmentObject( C, {
|
3423
|
getHorizSlider: function( F, G, I, H, E ) {
|
3424
|
return new C( F, F, new YAHOO.widget.SliderThumb( G, F, I, H, 0, 0, E ), "horiz" );
|
3425
|
},
|
3426
|
getVertSlider: function( G, H, E, I, F ) {
|
3427
|
return new C( G, G, new YAHOO.widget.SliderThumb( H, G, 0, 0, E, I, F ), "vert" );
|
3428
|
},
|
3429
|
getSliderRegion: function( G, H, J, I, E, K, F ) {
|
3430
|
return new C( G, G, new YAHOO.widget.SliderThumb( H, G, J, I, E, K, F ), "region" );
|
3431
|
},
|
3432
|
SOURCE_UI_EVENT: 1, SOURCE_SET_VALUE: 2, SOURCE_KEY_EVENT: 3, ANIM_AVAIL: false }, true );
|
3433
|
YAHOO.extend( C, YAHOO.util.DragDrop, {
|
3434
|
_mouseDown: false, dragOnly: true, initSlider: function( E ) {
|
3435
|
this.type = E; this.createEvent( "change", this );
|
3436
|
this.createEvent( "slideStart", this );
|
3437
|
this.createEvent( "slideEnd", this );
|
3438
|
this.isTarget = false;
|
3439
|
this.animate = C.ANIM_AVAIL;
|
3440
|
this.backgroundEnabled = true;
|
3441
|
this.tickPause = 40;
|
3442
|
this.enableKeys = true;
|
3443
|
this.keyIncrement = 20;
|
3444
|
this.moveComplete = true;
|
3445
|
this.animationDuration = 0.2;
|
3446
|
this.SOURCE_UI_EVENT = 1;
|
3447
|
this.SOURCE_SET_VALUE = 2;
|
3448
|
this.valueChangeSource = 0;
|
3449
|
this._silent = false;
|
3450
|
this.lastOffset = [ 0, 0 ];
|
3451
|
},
|
3452
|
initThumb: function( F ) {
|
3453
|
var E = this; this.thumb = F; F.cacheBetweenDrags = true; if ( F._isHoriz && F.xTicks && F.xTicks.length ) {
|
3454
|
this.tickPause = Math.round( 360 / F.xTicks.length );
|
3455
|
} else {
|
3456
|
if ( F.yTicks && F.yTicks.length ) {
|
3457
|
this.tickPause = Math.round( 360 / F.yTicks.length );
|
3458
|
}
|
3459
|
}
|
3460
|
F.onAvailable = function() {
|
3461
|
return E.setStartSliderState();
|
3462
|
};
|
3463
|
F.onMouseDown = function() {
|
3464
|
E._mouseDown = true;
|
3465
|
return E.focus();
|
3466
|
};
|
3467
|
F.startDrag = function() {
|
3468
|
E._slideStart();
|
3469
|
};
|
3470
|
F.onDrag = function() {
|
3471
|
E.fireEvents( true );
|
3472
|
};
|
3473
|
F.onMouseUp = function() {
|
3474
|
E.thumbMouseUp();
|
3475
|
};
|
3476
|
},
|
3477
|
onAvailable: function() {
|
3478
|
this._bindKeyEvents();
|
3479
|
},
|
3480
|
_bindKeyEvents: function() {
|
3481
|
A.on( this.id, "keydown", this.handleKeyDown, this, true );
|
3482
|
A.on( this.id, "keypress", this.handleKeyPress, this, true );
|
3483
|
},
|
3484
|
handleKeyPress: function( F ) {
|
3485
|
if ( this.enableKeys ) {
|
3486
|
var E = A.getCharCode( F );
|
3487
|
switch ( E ) {
|
3488
|
case 37:
|
3489
|
case 38:
|
3490
|
case 39:
|
3491
|
case 40:
|
3492
|
case 36:
|
3493
|
case 35:
|
3494
|
A.preventDefault( F );
|
3495
|
break;default:
|
3496
|
}
|
3497
|
}
|
3498
|
},
|
3499
|
handleKeyDown: function( J ) {
|
3500
|
if ( this.enableKeys ) {
|
3501
|
var G = A.getCharCode( J ),
|
3502
|
F = this.thumb,
|
3503
|
H = this.getXValue(),
|
3504
|
E = this.getYValue(),
|
3505
|
I = true;
|
3506
|
switch ( G ) {
|
3507
|
case 37:
|
3508
|
H -= this.keyIncrement;
|
3509
|
break;case 38:
|
3510
|
E -= this.keyIncrement;
|
3511
|
break;case 39:
|
3512
|
H += this.keyIncrement;
|
3513
|
break;case 40:
|
3514
|
E += this.keyIncrement;
|
3515
|
break;case 36:
|
3516
|
H = F.leftConstraint;
|
3517
|
E = F.topConstraint;
|
3518
|
break;case 35:
|
3519
|
H = F.rightConstraint;
|
3520
|
E = F.bottomConstraint;
|
3521
|
break;default:
|
3522
|
I = false;
|
3523
|
}
|
3524
|
if ( I ) {
|
3525
|
if ( F._isRegion ) {
|
3526
|
this._setRegionValue( C.SOURCE_KEY_EVENT, H, E, true );
|
3527
|
} else {
|
3528
|
this._setValue( C.SOURCE_KEY_EVENT, ( F._isHoriz ? H : E ), true );
|
3529
|
}
|
3530
|
A.stopEvent( J );
|
3531
|
}
|
3532
|
}
|
3533
|
},
|
3534
|
setStartSliderState: function() {
|
3535
|
this.setThumbCenterPoint();
|
3536
|
this.baselinePos = B( this.getEl() );
|
3537
|
this.thumb.startOffset = this.thumb.getOffsetFromParent( this.baselinePos );
|
3538
|
if ( this.thumb._isRegion ) {
|
3539
|
if ( this.deferredSetRegionValue ) {
|
3540
|
this._setRegionValue.apply( this, this.deferredSetRegionValue );
|
3541
|
this.deferredSetRegionValue = null;
|
3542
|
} else {
|
3543
|
this.setRegionValue( 0, 0, true, true, true );
|
3544
|
}
|
3545
|
} else {
|
3546
|
if ( this.deferredSetValue ) {
|
3547
|
this._setValue.apply( this, this.deferredSetValue );
|
3548
|
this.deferredSetValue = null;
|
3549
|
} else {
|
3550
|
this.setValue( 0, true, true, true );
|
3551
|
}
|
3552
|
}
|
3553
|
},
|
3554
|
setThumbCenterPoint: function() {
|
3555
|
var E = this.thumb.getEl();
|
3556
|
if ( E ) {
|
3557
|
this.thumbCenterPoint = { x: parseInt( E.offsetWidth / 2, 10 ), y: parseInt( E.offsetHeight / 2, 10 ) };
|
3558
|
}
|
3559
|
},
|
3560
|
lock: function() {
|
3561
|
this.thumb.lock();
|
3562
|
this.locked = true;
|
3563
|
},
|
3564
|
unlock: function() {
|
3565
|
this.thumb.unlock();
|
3566
|
this.locked = false;
|
3567
|
},
|
3568
|
thumbMouseUp: function() {
|
3569
|
this._mouseDown = false; if ( !this.isLocked() && !this.moveComplete ) {
|
3570
|
this.endMove();
|
3571
|
}
|
3572
|
},
|
3573
|
onMouseUp: function() {
|
3574
|
this._mouseDown = false; if ( this.backgroundEnabled && !this.isLocked() && !this.moveComplete ) {
|
3575
|
this.endMove();
|
3576
|
}
|
3577
|
},
|
3578
|
getThumb: function() {
|
3579
|
return this.thumb;
|
3580
|
},
|
3581
|
focus: function() {
|
3582
|
this.valueChangeSource = C.SOURCE_UI_EVENT; var E = this.getEl();
|
3583
|
if ( E.focus ) {
|
3584
|
try {
|
3585
|
E.focus();
|
3586
|
} catch ( F ) {}
|
3587
|
}
|
3588
|
this.verifyOffset();
|
3589
|
return !this.isLocked();
|
3590
|
},
|
3591
|
onChange: function( E, F ) {},
|
3592
|
onSlideStart: function() {},
|
3593
|
onSlideEnd: function() {},
|
3594
|
getValue: function() {
|
3595
|
return this.thumb.getValue();
|
3596
|
},
|
3597
|
getXValue: function() {
|
3598
|
return this.thumb.getXValue();
|
3599
|
},
|
3600
|
getYValue: function() {
|
3601
|
return this.thumb.getYValue();
|
3602
|
},
|
3603
|
setValue: function() {
|
3604
|
var E = D.call( arguments );
|
3605
|
E.unshift( C.SOURCE_SET_VALUE );
|
3606
|
return this._setValue.apply( this, E );
|
3607
|
},
|
3608
|
_setValue: function( I, L, G, H, E ) {
|
3609
|
var F = this.thumb,
|
3610
|
K, J; if ( !F.available ) {
|
3611
|
this.deferredSetValue = arguments;
|
3612
|
return false;
|
3613
|
}
|
3614
|
if ( this.isLocked() && !H ) {
|
3615
|
return false;
|
3616
|
}
|
3617
|
if ( isNaN( L ) ) {
|
3618
|
return false;
|
3619
|
}
|
3620
|
if ( F._isRegion ) {
|
3621
|
return false;
|
3622
|
}
|
3623
|
this._silent = E;
|
3624
|
this.valueChangeSource = I || C.SOURCE_SET_VALUE;
|
3625
|
F.lastOffset = [ L, L ];
|
3626
|
this.verifyOffset( true );
|
3627
|
this._slideStart();
|
3628
|
if ( F._isHoriz ) {
|
3629
|
K = F.initPageX + L + this.thumbCenterPoint.x;
|
3630
|
this.moveThumb( K, F.initPageY, G );
|
3631
|
} else {
|
3632
|
J = F.initPageY + L + this.thumbCenterPoint.y;
|
3633
|
this.moveThumb( F.initPageX, J, G );
|
3634
|
}
|
3635
|
return true;
|
3636
|
},
|
3637
|
setRegionValue: function() {
|
3638
|
var E = D.call( arguments );
|
3639
|
E.unshift( C.SOURCE_SET_VALUE );
|
3640
|
return this._setRegionValue.apply( this, E );
|
3641
|
},
|
3642
|
_setRegionValue: function( F, J, H, I, G, K ) {
|
3643
|
var L = this.thumb,
|
3644
|
E, M; if ( !L.available ) {
|
3645
|
this.deferredSetRegionValue = arguments;
|
3646
|
return false;
|
3647
|
}
|
3648
|
if ( this.isLocked() && !G ) {
|
3649
|
return false;
|
3650
|
}
|
3651
|
if ( isNaN( J ) ) {
|
3652
|
return false;
|
3653
|
}
|
3654
|
if ( !L._isRegion ) {
|
3655
|
return false;
|
3656
|
}
|
3657
|
this._silent = K;
|
3658
|
this.valueChangeSource = F || C.SOURCE_SET_VALUE;
|
3659
|
L.lastOffset = [ J, H ];
|
3660
|
this.verifyOffset( true );
|
3661
|
this._slideStart();
|
3662
|
E = L.initPageX + J + this.thumbCenterPoint.x;
|
3663
|
M = L.initPageY + H + this.thumbCenterPoint.y;
|
3664
|
this.moveThumb( E, M, I );
|
3665
|
return true;
|
3666
|
},
|
3667
|
verifyOffset: function( F ) {
|
3668
|
var G = B( this.getEl() ),
|
3669
|
E = this.thumb;
|
3670
|
if ( !this.thumbCenterPoint || !this.thumbCenterPoint.x ) {
|
3671
|
this.setThumbCenterPoint();
|
3672
|
}
|
3673
|
if ( G ) {
|
3674
|
if ( G[ 0 ] != this.baselinePos[ 0 ] || G[ 1 ] != this.baselinePos[ 1 ] ) {
|
3675
|
this.setInitPosition();
|
3676
|
this.baselinePos = G;
|
3677
|
E.initPageX = this.initPageX + E.startOffset[ 0 ];
|
3678
|
E.initPageY = this.initPageY + E.startOffset[ 1 ];
|
3679
|
E.deltaSetXY = null;
|
3680
|
this.resetThumbConstraints();
|
3681
|
return false;
|
3682
|
}
|
3683
|
}
|
3684
|
return true;
|
3685
|
},
|
3686
|
moveThumb: function( K, J, I, G ) {
|
3687
|
var L = this.thumb,
|
3688
|
M = this,
|
3689
|
F, E, H; if ( !L.available ) {
|
3690
|
return;
|
3691
|
}
|
3692
|
L.setDelta( this.thumbCenterPoint.x, this.thumbCenterPoint.y );
|
3693
|
E = L.getTargetCoord( K, J );
|
3694
|
F = [ Math.round( E.x ), Math.round( E.y ) ];
|
3695
|
if ( this.animate && L._graduated && !I ) {
|
3696
|
this.lock();
|
3697
|
this.curCoord = B( this.thumb.getEl() );
|
3698
|
this.curCoord = [ Math.round( this.curCoord[ 0 ] ), Math.round( this.curCoord[ 1 ] ) ];
|
3699
|
setTimeout( function() {
|
3700
|
M.moveOneTick( F );
|
3701
|
}, this.tickPause );
|
3702
|
} else {
|
3703
|
if ( this.animate && C.ANIM_AVAIL && !I ) {
|
3704
|
this.lock();
|
3705
|
H = new YAHOO.util.Motion( L.id, {
|
3706
|
points: { to: F } }, this.animationDuration, YAHOO.util.Easing.easeOut );
|
3707
|
H.onComplete.subscribe( function() {
|
3708
|
M.unlock();
|
3709
|
if ( !M._mouseDown ) {
|
3710
|
M.endMove();
|
3711
|
}
|
3712
|
});
|
3713
|
H.animate();
|
3714
|
} else {
|
3715
|
L.setDragElPos( K, J );
|
3716
|
if ( !G && !this._mouseDown ) {
|
3717
|
this.endMove();
|
3718
|
}
|
3719
|
}
|
3720
|
}
|
3721
|
},
|
3722
|
_slideStart: function() {
|
3723
|
if ( !this._sliding ) {
|
3724
|
if ( !this._silent ) {
|
3725
|
this.onSlideStart();
|
3726
|
this.fireEvent( "slideStart" );
|
3727
|
}
|
3728
|
this._sliding = true;
|
3729
|
}
|
3730
|
},
|
3731
|
_slideEnd: function() {
|
3732
|
if ( this._sliding && this.moveComplete ) {
|
3733
|
var E = this._silent;
|
3734
|
this._sliding = false;
|
3735
|
this._silent = false;
|
3736
|
this.moveComplete = false;
|
3737
|
if ( !E ) {
|
3738
|
this.onSlideEnd();
|
3739
|
this.fireEvent( "slideEnd" );
|
3740
|
}
|
3741
|
}
|
3742
|
},
|
3743
|
moveOneTick: function( F ) {
|
3744
|
var H = this.thumb,
|
3745
|
G = this,
|
3746
|
I = null,
|
3747
|
E, J; if ( H._isRegion ) {
|
3748
|
I = this._getNextX( this.curCoord, F );
|
3749
|
E = ( I !== null ) ? I[ 0 ] : this.curCoord[ 0 ];
|
3750
|
I = this._getNextY( this.curCoord, F );
|
3751
|
J = ( I !== null ) ? I[ 1 ] : this.curCoord[ 1 ];
|
3752
|
I = E !== this.curCoord[ 0 ] || J !== this.curCoord[ 1 ] ? [ E, J ] : null;
|
3753
|
} else {
|
3754
|
if ( H._isHoriz ) {
|
3755
|
I = this._getNextX( this.curCoord, F );
|
3756
|
} else {
|
3757
|
I = this._getNextY( this.curCoord, F );
|
3758
|
}
|
3759
|
}
|
3760
|
if ( I ) {
|
3761
|
this.curCoord = I;
|
3762
|
this.thumb.alignElWithMouse( H.getEl(), I[ 0 ] + this.thumbCenterPoint.x, I[ 1 ] + this.thumbCenterPoint.y );
|
3763
|
if ( !( I[ 0 ] == F[ 0 ] && I[ 1 ] == F[ 1 ] ) ) {
|
3764
|
setTimeout( function() {
|
3765
|
G.moveOneTick( F );
|
3766
|
}, this.tickPause );
|
3767
|
} else {
|
3768
|
this.unlock();
|
3769
|
if ( !this._mouseDown ) {
|
3770
|
this.endMove();
|
3771
|
}
|
3772
|
}
|
3773
|
} else {
|
3774
|
this.unlock();
|
3775
|
if ( !this._mouseDown ) {
|
3776
|
this.endMove();
|
3777
|
}
|
3778
|
}
|
3779
|
},
|
3780
|
_getNextX: function( E, F ) {
|
3781
|
var H = this.thumb,
|
3782
|
J,
|
3783
|
G = [],
|
3784
|
I = null;
|
3785
|
if ( E[ 0 ] > F[ 0 ] ) {
|
3786
|
J = H.tickSize - this.thumbCenterPoint.x;
|
3787
|
G = H.getTargetCoord( E[ 0 ] - J, E[ 1 ] );
|
3788
|
I = [ G.x, G.y ];
|
3789
|
} else {
|
3790
|
if ( E[ 0 ] < F[ 0 ] ) {
|
3791
|
J = H.tickSize + this.thumbCenterPoint.x;
|
3792
|
G = H.getTargetCoord( E[ 0 ] + J, E[ 1 ] );
|
3793
|
I = [ G.x, G.y ];
|
3794
|
} else {}
|
3795
|
}
|
3796
|
return I;
|
3797
|
},
|
3798
|
_getNextY: function( E, F ) {
|
3799
|
var H = this.thumb,
|
3800
|
J,
|
3801
|
G = [],
|
3802
|
I = null;
|
3803
|
if ( E[ 1 ] > F[ 1 ] ) {
|
3804
|
J = H.tickSize - this.thumbCenterPoint.y;
|
3805
|
G = H.getTargetCoord( E[ 0 ], E[ 1 ] - J );
|
3806
|
I = [ G.x, G.y ];
|
3807
|
} else {
|
3808
|
if ( E[ 1 ] < F[ 1 ] ) {
|
3809
|
J = H.tickSize + this.thumbCenterPoint.y;
|
3810
|
G = H.getTargetCoord( E[ 0 ], E[ 1 ] + J );
|
3811
|
I = [ G.x, G.y ];
|
3812
|
} else {}
|
3813
|
}
|
3814
|
return I;
|
3815
|
},
|
3816
|
b4MouseDown: function( E ) {
|
3817
|
if ( !this.backgroundEnabled ) {
|
3818
|
return false;
|
3819
|
}
|
3820
|
this.thumb.autoOffset();
|
3821
|
this.resetThumbConstraints();
|
3822
|
},
|
3823
|
onMouseDown: function( F ) {
|
3824
|
if ( !this.backgroundEnabled || this.isLocked() ) {
|
3825
|
return false;
|
3826
|
}
|
3827
|
this._mouseDown = true;
|
3828
|
var E = A.getPageX( F ),
|
3829
|
G = A.getPageY( F );
|
3830
|
this.focus();
|
3831
|
this._slideStart();
|
3832
|
this.moveThumb( E, G );
|
3833
|
},
|
3834
|
onDrag: function( F ) {
|
3835
|
if ( this.backgroundEnabled && !this.isLocked() ) {
|
3836
|
var E = A.getPageX( F ),
|
3837
|
G = A.getPageY( F );
|
3838
|
this.moveThumb( E, G, true, true );
|
3839
|
this.fireEvents();
|
3840
|
}
|
3841
|
},
|
3842
|
endMove: function() {
|
3843
|
this.unlock();
|
3844
|
this.fireEvents();
|
3845
|
this.moveComplete = true;
|
3846
|
this._slideEnd();
|
3847
|
},
|
3848
|
resetThumbConstraints: function() {
|
3849
|
var E = this.thumb; E.setXConstraint( E.leftConstraint, E.rightConstraint, E.xTickSize );
|
3850
|
E.setYConstraint( E.topConstraint, E.bottomConstraint, E.xTickSize );
|
3851
|
},
|
3852
|
fireEvents: function( G ) {
|
3853
|
var F = this.thumb,
|
3854
|
I, H, E; if ( !G ) {
|
3855
|
F.cachePosition();
|
3856
|
}
|
3857
|
if ( !this.isLocked() ) {
|
3858
|
if ( F._isRegion ) {
|
3859
|
I = F.getXValue();
|
3860
|
H = F.getYValue();
|
3861
|
if ( I != this.previousX || H != this.previousY ) {
|
3862
|
if ( !this._silent ) {
|
3863
|
this.onChange( I, H );
|
3864
|
this.fireEvent( "change", { x: I, y: H } );
|
3865
|
}
|
3866
|
}
|
3867
|
this.previousX = I;
|
3868
|
this.previousY = H;
|
3869
|
} else {
|
3870
|
E = F.getValue();
|
3871
|
if ( E != this.previousVal ) {
|
3872
|
if ( !this._silent ) {
|
3873
|
this.onChange( E );
|
3874
|
this.fireEvent( "change", E );
|
3875
|
}
|
3876
|
}
|
3877
|
this.previousVal = E;
|
3878
|
}
|
3879
|
}
|
3880
|
},
|
3881
|
toString: function() {
|
3882
|
return ( "Slider (" + this.type + ") " + this.id );
|
3883
|
} } );
|
3884
|
YAHOO.lang.augmentProto( C, YAHOO.util.EventProvider );
|
3885
|
YAHOO.widget.Slider = C;
|
3886
|
})();
|
3887
|
YAHOO.widget.SliderThumb = function( G, B, E, D, A, F, C ) {
|
3888
|
if ( G ) {
|
3889
|
YAHOO.widget.SliderThumb.superclass.constructor.call( this, G, B );
|
3890
|
this.parentElId = B;
|
3891
|
}
|
3892
|
this.isTarget = false;
|
3893
|
this.tickSize = C;
|
3894
|
this.maintainOffset = true;
|
3895
|
this.initSlider( E, D, A, F, C );
|
3896
|
this.scroll = false;
|
3897
|
};
|
3898
|
YAHOO.extend( YAHOO.widget.SliderThumb, YAHOO.util.DD, {
|
3899
|
startOffset: null, dragOnly: true, _isHoriz: false, _prevVal: 0, _graduated: false, getOffsetFromParent0: function( C ) {
|
3900
|
var A = YAHOO.util.Dom.getXY( this.getEl() ),
|
3901
|
B = C || YAHOO.util.Dom.getXY( this.parentElId );
|
3902
|
return [ ( A[ 0 ] - B[ 0 ] ), ( A[ 1 ] - B[ 1 ] ) ];
|
3903
|
},
|
3904
|
getOffsetFromParent: function( H ) {
|
3905
|
var A = this.getEl(),
|
3906
|
E, I, F, B, K, D, C, J, G;
|
3907
|
if ( !this.deltaOffset ) {
|
3908
|
I = YAHOO.util.Dom.getXY( A );
|
3909
|
F = H || YAHOO.util.Dom.getXY( this.parentElId );
|
3910
|
E = [ ( I[ 0 ] - F[ 0 ] ), ( I[ 1 ] - F[ 1 ] ) ];
|
3911
|
B = parseInt( YAHOO.util.Dom.getStyle( A, "left" ), 10 );
|
3912
|
K = parseInt( YAHOO.util.Dom.getStyle( A, "top" ), 10 );
|
3913
|
D = B - E[ 0 ];
|
3914
|
C = K - E[ 1 ];
|
3915
|
if ( isNaN( D ) || isNaN( C ) ) {} else {
|
3916
|
this.deltaOffset = [ D, C ];
|
3917
|
}
|
3918
|
} else {
|
3919
|
J = parseInt( YAHOO.util.Dom.getStyle( A, "left" ), 10 );
|
3920
|
G = parseInt( YAHOO.util.Dom.getStyle( A, "top" ), 10 );
|
3921
|
E = [ J + this.deltaOffset[ 0 ], G + this.deltaOffset[ 1 ] ];
|
3922
|
}
|
3923
|
return E;
|
3924
|
},
|
3925
|
initSlider: function( D, C, A, E, B ) {
|
3926
|
this.initLeft = D; this.initRight = C; this.initUp = A; this.initDown = E; this.setXConstraint( D, C, B );
|
3927
|
this.setYConstraint( A, E, B );
|
3928
|
if ( B && B > 1 ) {
|
3929
|
this._graduated = true;
|
3930
|
}
|
3931
|
this._isHoriz = ( D || C );
|
3932
|
this._isVert = ( A || E );
|
3933
|
this._isRegion = ( this._isHoriz && this._isVert );
|
3934
|
},
|
3935
|
clearTicks: function() {
|
3936
|
YAHOO.widget.SliderThumb.superclass.clearTicks.call( this );
|
3937
|
this.tickSize = 0;
|
3938
|
this._graduated = false;
|
3939
|
},
|
3940
|
getValue: function() {
|
3941
|
return ( this._isHoriz ) ? this.getXValue() : this.getYValue();
|
3942
|
},
|
3943
|
getXValue: function() {
|
3944
|
if ( !this.available ) {
|
3945
|
return 0;
|
3946
|
}
|
3947
|
var A = this.getOffsetFromParent();
|
3948
|
if ( YAHOO.lang.isNumber( A[ 0 ] ) ) {
|
3949
|
this.lastOffset = A;
|
3950
|
return ( A[ 0 ] - this.startOffset[ 0 ] );
|
3951
|
} else {
|
3952
|
return ( this.lastOffset[ 0 ] - this.startOffset[ 0 ] );
|
3953
|
}
|
3954
|
},
|
3955
|
getYValue: function() {
|
3956
|
if ( !this.available ) {
|
3957
|
return 0;
|
3958
|
}
|
3959
|
var A = this.getOffsetFromParent();
|
3960
|
if ( YAHOO.lang.isNumber( A[ 1 ] ) ) {
|
3961
|
this.lastOffset = A;
|
3962
|
return ( A[ 1 ] - this.startOffset[ 1 ] );
|
3963
|
} else {
|
3964
|
return ( this.lastOffset[ 1 ] - this.startOffset[ 1 ] );
|
3965
|
}
|
3966
|
},
|
3967
|
toString: function() {
|
3968
|
return "SliderThumb " + this.id;
|
3969
|
},
|
3970
|
onChange: function( A, B ) {} } );
|
3971
|
(function() {
|
3972
|
var A = YAHOO.util.Event,
|
3973
|
B = YAHOO.widget;
|
3974
|
|
3975
|
function C( I, F, H, D ) {
|
3976
|
var G = this,
|
3977
|
J = { min: false, max: false },
|
3978
|
E, K; this.minSlider = I; this.maxSlider = F; this.activeSlider = I; this.isHoriz = I.thumb._isHoriz; E = this.minSlider.thumb.onMouseDown; K = this.maxSlider.thumb.onMouseDown; this.minSlider.thumb.onMouseDown = function() {
|
3979
|
G.activeSlider = G.minSlider;
|
3980
|
E.apply( this, arguments );
|
3981
|
};
|
3982
|
this.maxSlider.thumb.onMouseDown = function() {
|
3983
|
G.activeSlider = G.maxSlider;
|
3984
|
K.apply( this, arguments );
|
3985
|
};
|
3986
|
this.minSlider.thumb.onAvailable = function() {
|
3987
|
I.setStartSliderState();
|
3988
|
J.min = true;
|
3989
|
if ( J.max ) {
|
3990
|
G.fireEvent( "ready", G );
|
3991
|
}
|
3992
|
};
|
3993
|
this.maxSlider.thumb.onAvailable = function() {
|
3994
|
F.setStartSliderState();
|
3995
|
J.max = true;
|
3996
|
if ( J.min ) {
|
3997
|
G.fireEvent( "ready", G );
|
3998
|
}
|
3999
|
};
|
4000
|
I.onMouseDown = F.onMouseDown = function( L ) {
|
4001
|
return this.backgroundEnabled && G._handleMouseDown( L );
|
4002
|
};
|
4003
|
I.onDrag = F.onDrag = function( L ) {
|
4004
|
G._handleDrag( L );
|
4005
|
};
|
4006
|
I.onMouseUp = F.onMouseUp = function( L ) {
|
4007
|
G._handleMouseUp( L );
|
4008
|
};
|
4009
|
I._bindKeyEvents = function() {
|
4010
|
G._bindKeyEvents( this );
|
4011
|
};
|
4012
|
F._bindKeyEvents = function() {};
|
4013
|
I.subscribe( "change", this._handleMinChange, I, this );
|
4014
|
I.subscribe( "slideStart", this._handleSlideStart, I, this );
|
4015
|
I.subscribe( "slideEnd", this._handleSlideEnd, I, this );
|
4016
|
F.subscribe( "change", this._handleMaxChange, F, this );
|
4017
|
F.subscribe( "slideStart", this._handleSlideStart, F, this );
|
4018
|
F.subscribe( "slideEnd", this._handleSlideEnd, F, this );
|
4019
|
this.createEvent( "ready", this );
|
4020
|
this.createEvent( "change", this );
|
4021
|
this.createEvent( "slideStart", this );
|
4022
|
this.createEvent( "slideEnd", this );
|
4023
|
D = YAHOO.lang.isArray( D ) ? D : [ 0, H ];
|
4024
|
D[ 0 ] = Math.min( Math.max( parseInt( D[ 0 ], 10 ) | 0, 0 ), H );
|
4025
|
D[ 1 ] = Math.max( Math.min( parseInt( D[ 1 ], 10 ) | 0, H ), 0 );
|
4026
|
if ( D[ 0 ] > D[ 1 ] ) {
|
4027
|
D.splice( 0, 2, D[ 1 ], D[ 0 ] );
|
4028
|
}
|
4029
|
this.minVal = D[ 0 ];
|
4030
|
this.maxVal = D[ 1 ];
|
4031
|
this.minSlider.setValue( this.minVal, true, true, true );
|
4032
|
this.maxSlider.setValue( this.maxVal, true, true, true );
|
4033
|
}
|
4034
|
C.prototype = {
|
4035
|
minVal: -1, maxVal: -1, minRange: 0, _handleSlideStart: function( E, D ) {
|
4036
|
this.fireEvent( "slideStart", D );
|
4037
|
},
|
4038
|
_handleSlideEnd: function( E, D ) {
|
4039
|
this.fireEvent( "slideEnd", D );
|
4040
|
},
|
4041
|
_handleDrag: function( D ) {
|
4042
|
B.Slider.prototype.onDrag.call( this.activeSlider, D );
|
4043
|
},
|
4044
|
_handleMinChange: function() {
|
4045
|
this.activeSlider = this.minSlider; this.updateValue();
|
4046
|
},
|
4047
|
_handleMaxChange: function() {
|
4048
|
this.activeSlider = this.maxSlider; this.updateValue();
|
4049
|
},
|
4050
|
_bindKeyEvents: function( D ) {
|
4051
|
A.on( D.id, "keydown", this._handleKeyDown, this, true );
|
4052
|
A.on( D.id, "keypress", this._handleKeyPress, this, true );
|
4053
|
},
|
4054
|
_handleKeyDown: function( D ) {
|
4055
|
this.activeSlider.handleKeyDown.apply( this.activeSlider, arguments );
|
4056
|
},
|
4057
|
_handleKeyPress: function( D ) {
|
4058
|
this.activeSlider.handleKeyPress.apply( this.activeSlider, arguments );
|
4059
|
},
|
4060
|
setValues: function( H, K, I, E, J ) {
|
4061
|
var F = this.minSlider,
|
4062
|
M = this.maxSlider,
|
4063
|
D = F.thumb,
|
4064
|
L = M.thumb,
|
4065
|
N = this,
|
4066
|
G = { min: false, max: false }; if ( D._isHoriz ) {
|
4067
|
D.setXConstraint( D.leftConstraint, L.rightConstraint, D.tickSize );
|
4068
|
L.setXConstraint( D.leftConstraint, L.rightConstraint, L.tickSize );
|
4069
|
} else {
|
4070
|
D.setYConstraint( D.topConstraint, L.bottomConstraint, D.tickSize );
|
4071
|
L.setYConstraint( D.topConstraint, L.bottomConstraint, L.tickSize );
|
4072
|
}
|
4073
|
this._oneTimeCallback( F, "slideEnd", function() {
|
4074
|
G.min = true;
|
4075
|
if ( G.max ) {
|
4076
|
N.updateValue( J );
|
4077
|
setTimeout( function() {
|
4078
|
N._cleanEvent( F, "slideEnd" );
|
4079
|
N._cleanEvent( M, "slideEnd" );
|
4080
|
}, 0 );
|
4081
|
}
|
4082
|
});
|
4083
|
this._oneTimeCallback( M, "slideEnd", function() {
|
4084
|
G.max = true;
|
4085
|
if ( G.min ) {
|
4086
|
N.updateValue( J );
|
4087
|
setTimeout( function() {
|
4088
|
N._cleanEvent( F, "slideEnd" );
|
4089
|
N._cleanEvent( M, "slideEnd" );
|
4090
|
}, 0 );
|
4091
|
}
|
4092
|
});
|
4093
|
F.setValue( H, I, E, false );
|
4094
|
M.setValue( K, I, E, false );
|
4095
|
},
|
4096
|
setMinValue: function( F, H, I, E ) {
|
4097
|
var G = this.minSlider,
|
4098
|
D = this; this.activeSlider = G; D = this; this._oneTimeCallback( G, "slideEnd", function() {
|
4099
|
D.updateValue( E );
|
4100
|
setTimeout( function() {
|
4101
|
D._cleanEvent( G, "slideEnd" );
|
4102
|
}, 0 );
|
4103
|
});
|
4104
|
G.setValue( F, H, I );
|
4105
|
},
|
4106
|
setMaxValue: function( D, H, I, F ) {
|
4107
|
var G = this.maxSlider,
|
4108
|
E = this; this.activeSlider = G; this._oneTimeCallback( G, "slideEnd", function() {
|
4109
|
E.updateValue( F );
|
4110
|
setTimeout( function() {
|
4111
|
E._cleanEvent( G, "slideEnd" );
|
4112
|
}, 0 );
|
4113
|
});
|
4114
|
G.setValue( D, H, I );
|
4115
|
},
|
4116
|
updateValue: function( J ) {
|
4117
|
var E = this.minSlider.getValue(),
|
4118
|
K = this.maxSlider.getValue(),
|
4119
|
F = false,
|
4120
|
D, M, H, I, L, G;
|
4121
|
if ( E != this.minVal || K != this.maxVal ) {
|
4122
|
F = true;
|
4123
|
D = this.minSlider.thumb;
|
4124
|
M = this.maxSlider.thumb;
|
4125
|
H = this.isHoriz ? "x" : "y";
|
4126
|
G = this.minSlider.thumbCenterPoint[ H ] + this.maxSlider.thumbCenterPoint[ H ];
|
4127
|
I = Math.max( K - G - this.minRange, 0 );
|
4128
|
L = Math.min( -E - G - this.minRange, 0 );
|
4129
|
if ( this.isHoriz ) {
|
4130
|
I = Math.min( I, M.rightConstraint );
|
4131
|
D.setXConstraint( D.leftConstraint, I, D.tickSize );
|
4132
|
M.setXConstraint( L, M.rightConstraint, M.tickSize );
|
4133
|
} else {
|
4134
|
I = Math.min( I, M.bottomConstraint );
|
4135
|
D.setYConstraint( D.leftConstraint, I, D.tickSize );
|
4136
|
M.setYConstraint( L, M.bottomConstraint, M.tickSize );
|
4137
|
}
|
4138
|
}
|
4139
|
this.minVal = E;
|
4140
|
this.maxVal = K;
|
4141
|
if ( F && !J ) {
|
4142
|
this.fireEvent( "change", this );
|
4143
|
}
|
4144
|
},
|
4145
|
selectActiveSlider: function( H ) {
|
4146
|
var E = this.minSlider,
|
4147
|
D = this.maxSlider,
|
4148
|
J = E.isLocked() || !E.backgroundEnabled,
|
4149
|
G = D.isLocked() || !E.backgroundEnabled,
|
4150
|
F = YAHOO.util.Event,
|
4151
|
I;
|
4152
|
if ( J || G ) {
|
4153
|
this.activeSlider = J ? D : E;
|
4154
|
} else {
|
4155
|
if ( this.isHoriz ) {
|
4156
|
I = F.getPageX( H ) - E.thumb.initPageX - E.thumbCenterPoint.x;
|
4157
|
} else {
|
4158
|
I = F.getPageY( H ) - E.thumb.initPageY - E.thumbCenterPoint.y;
|
4159
|
}
|
4160
|
this.activeSlider = I * 2 > D.getValue() + E.getValue() ? D : E;
|
4161
|
}
|
4162
|
},
|
4163
|
_handleMouseDown: function( D ) {
|
4164
|
if ( !D._handled ) {
|
4165
|
D._handled = true;
|
4166
|
this.selectActiveSlider( D );
|
4167
|
return B.Slider.prototype.onMouseDown.call( this.activeSlider, D );
|
4168
|
} else {
|
4169
|
return false;
|
4170
|
}
|
4171
|
},
|
4172
|
_handleMouseUp: function( D ) {
|
4173
|
B.Slider.prototype.onMouseUp.apply( this.activeSlider, arguments );
|
4174
|
},
|
4175
|
_oneTimeCallback: function( F, D, E ) {
|
4176
|
F.subscribe( D, function() {
|
4177
|
F.unsubscribe( D, arguments.callee );
|
4178
|
E.apply( {}, [].slice.apply( arguments ) );
|
4179
|
});
|
4180
|
},
|
4181
|
_cleanEvent: function( K, E ) {
|
4182
|
var J, I, D, G, H, F; if ( K.__yui_events && K.events[ E ] ) {
|
4183
|
for ( I = K.__yui_events.length; I >= 0; --I ) {
|
4184
|
if ( K.__yui_events[ I ].type === E ) {
|
4185
|
J = K.__yui_events[ I ];
|
4186
|
break;
|
4187
|
}
|
4188
|
}
|
4189
|
if ( J ) {
|
4190
|
H = J.subscribers;
|
4191
|
F = [];
|
4192
|
G = 0;
|
4193
|
for ( I = 0, D = H.length; I < D; ++I ) {
|
4194
|
if ( H[ I ] ) {
|
4195
|
F[ G++ ] = H[ I ];
|
4196
|
}
|
4197
|
}
|
4198
|
J.subscribers = F;
|
4199
|
}
|
4200
|
}
|
4201
|
} }; YAHOO.lang.augmentProto( C, YAHOO.util.EventProvider );
|
4202
|
B.Slider.getHorizDualSlider = function( H, J, K, G, F, D ) {
|
4203
|
var I = new B.SliderThumb( J, H, 0, G, 0, 0, F ),
|
4204
|
E = new B.SliderThumb( K, H, 0, G, 0, 0, F );
|
4205
|
return new C( new B.Slider( H, H, I, "horiz" ), new B.Slider( H, H, E, "horiz" ), G, D );
|
4206
|
};
|
4207
|
B.Slider.getVertDualSlider = function( H, J, K, G, F, D ) {
|
4208
|
var I = new B.SliderThumb( J, H, 0, 0, 0, G, F ),
|
4209
|
E = new B.SliderThumb( K, H, 0, 0, 0, G, F );
|
4210
|
return new B.DualSlider( new B.Slider( H, H, I, "vert" ), new B.Slider( H, H, E, "vert" ), G, D );
|
4211
|
};
|
4212
|
YAHOO.widget.DualSlider = C;
|
4213
|
})();
|
4214
|
YAHOO.register( "slider", YAHOO.widget.Slider, { version: "2.7.0", build: "1796" } );
|
4215
|
|
4216
|
|
4217
|
|
4218
|
|
4219
|
|
4220
|
|
4221
|
YAHOO.util.Attribute = function( B, A ) {
|
4222
|
if ( A ) {
|
4223
|
this.owner = A;
|
4224
|
this.configure( B, true );
|
4225
|
}
|
4226
|
};
|
4227
|
YAHOO.util.Attribute.prototype = {
|
4228
|
name: undefined, value: null, owner: null, readOnly: false, writeOnce: false, _initialConfig: null, _written: false, method: null, setter: null, getter: null, validator: null, getValue: function() {
|
4229
|
var A = this.value; if ( this.getter ) {
|
4230
|
A = this.getter.call( this.owner, this.name );
|
4231
|
}
|
4232
|
return A;
|
4233
|
},
|
4234
|
setValue: function( F, B ) {
|
4235
|
var E,
|
4236
|
A = this.owner,
|
4237
|
C = this.name; var D = { type: C, prevValue: this.getValue(), newValue: F }; if ( this.readOnly || ( this.writeOnce && this._written ) ) {
|
4238
|
return false;
|
4239
|
}
|
4240
|
if ( this.validator && !this.validator.call( A, F ) ) {
|
4241
|
return false;
|
4242
|
}
|
4243
|
if ( !B ) {
|
4244
|
E = A.fireBeforeChangeEvent( D );
|
4245
|
if ( E === false ) {
|
4246
|
return false;
|
4247
|
}
|
4248
|
}
|
4249
|
if ( this.setter ) {
|
4250
|
F = this.setter.call( A, F, this.name );
|
4251
|
if ( F === undefined ) {}
|
4252
|
}
|
4253
|
if ( this.method ) {
|
4254
|
this.method.call( A, F, this.name );
|
4255
|
}
|
4256
|
this.value = F;
|
4257
|
this._written = true;
|
4258
|
D.type = C;
|
4259
|
if ( !B ) {
|
4260
|
this.owner.fireChangeEvent( D );
|
4261
|
}
|
4262
|
return true;
|
4263
|
},
|
4264
|
configure: function( B, C ) {
|
4265
|
B = B || {};
|
4266
|
if ( C ) {
|
4267
|
this._written = false;
|
4268
|
}
|
4269
|
this._initialConfig = this._initialConfig || {};
|
4270
|
for ( var A in B ) {
|
4271
|
if ( B.hasOwnProperty( A ) ) {
|
4272
|
this[ A ] = B[ A ];
|
4273
|
if ( C ) {
|
4274
|
this._initialConfig[ A ] = B[ A ];
|
4275
|
}
|
4276
|
}
|
4277
|
}
|
4278
|
},
|
4279
|
resetValue: function() {
|
4280
|
return this.setValue( this._initialConfig.value );
|
4281
|
},
|
4282
|
resetConfig: function() {
|
4283
|
this.configure( this._initialConfig, true );
|
4284
|
},
|
4285
|
refresh: function( A ) {
|
4286
|
this.setValue( this.value, A );
|
4287
|
} };
|
4288
|
(function() {
|
4289
|
var A = YAHOO.util.Lang;
|
4290
|
YAHOO.util.AttributeProvider = function() {};
|
4291
|
YAHOO.util.AttributeProvider.prototype = {
|
4292
|
_configs: null, get: function( C ) {
|
4293
|
this._configs = this._configs || {};
|
4294
|
var B = this._configs[ C ];
|
4295
|
if ( !B || !this._configs.hasOwnProperty( C ) ) {
|
4296
|
return null;
|
4297
|
}
|
4298
|
return B.getValue();
|
4299
|
},
|
4300
|
set: function( D, E, B ) {
|
4301
|
this._configs = this._configs || {};
|
4302
|
var C = this._configs[ D ];
|
4303
|
if ( !C ) {
|
4304
|
return false;
|
4305
|
}
|
4306
|
return C.setValue( E, B );
|
4307
|
},
|
4308
|
getAttributeKeys: function() {
|
4309
|
this._configs = this._configs; var C = [],
|
4310
|
B;
|
4311
|
for ( B in this._configs ) {
|
4312
|
if ( A.hasOwnProperty( this._configs, B ) && !A.isUndefined( this._configs[ B ] ) ) {
|
4313
|
C[ C.length ] = B;
|
4314
|
}
|
4315
|
}
|
4316
|
return C;
|
4317
|
},
|
4318
|
setAttributes: function( D, B ) {
|
4319
|
for ( var C in D ) {
|
4320
|
if ( A.hasOwnProperty( D, C ) ) {
|
4321
|
this.set( C, D[ C ], B );
|
4322
|
}
|
4323
|
}
|
4324
|
},
|
4325
|
resetValue: function( C, B ) {
|
4326
|
this._configs = this._configs || {};
|
4327
|
if ( this._configs[ C ] ) {
|
4328
|
this.set( C, this._configs[ C ]._initialConfig.value, B );
|
4329
|
return true;
|
4330
|
}
|
4331
|
return false;
|
4332
|
},
|
4333
|
refresh: function( E, C ) {
|
4334
|
this._configs = this._configs || {};
|
4335
|
var F = this._configs;
|
4336
|
E = ( ( A.isString( E ) ) ? [ E ] : E ) || this.getAttributeKeys();
|
4337
|
for ( var D = 0, B = E.length; D < B; ++D ) {
|
4338
|
if ( F.hasOwnProperty( E[ D ] ) ) {
|
4339
|
this._configs[ E[ D ] ].refresh( C );
|
4340
|
}
|
4341
|
}
|
4342
|
},
|
4343
|
register: function( B, C ) {
|
4344
|
this.setAttributeConfig( B, C );
|
4345
|
},
|
4346
|
getAttributeConfig: function( C ) {
|
4347
|
this._configs = this._configs || {};
|
4348
|
var B = this._configs[ C ] || {};
|
4349
|
var D = {};
|
4350
|
for ( C in B ) {
|
4351
|
if ( A.hasOwnProperty( B, C ) ) {
|
4352
|
D[ C ] = B[ C ];
|
4353
|
}
|
4354
|
}
|
4355
|
return D;
|
4356
|
},
|
4357
|
setAttributeConfig: function( B, C, D ) {
|
4358
|
this._configs = this._configs || {};
|
4359
|
C = C || {};
|
4360
|
if ( !this._configs[ B ] ) {
|
4361
|
C.name = B;
|
4362
|
this._configs[ B ] = this.createAttribute( C );
|
4363
|
} else {
|
4364
|
this._configs[ B ].configure( C, D );
|
4365
|
}
|
4366
|
},
|
4367
|
configureAttribute: function( B, C, D ) {
|
4368
|
this.setAttributeConfig( B, C, D );
|
4369
|
},
|
4370
|
resetAttributeConfig: function( B ) {
|
4371
|
this._configs = this._configs || {};
|
4372
|
this._configs[ B ].resetConfig();
|
4373
|
},
|
4374
|
subscribe: function( B, C ) {
|
4375
|
this._events = this._events || {};
|
4376
|
if ( !( B in this._events ) ) {
|
4377
|
this._events[ B ] = this.createEvent( B );
|
4378
|
}
|
4379
|
YAHOO.util.EventProvider.prototype.subscribe.apply( this, arguments );
|
4380
|
},
|
4381
|
on: function() {
|
4382
|
this.subscribe.apply( this, arguments );
|
4383
|
},
|
4384
|
addListener: function() {
|
4385
|
this.subscribe.apply( this, arguments );
|
4386
|
},
|
4387
|
fireBeforeChangeEvent: function( C ) {
|
4388
|
var B = "before"; B += C.type.charAt( 0 ).toUpperCase() + C.type.substr( 1 ) + "Change";
|
4389
|
C.type = B;
|
4390
|
return this.fireEvent( C.type, C );
|
4391
|
},
|
4392
|
fireChangeEvent: function( B ) {
|
4393
|
B.type += "Change"; return this.fireEvent( B.type, B );
|
4394
|
},
|
4395
|
createAttribute: function( B ) {
|
4396
|
return new YAHOO.util.Attribute( B, this );
|
4397
|
} }; YAHOO.augment( YAHOO.util.AttributeProvider, YAHOO.util.EventProvider );
|
4398
|
})();
|
4399
|
(function() {
|
4400
|
var B = YAHOO.util.Dom,
|
4401
|
C = YAHOO.util.AttributeProvider;
|
4402
|
var A = function( D, E ) {
|
4403
|
this.init.apply( this, arguments );
|
4404
|
};
|
4405
|
A.DOM_EVENTS = { "click": true, "dblclick": true, "keydown": true, "keypress": true, "keyup": true, "mousedown": true, "mousemove": true, "mouseout": true, "mouseover": true, "mouseup": true, "focus": true, "blur": true, "submit": true, "change": true }; A.prototype = {
|
4406
|
DOM_EVENTS: null, DEFAULT_HTML_SETTER: function( F, D ) {
|
4407
|
var E = this.get( "element" );
|
4408
|
if ( E ) {
|
4409
|
E[ D ] = F;
|
4410
|
}
|
4411
|
},
|
4412
|
DEFAULT_HTML_GETTER: function( D ) {
|
4413
|
var E = this.get( "element" ),
|
4414
|
F;
|
4415
|
if ( E ) {
|
4416
|
F = E[ D ];
|
4417
|
}
|
4418
|
return F;
|
4419
|
},
|
4420
|
appendChild: function( D ) {
|
4421
|
D = D.get ? D.get( "element" ) : D;
|
4422
|
return this.get( "element" ).appendChild( D );
|
4423
|
},
|
4424
|
getElementsByTagName: function( D ) {
|
4425
|
return this.get( "element" ).getElementsByTagName( D );
|
4426
|
},
|
4427
|
hasChildNodes: function() {
|
4428
|
return this.get( "element" ).hasChildNodes();
|
4429
|
},
|
4430
|
insertBefore: function( D, E ) {
|
4431
|
D = D.get ? D.get( "element" ) : D;
|
4432
|
E = ( E && E.get ) ? E.get( "element" ) : E;
|
4433
|
return this.get( "element" ).insertBefore( D, E );
|
4434
|
},
|
4435
|
removeChild: function( D ) {
|
4436
|
D = D.get ? D.get( "element" ) : D;
|
4437
|
return this.get( "element" ).removeChild( D );
|
4438
|
},
|
4439
|
replaceChild: function( D, E ) {
|
4440
|
D = D.get ? D.get( "element" ) : D;
|
4441
|
E = E.get ? E.get( "element" ) : E;
|
4442
|
return this.get( "element" ).replaceChild( D, E );
|
4443
|
},
|
4444
|
initAttributes: function( D ) {},
|
4445
|
addListener: function( H, G, I, F ) {
|
4446
|
var E = this.get( "element" ) || this.get( "id" );
|
4447
|
F = F || this;
|
4448
|
var D = this;
|
4449
|
if ( !this._events[ H ] ) {
|
4450
|
if ( E && this.DOM_EVENTS[ H ] ) {
|
4451
|
YAHOO.util.Event.addListener( E, H, function( J ) {
|
4452
|
if ( J.srcElement && !J.target ) {
|
4453
|
J.target = J.srcElement;
|
4454
|
}
|
4455
|
D.fireEvent( H, J );
|
4456
|
}, I, F );
|
4457
|
}
|
4458
|
this.createEvent( H, this );
|
4459
|
}
|
4460
|
return YAHOO.util.EventProvider.prototype.subscribe.apply( this, arguments );
|
4461
|
},
|
4462
|
on: function() {
|
4463
|
return this.addListener.apply( this, arguments );
|
4464
|
},
|
4465
|
subscribe: function() {
|
4466
|
return this.addListener.apply( this, arguments );
|
4467
|
},
|
4468
|
removeListener: function( E, D ) {
|
4469
|
return this.unsubscribe.apply( this, arguments );
|
4470
|
},
|
4471
|
addClass: function( D ) {
|
4472
|
B.addClass( this.get( "element" ), D );
|
4473
|
},
|
4474
|
getElementsByClassName: function( E, D ) {
|
4475
|
return B.getElementsByClassName( E, D, this.get( "element" ) );
|
4476
|
},
|
4477
|
hasClass: function( D ) {
|
4478
|
return B.hasClass( this.get( "element" ), D );
|
4479
|
},
|
4480
|
removeClass: function( D ) {
|
4481
|
return B.removeClass( this.get( "element" ), D );
|
4482
|
},
|
4483
|
replaceClass: function( E, D ) {
|
4484
|
return B.replaceClass( this.get( "element" ), E, D );
|
4485
|
},
|
4486
|
setStyle: function( E, D ) {
|
4487
|
return B.setStyle( this.get( "element" ), E, D );
|
4488
|
},
|
4489
|
getStyle: function( D ) {
|
4490
|
return B.getStyle( this.get( "element" ), D );
|
4491
|
},
|
4492
|
fireQueue: function() {
|
4493
|
var E = this._queue; for ( var F = 0, D = E.length; F < D; ++F ) {
|
4494
|
this[ E[ F ][ 0 ] ].apply( this, E[ F ][ 1 ] );
|
4495
|
}
|
4496
|
},
|
4497
|
appendTo: function( E, F ) {
|
4498
|
E = ( E.get ) ? E.get( "element" ) : B.get( E );
|
4499
|
this.fireEvent( "beforeAppendTo", { type: "beforeAppendTo", target: E } );
|
4500
|
F = ( F && F.get ) ? F.get( "element" ) : B.get( F );
|
4501
|
var D = this.get( "element" );
|
4502
|
if ( !D ) {
|
4503
|
return false;
|
4504
|
}
|
4505
|
if ( !E ) {
|
4506
|
return false;
|
4507
|
}
|
4508
|
if ( D.parent != E ) {
|
4509
|
if ( F ) {
|
4510
|
E.insertBefore( D, F );
|
4511
|
} else {
|
4512
|
E.appendChild( D );
|
4513
|
}
|
4514
|
}
|
4515
|
this.fireEvent( "appendTo", { type: "appendTo", target: E } );
|
4516
|
return D;
|
4517
|
},
|
4518
|
get: function( D ) {
|
4519
|
var F = this._configs || {},
|
4520
|
E = F.element;
|
4521
|
if ( E && !F[ D ] && !YAHOO.lang.isUndefined( E.value[ D ] ) ) {
|
4522
|
this._setHTMLAttrConfig( D );
|
4523
|
}
|
4524
|
return C.prototype.get.call( this, D );
|
4525
|
},
|
4526
|
setAttributes: function( J, G ) {
|
4527
|
var E = {},
|
4528
|
H = this._configOrder;
|
4529
|
for ( var I = 0, D = H.length; I < D; ++I ) {
|
4530
|
if ( J[ H[ I ] ] !== undefined ) {
|
4531
|
E[ H[ I ] ] = true;
|
4532
|
this.set( H[ I ], J[ H[ I ] ], G );
|
4533
|
}
|
4534
|
}
|
4535
|
for ( var F in J ) {
|
4536
|
if ( J.hasOwnProperty( F ) && !E[ F ] ) {
|
4537
|
this.set( F, J[ F ], G );
|
4538
|
}
|
4539
|
}
|
4540
|
},
|
4541
|
set: function( E, G, D ) {
|
4542
|
var F = this.get( "element" );
|
4543
|
if ( !F ) {
|
4544
|
this._queue[ this._queue.length ] = [ "set", arguments ];
|
4545
|
if ( this._configs[ E ] ) {
|
4546
|
this._configs[ E ].value = G;
|
4547
|
}
|
4548
|
return;
|
4549
|
}
|
4550
|
if ( !this._configs[ E ] && !YAHOO.lang.isUndefined( F[ E ] ) ) {
|
4551
|
this._setHTMLAttrConfig( E );
|
4552
|
}
|
4553
|
return C.prototype.set.apply( this, arguments );
|
4554
|
},
|
4555
|
setAttributeConfig: function( D, E, F ) {
|
4556
|
this._configOrder.push( D );
|
4557
|
C.prototype.setAttributeConfig.apply( this, arguments );
|
4558
|
},
|
4559
|
createEvent: function( E, D ) {
|
4560
|
this._events[ E ] = true;
|
4561
|
return C.prototype.createEvent.apply( this, arguments );
|
4562
|
},
|
4563
|
init: function( E, D ) {
|
4564
|
this._initElement( E, D );
|
4565
|
},
|
4566
|
destroy: function() {
|
4567
|
var D = this.get( "element" );
|
4568
|
YAHOO.util.Event.purgeElement( D, true );
|
4569
|
this.unsubscribeAll();
|
4570
|
if ( D && D.parentNode ) {
|
4571
|
D.parentNode.removeChild( D );
|
4572
|
}
|
4573
|
this._queue = [];
|
4574
|
this._events = {};
|
4575
|
this._configs = {};
|
4576
|
this._configOrder = [];
|
4577
|
},
|
4578
|
_initElement: function( F, E ) {
|
4579
|
this._queue = this._queue || [];
|
4580
|
this._events = this._events || {};
|
4581
|
this._configs = this._configs || {};
|
4582
|
this._configOrder = [];
|
4583
|
E = E || {};
|
4584
|
E.element = E.element || F || null;
|
4585
|
var H = false;
|
4586
|
var D = A.DOM_EVENTS;
|
4587
|
this.DOM_EVENTS = this.DOM_EVENTS || {};
|
4588
|
for ( var G in D ) {
|
4589
|
if ( D.hasOwnProperty( G ) ) {
|
4590
|
this.DOM_EVENTS[ G ] = D[ G ];
|
4591
|
}
|
4592
|
}
|
4593
|
if ( typeof E.element === "string" ) {
|
4594
|
this._setHTMLAttrConfig( "id", { value: E.element } );
|
4595
|
}
|
4596
|
if ( B.get( E.element ) ) {
|
4597
|
H = true;
|
4598
|
this._initHTMLElement( E );
|
4599
|
this._initContent( E );
|
4600
|
}
|
4601
|
YAHOO.util.Event.onAvailable( E.element, function() {
|
4602
|
if ( !H ) {
|
4603
|
this._initHTMLElement( E );
|
4604
|
}
|
4605
|
this.fireEvent( "available", { type: "available", target: B.get( E.element ) } );
|
4606
|
}, this, true );
|
4607
|
YAHOO.util.Event.onContentReady( E.element, function() {
|
4608
|
if ( !H ) {
|
4609
|
this._initContent( E );
|
4610
|
}
|
4611
|
this.fireEvent( "contentReady", { type: "contentReady", target: B.get( E.element ) } );
|
4612
|
}, this, true );
|
4613
|
},
|
4614
|
_initHTMLElement: function( D ) {
|
4615
|
this.setAttributeConfig( "element", { value: B.get( D.element ), readOnly: true } );
|
4616
|
},
|
4617
|
_initContent: function( D ) {
|
4618
|
this.initAttributes( D );
|
4619
|
this.setAttributes( D, true );
|
4620
|
this.fireQueue();
|
4621
|
},
|
4622
|
_setHTMLAttrConfig: function( D, F ) {
|
4623
|
var E = this.get( "element" );
|
4624
|
F = F || {};
|
4625
|
F.name = D;
|
4626
|
F.setter = F.setter || this.DEFAULT_HTML_SETTER;
|
4627
|
F.getter = F.getter || this.DEFAULT_HTML_GETTER;
|
4628
|
F.value = F.value || E[ D ];
|
4629
|
this._configs[ D ] = new YAHOO.util.Attribute( F, this );
|
4630
|
} }; YAHOO.augment( A, C );
|
4631
|
YAHOO.util.Element = A;
|
4632
|
})();
|
4633
|
YAHOO.register( "element", YAHOO.util.Element, { version: "2.7.0", build: "1796" } );
|
4634
|
|
4635
|
|
4636
|
|
4637
|
|
4638
|
|
4639
|
|
4640
|
YAHOO.util.Color = function() {
|
4641
|
var A = "0",
|
4642
|
B = YAHOO.lang.isArray,
|
4643
|
C = YAHOO.lang.isNumber;
|
4644
|
return {
|
4645
|
real2dec: function( D ) {
|
4646
|
return Math.min( 255, Math.round( D * 256 ) );
|
4647
|
},
|
4648
|
hsv2rgb: function( H, O, M ) {
|
4649
|
if ( B( H ) ) {
|
4650
|
return this.hsv2rgb.call( this, H[ 0 ], H[ 1 ], H[ 2 ] );
|
4651
|
}
|
4652
|
var D, I, L,
|
4653
|
G = Math.floor( ( H / 60 ) % 6 ),
|
4654
|
J = ( H / 60 ) - G,
|
4655
|
F = M * ( 1 - O ),
|
4656
|
E = M * ( 1 - J * O ),
|
4657
|
N = M * ( 1 - ( 1 - J ) * O ),
|
4658
|
K;
|
4659
|
switch ( G ) {
|
4660
|
case 0:
|
4661
|
D = M;
|
4662
|
I = N;
|
4663
|
L = F;
|
4664
|
break;case 1:
|
4665
|
D = E;
|
4666
|
I = M;
|
4667
|
L = F;
|
4668
|
break;case 2:
|
4669
|
D = F;
|
4670
|
I = M;
|
4671
|
L = N;
|
4672
|
break;case 3:
|
4673
|
D = F;
|
4674
|
I = E;
|
4675
|
L = M;
|
4676
|
break;case 4:
|
4677
|
D = N;
|
4678
|
I = F;
|
4679
|
L = M;
|
4680
|
break;case 5:
|
4681
|
D = M;
|
4682
|
I = F;
|
4683
|
L = E;
|
4684
|
break;
|
4685
|
}
|
4686
|
K = this.real2dec;
|
4687
|
return [ K( D ), K( I ), K( L ) ];
|
4688
|
},
|
4689
|
rgb2hsv: function( D, H, I ) {
|
4690
|
if ( B( D ) ) {
|
4691
|
return this.rgb2hsv.apply( this, D );
|
4692
|
}
|
4693
|
D /= 255;
|
4694
|
H /= 255;
|
4695
|
I /= 255;
|
4696
|
var G, L,
|
4697
|
E = Math.min( Math.min( D, H ), I ),
|
4698
|
J = Math.max( Math.max( D, H ), I ),
|
4699
|
K = J - E,
|
4700
|
F;
|
4701
|
switch ( J ) {
|
4702
|
case E:
|
4703
|
G = 0;
|
4704
|
break;case D:
|
4705
|
G = 60 * ( H - I ) / K;
|
4706
|
if ( H < I ) {
|
4707
|
G += 360;
|
4708
|
}
|
4709
|
break;case H:
|
4710
|
G = ( 60 * ( I - D ) / K ) + 120;
|
4711
|
break;case I:
|
4712
|
G = ( 60 * ( D - H ) / K ) + 240;
|
4713
|
break;
|
4714
|
}
|
4715
|
L = ( J === 0 ) ? 0 : 1 - ( E / J );
|
4716
|
F = [ Math.round( G ), L, J ];
|
4717
|
return F;
|
4718
|
},
|
4719
|
rgb2hex: function( F, E, D ) {
|
4720
|
if ( B( F ) ) {
|
4721
|
return this.rgb2hex.apply( this, F );
|
4722
|
}
|
4723
|
var G = this.dec2hex;
|
4724
|
return G( F ) + G( E ) + G( D );
|
4725
|
},
|
4726
|
dec2hex: function( D ) {
|
4727
|
D = parseInt( D, 10 ) | 0;
|
4728
|
D = ( D > 255 || D < 0 ) ? 0 : D;
|
4729
|
return ( A + D.toString( 16 ) ).slice( -2 ).toUpperCase();
|
4730
|
},
|
4731
|
hex2dec: function( D ) {
|
4732
|
return parseInt( D, 16 );
|
4733
|
},
|
4734
|
hex2rgb: function( D ) {
|
4735
|
var E = this.hex2dec; return [ E( D.slice( 0, 2 ) ), E( D.slice( 2, 4 ) ), E( D.slice( 4, 6 ) ) ];
|
4736
|
},
|
4737
|
websafe: function( F, E, D ) {
|
4738
|
if ( B( F ) ) {
|
4739
|
return this.websafe.apply( this, F );
|
4740
|
}
|
4741
|
var G = function( H ) {
|
4742
|
if ( C( H ) ) {
|
4743
|
H = Math.min( Math.max( 0, H ), 255 );
|
4744
|
var I, J;
|
4745
|
for ( I = 0; I < 256; I = I + 51 ) {
|
4746
|
J = I + 51;
|
4747
|
if ( H >= I && H <= J ) {
|
4748
|
return ( H - I > 25 ) ? J : I;
|
4749
|
}
|
4750
|
}
|
4751
|
}
|
4752
|
return H;
|
4753
|
};
|
4754
|
return [ G( F ), G( E ), G( D ) ];
|
4755
|
} };
|
4756
|
}();
|
4757
|
(function() {
|
4758
|
var J = 0,
|
4759
|
F = YAHOO.util,
|
4760
|
C = YAHOO.lang,
|
4761
|
D = YAHOO.widget.Slider,
|
4762
|
B = F.Color,
|
4763
|
E = F.Dom,
|
4764
|
I = F.Event,
|
4765
|
A = C.substitute,
|
4766
|
H = "yui-picker";
|
4767
|
|
4768
|
function G( L, K ) {
|
4769
|
J = J + 1;
|
4770
|
K = K || {};
|
4771
|
if ( arguments.length === 1 && !YAHOO.lang.isString( L ) && !L.nodeName ) {
|
4772
|
K = L;
|
4773
|
L = K.element || null;
|
4774
|
}
|
4775
|
if ( !L && !K.element ) {
|
4776
|
L = this._createHostElement( K );
|
4777
|
}
|
4778
|
G.superclass.constructor.call( this, L, K );
|
4779
|
this.initPicker();
|
4780
|
}
|
4781
|
YAHOO.extend( G, YAHOO.util.Element, {
|
4782
|
ID: { R: H + "-r", R_HEX: H + "-rhex", G: H + "-g", G_HEX: H + "-ghex", B: H + "-b", B_HEX: H + "-bhex", H: H + "-h", S: H + "-s", V: H + "-v", PICKER_BG: H + "-bg", PICKER_THUMB: H + "-thumb", HUE_BG: H + "-hue-bg", HUE_THUMB: H + "-hue-thumb", HEX: H + "-hex", SWATCH: H + "-swatch", WEBSAFE_SWATCH: H + "-websafe-swatch", CONTROLS: H + "-controls", RGB_CONTROLS: H + "-rgb-controls", HSV_CONTROLS: H + "-hsv-controls", HEX_CONTROLS: H + "-hex-controls", HEX_SUMMARY: H + "-hex-summary", CONTROLS_LABEL: H + "-controls-label" },
|
4783
|
TXT: { ILLEGAL_HEX: "Illegal hex value entered", SHOW_CONTROLS: "Show color details", HIDE_CONTROLS: "Hide color details", CURRENT_COLOR: "Currently selected color: {rgb}", CLOSEST_WEBSAFE: "Closest websafe color: {rgb}. Click to select.", R: "R", G: "G", B: "B", H: "H", S: "S", V: "V", HEX: "#", DEG: "\u00B0", PERCENT: "%" },
|
4784
|
IMAGE: { PICKER_THUMB: "../../build/colorpicker/assets/picker_thumb.png", HUE_THUMB: "../../build/colorpicker/assets/hue_thumb.png" },
|
4785
|
DEFAULT: { PICKER_SIZE: 180 },
|
4786
|
OPT: { HUE: "hue", SATURATION: "saturation", VALUE: "value", RED: "red", GREEN: "green", BLUE: "blue", HSV: "hsv", RGB: "rgb", WEBSAFE: "websafe", HEX: "hex", PICKER_SIZE: "pickersize", SHOW_CONTROLS: "showcontrols", SHOW_RGB_CONTROLS: "showrgbcontrols", SHOW_HSV_CONTROLS: "showhsvcontrols", SHOW_HEX_CONTROLS: "showhexcontrols", SHOW_HEX_SUMMARY: "showhexsummary", SHOW_WEBSAFE: "showwebsafe", CONTAINER: "container", IDS: "ids", ELEMENTS: "elements", TXT: "txt", IMAGES: "images", ANIMATE: "animate" },
|
4787
|
skipAnim: true, _createHostElement: function() {
|
4788
|
var K = document.createElement( "div" );
|
4789
|
if ( this.CSS.BASE ) {
|
4790
|
K.className = this.CSS.BASE;
|
4791
|
}
|
4792
|
return K;
|
4793
|
},
|
4794
|
_updateHueSlider: function() {
|
4795
|
var K = this.get( this.OPT.PICKER_SIZE ),
|
4796
|
L = this.get( this.OPT.HUE );
|
4797
|
L = K - Math.round( L / 360 * K );
|
4798
|
if ( L === K ) {
|
4799
|
L = 0;
|
4800
|
}
|
4801
|
this.hueSlider.setValue( L, this.skipAnim );
|
4802
|
},
|
4803
|
_updatePickerSlider: function() {
|
4804
|
var L = this.get( this.OPT.PICKER_SIZE ),
|
4805
|
M = this.get( this.OPT.SATURATION ),
|
4806
|
K = this.get( this.OPT.VALUE );
|
4807
|
M = Math.round( M * L / 100 );
|
4808
|
K = Math.round( L - ( K * L / 100 ) );
|
4809
|
this.pickerSlider.setRegionValue( M, K, this.skipAnim );
|
4810
|
},
|
4811
|
_updateSliders: function() {
|
4812
|
this._updateHueSlider();
|
4813
|
this._updatePickerSlider();
|
4814
|
},
|
4815
|
setValue: function( L, K ) {
|
4816
|
K = ( K ) || false;
|
4817
|
this.set( this.OPT.RGB, L, K );
|
4818
|
this._updateSliders();
|
4819
|
},
|
4820
|
hueSlider: null, pickerSlider: null, _getH: function() {
|
4821
|
var K = this.get( this.OPT.PICKER_SIZE ),
|
4822
|
L = ( K - this.hueSlider.getValue() ) / K;
|
4823
|
L = Math.round( L * 360 );
|
4824
|
return ( L === 360 ) ? 0 : L;
|
4825
|
},
|
4826
|
_getS: function() {
|
4827
|
return this.pickerSlider.getXValue() / this.get( this.OPT.PICKER_SIZE );
|
4828
|
},
|
4829
|
_getV: function() {
|
4830
|
var K = this.get( this.OPT.PICKER_SIZE );
|
4831
|
return ( K - this.pickerSlider.getYValue() ) / K;
|
4832
|
},
|
4833
|
_updateSwatch: function() {
|
4834
|
var M = this.get( this.OPT.RGB ),
|
4835
|
O = this.get( this.OPT.WEBSAFE ),
|
4836
|
N = this.getElement( this.ID.SWATCH ),
|
4837
|
L = M.join( "," ),
|
4838
|
K = this.get( this.OPT.TXT );
|
4839
|
E.setStyle( N, "background-color", "rgb(" + L + ")" );
|
4840
|
N.title = A( K.CURRENT_COLOR, { "rgb": "#" + this.get( this.OPT.HEX ) } );
|
4841
|
N = this.getElement( this.ID.WEBSAFE_SWATCH );
|
4842
|
L = O.join( "," );
|
4843
|
E.setStyle( N, "background-color", "rgb(" + L + ")" );
|
4844
|
N.title = A( K.CLOSEST_WEBSAFE, { "rgb": "#" + B.rgb2hex( O ) } );
|
4845
|
},
|
4846
|
_getValuesFromSliders: function() {
|
4847
|
this.set( this.OPT.RGB, B.hsv2rgb( this._getH(), this._getS(), this._getV() ) );
|
4848
|
},
|
4849
|
_updateFormFields: function() {
|
4850
|
this.getElement( this.ID.H ).value = this.get( this.OPT.HUE );
|
4851
|
this.getElement( this.ID.S ).value = this.get( this.OPT.SATURATION );
|
4852
|
this.getElement( this.ID.V ).value = this.get( this.OPT.VALUE );
|
4853
|
this.getElement( this.ID.R ).value = this.get( this.OPT.RED );
|
4854
|
this.getElement( this.ID.R_HEX ).innerHTML = B.dec2hex( this.get( this.OPT.RED ) );
|
4855
|
this.getElement( this.ID.G ).value = this.get( this.OPT.GREEN );
|
4856
|
this.getElement( this.ID.G_HEX ).innerHTML = B.dec2hex( this.get( this.OPT.GREEN ) );
|
4857
|
this.getElement( this.ID.B ).value = this.get( this.OPT.BLUE );
|
4858
|
this.getElement( this.ID.B_HEX ).innerHTML = B.dec2hex( this.get( this.OPT.BLUE ) );
|
4859
|
this.getElement( this.ID.HEX ).value = this.get( this.OPT.HEX );
|
4860
|
},
|
4861
|
_onHueSliderChange: function( N ) {
|
4862
|
var L = this._getH(),
|
4863
|
K = B.hsv2rgb( L, 1, 1 ),
|
4864
|
M = "rgb(" + K.join( "," ) + ")";
|
4865
|
this.set( this.OPT.HUE, L, true );
|
4866
|
E.setStyle( this.getElement( this.ID.PICKER_BG ), "background-color", M );
|
4867
|
if ( this.hueSlider.valueChangeSource !== D.SOURCE_SET_VALUE ) {
|
4868
|
this._getValuesFromSliders();
|
4869
|
}
|
4870
|
this._updateFormFields();
|
4871
|
this._updateSwatch();
|
4872
|
},
|
4873
|
_onPickerSliderChange: function( M ) {
|
4874
|
var L = this._getS(),
|
4875
|
K = this._getV();
|
4876
|
this.set( this.OPT.SATURATION, Math.round( L * 100 ), true );
|
4877
|
this.set( this.OPT.VALUE, Math.round( K * 100 ), true );
|
4878
|
if ( this.pickerSlider.valueChangeSource !== D.SOURCE_SET_VALUE ) {
|
4879
|
this._getValuesFromSliders();
|
4880
|
}
|
4881
|
this._updateFormFields();
|
4882
|
this._updateSwatch();
|
4883
|
},
|
4884
|
_getCommand: function( K ) {
|
4885
|
var L = I.getCharCode( K );
|
4886
|
if ( L === 38 ) {
|
4887
|
return 3;
|
4888
|
} else {
|
4889
|
if ( L === 13 ) {
|
4890
|
return 6;
|
4891
|
} else {
|
4892
|
if ( L === 40 ) {
|
4893
|
return 4;
|
4894
|
} else {
|
4895
|
if ( L >= 48 && L <= 57 ) {
|
4896
|
return 1;
|
4897
|
} else {
|
4898
|
if ( L >= 97 && L <= 102 ) {
|
4899
|
return 2;
|
4900
|
} else {
|
4901
|
if ( L >= 65 && L <= 70 ) {
|
4902
|
return 2;
|
4903
|
} else {
|
4904
|
if ( "8, 9, 13, 27, 37, 39".indexOf( L ) > -1 || K.ctrlKey || K.metaKey ) {
|
4905
|
return 5;
|
4906
|
} else {
|
4907
|
return 0;
|
4908
|
}
|
4909
|
}
|
4910
|
}
|
4911
|
}
|
4912
|
}
|
4913
|
}
|
4914
|
}
|
4915
|
},
|
4916
|
_useFieldValue: function( L, K, N ) {
|
4917
|
var M = K.value; if ( N !== this.OPT.HEX ) {
|
4918
|
M = parseInt( M, 10 );
|
4919
|
}
|
4920
|
if ( M !== this.get( N ) ) {
|
4921
|
this.set( N, M );
|
4922
|
}
|
4923
|
},
|
4924
|
_rgbFieldKeypress: function( M, K, O ) {
|
4925
|
var N = this._getCommand( M ),
|
4926
|
L = ( M.shiftKey ) ? 10 : 1;
|
4927
|
switch ( N ) {
|
4928
|
case 6:
|
4929
|
this._useFieldValue.apply( this, arguments );
|
4930
|
break;case 3:
|
4931
|
this.set( O, Math.min( this.get( O ) + L, 255 ) );
|
4932
|
this._updateFormFields();
|
4933
|
break;case 4:
|
4934
|
this.set( O, Math.max( this.get( O ) - L, 0 ) );
|
4935
|
this._updateFormFields();
|
4936
|
break;default:
|
4937
|
}
|
4938
|
},
|
4939
|
_hexFieldKeypress: function( L, K, N ) {
|
4940
|
var M = this._getCommand( L );
|
4941
|
if ( M === 6 ) {
|
4942
|
this._useFieldValue.apply( this, arguments );
|
4943
|
}
|
4944
|
},
|
4945
|
_hexOnly: function( L, K ) {
|
4946
|
var M = this._getCommand( L );
|
4947
|
switch ( M ) {
|
4948
|
case 6:
|
4949
|
case 5:
|
4950
|
case 1:
|
4951
|
break;case 2:
|
4952
|
if ( K !== true ) {
|
4953
|
break;
|
4954
|
}default:
|
4955
|
I.stopEvent( L );
|
4956
|
return false;
|
4957
|
}
|
4958
|
},
|
4959
|
_numbersOnly: function( K ) {
|
4960
|
return this._hexOnly( K, true );
|
4961
|
},
|
4962
|
getElement: function( K ) {
|
4963
|
return this.get( this.OPT.ELEMENTS )[ this.get( this.OPT.IDS )[ K ] ];
|
4964
|
},
|
4965
|
_createElements: function() {
|
4966
|
var N, M, P, O, L,
|
4967
|
K = this.get( this.OPT.IDS ),
|
4968
|
Q = this.get( this.OPT.TXT ),
|
4969
|
S = this.get( this.OPT.IMAGES ),
|
4970
|
R = function( U, V ) {
|
4971
|
var W = document.createElement( U );
|
4972
|
if ( V ) {
|
4973
|
C.augmentObject( W, V, true );
|
4974
|
}
|
4975
|
return W;
|
4976
|
},
|
4977
|
T = function( U, V ) {
|
4978
|
var W = C.merge({ autocomplete: "off", value: "0", size: 3, maxlength: 3 }, V );
|
4979
|
W.name = W.id;
|
4980
|
return new R( U, W );
|
4981
|
};
|
4982
|
L = this.get( "element" );
|
4983
|
N = new R( "div", { id: K[ this.ID.PICKER_BG ], className: "yui-picker-bg", tabIndex: -1, hideFocus: true } );
|
4984
|
M = new R( "div", { id: K[ this.ID.PICKER_THUMB ], className: "yui-picker-thumb" } );
|
4985
|
P = new R( "img", { src: S.PICKER_THUMB } );
|
4986
|
M.appendChild( P );
|
4987
|
N.appendChild( M );
|
4988
|
L.appendChild( N );
|
4989
|
N = new R( "div", { id: K[ this.ID.HUE_BG ], className: "yui-picker-hue-bg", tabIndex: -1, hideFocus: true } );
|
4990
|
M = new R( "div", { id: K[ this.ID.HUE_THUMB ], className: "yui-picker-hue-thumb" } );
|
4991
|
P = new R( "img", { src: S.HUE_THUMB } );
|
4992
|
M.appendChild( P );
|
4993
|
N.appendChild( M );
|
4994
|
L.appendChild( N );
|
4995
|
N = new R( "div", { id: K[ this.ID.CONTROLS ], className: "yui-picker-controls" } );
|
4996
|
L.appendChild( N );
|
4997
|
L = N;
|
4998
|
N = new R( "div", { className: "hd" } );
|
4999
|
M = new R( "a", { id: K[ this.ID.CONTROLS_LABEL ], href: "#" } );
|
5000
|
N.appendChild( M );
|
5001
|
L.appendChild( N );
|
5002
|
N = new R( "div", { className: "bd" } );
|
5003
|
L.appendChild( N );
|
5004
|
L = N;
|
5005
|
N = new R( "ul", { id: K[ this.ID.RGB_CONTROLS ], className: "yui-picker-rgb-controls" } );
|
5006
|
M = new R( "li" );
|
5007
|
M.appendChild( document.createTextNode( Q.R + " " ) );
|
5008
|
O = new T( "input", { id: K[ this.ID.R ], className: "yui-picker-r" } );
|
5009
|
M.appendChild( O );
|
5010
|
N.appendChild( M );
|
5011
|
M = new R( "li" );
|
5012
|
M.appendChild( document.createTextNode( Q.G + " " ) );
|
5013
|
O = new T( "input", { id: K[ this.ID.G ], className: "yui-picker-g" } );
|
5014
|
M.appendChild( O );
|
5015
|
N.appendChild( M );
|
5016
|
M = new R( "li" );
|
5017
|
M.appendChild( document.createTextNode( Q.B + " " ) );
|
5018
|
O = new T( "input", { id: K[ this.ID.B ], className: "yui-picker-b" } );
|
5019
|
M.appendChild( O );
|
5020
|
N.appendChild( M );
|
5021
|
L.appendChild( N );
|
5022
|
N = new R( "ul", { id: K[ this.ID.HSV_CONTROLS ], className: "yui-picker-hsv-controls" } );
|
5023
|
M = new R( "li" );
|
5024
|
M.appendChild( document.createTextNode( Q.H + " " ) );
|
5025
|
O = new T( "input", { id: K[ this.ID.H ], className: "yui-picker-h" } );
|
5026
|
M.appendChild( O );
|
5027
|
M.appendChild( document.createTextNode( " " + Q.DEG ) );
|
5028
|
N.appendChild( M );
|
5029
|
M = new R( "li" );
|
5030
|
M.appendChild( document.createTextNode( Q.S + " " ) );
|
5031
|
O = new T( "input", { id: K[ this.ID.S ], className: "yui-picker-s" } );
|
5032
|
M.appendChild( O );
|
5033
|
M.appendChild( document.createTextNode( " " + Q.PERCENT ) );
|
5034
|
N.appendChild( M );
|
5035
|
M = new R( "li" );
|
5036
|
M.appendChild( document.createTextNode( Q.V + " " ) );
|
5037
|
O = new T( "input", { id: K[ this.ID.V ], className: "yui-picker-v" } );
|
5038
|
M.appendChild( O );
|
5039
|
M.appendChild( document.createTextNode( " " + Q.PERCENT ) );
|
5040
|
N.appendChild( M );
|
5041
|
L.appendChild( N );
|
5042
|
N = new R( "ul", { id: K[ this.ID.HEX_SUMMARY ], className: "yui-picker-hex_summary" } );
|
5043
|
M = new R( "li", { id: K[ this.ID.R_HEX ] } );
|
5044
|
N.appendChild( M );
|
5045
|
M = new R( "li", { id: K[ this.ID.G_HEX ] } );
|
5046
|
N.appendChild( M );
|
5047
|
M = new R( "li", { id: K[ this.ID.B_HEX ] } );
|
5048
|
N.appendChild( M );
|
5049
|
L.appendChild( N );
|
5050
|
N = new R( "div", { id: K[ this.ID.HEX_CONTROLS ], className: "yui-picker-hex-controls" } );
|
5051
|
N.appendChild( document.createTextNode( Q.HEX + " " ) );
|
5052
|
M = new T( "input", { id: K[ this.ID.HEX ], className: "yui-picker-hex", size: 6, maxlength: 6 } );
|
5053
|
N.appendChild( M );
|
5054
|
L.appendChild( N );
|
5055
|
L = this.get( "element" );
|
5056
|
N = new R( "div", { id: K[ this.ID.SWATCH ], className: "yui-picker-swatch" } );
|
5057
|
L.appendChild( N );
|
5058
|
N = new R( "div", { id: K[ this.ID.WEBSAFE_SWATCH ], className: "yui-picker-websafe-swatch" } );
|
5059
|
L.appendChild( N );
|
5060
|
},
|
5061
|
_attachRGBHSV: function( L, K ) {
|
5062
|
I.on( this.getElement( L ), "keydown", function( N, M ) {
|
5063
|
M._rgbFieldKeypress( N, this, K );
|
5064
|
}, this );
|
5065
|
I.on( this.getElement( L ), "keypress", this._numbersOnly, this, true );
|
5066
|
I.on( this.getElement( L ), "blur", function( N, M ) {
|
5067
|
M._useFieldValue( N, this, K );
|
5068
|
}, this );
|
5069
|
},
|
5070
|
_updateRGB: function() {
|
5071
|
var K = [ this.get( this.OPT.RED ), this.get( this.OPT.GREEN ), this.get( this.OPT.BLUE ) ];
|
5072
|
this.set( this.OPT.RGB, K );
|
5073
|
this._updateSliders();
|
5074
|
},
|
5075
|
_initElements: function() {
|
5076
|
var O = this.OPT,
|
5077
|
N = this.get( O.IDS ),
|
5078
|
L = this.get( O.ELEMENTS ),
|
5079
|
K, M, P;
|
5080
|
for ( K in this.ID ) {
|
5081
|
if ( C.hasOwnProperty( this.ID, K ) ) {
|
5082
|
N[ this.ID[ K ] ] = N[ K ];
|
5083
|
}
|
5084
|
}
|
5085
|
M = E.get( N[ this.ID.PICKER_BG ] );
|
5086
|
if ( !M ) {
|
5087
|
this._createElements();
|
5088
|
} else {}
|
5089
|
for ( K in N ) {
|
5090
|
if ( C.hasOwnProperty( N, K ) ) {
|
5091
|
M = E.get( N[ K ] );
|
5092
|
P = E.generateId( M );
|
5093
|
N[ K ] = P;
|
5094
|
N[ N[ K ] ] = P;
|
5095
|
L[ P ] = M;
|
5096
|
}
|
5097
|
}
|
5098
|
},
|
5099
|
initPicker: function() {
|
5100
|
this._initSliders();
|
5101
|
this._bindUI();
|
5102
|
this.syncUI( true );
|
5103
|
},
|
5104
|
_initSliders: function() {
|
5105
|
var K = this.ID,
|
5106
|
L = this.get( this.OPT.PICKER_SIZE );
|
5107
|
this.hueSlider = D.getVertSlider( this.getElement( K.HUE_BG ), this.getElement( K.HUE_THUMB ), 0, L );
|
5108
|
this.pickerSlider = D.getSliderRegion( this.getElement( K.PICKER_BG ), this.getElement( K.PICKER_THUMB ), 0, L, 0, L );
|
5109
|
this.set( this.OPT.ANIMATE, this.get( this.OPT.ANIMATE ) );
|
5110
|
},
|
5111
|
_bindUI: function() {
|
5112
|
var K = this.ID,
|
5113
|
L = this.OPT; this.hueSlider.subscribe( "change", this._onHueSliderChange, this, true );
|
5114
|
this.pickerSlider.subscribe( "change", this._onPickerSliderChange, this, true );
|
5115
|
I.on( this.getElement( K.WEBSAFE_SWATCH ), "click", function( M ) {
|
5116
|
this.setValue( this.get( L.WEBSAFE ) );
|
5117
|
}, this, true );
|
5118
|
I.on( this.getElement( K.CONTROLS_LABEL ), "click", function( M ) {
|
5119
|
this.set( L.SHOW_CONTROLS, !this.get( L.SHOW_CONTROLS ) );
|
5120
|
I.preventDefault( M );
|
5121
|
}, this, true );
|
5122
|
this._attachRGBHSV( K.R, L.RED );
|
5123
|
this._attachRGBHSV( K.G, L.GREEN );
|
5124
|
this._attachRGBHSV( K.B, L.BLUE );
|
5125
|
this._attachRGBHSV( K.H, L.HUE );
|
5126
|
this._attachRGBHSV( K.S, L.SATURATION );
|
5127
|
this._attachRGBHSV( K.V, L.VALUE );
|
5128
|
I.on( this.getElement( K.HEX ), "keydown", function( N, M ) {
|
5129
|
M._hexFieldKeypress( N, this, L.HEX );
|
5130
|
}, this );
|
5131
|
I.on( this.getElement( this.ID.HEX ), "keypress", this._hexOnly, this, true );
|
5132
|
I.on( this.getElement( this.ID.HEX ), "blur", function( N, M ) {
|
5133
|
M._useFieldValue( N, this, L.HEX );
|
5134
|
}, this );
|
5135
|
},
|
5136
|
syncUI: function( K ) {
|
5137
|
this.skipAnim = K; this._updateRGB();
|
5138
|
this.skipAnim = false;
|
5139
|
},
|
5140
|
_updateRGBFromHSV: function() {
|
5141
|
var L = [ this.get( this.OPT.HUE ), this.get( this.OPT.SATURATION ) / 100, this.get( this.OPT.VALUE ) / 100 ],
|
5142
|
K = B.hsv2rgb( L );
|
5143
|
this.set( this.OPT.RGB, K );
|
5144
|
this._updateSliders();
|
5145
|
},
|
5146
|
_updateHex: function() {
|
5147
|
var N = this.get( this.OPT.HEX ),
|
5148
|
K = N.length,
|
5149
|
O, M, L;
|
5150
|
if ( K === 3 ) {
|
5151
|
O = N.split( "" );
|
5152
|
for ( M = 0; M < K; M = M + 1 ) {
|
5153
|
O[ M ] = O[ M ] + O[ M ];
|
5154
|
}
|
5155
|
N = O.join( "" );
|
5156
|
}
|
5157
|
if ( N.length !== 6 ) {
|
5158
|
return false;
|
5159
|
}
|
5160
|
L = B.hex2rgb( N );
|
5161
|
this.setValue( L );
|
5162
|
},
|
5163
|
_hideShowEl: function( M, K ) {
|
5164
|
var L = ( C.isString( M ) ? this.getElement( M ) : M );
|
5165
|
E.setStyle( L, "display", ( K ) ? "" : "none" );
|
5166
|
},
|
5167
|
initAttributes: function( K ) {
|
5168
|
K = K || {};
|
5169
|
G.superclass.initAttributes.call( this, K );
|
5170
|
this.setAttributeConfig( this.OPT.PICKER_SIZE, { value: K.size || this.DEFAULT.PICKER_SIZE } );
|
5171
|
this.setAttributeConfig( this.OPT.HUE, { value: K.hue || 0, validator: C.isNumber } );
|
5172
|
this.setAttributeConfig( this.OPT.SATURATION, { value: K.saturation || 0, validator: C.isNumber } );
|
5173
|
this.setAttributeConfig( this.OPT.VALUE, { value: C.isNumber( K.value ) ? K.value : 100, validator: C.isNumber } );
|
5174
|
this.setAttributeConfig( this.OPT.RED, { value: C.isNumber( K.red ) ? K.red : 255, validator: C.isNumber } );
|
5175
|
this.setAttributeConfig( this.OPT.GREEN, { value: C.isNumber( K.green ) ? K.green : 255, validator: C.isNumber } );
|
5176
|
this.setAttributeConfig( this.OPT.BLUE, { value: C.isNumber( K.blue ) ? K.blue : 255, validator: C.isNumber } );
|
5177
|
this.setAttributeConfig( this.OPT.HEX, { value: K.hex || "FFFFFF", validator: C.isString } );
|
5178
|
this.setAttributeConfig( this.OPT.RGB, {
|
5179
|
value: K.rgb || [ 255, 255, 255 ], method: function( O ) {
|
5180
|
this.set( this.OPT.RED, O[ 0 ], true );
|
5181
|
this.set( this.OPT.GREEN, O[ 1 ], true );
|
5182
|
this.set( this.OPT.BLUE, O[ 2 ], true );
|
5183
|
var Q = B.websafe( O ),
|
5184
|
P = B.rgb2hex( O ),
|
5185
|
N = B.rgb2hsv( O );
|
5186
|
this.set( this.OPT.WEBSAFE, Q, true );
|
5187
|
this.set( this.OPT.HEX, P, true );
|
5188
|
if ( N[ 1 ] ) {
|
5189
|
this.set( this.OPT.HUE, N[ 0 ], true );
|
5190
|
}
|
5191
|
this.set( this.OPT.SATURATION, Math.round( N[ 1 ] * 100 ), true );
|
5192
|
this.set( this.OPT.VALUE, Math.round( N[ 2 ] * 100 ), true );
|
5193
|
},
|
5194
|
readonly: true } );
|
5195
|
this.setAttributeConfig( this.OPT.CONTAINER, {
|
5196
|
value: null, method: function( N ) {
|
5197
|
if ( N ) {
|
5198
|
N.showEvent.subscribe( function() {
|
5199
|
this.pickerSlider.focus();
|
5200
|
}, this, true );
|
5201
|
}
|
5202
|
} } );
|
5203
|
this.setAttributeConfig( this.OPT.WEBSAFE, { value: K.websafe || [ 255, 255, 255 ] } );
|
5204
|
var M = K.ids || C.merge( {}, this.ID ),
|
5205
|
L;
|
5206
|
if ( !K.ids && J > 1 ) {
|
5207
|
for ( L in M ) {
|
5208
|
if ( C.hasOwnProperty( M, L ) ) {
|
5209
|
M[ L ] = M[ L ] + J;
|
5210
|
}
|
5211
|
}
|
5212
|
}
|
5213
|
this.setAttributeConfig( this.OPT.IDS, { value: M, writeonce: true } );
|
5214
|
this.setAttributeConfig( this.OPT.TXT, { value: K.txt || this.TXT, writeonce: true } );
|
5215
|
this.setAttributeConfig( this.OPT.IMAGES, { value: K.images || this.IMAGE, writeonce: true } );
|
5216
|
this.setAttributeConfig( this.OPT.ELEMENTS, {
|
5217
|
value: {},
|
5218
|
readonly: true } );
|
5219
|
this.setAttributeConfig( this.OPT.SHOW_CONTROLS, {
|
5220
|
value: C.isBoolean( K.showcontrols ) ? K.showcontrols : true, method: function( N ) {
|
5221
|
var O = E.getElementsByClassName( "bd", "div", this.getElement( this.ID.CONTROLS ) )[ 0 ];
|
5222
|
this._hideShowEl( O, N );
|
5223
|
this.getElement( this.ID.CONTROLS_LABEL ).innerHTML = ( N ) ? this.get( this.OPT.TXT ).HIDE_CONTROLS : this.get( this.OPT.TXT ).SHOW_CONTROLS;
|
5224
|
} } );
|
5225
|
this.setAttributeConfig( this.OPT.SHOW_RGB_CONTROLS, {
|
5226
|
value: C.isBoolean( K.showrgbcontrols ) ? K.showrgbcontrols : true, method: function( N ) {
|
5227
|
this._hideShowEl( this.ID.RGB_CONTROLS, N );
|
5228
|
} } );
|
5229
|
this.setAttributeConfig( this.OPT.SHOW_HSV_CONTROLS, {
|
5230
|
value: C.isBoolean( K.showhsvcontrols ) ? K.showhsvcontrols : false, method: function( N ) {
|
5231
|
this._hideShowEl( this.ID.HSV_CONTROLS, N );
|
5232
|
if ( N && this.get( this.OPT.SHOW_HEX_SUMMARY ) ) {
|
5233
|
this.set( this.OPT.SHOW_HEX_SUMMARY, false );
|
5234
|
}
|
5235
|
} } );
|
5236
|
this.setAttributeConfig( this.OPT.SHOW_HEX_CONTROLS, {
|
5237
|
value: C.isBoolean( K.showhexcontrols ) ? K.showhexcontrols : false, method: function( N ) {
|
5238
|
this._hideShowEl( this.ID.HEX_CONTROLS, N );
|
5239
|
} } );
|
5240
|
this.setAttributeConfig( this.OPT.SHOW_WEBSAFE, {
|
5241
|
value: C.isBoolean( K.showwebsafe ) ? K.showwebsafe : true, method: function( N ) {
|
5242
|
this._hideShowEl( this.ID.WEBSAFE_SWATCH, N );
|
5243
|
} } );
|
5244
|
this.setAttributeConfig( this.OPT.SHOW_HEX_SUMMARY, {
|
5245
|
value: C.isBoolean( K.showhexsummary ) ? K.showhexsummary : true, method: function( N ) {
|
5246
|
this._hideShowEl( this.ID.HEX_SUMMARY, N );
|
5247
|
if ( N && this.get( this.OPT.SHOW_HSV_CONTROLS ) ) {
|
5248
|
this.set( this.OPT.SHOW_HSV_CONTROLS, false );
|
5249
|
}
|
5250
|
} } );
|
5251
|
this.setAttributeConfig( this.OPT.ANIMATE, {
|
5252
|
value: C.isBoolean( K.animate ) ? K.animate : true, method: function( N ) {
|
5253
|
if ( this.pickerSlider ) {
|
5254
|
this.pickerSlider.animate = N;
|
5255
|
this.hueSlider.animate = N;
|
5256
|
}
|
5257
|
} } );
|
5258
|
this.on( this.OPT.HUE + "Change", this._updateRGBFromHSV, this, true );
|
5259
|
this.on( this.OPT.SATURATION + "Change", this._updateRGBFromHSV, this, true );
|
5260
|
this.on( this.OPT.VALUE + "Change", this._updateRGBFromHSV, this, true );
|
5261
|
this.on( this.OPT.RED + "Change", this._updateRGB, this, true );
|
5262
|
this.on( this.OPT.GREEN + "Change", this._updateRGB, this, true );
|
5263
|
this.on( this.OPT.BLUE + "Change", this._updateRGB, this, true );
|
5264
|
this.on( this.OPT.HEX + "Change", this._updateHex, this, true );
|
5265
|
this._initElements();
|
5266
|
} } );
|
5267
|
YAHOO.widget.ColorPicker = G;
|
5268
|
})();
|
5269
|
YAHOO.register( "colorpicker", YAHOO.widget.ColorPicker, { version: "2.7.0", build: "1796" } );
|
5270
|
|
5271
|
|
5272
|
|
5273
|
|
5274
|
|
5275
|
|
5276
|
( function() {
|
5277
|
var B = YAHOO.util;
|
5278
|
var A = function( D, C, E, F ) {
|
5279
|
if ( !D ) {}
|
5280
|
this.init( D, C, E, F );
|
5281
|
};
|
5282
|
A.NAME = "Anim";
|
5283
|
A.prototype = {
|
5284
|
toString: function() {
|
5285
|
var C = this.getEl() || {};
|
5286
|
var D = C.id || C.tagName;
|
5287
|
return ( this.constructor.NAME + ": " + D );
|
5288
|
},
|
5289
|
patterns: { noNegatives: /width|height|opacity|padding/i, offsetAttribute: /^((width|height)|(top|left))$/, defaultUnit: /width|height|top$|bottom$|left$|right$/i, offsetUnit: /\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i },
|
5290
|
doMethod: function( C, E, D ) {
|
5291
|
return this.method( this.currentFrame, E, D - E, this.totalFrames );
|
5292
|
},
|
5293
|
setAttribute: function( C, F, E ) {
|
5294
|
var D = this.getEl();
|
5295
|
if ( this.patterns.noNegatives.test( C ) ) {
|
5296
|
F = ( F > 0 ) ? F : 0;
|
5297
|
}
|
5298
|
if ( "style" in D ) {
|
5299
|
B.Dom.setStyle( D, C, F + E );
|
5300
|
} else {
|
5301
|
if ( C in D ) {
|
5302
|
D[ C ] = F;
|
5303
|
}
|
5304
|
}
|
5305
|
},
|
5306
|
getAttribute: function( C ) {
|
5307
|
var E = this.getEl();
|
5308
|
var G = B.Dom.getStyle( E, C );
|
5309
|
if ( G !== "auto" && !this.patterns.offsetUnit.test( G ) ) {
|
5310
|
return parseFloat( G );
|
5311
|
}
|
5312
|
var D = this.patterns.offsetAttribute.exec( C ) || [];
|
5313
|
var H = !!( D[ 3 ] );
|
5314
|
var F = !!( D[ 2 ] );
|
5315
|
if ( "style" in E ) {
|
5316
|
if ( F || ( B.Dom.getStyle( E, "position" ) == "absolute" && H ) ) {
|
5317
|
G = E[ "offset" + D[ 0 ].charAt( 0 ).toUpperCase() + D[ 0 ].substr( 1 ) ];
|
5318
|
} else {
|
5319
|
G = 0;
|
5320
|
}
|
5321
|
} else {
|
5322
|
if ( C in E ) {
|
5323
|
G = E[ C ];
|
5324
|
}
|
5325
|
}
|
5326
|
return G;
|
5327
|
},
|
5328
|
getDefaultUnit: function( C ) {
|
5329
|
if ( this.patterns.defaultUnit.test( C ) ) {
|
5330
|
return "px";
|
5331
|
}
|
5332
|
return "";
|
5333
|
},
|
5334
|
setRuntimeAttribute: function( D ) {
|
5335
|
var I; var E; var F = this.attributes; this.runtimeAttributes[ D ] = {};
|
5336
|
var H = function( J ) {
|
5337
|
return ( typeof J !== "undefined" );
|
5338
|
};
|
5339
|
if ( !H( F[ D ][ "to" ] ) && !H( F[ D ][ "by" ] ) ) {
|
5340
|
return false;
|
5341
|
}
|
5342
|
I = ( H( F[ D ][ "from" ] ) ) ? F[ D ][ "from" ] : this.getAttribute( D );
|
5343
|
if ( H( F[ D ][ "to" ] ) ) {
|
5344
|
E = F[ D ][ "to" ];
|
5345
|
} else {
|
5346
|
if ( H( F[ D ][ "by" ] ) ) {
|
5347
|
if ( I.constructor == Array ) {
|
5348
|
E = [];
|
5349
|
for ( var G = 0, C = I.length; G < C; ++G ) {
|
5350
|
E[ G ] = I[ G ] + F[ D ][ "by" ][ G ] * 1;
|
5351
|
}
|
5352
|
} else {
|
5353
|
E = I + F[ D ][ "by" ] * 1;
|
5354
|
}
|
5355
|
}
|
5356
|
}
|
5357
|
this.runtimeAttributes[ D ].start = I;
|
5358
|
this.runtimeAttributes[ D ].end = E;
|
5359
|
this.runtimeAttributes[ D ].unit = ( H( F[ D ].unit ) ) ? F[ D ][ "unit" ] : this.getDefaultUnit( D );
|
5360
|
return true;
|
5361
|
},
|
5362
|
init: function( E, J, I, C ) {
|
5363
|
var D = false; var F = null; var H = 0; E = B.Dom.get( E );
|
5364
|
this.attributes = J || {};
|
5365
|
this.duration = !YAHOO.lang.isUndefined( I ) ? I : 1;
|
5366
|
this.method = C || B.Easing.easeNone;
|
5367
|
this.useSeconds = true;
|
5368
|
this.currentFrame = 0;
|
5369
|
this.totalFrames = B.AnimMgr.fps;
|
5370
|
this.setEl = function( M ) {
|
5371
|
E = B.Dom.get( M );
|
5372
|
};
|
5373
|
this.getEl = function() {
|
5374
|
return E;
|
5375
|
};
|
5376
|
this.isAnimated = function() {
|
5377
|
return D;
|
5378
|
};
|
5379
|
this.getStartTime = function() {
|
5380
|
return F;
|
5381
|
};
|
5382
|
this.runtimeAttributes = {};
|
5383
|
this.animate = function() {
|
5384
|
if ( this.isAnimated() ) {
|
5385
|
return false;
|
5386
|
}
|
5387
|
this.currentFrame = 0;
|
5388
|
this.totalFrames = ( this.useSeconds ) ? Math.ceil( B.AnimMgr.fps * this.duration ) : this.duration;
|
5389
|
if ( this.duration === 0 && this.useSeconds ) {
|
5390
|
this.totalFrames = 1;
|
5391
|
}
|
5392
|
B.AnimMgr.registerElement( this );
|
5393
|
return true;
|
5394
|
};
|
5395
|
this.stop = function( M ) {
|
5396
|
if ( !this.isAnimated() ) {
|
5397
|
return false;
|
5398
|
}
|
5399
|
if ( M ) {
|
5400
|
this.currentFrame = this.totalFrames;
|
5401
|
this._onTween.fire();
|
5402
|
}
|
5403
|
B.AnimMgr.stop( this );
|
5404
|
};
|
5405
|
var L = function() {
|
5406
|
this.onStart.fire();
|
5407
|
this.runtimeAttributes = {};
|
5408
|
for ( var M in this.attributes ) {
|
5409
|
this.setRuntimeAttribute( M );
|
5410
|
}
|
5411
|
D = true;
|
5412
|
H = 0;
|
5413
|
F = new Date();
|
5414
|
};
|
5415
|
var K = function() {
|
5416
|
var O = { duration: new Date() - this.getStartTime(), currentFrame: this.currentFrame }; O.toString = function() {
|
5417
|
return ( "duration: " + O.duration + ", currentFrame: " + O.currentFrame );
|
5418
|
};
|
5419
|
this.onTween.fire( O );
|
5420
|
var N = this.runtimeAttributes;
|
5421
|
for ( var M in N ) {
|
5422
|
this.setAttribute( M, this.doMethod( M, N[ M ].start, N[ M ].end ), N[ M ].unit );
|
5423
|
}
|
5424
|
H += 1;
|
5425
|
};
|
5426
|
var G = function() {
|
5427
|
var M = ( new Date() - F ) / 1000;
|
5428
|
var N = { duration: M, frames: H, fps: H / M }; N.toString = function() {
|
5429
|
return ( "duration: " + N.duration + ", frames: " + N.frames + ", fps: " + N.fps );
|
5430
|
};
|
5431
|
D = false;
|
5432
|
H = 0;
|
5433
|
this.onComplete.fire( N );
|
5434
|
};
|
5435
|
this._onStart = new B.CustomEvent( "_start", this, true );
|
5436
|
this.onStart = new B.CustomEvent( "start", this );
|
5437
|
this.onTween = new B.CustomEvent( "tween", this );
|
5438
|
this._onTween = new B.CustomEvent( "_tween", this, true );
|
5439
|
this.onComplete = new B.CustomEvent( "complete", this );
|
5440
|
this._onComplete = new B.CustomEvent( "_complete", this, true );
|
5441
|
this._onStart.subscribe( L );
|
5442
|
this._onTween.subscribe( K );
|
5443
|
this._onComplete.subscribe( G );
|
5444
|
} }; B.Anim = A;
|
5445
|
})();
|
5446
|
YAHOO.util.AnimMgr = new function() {
|
5447
|
var C = null;
|
5448
|
var B = [];
|
5449
|
var A = 0;
|
5450
|
this.fps = 1000;
|
5451
|
this.delay = 1;
|
5452
|
this.registerElement = function( F ) {
|
5453
|
B[ B.length ] = F;
|
5454
|
A += 1;
|
5455
|
F._onStart.fire();
|
5456
|
this.start();
|
5457
|
};
|
5458
|
this.unRegister = function( G, F ) {
|
5459
|
F = F || E( G );
|
5460
|
if ( !G.isAnimated() || F == -1 ) {
|
5461
|
return false;
|
5462
|
}
|
5463
|
G._onComplete.fire();
|
5464
|
B.splice( F, 1 );
|
5465
|
A -= 1;
|
5466
|
if ( A <= 0 ) {
|
5467
|
this.stop();
|
5468
|
}
|
5469
|
return true;
|
5470
|
};
|
5471
|
this.start = function() {
|
5472
|
if ( C === null ) {
|
5473
|
C = setInterval( this.run, this.delay );
|
5474
|
}
|
5475
|
};
|
5476
|
this.stop = function( H ) {
|
5477
|
if ( !H ) {
|
5478
|
clearInterval( C );
|
5479
|
for ( var G = 0, F = B.length; G < F; ++G ) {
|
5480
|
this.unRegister( B[ 0 ], 0 );
|
5481
|
}
|
5482
|
B = [];
|
5483
|
C = null;
|
5484
|
A = 0;
|
5485
|
} else {
|
5486
|
this.unRegister( H );
|
5487
|
}
|
5488
|
};
|
5489
|
this.run = function() {
|
5490
|
for ( var H = 0, F = B.length; H < F; ++H ) {
|
5491
|
var G = B[ H ];
|
5492
|
if ( !G || !G.isAnimated() ) {
|
5493
|
continue;
|
5494
|
}
|
5495
|
if ( G.currentFrame < G.totalFrames || G.totalFrames === null ) {
|
5496
|
G.currentFrame += 1;
|
5497
|
if ( G.useSeconds ) {
|
5498
|
D( G );
|
5499
|
}
|
5500
|
G._onTween.fire();
|
5501
|
} else {
|
5502
|
YAHOO.util.AnimMgr.stop( G, H );
|
5503
|
}
|
5504
|
}
|
5505
|
};
|
5506
|
var E = function( H ) {
|
5507
|
for ( var G = 0, F = B.length; G < F; ++G ) {
|
5508
|
if ( B[ G ] == H ) {
|
5509
|
return G;
|
5510
|
}
|
5511
|
}
|
5512
|
return -1;
|
5513
|
};
|
5514
|
var D = function( G ) {
|
5515
|
var J = G.totalFrames;
|
5516
|
var I = G.currentFrame;
|
5517
|
var H = ( G.currentFrame * G.duration * 1000 / G.totalFrames );
|
5518
|
var F = ( new Date() - G.getStartTime() );
|
5519
|
var K = 0;
|
5520
|
if ( F < G.duration * 1000 ) {
|
5521
|
K = Math.round( ( F / H - 1 ) * G.currentFrame );
|
5522
|
} else {
|
5523
|
K = J - ( I + 1 );
|
5524
|
}
|
5525
|
if ( K > 0 && isFinite( K ) ) {
|
5526
|
if ( G.currentFrame + K >= J ) {
|
5527
|
K = J - ( I + 1 );
|
5528
|
}
|
5529
|
G.currentFrame += K;
|
5530
|
}
|
5531
|
};
|
5532
|
};
|
5533
|
YAHOO.util.Bezier = new function() {
|
5534
|
this.getPosition = function( E, D ) {
|
5535
|
var F = E.length;
|
5536
|
var C = [];
|
5537
|
for ( var B = 0; B < F; ++B ) {
|
5538
|
C[ B ] = [ E[ B ][ 0 ], E[ B ][ 1 ] ];
|
5539
|
}
|
5540
|
for ( var A = 1; A < F; ++A ) {
|
5541
|
for ( B = 0; B < F - A; ++B ) {
|
5542
|
C[ B ][ 0 ] = ( 1 - D ) * C[ B ][ 0 ] + D * C[ parseInt( B + 1, 10 ) ][ 0 ];
|
5543
|
C[ B ][ 1 ] = ( 1 - D ) * C[ B ][ 1 ] + D * C[ parseInt( B + 1, 10 ) ][ 1 ];
|
5544
|
}
|
5545
|
}
|
5546
|
return [ C[ 0 ][ 0 ], C[ 0 ][ 1 ] ];
|
5547
|
};
|
5548
|
};
|
5549
|
(function() {
|
5550
|
var A = function( F, E, G, H ) {
|
5551
|
A.superclass.constructor.call( this, F, E, G, H );
|
5552
|
};
|
5553
|
A.NAME = "ColorAnim";
|
5554
|
A.DEFAULT_BGCOLOR = "#fff";
|
5555
|
var C = YAHOO.util;
|
5556
|
YAHOO.extend( A, C.Anim );
|
5557
|
var D = A.superclass;
|
5558
|
var B = A.prototype;
|
5559
|
B.patterns.color = /color$/i;
|
5560
|
B.patterns.rgb = /^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;
|
5561
|
B.patterns.hex = /^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;
|
5562
|
B.patterns.hex3 = /^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;
|
5563
|
B.patterns.transparent = /^transparent|rgba\(0, 0, 0, 0\)$/;
|
5564
|
B.parseColor = function( E ) {
|
5565
|
if ( E.length == 3 ) {
|
5566
|
return E;
|
5567
|
}
|
5568
|
var F = this.patterns.hex.exec( E );
|
5569
|
if ( F && F.length == 4 ) {
|
5570
|
return [ parseInt( F[ 1 ], 16 ), parseInt( F[ 2 ], 16 ), parseInt( F[ 3 ], 16 ) ];
|
5571
|
}
|
5572
|
F = this.patterns.rgb.exec( E );
|
5573
|
if ( F && F.length == 4 ) {
|
5574
|
return [ parseInt( F[ 1 ], 10 ), parseInt( F[ 2 ], 10 ), parseInt( F[ 3 ], 10 ) ];
|
5575
|
}
|
5576
|
F = this.patterns.hex3.exec( E );
|
5577
|
if ( F && F.length == 4 ) {
|
5578
|
return [ parseInt( F[ 1 ] + F[ 1 ], 16 ), parseInt( F[ 2 ] + F[ 2 ], 16 ), parseInt( F[ 3 ] + F[ 3 ], 16 ) ];
|
5579
|
}
|
5580
|
return null;
|
5581
|
};
|
5582
|
B.getAttribute = function( E ) {
|
5583
|
var G = this.getEl();
|
5584
|
if ( this.patterns.color.test( E ) ) {
|
5585
|
var I = YAHOO.util.Dom.getStyle( G, E );
|
5586
|
var H = this;
|
5587
|
if ( this.patterns.transparent.test( I ) ) {
|
5588
|
var F = YAHOO.util.Dom.getAncestorBy( G, function( J ) {
|
5589
|
return !H.patterns.transparent.test( I );
|
5590
|
});
|
5591
|
if ( F ) {
|
5592
|
I = C.Dom.getStyle( F, E );
|
5593
|
} else {
|
5594
|
I = A.DEFAULT_BGCOLOR;
|
5595
|
}
|
5596
|
}
|
5597
|
} else {
|
5598
|
I = D.getAttribute.call( this, E );
|
5599
|
}
|
5600
|
return I;
|
5601
|
};
|
5602
|
B.doMethod = function( F, J, G ) {
|
5603
|
var I;
|
5604
|
if ( this.patterns.color.test( F ) ) {
|
5605
|
I = [];
|
5606
|
for ( var H = 0, E = J.length; H < E; ++H ) {
|
5607
|
I[ H ] = D.doMethod.call( this, F, J[ H ], G[ H ] );
|
5608
|
}
|
5609
|
I = "rgb(" + Math.floor( I[ 0 ] ) + "," + Math.floor( I[ 1 ] ) + "," + Math.floor( I[ 2 ] ) + ")";
|
5610
|
} else {
|
5611
|
I = D.doMethod.call( this, F, J, G );
|
5612
|
}
|
5613
|
return I;
|
5614
|
};
|
5615
|
B.setRuntimeAttribute = function( F ) {
|
5616
|
D.setRuntimeAttribute.call( this, F );
|
5617
|
if ( this.patterns.color.test( F ) ) {
|
5618
|
var H = this.attributes;
|
5619
|
var J = this.parseColor( this.runtimeAttributes[ F ].start );
|
5620
|
var G = this.parseColor( this.runtimeAttributes[ F ].end );
|
5621
|
if ( typeof H[ F ][ "to" ] === "undefined" && typeof H[ F ][ "by" ] !== "undefined" ) {
|
5622
|
G = this.parseColor( H[ F ].by );
|
5623
|
for ( var I = 0, E = J.length; I < E; ++I ) {
|
5624
|
G[ I ] = J[ I ] + G[ I ];
|
5625
|
}
|
5626
|
}
|
5627
|
this.runtimeAttributes[ F ].start = J;
|
5628
|
this.runtimeAttributes[ F ].end = G;
|
5629
|
}
|
5630
|
};
|
5631
|
C.ColorAnim = A;
|
5632
|
})();
|
5633
|
|
5634
|
|
5635
|
|
5636
|
|
5637
|
|
5638
|
|
5639
|
|
5640
|
|
5641
|
|
5642
|
|
5643
|
|
5644
|
|
5645
|
|
5646
|
YAHOO.util.Easing = {
|
5647
|
easeNone: function( B, A, D, C ) {
|
5648
|
return D * B / C + A;
|
5649
|
},
|
5650
|
easeIn: function( B, A, D, C ) {
|
5651
|
return D * ( B /= C ) * B + A;
|
5652
|
},
|
5653
|
easeOut: function( B, A, D, C ) {
|
5654
|
return -D * ( B /= C ) * ( B - 2 ) + A;
|
5655
|
},
|
5656
|
easeBoth: function( B, A, D, C ) {
|
5657
|
if ( ( B /= C / 2 ) < 1 ) {
|
5658
|
return D / 2 * B * B + A;
|
5659
|
}
|
5660
|
return -D / 2 * ( ( --B ) * ( B - 2 ) - 1 ) + A;
|
5661
|
},
|
5662
|
easeInStrong: function( B, A, D, C ) {
|
5663
|
return D * ( B /= C ) * B * B * B + A;
|
5664
|
},
|
5665
|
easeOutStrong: function( B, A, D, C ) {
|
5666
|
return -D * ( ( B = B / C - 1 ) * B * B * B - 1 ) + A;
|
5667
|
},
|
5668
|
easeBothStrong: function( B, A, D, C ) {
|
5669
|
if ( ( B /= C / 2 ) < 1 ) {
|
5670
|
return D / 2 * B * B * B * B + A;
|
5671
|
}
|
5672
|
return -D / 2 * ( ( B -= 2 ) * B * B * B - 2 ) + A;
|
5673
|
},
|
5674
|
elasticIn: function( C, A, G, F, B, E ) {
|
5675
|
if ( C == 0 ) {
|
5676
|
return A;
|
5677
|
}
|
5678
|
if ( ( C /= F ) == 1 ) {
|
5679
|
return A + G;
|
5680
|
}
|
5681
|
if ( !E ) {
|
5682
|
E = F * 0.3;
|
5683
|
}
|
5684
|
if ( !B || B < Math.abs( G ) ) {
|
5685
|
B = G;
|
5686
|
var D = E / 4;
|
5687
|
} else {
|
5688
|
var D = E / ( 2 * Math.PI ) * Math.asin( G / B );
|
5689
|
}
|
5690
|
return -( B * Math.pow( 2, 10 * ( C -= 1 ) ) * Math.sin( ( C * F - D ) * ( 2 * Math.PI ) / E ) ) + A;
|
5691
|
},
|
5692
|
elasticOut: function( C, A, G, F, B, E ) {
|
5693
|
if ( C == 0 ) {
|
5694
|
return A;
|
5695
|
}
|
5696
|
if ( ( C /= F ) == 1 ) {
|
5697
|
return A + G;
|
5698
|
}
|
5699
|
if ( !E ) {
|
5700
|
E = F * 0.3;
|
5701
|
}
|
5702
|
if ( !B || B < Math.abs( G ) ) {
|
5703
|
B = G;
|
5704
|
var D = E / 4;
|
5705
|
} else {
|
5706
|
var D = E / ( 2 * Math.PI ) * Math.asin( G / B );
|
5707
|
}
|
5708
|
return B * Math.pow( 2, -10 * C ) * Math.sin( ( C * F - D ) * ( 2 * Math.PI ) / E ) + G + A;
|
5709
|
},
|
5710
|
elasticBoth: function( C, A, G, F, B, E ) {
|
5711
|
if ( C == 0 ) {
|
5712
|
return A;
|
5713
|
}
|
5714
|
if ( ( C /= F / 2 ) == 2 ) {
|
5715
|
return A + G;
|
5716
|
}
|
5717
|
if ( !E ) {
|
5718
|
E = F * ( 0.3 * 1.5 );
|
5719
|
}
|
5720
|
if ( !B || B < Math.abs( G ) ) {
|
5721
|
B = G;
|
5722
|
var D = E / 4;
|
5723
|
} else {
|
5724
|
var D = E / ( 2 * Math.PI ) * Math.asin( G / B );
|
5725
|
}
|
5726
|
if ( C < 1 ) {
|
5727
|
return -0.5 * ( B * Math.pow( 2, 10 * ( C -= 1 ) ) * Math.sin( ( C * F - D ) * ( 2 * Math.PI ) / E ) ) + A;
|
5728
|
}
|
5729
|
return B * Math.pow( 2, -10 * ( C -= 1 ) ) * Math.sin( ( C * F - D ) * ( 2 * Math.PI ) / E ) * 0.5 + G + A;
|
5730
|
},
|
5731
|
backIn: function( B, A, E, D, C ) {
|
5732
|
if ( typeof C == "undefined" ) {
|
5733
|
C = 1.70158;
|
5734
|
}
|
5735
|
return E * ( B /= D ) * B * ( ( C + 1 ) * B - C ) + A;
|
5736
|
},
|
5737
|
backOut: function( B, A, E, D, C ) {
|
5738
|
if ( typeof C == "undefined" ) {
|
5739
|
C = 1.70158;
|
5740
|
}
|
5741
|
return E * ( ( B = B / D - 1 ) * B * ( ( C + 1 ) * B + C ) + 1 ) + A;
|
5742
|
},
|
5743
|
backBoth: function( B, A, E, D, C ) {
|
5744
|
if ( typeof C == "undefined" ) {
|
5745
|
C = 1.70158;
|
5746
|
}
|
5747
|
if ( ( B /= D / 2 ) < 1 ) {
|
5748
|
return E / 2 * ( B * B * ( ( ( C *= ( 1.525 ) ) + 1 ) * B - C ) ) + A;
|
5749
|
}
|
5750
|
return E / 2 * ( ( B -= 2 ) * B * ( ( ( C *= ( 1.525 ) ) + 1 ) * B + C ) + 2 ) + A;
|
5751
|
},
|
5752
|
bounceIn: function( B, A, D, C ) {
|
5753
|
return D - YAHOO.util.Easing.bounceOut( C - B, 0, D, C ) + A;
|
5754
|
},
|
5755
|
bounceOut: function( B, A, D, C ) {
|
5756
|
if ( ( B /= C ) < ( 1 / 2.75 ) ) {
|
5757
|
return D * ( 7.5625 * B * B ) + A;
|
5758
|
} else {
|
5759
|
if ( B < ( 2 / 2.75 ) ) {
|
5760
|
return D * ( 7.5625 * ( B -= ( 1.5 / 2.75 ) ) * B + 0.75 ) + A;
|
5761
|
} else {
|
5762
|
if ( B < ( 2.5 / 2.75 ) ) {
|
5763
|
return D * ( 7.5625 * ( B -= ( 2.25 / 2.75 ) ) * B + 0.9375 ) + A;
|
5764
|
}
|
5765
|
}
|
5766
|
}
|
5767
|
return D * ( 7.5625 * ( B -= ( 2.625 / 2.75 ) ) * B + 0.984375 ) + A;
|
5768
|
},
|
5769
|
bounceBoth: function( B, A, D, C ) {
|
5770
|
if ( B < C / 2 ) {
|
5771
|
return YAHOO.util.Easing.bounceIn( B * 2, 0, D, C ) * 0.5 + A;
|
5772
|
}
|
5773
|
return YAHOO.util.Easing.bounceOut( B * 2 - C, 0, D, C ) * 0.5 + D * 0.5 + A;
|
5774
|
} };
|
5775
|
(function() {
|
5776
|
var A = function( H, G, I, J ) {
|
5777
|
if ( H ) {
|
5778
|
A.superclass.constructor.call( this, H, G, I, J );
|
5779
|
}
|
5780
|
};
|
5781
|
A.NAME = "Motion";
|
5782
|
var E = YAHOO.util;
|
5783
|
YAHOO.extend( A, E.ColorAnim );
|
5784
|
var F = A.superclass;
|
5785
|
var C = A.prototype;
|
5786
|
C.patterns.points = /^points$/i;
|
5787
|
C.setAttribute = function( G, I, H ) {
|
5788
|
if ( this.patterns.points.test( G ) ) {
|
5789
|
H = H || "px";
|
5790
|
F.setAttribute.call( this, "left", I[ 0 ], H );
|
5791
|
F.setAttribute.call( this, "top", I[ 1 ], H );
|
5792
|
} else {
|
5793
|
F.setAttribute.call( this, G, I, H );
|
5794
|
}
|
5795
|
};
|
5796
|
C.getAttribute = function( G ) {
|
5797
|
if ( this.patterns.points.test( G ) ) {
|
5798
|
var H = [ F.getAttribute.call( this, "left" ), F.getAttribute.call( this, "top" ) ];
|
5799
|
} else {
|
5800
|
H = F.getAttribute.call( this, G );
|
5801
|
}
|
5802
|
return H;
|
5803
|
};
|
5804
|
C.doMethod = function( G, K, H ) {
|
5805
|
var J = null;
|
5806
|
if ( this.patterns.points.test( G ) ) {
|
5807
|
var I = this.method( this.currentFrame, 0, 100, this.totalFrames ) / 100;
|
5808
|
J = E.Bezier.getPosition( this.runtimeAttributes[ G ], I );
|
5809
|
} else {
|
5810
|
J = F.doMethod.call( this, G, K, H );
|
5811
|
}
|
5812
|
return J;
|
5813
|
};
|
5814
|
C.setRuntimeAttribute = function( P ) {
|
5815
|
if ( this.patterns.points.test( P ) ) {
|
5816
|
var H = this.getEl();
|
5817
|
var J = this.attributes;
|
5818
|
var G;
|
5819
|
var L = J[ "points" ][ "control" ] || [];
|
5820
|
var I;
|
5821
|
var M, O;
|
5822
|
if ( L.length > 0 && !( L[ 0 ] instanceof Array ) ) {
|
5823
|
L = [ L ];
|
5824
|
} else {
|
5825
|
var K = [];
|
5826
|
for ( M = 0, O = L.length; M < O; ++M ) {
|
5827
|
K[ M ] = L[ M ];
|
5828
|
}
|
5829
|
L = K;
|
5830
|
}
|
5831
|
if ( E.Dom.getStyle( H, "position" ) == "static" ) {
|
5832
|
E.Dom.setStyle( H, "position", "relative" );
|
5833
|
}
|
5834
|
if ( D( J[ "points" ][ "from" ] ) ) {
|
5835
|
E.Dom.setXY( H, J[ "points" ][ "from" ] );
|
5836
|
} else {
|
5837
|
E.Dom.setXY( H, E.Dom.getXY( H ) );
|
5838
|
}
|
5839
|
G = this.getAttribute( "points" );
|
5840
|
if ( D( J[ "points" ][ "to" ] ) ) {
|
5841
|
I = B.call( this, J[ "points" ][ "to" ], G );
|
5842
|
var N = E.Dom.getXY( this.getEl() );
|
5843
|
for ( M = 0, O = L.length; M < O; ++M ) {
|
5844
|
L[ M ] = B.call( this, L[ M ], G );
|
5845
|
}
|
5846
|
} else {
|
5847
|
if ( D( J[ "points" ][ "by" ] ) ) {
|
5848
|
I = [ G[ 0 ] + J[ "points" ][ "by" ][ 0 ], G[ 1 ] + J[ "points" ][ "by" ][ 1 ] ];
|
5849
|
for ( M = 0, O = L.length; M < O; ++M ) {
|
5850
|
L[ M ] = [ G[ 0 ] + L[ M ][ 0 ], G[ 1 ] + L[ M ][ 1 ] ];
|
5851
|
}
|
5852
|
}
|
5853
|
}
|
5854
|
this.runtimeAttributes[ P ] = [ G ];
|
5855
|
if ( L.length > 0 ) {
|
5856
|
this.runtimeAttributes[ P ] = this.runtimeAttributes[ P ].concat( L );
|
5857
|
}
|
5858
|
this.runtimeAttributes[ P ][ this.runtimeAttributes[ P ].length ] = I;
|
5859
|
} else {
|
5860
|
F.setRuntimeAttribute.call( this, P );
|
5861
|
}
|
5862
|
};
|
5863
|
var B = function( G, I ) {
|
5864
|
var H = E.Dom.getXY( this.getEl() );
|
5865
|
G = [ G[ 0 ] - H[ 0 ] + I[ 0 ], G[ 1 ] - H[ 1 ] + I[ 1 ] ];
|
5866
|
return G;
|
5867
|
};
|
5868
|
var D = function( G ) {
|
5869
|
return ( typeof G !== "undefined" );
|
5870
|
};
|
5871
|
E.Motion = A;
|
5872
|
})();
|
5873
|
(function() {
|
5874
|
var D = function( F, E, G, H ) {
|
5875
|
if ( F ) {
|
5876
|
D.superclass.constructor.call( this, F, E, G, H );
|
5877
|
}
|
5878
|
};
|
5879
|
D.NAME = "Scroll";
|
5880
|
var B = YAHOO.util;
|
5881
|
YAHOO.extend( D, B.ColorAnim );
|
5882
|
var C = D.superclass;
|
5883
|
var A = D.prototype;
|
5884
|
A.doMethod = function( E, H, F ) {
|
5885
|
var G = null;
|
5886
|
if ( E == "scroll" ) {
|
5887
|
G = [ this.method( this.currentFrame, H[ 0 ], F[ 0 ] - H[ 0 ], this.totalFrames ), this.method( this.currentFrame, H[ 1 ], F[ 1 ] - H[ 1 ], this.totalFrames ) ];
|
5888
|
} else {
|
5889
|
G = C.doMethod.call( this, E, H, F );
|
5890
|
}
|
5891
|
return G;
|
5892
|
};
|
5893
|
A.getAttribute = function( E ) {
|
5894
|
var G = null;
|
5895
|
var F = this.getEl();
|
5896
|
if ( E == "scroll" ) {
|
5897
|
G = [ F.scrollLeft, F.scrollTop ];
|
5898
|
} else {
|
5899
|
G = C.getAttribute.call( this, E );
|
5900
|
}
|
5901
|
return G;
|
5902
|
};
|
5903
|
A.setAttribute = function( E, H, G ) {
|
5904
|
var F = this.getEl();
|
5905
|
if ( E == "scroll" ) {
|
5906
|
F.scrollLeft = H[ 0 ];
|
5907
|
F.scrollTop = H[ 1 ];
|
5908
|
} else {
|
5909
|
C.setAttribute.call( this, E, H, G );
|
5910
|
}
|
5911
|
};
|
5912
|
B.Scroll = D;
|
5913
|
})();
|
5914
|
YAHOO.register( "animation", YAHOO.util.Anim, { version: "2.7.0", build: "1799" } );
|