diff options
Diffstat (limited to 'lib/scripts/media.js')
-rw-r--r-- | lib/scripts/media.js | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/lib/scripts/media.js b/lib/scripts/media.js index a9b8b49da..f407aa2f7 100644 --- a/lib/scripts/media.js +++ b/lib/scripts/media.js @@ -11,7 +11,7 @@ * @author Pierre Spring <pierre.spring@caillou.ch> */ (function ($) { - var toggle, list, prepare_content, insert, confirmattach, attachoptions, initpopup, updatehide, setalign, setsize, inSet, outSet, media_manager; + var toggle, list, prepare_content, insert, confirmattach, attachoptions, initpopup, updatehide, setalign, setsize, inSet, outSet, media_manager, hasFlash; var media_manager = { keepopen: false, @@ -156,6 +156,26 @@ btn.value = LANG['mediainsert']; btnp.appendChild(btn); }; + + // moved from helpers.js temporarily here + /** + * Very simplistic Flash plugin check, probably works for Flash 8 and higher only + * + */ + hasFlash = function(version){ + var ver = 0; + try{ + if(navigator.plugins != null && navigator.plugins.length > 0){ + ver = navigator.plugins["Shockwave Flash"].description.split(' ')[2].split('.')[0]; + }else{ + var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash"); + ver = axo.GetVariable("$version").split(' ')[1].split(',')[0]; + } + }catch(e){ } + + if(ver >= version) return true; + return false; + }; /** * Insert the clicked image into the opener's textarea |