/usr/share/javascript/yui/swfdetect/swfdetect.js is in libjs-yui 2.9.0.dfsg.0.1-0.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | /*
Copyright (c) 2011, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 2.9.0
*/
/**
* Utility for Flash version detection
* @namespace YAHOO.util
* @module swfdetect
*/
YAHOO.namespace("util");
/**
* Flafh detection utility.
* @class SWFDetect
* @static
*/
(function () {
var version = 0;
var uA = YAHOO.env.ua;
var sF = "ShockwaveFlash";
var mF, eP;
if (uA.gecko || uA.webkit || uA.opera) {
if ((mF = navigator.mimeTypes['application/x-shockwave-flash'])) {
if ((eP = mF.enabledPlugin)) {
var vS = [];
vS = eP.description.replace(/\s[rd]/g, '.').replace(/[A-Za-z\s]+/g, '').split('.');
version = vS[0] + '.';
switch((vS[2].toString()).length)
{
case 1:
version += "00";
break;
case 2:
version += "0";
break;
}
version += vS[2];
version = parseFloat(version);
}
}
}
else if(uA.ie) {
try
{
var ax6 = new ActiveXObject(sF + "." + sF + ".6");
ax6.AllowScriptAccess = "always";
}
catch(e)
{
if(ax6 != null)
{
version = 6.0;
}
}
if (version == 0) {
try
{
var ax = new ActiveXObject(sF + "." + sF);
var vS = [];
vS = ax.GetVariable("$version").replace(/[A-Za-z\s]+/g, '').split(',');
version = vS[0] + '.';
switch((vS[2].toString()).length)
{
case 1:
version += "00";
break;
case 2:
version += "0";
break;
}
version += vS[2];
version = parseFloat(version);
} catch (e) {}
}
}
uA.flash = version;
YAHOO.util.SWFDetect = {
getFlashVersion : function () {
return version;
},
isFlashVersionAtLeast : function (ver) {
return version >= ver;
},
parseFlashVersion : function (ver)
{
var flashVersion = ver;
if(YAHOO.lang.isString(ver))
{
var verSplit = ver.split(".");
if(verSplit.length > 2)
{
flashVersion = parseInt(verSplit[0]);
flashVersion += parseInt(verSplit[2]) * .001;
}
else
{
flashVersion = parseFloat(ver);
}
}
return YAHOO.lang.isNumber(flashVersion) ? flashVersion : null;
}
};
})();
YAHOO.register("swfdetect", YAHOO.util.SWFDetect, {version: "2.9.0", build: "2800"});
|