Mercurial > kallithea
annotate rhodecode/public/js/yui/swfdetect/swfdetect.js @ 1073:289ff43cc190 beta
update YUI dev libs to latest version
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Sun, 20 Feb 2011 20:58:07 +0100 |
parents | 1e757ac98988 |
children |
rev | line source |
---|---|
0 | 1 /* |
1073
289ff43cc190
update YUI dev libs to latest version
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
2 Copyright (c) 2010, Yahoo! Inc. All rights reserved. |
0 | 3 Code licensed under the BSD License: |
1073
289ff43cc190
update YUI dev libs to latest version
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
4 http://developer.yahoo.com/yui/license.html |
289ff43cc190
update YUI dev libs to latest version
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
5 version: 2.8.2r1 |
0 | 6 */ |
7 /** | |
8 * Utility for Flash version detection | |
9 * @namespace YAHOO.util | |
10 * @module swfdetect | |
11 */ | |
12 YAHOO.namespace("util"); | |
13 | |
14 /** | |
15 * Flafh detection utility. | |
16 * @class SWFDetect | |
17 * @static | |
18 */ | |
19 (function () { | |
20 | |
21 var version = 0; | |
22 var uA = YAHOO.env.ua; | |
23 var sF = "ShockwaveFlash"; | |
24 | |
25 if (uA.gecko || uA.webkit || uA.opera) { | |
26 if ((mF = navigator.mimeTypes['application/x-shockwave-flash'])) { | |
27 if ((eP = mF.enabledPlugin)) { | |
28 var vS = []; | |
29 vS = eP.description.replace(/\s[rd]/g, '.').replace(/[A-Za-z\s]+/g, '').split('.'); | |
30 version = vS[0] + '.'; | |
31 switch((vS[2].toString()).length) | |
32 { | |
33 case 1: | |
34 version += "00"; | |
35 break; | |
36 case 2: | |
37 version += "0"; | |
38 break; | |
39 } | |
40 version += vS[2]; | |
41 version = parseFloat(version); | |
42 } | |
43 } | |
44 } | |
45 else if(uA.ie) { | |
46 try | |
47 { | |
48 var ax6 = new ActiveXObject(sF + "." + sF + ".6"); | |
49 ax6.AllowScriptAccess = "always"; | |
50 } | |
51 catch(e) | |
52 { | |
53 if(ax6 != null) | |
54 { | |
55 version = 6.0; | |
56 } | |
57 } | |
58 if (version == 0) { | |
59 try | |
60 { | |
61 var ax = new ActiveXObject(sF + "." + sF); | |
62 var vS = []; | |
63 vS = ax.GetVariable("$version").replace(/[A-Za-z\s]+/g, '').split(','); | |
64 version = vS[0] + '.'; | |
65 switch((vS[2].toString()).length) | |
66 { | |
67 case 1: | |
68 version += "00"; | |
69 break; | |
70 case 2: | |
71 version += "0"; | |
72 break; | |
73 } | |
74 version += vS[2]; | |
75 version = parseFloat(version); | |
76 | |
77 } catch (e) {} | |
78 } | |
79 } | |
80 | |
81 uA.flash = version; | |
82 | |
83 YAHOO.util.SWFDetect = { | |
84 getFlashVersion : function () { | |
85 return version; | |
86 }, | |
87 | |
88 isFlashVersionAtLeast : function (ver) { | |
89 return version >= ver; | |
90 } | |
91 }; | |
92 })(); | |
1073
289ff43cc190
update YUI dev libs to latest version
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
93 YAHOO.register("swfdetect", YAHOO.util.SWFDetect, {version: "2.8.2r1", build: "7"}); |