/usr/share/javascript/yui3/swfdetect/swfdetect.js is in libjs-yui3-full 3.5.1-1ubuntu3.
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 114 115 116 117 118 119 120 121 | /*
YUI 3.5.1 (build 22)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add('swfdetect', function(Y) {
/**
* Utility for Flash version detection
* @module swfdetect
*/
// Shortcuts and helper methods
var version = 0,
uA = Y.UA,
lG = Y.Lang,
sF = "ShockwaveFlash",
mF, eP, vS, ax6, ax;
function makeInt(n) {
return parseInt(n, 10);
}
function parseFlashVersion (flashVer) {
if (lG.isNumber(makeInt(flashVer[0]))) {
uA.flashMajor = flashVer[0];
}
if (lG.isNumber(makeInt(flashVer[1]))) {
uA.flashMinor = flashVer[1];
}
if (lG.isNumber(makeInt(flashVer[2]))) {
uA.flashRev = flashVer[2];
}
}
if (uA.gecko || uA.webkit || uA.opera) {
if ((mF = navigator.mimeTypes['application/x-shockwave-flash'])) {
if ((eP = mF.enabledPlugin)) {
vS = eP.description.replace(/\s[rd]/g, '.').replace(/[A-Za-z\s]+/g, '').split('.');
parseFlashVersion(vS);
}
}
}
else if(uA.ie) {
try
{
ax6 = new ActiveXObject(sF + "." + sF + ".6");
ax6.AllowScriptAccess = "always";
}
catch (e)
{
if(ax6 !== null)
{
version = 6.0;
}
}
if (version === 0) {
try
{
ax = new ActiveXObject(sF + "." + sF);
vS = ax.GetVariable("$version").replace(/[A-Za-z\s]+/g, '').split(',');
parseFlashVersion(vS);
} catch (e2) {}
}
}
/** Create a calendar view to represent a single or multiple
* month range of dates, rendered as a grid with date and
* weekday labels.
*
* @class SWFDetect
* @constructor
*/
Y.SWFDetect = {
/**
* Returns the version of either the Flash Player plugin (in Mozilla/WebKit/Opera browsers),
* or the Flash Player ActiveX control (in IE), as a String of the form "MM.mm.rr", where
* MM is the major version, mm is the minor version, and rr is the revision.
* @method getFlashVersion
*/
getFlashVersion : function () {
return (String(uA.flashMajor) + "." + String(uA.flashMinor) + "." + String(uA.flashRev));
},
/**
* Checks whether the version of the Flash player installed on the user's machine is greater
* than or equal to the one specified. If it is, this method returns true; it is false otherwise.
* @method isFlashVersionAtLeast
* @return {Boolean} Whether the Flash player version is greater than or equal to the one specified.
* @param flashMajor {int} The Major version of the Flash player to compare against.
* @param flashMinor {int} The Minor version of the Flash player to compare against.
* @param flashRev {int} The Revision version of the Flash player to compare against.
*/
isFlashVersionAtLeast : function (flashMajor, flashMinor, flashRev) {
var uaMajor = makeInt(uA.flashMajor),
uaMinor = makeInt(uA.flashMinor),
uaRev = makeInt(uA.flashRev);
flashMajor = makeInt(flashMajor || 0);
flashMinor = makeInt(flashMinor || 0);
flashRev = makeInt(flashRev || 0);
if (flashMajor === uaMajor) {
if (flashMinor === uaMinor) {
return flashRev <= uaRev;
}
return flashMinor < uaMinor;
}
return flashMajor < uaMajor;
}
};
}, '3.5.1' ,{requires:['yui-base']});
|