06f7e0b4138d8ea5759abb54c95ddcfbb08a4940.svn-base 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. (function ($) {
  2. //$.getScript("http://java.com/js/deployJava.js");
  3. //checks if browser object exists
  4. if (typeof $.browser === "undefined" || !$.browser) {
  5. var browser = {};
  6. $.extend(browser);
  7. }
  8. var pluginList = {
  9. flash: {
  10. activex: ["ShockwaveFlash.ShockwaveFlash", "ShockwaveFlash.ShockwaveFlash.3", "ShockwaveFlash.ShockwaveFlash.4", "ShockwaveFlash.ShockwaveFlash.5", "ShockwaveFlash.ShockwaveFlash.6", "ShockwaveFlash.ShockwaveFlash.7"],
  11. plugin: /flash/gim
  12. },
  13. sl: {
  14. activex: ["AgControl.AgControl"],
  15. plugin: /silverlight/gim
  16. },
  17. pdf: {
  18. activex: ["acroPDF.PDF.1", "PDF.PdfCtrl.1", "PDF.PdfCtrl.4", "PDF.PdfCtrl.5", "PDF.PdfCtrl.6"],
  19. plugin: /adobe\s?acrobat/gim
  20. },
  21. qtime: {
  22. activex: ["QuickTime.QuickTime", "QuickTimeCheckObject.QuickTimeCheck.1", "QuickTime.QuickTime.4"],
  23. plugin: /quicktime/gim
  24. },
  25. wmp: {
  26. activex: ["WMPlayer.OCX", "MediaPlayer.MediaPlayer.1"],
  27. plugin: /(windows\smedia)|(Microsoft)/gim
  28. },
  29. shk: {
  30. activex: ["SWCtl.SWCtl", "SWCt1.SWCt1.7", "SWCt1.SWCt1.8", "SWCt1.SWCt1.9", "ShockwaveFlash.ShockwaveFlash.1"],
  31. plugin: /shockwave/gim
  32. },
  33. rp: {
  34. activex: ["RealPlayer", "rmocx.RealPlayer G2 Control.1"],
  35. plugin: /realplayer/gim
  36. }
  37. };
  38. var isSupported = function (p) {
  39. if (window.ActiveXObject) {
  40. $.browser[p] = false;
  41. for (i = 0; i < pluginList[p].activex.length; i++) {
  42. try {
  43. new ActiveXObject(pluginList[p].activex[i]);
  44. $.browser[p] = true;
  45. } catch (e) {}
  46. }
  47. } else {
  48. $.each(navigator.plugins, function () {
  49. if (this.name.match(pluginList[p].plugin)) {
  50. $.browser[p] = true;
  51. return false;
  52. } else {
  53. $.browser[p] = false;
  54. }
  55. });
  56. }
  57. };
  58. $.each(pluginList, function (i, n) {
  59. isSupported(i);
  60. });
  61. //uses sun script to detect if java plugin is available
  62. /*
  63. $.getScript("http://java.com/js/deployJava.js", function () {
  64. if (deployJava.versionCheck("1.6.0+") || deployJava.versionCheck("1.4") || deployJava.versionCheck("1.5.0*")) {
  65. $.browser.java = true;
  66. } else {
  67. $.browser.java = false;
  68. }
  69. });
  70. */
  71. })(jQuery);