PageRenderTime 17ms CodeModel.GetById 8ms app.highlight 3ms RepoModel.GetById 2ms app.codeStats 0ms

/Frameworks/AppKit/browser.platform/CPCompatibility.j

http://github.com/jfahrenkrug/MapKit-HelloWorld
Unknown | 108 lines | 108 code | 0 blank | 0 comment | 0 complexity | 8dae61bd5bd349f176e4446d640cbabf MD5 | raw file
  1i;9;CPEvent.jc;3118;
  2CPUnknownBrowserEngine=0;
  3CPGeckoBrowserEngine=1;
  4CPInternetExplorerBrowserEngine=2;
  5CPKHTMLBrowserEngine=3;
  6CPOperaBrowserEngine=4;
  7CPWebKitBrowserEngine=5;
  8CPCSSRGBAFeature=1<<5;
  9CPHTMLCanvasFeature=1<<6;
 10CPHTMLContentEditableFeature=1<<7;
 11CPJavascriptInnerTextFeature=1<<8;
 12CPJavascriptTextContentFeature=1<<9;
 13CPJavascriptClipboardEventsFeature=1<<10;
 14CPJavascriptClipboardAccessFeature=1<<11;
 15CPJavaScriptCanvasDrawFeature=1<<12;
 16CPJavaScriptCanvasTransformFeature=1<<13;
 17CPVMLFeature=1<<14;
 18CPJavascriptRemedialKeySupport=1<<15;
 19CPJavaScriptShadowFeature=1<<20;
 20CPJavaScriptNegativeMouseWheelValues=1<<22;
 21CPJavaScriptMouseWheelValues_8_15=1<<23;
 22CPOpacityRequiresFilterFeature=1<<24;
 23CPInputTypeCanBeChangedFeature=1<<25;
 24var _1="",_2=CPUnknownBrowserEngine,_3=0;
 25_3|=CPInputTypeCanBeChangedFeature;
 26if(typeof window!="undfined"&&typeof window.navigator!="undefined"){
 27_1=window.navigator.userAgent;
 28}
 29if(window.opera){
 30_2=CPOperaBrowserEngine;
 31_3|=CPJavaScriptCanvasDrawFeature;
 32}else{
 33if(window.attachEvent){
 34_2=CPInternetExplorerBrowserEngine;
 35_3|=CPVMLFeature;
 36_3|=CPJavascriptRemedialKeySupport;
 37_3|=CPJavaScriptShadowFeature;
 38_3|=CPOpacityRequiresFilterFeature;
 39_3&=~CPInputTypeCanBeChangedFeature;
 40}else{
 41if(_1.indexOf("AppleWebKit/")!=-1){
 42_2=CPWebKitBrowserEngine;
 43_3|=CPCSSRGBAFeature;
 44_3|=CPHTMLContentEditableFeature;
 45_3|=CPJavascriptClipboardEventsFeature;
 46_3|=CPJavascriptClipboardAccessFeature;
 47_3|=CPJavaScriptShadowFeature;
 48var _4=_1.indexOf("AppleWebKit/")+"AppleWebKit/".length,_5=_1.indexOf(" ",_4),_6=parseFloat(_1.substring(_4,_5),10);
 49if(_1.indexOf("Plainview")==-1&&_6>=525.14||_1.indexOf("Chrome")!=-1){
 50_3|=CPJavascriptRemedialKeySupport;
 51}
 52}else{
 53if(_1.indexOf("KHTML")!=-1){
 54_2=CPKHTMLBrowserEngine;
 55}else{
 56if(_1.indexOf("Gecko")!=-1){
 57_2=CPGeckoBrowserEngine;
 58_3|=CPJavaScriptCanvasDrawFeature;
 59var _7=_1.indexOf("Firefox"),_6=(_7==-1)?2:parseFloat(_1.substring(_7+"Firefox".length+1));
 60if(_6>=3){
 61_3|=CPCSSRGBAFeature;
 62}
 63var _8=_1.indexOf("Gecko"),_9=(_8===-1)?0:parseFloat(_1.substring(_8+"Gecko".length+1,_1.indexOf(" ",_8)));
 64if(_6<20061028){
 65_3|=CPJavaScriptMouseWheelValues_8_15;
 66}
 67}
 68}
 69}
 70}
 71}
 72if(typeof document!="undefined"){
 73var _a=document.createElement("canvas");
 74if(_a&&_a.getContext){
 75_3|=CPHTMLCanvasFeature;
 76var _b=document.createElement("canvas").getContext("2d");
 77if(_b&&_b.setTransform&&_b.transform){
 78_3|=CPJavaScriptCanvasTransformFeature;
 79}
 80}
 81var _c=document.createElement("div");
 82if(_c.innerText!=undefined){
 83_3|=CPJavascriptInnerTextFeature;
 84}else{
 85if(_c.textContent!=undefined){
 86_3|=CPJavascriptTextContentFeature;
 87}
 88}
 89}
 90CPFeatureIsCompatible=function(_d){
 91return _3&_d;
 92};
 93CPBrowserIsEngine=function(_e){
 94return _2==_e;
 95};
 96if(_1.indexOf("Mac")!=-1){
 97CPPlatformActionKeyMask=CPCommandKeyMask;
 98CPUndoKeyEquivalent="Z";
 99CPRedoKeyEquivalent="Z";
100CPUndoKeyEquivalentModifierMask=CPCommandKeyMask;
101CPRedoKeyEquivalentModifierMask=CPCommandKeyMask|CPShiftKeyMask;
102}else{
103CPPlatformActionKeyMask=CPControlKeyMask;
104CPUndoKeyEquivalent="Z";
105CPRedoKeyEquivalent="Y";
106CPUndoKeyEquivalentModifierMask=CPControlKeyMask;
107CPRedoKeyEquivalentModifierMask=CPControlKeyMask;
108}