From d179455dde34b576571d54fcc9c6810bfc9a366b Mon Sep 17 00:00:00 2001 From: Tom Goethals Date: Fri, 13 Feb 2009 14:52:34 +0100 Subject: [PATCH] [svn r18489] Updated hotspot question and extra trackers for assessment results in learning path --- .../plugin/hotspot/JavaScriptFlashGateway.swf | Bin 0 -> 420 bytes main/plugin/hotspot/js_methods.js | 86 ++++++++++++++++++ main/plugin/hotspot/vb_methods.vbscript | 11 +++ 3 files changed, 97 insertions(+) create mode 100644 main/plugin/hotspot/JavaScriptFlashGateway.swf create mode 100644 main/plugin/hotspot/js_methods.js create mode 100644 main/plugin/hotspot/vb_methods.vbscript diff --git a/main/plugin/hotspot/JavaScriptFlashGateway.swf b/main/plugin/hotspot/JavaScriptFlashGateway.swf new file mode 100644 index 0000000000000000000000000000000000000000..c0add059e6f6e81e422ad569a243b6ff05b4bf67 GIT binary patch literal 420 zcmV;V0bBkOL^w z_cL~IJ6Ewua}|kuiEE)%s;1##xIPY5Zo)*~rb;FU;raK}Sk3{?v=%=wn-_O5NN_10 z#3a_~%uJ+CMV9`Q8i_1kn~{pcUTq#*)B3Bb5%)Efm z)1r8WCuI!!t?_?)ZpG2kxl%m!XA{!FTp) za8kC=M16cV_~oDxyeT%|(RcBN?~Vi8y)i9~1*EqZ{(5nPvPnYD*+oRaGLa&OSVD~& zveXv1%eluWx7nu`dE@^A894h=Mg3uTT2S9OA*O#ub)!;kMyr@7lpTw%7HSRlDt_Ot z>{XVwr)r3drt}9M-5xg535&r@LaO=t3h`hy!+ba Ov^Negu= 3 check for Flash plugin in plugin array + if (navigator.plugins != null && navigator.plugins.length > 0) { + if (navigator.plugins[\"Shockwave Flash 2.0\"] || navigator.plugins[\"Shockwave Flash\"]) { + var swVer2 = navigator.plugins[\"Shockwave Flash 2.0\"] ? \" 2.0\" : \"\"; + var flashDescription = navigator.plugins[\"Shockwave Flash\" + swVer2].description; + descArray = flashDescription.split(\" \"); + tempArrayMajor = descArray[2].split(\".\"); + versionMajor = tempArrayMajor[0]; + versionMinor = tempArrayMajor[1]; + if ( descArray[3] != \"\" ) { + tempArrayMinor = descArray[3].split(\"r\"); + } else { + tempArrayMinor = descArray[4].split(\"r\"); + } + versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0; + flashVer = versionMajor + \".\" + versionMinor + \".\" + versionRevision; + } else { + flashVer = -1; + } + } + // MSN/WebTV 2.6 supports Flash 4 + else if (navigator.userAgent.toLowerCase().indexOf(\"webtv/2.6\") != -1) flashVer = 4; + // WebTV 2.5 supports Flash 3 + else if (navigator.userAgent.toLowerCase().indexOf(\"webtv/2.5\") != -1) flashVer = 3; + // older WebTV supports Flash 2 + else if (navigator.userAgent.toLowerCase().indexOf(\"webtv\") != -1) flashVer = 2; + // Can\'t detect in all other cases + else { + + flashVer = -1; + } + return flashVer; +} +// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available +function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision) +{ + reqVer = parseFloat(reqMajorVer + \".\" + reqRevision); + // loop backwards through the versions until we find the newest version + for (i=25;i>0;i--) { + if (isIE && isWin && !isOpera) { + versionStr = VBGetSwfVer(i); + } else { + versionStr = JSGetSwfVer(i); + } + if (versionStr == -1 ) { + return false; + } else if (versionStr != 0) { + if(isIE && isWin && !isOpera) { + tempArray = versionStr.split(\" \"); + tempString = tempArray[1]; + versionArray = tempString .split(\",\"); + } else { + versionArray = versionStr.split(\".\"); + } + versionMajor = versionArray[0]; + versionMinor = versionArray[1]; + versionRevision = versionArray[2]; + + versionString = versionMajor + \".\" + versionRevision; // 7.0r24 == 7.24 + versionNum = parseFloat(versionString); + // is the major.revision >= requested major.revision AND the minor version >= requested minor + if ( (versionMajor > reqMajorVer) && (versionNum >= reqVer) ) { + return true; + } else { + return ((versionNum >= reqVer && versionMinor >= reqMinorVer) ? true : false ); + } + } + } +} diff --git a/main/plugin/hotspot/vb_methods.vbscript b/main/plugin/hotspot/vb_methods.vbscript new file mode 100644 index 0000000000..20d354f19e --- /dev/null +++ b/main/plugin/hotspot/vb_methods.vbscript @@ -0,0 +1,11 @@ +Function VBGetSwfVer(i) + on error resume next + Dim swControl, swVersion + swVersion = 0 + + set swControl = CreateObject(\"ShockwaveFlash.ShockwaveFlash.\" + CStr(i)) + if (IsObject(swControl)) then + swVersion = swControl.GetVariable(\"\$version\") + end if + VBGetSwfVer = swVersion +End Function