bebeboutik/js/pluginDetect.js

1 line
23 KiB
JavaScript
Raw Normal View History

2016-01-04 12:48:08 +01:00
/* PluginDetect v0.6.3 [ onWindowLoaded getVersion Java(OTF) QT DevalVR Shockwave Flash WMP Silverlight VLC ] by Eric Gerds www.pinlady.net/PluginDetect */ if(!PluginDetect){var PluginDetect={getNum:function(b,c){if(!this.num(b)){return null}var a;if(typeof c=="undefined"){a=/[\d][\d\.\_,-]*/.exec(b)}else{a=(new RegExp(c)).exec(b)}return a?a[0].replace(/[\.\_-]/g,","):null},hasMimeType:function(c){if(PluginDetect.isIE){return null}var b,a,d,e=c.constructor==String?[c]:c;for(d=0;d<e.length;d++){b=navigator.mimeTypes[e[d]];if(b&&b.enabledPlugin){a=b.enabledPlugin;if(a.name||a.description){return b}}}return null},findNavPlugin:function(g,d){var a=g.constructor==String?g:g.join(".*"),e=d===false?"":"\\d",b,c=new RegExp(a+".*"+e+"|"+e+".*"+a,"i"),f=navigator.plugins;for(b=0;b<f.length;b++){if(c.test(f[b].description)||c.test(f[b].name)){return f[b]}}return null},AXO:window.ActiveXObject,getAXO:function(b,a){var f=null,d,c=false;try{f=new this.AXO(b);c=true}catch(d){}if(typeof a!="undefined"){delete f;return c}return f},num:function(a){return(typeof a!="string"?false:(/\d/).test(a))},compareNums:function(g,e){var d=this,c,b,a,f=window.parseInt;if(!d.num(g)||!d.num(e)){return 0}if(d.plugin&&d.plugin.compareNums){return d.plugin.compareNums(g,e)}c=g.split(",");b=e.split(",");for(a=0;a<Math.min(c.length,b.length);a++){if(f(c[a],10)>f(b[a],10)){return 1}if(f(c[a],10)<f(b[a],10)){return -1}}return 0},formatNum:function(b){if(!this.num(b)){return null}var a,c=b.replace(/\s/g,"").replace(/[\.\_]/g,",").split(",").concat(["0","0","0","0"]);for(a=0;a<4;a++){if(/^(0+)(.+)$/.test(c[a])){c[a]=RegExp.$2}}if(!(/\d/).test(c[0])){c[0]="0"}return c[0]+","+c[1]+","+c[2]+","+c[3]},initScript:function(){var $=this,userAgent=navigator.userAgent;$.isIE=/*@cc_on!@*/false;$.IEver=$.isIE&&((/MSIE\s*(\d\.?\d*)/i).exec(userAgent))?parseFloat(RegExp.$1,10):-1;$.ActiveXEnabled=false;if($.isIE){var x,progid=["Msxml2.XMLHTTP","Msxml2.DOMDocument","Microsoft.XMLDOM","ShockwaveFlash.ShockwaveFlash","TDCCtl.TDCCtl","Shell.UIHelper","Scripting.Dictionary","wmplayer.ocx"];for(x=0;x<progid.length;x++){if($.getAXO(progid[x],1)){$.ActiveXEnabled=true;break}}$.head=typeof document.getElementsByTagName!="undefined"?document.getElementsByTagName("head")[0]:null}$.isGecko=!$.isIE&&typeof navigator.product=="string"&&(/Gecko/i).test(navigator.product)&&(/Gecko\s*\/\s*\d/i).test(userAgent)?true:false;$.GeckoRV=$.isGecko?$.formatNum((/rv\s*\:\s*([\.\,\d]+)/i).test(userAgent)?RegExp.$1:"0.9"):null;$.isSafari=!$.isIE&&(/Safari\s*\/\s*\d/i).test(userAgent)?true:false;$.isChrome=(/Chrome\s*\/\s*\d/i).test(userAgent)?true:false;$.onWindowLoaded(0)},init:function(c,a){if(typeof c!="string"){return -3}c=c.toLowerCase().replace(/\s/g,"");var b=this,d;if(typeof b[c]=="undefined"){return -3}d=b[c];b.plugin=d;if(typeof d.installed=="undefined"||a==true){d.installed=null;d.version=null;d.version0=null;d.getVersionDone=null;d.$=b}b.garbage=false;if(b.isIE&&!b.ActiveXEnabled){if(b.plugin!=b.java){return -2}}return 1},isMinVersion:function(g,e,c,b){return -3},getVersion:function(e,b,a){var d=PluginDetect,c=d.init(e),f;if(c<0){return null}f=d.plugin;if(f.getVersionDone!=1){f.getVersion(b,a);if(f.getVersionDone===null){f.getVersionDone=1}}d.cleanup();return(f.version||f.version0);return null},getInfo:function(f,c,b){var a={};return a},cleanup:function(){var a=this;if(a.garbage&&typeof window.CollectGarbage!="undefined"){window.CollectGarbage()}},isActiveXObject:function(b){var d=this,a,g,f="/",c='<object width="1" height="1" style="display:none" '+d.plugin.getCodeBaseVersion(b)+">"+d.plugin.HTML+"<"+f+"object>";if(d.head.firstChild){d.head.insertBefore(document.createElement("object"),d.head.firstChild)}else{d.head.appendChild(document.createElement("object"))}d.head.firstChild.outerHTML=c;try{d.head.firstChild.classid=d.plugin.classID}catch(g){}a=false;try{if(d.head.firstChild.object){a=true}}catch(g){}try{if(a&&d.head.firstChild.readyState<4){d.garbage=true}}catch(g){}d.head.removeChild(d.head.firstChild);return a},codebaseSearch:function(c){var e=this;if(!e.ActiveXEnabled){return null