Cappuccino  1.0.0
 All Classes Files Functions Variables Typedefs Macros Groups Pages
CPCompatibility.j File Reference

Go to the source code of this file.

Functions

function CPBrowserBackingStorePixelRatio (context)
 
function CPBrowserCSSProperty (aProperty)
 
function CPBrowserIsEngine (anEngine)
 
function CPBrowserIsOperatingSystem (anOperatingSystem)
 
function CPBrowserStyleProperty (aProperty)
 
function CPFeatureIsCompatible (aFeature)
 
function CPPlatformHasBug (aBug)
 
function CPSetPlatformFeature (aFeature, aBool)
 
 if (typeof window!=="undefined"&&typeof window.navigator!=="undefined") USER_AGENT
 
else if (USER_AGENT.indexOf("Edge/")!=-1)
 
else if (USER_AGENT.indexOf("AppleWebKit/")!=-1)
 
else if (USER_AGENT.indexOf("KHTML")!=-1)
 
else if (USER_AGENT.indexOf("Gecko")!==-1)
 
 if (typeof document!="undefined")
 
 if (USER_AGENT.indexOf("Mac")!==-1)
 

Variables

 CPAltEnterTextAreaFeature = 32
 
 CPBlinkBrowserEngine = 1 << 5
 
 CPCanvasParentDrawErrorsOnMovementBug = 1 << 0
 
 CPCSSAnimationFeature = 33
 
 CPCSSRGBAFeature = 5
 
 CPEdgeBrowserEngine = 1 << 6
 
 CPFileAPIFeature = 31
 
 CPGeckoBrowserEngine = 1 << 0
 
 CPHTML5DragAndDropSourceYOffBy1 = 26
 
 CPHTMLCanvasFeature = 6
 
 CPHTMLContentEditableFeature = 7
 
 CPHTMLDragAndDropFeature = 8
 
 CPInput1PxLeftPadding = 29
 
 CPInputOnInputEventFeature = 30
 
 CPInputSetFontOutsideOfDOM = 28
 
 CPInputTypeCanBeChangedFeature = 25
 
 CPInternetExplorerBrowserEngine = 1 << 1
 
 CPJavaScriptCanvasDrawFeature = 13
 
 CPJavaScriptCanvasTransformFeature = 14
 
 CPJavaScriptClipboardAccessFeature = 12
 
 CPJavaScriptClipboardEventsFeature = 11
 
 CPJavaScriptInnerTextFeature = 9
 
 CPJavaScriptMouseWheelValues_8_15 = 23
 
 CPJavaScriptNegativeMouseWheelValues = 22
 
 CPJavaScriptPasteCantRefocus = 1 << 2
 
 CPJavaScriptPasteRequiresEditableTarget = 1 << 1
 
 CPJavaScriptRemedialKeySupport = 16
 
 CPJavaScriptShadowFeature = 20
 
 CPJavaScriptTextContentFeature = 10
 
 CPKHTMLBrowserEngine = 1 << 2
 
 CPMacOperatingSystem = 0
 
 CPOpacityRequiresFilterFeature = 24
 
 CPOperaBrowserEngine = 1 << 3
 
 CPOtherOperatingSystem = 2
 
 CPPlatformActionKeyMask = CPControlKeyMask
 
 CPRedoKeyEquivalent = @"y"
 
 CPRedoKeyEquivalentModifierMask = CPControlKeyMask
 
 CPSOPDisabledFromFileURLs = 27
 
 CPTextSizingAlwaysNeedsSetFontBug = 1 << 3
 
 CPUndoKeyEquivalent = @"z"
 
 CPUndoKeyEquivalentModifierMask = CPControlKeyMask
 
 CPUnknownBrowserEngine = 0
 
 CPVMLFeature = 15
 
 CPWebKitBrowserEngine = 1 << 4
 
 CPWindowsOperatingSystem = 1
 
 else
 
 OPERATING_SYSTEM = CPOtherOperatingSystem
 
var PLATFORM_BUGS = 0
 
var PLATFORM_ENGINE = CPUnknownBrowserEngine
 
var PLATFORM_FEATURES = []
 
var PLATFORM_STYLE_JS_PROPERTIES = {}
 
var USER_AGENT = ""
 

Function Documentation

function CPBrowserBackingStorePixelRatio ( context  )

Definition at line 496 of file CPCompatibility.j.

function CPBrowserCSSProperty ( aProperty  )

Definition at line 459 of file CPCompatibility.j.

function CPBrowserIsEngine ( anEngine  )

Definition at line 321 of file CPCompatibility.j.

function CPBrowserIsOperatingSystem ( anOperatingSystem  )

Definition at line 326 of file CPCompatibility.j.

function CPBrowserStyleProperty ( aProperty  )

Return the properly prefixed JS property for the given name. E.g. in a webkit browser, CPBrowserStyleProperty('transition') -> WebkitTransition

While technically not a style property, style related event handler names are also supported. CPBrowserStyleProperty('transitionend') -> 'webkitTransitionEnd'

CSS is only available in platform(dom), so don't rely too heavily on it.

Definition at line 376 of file CPCompatibility.j.

function CPFeatureIsCompatible ( aFeature  )

Definition at line 311 of file CPCompatibility.j.

function CPPlatformHasBug ( aBug  )

Definition at line 316 of file CPCompatibility.j.

function CPSetPlatformFeature ( aFeature  ,
aBool   
)

Sets a feature with the given value.

Definition at line 362 of file CPCompatibility.j.

else if ( typeof window!  = = "undefined" && typeof window.navigator !== "undefined")

Definition at line 120 of file CPCompatibility.j.

else if ( USER_AGENT.indexOf("Edge/")!  = -1)

Definition at line 149 of file CPCompatibility.j.

else if ( USER_AGENT.indexOf("AppleWebKit/")!  = -1)

Definition at line 171 of file CPCompatibility.j.

else if ( USER_AGENT.indexOf("KHTML")!  = -1)

Definition at line 224 of file CPCompatibility.j.

else if ( USER_AGENT.indexOf("Gecko")!  = = -1)

Definition at line 230 of file CPCompatibility.j.

if ( typeof document!  = "undefined")

Definition at line 262 of file CPCompatibility.j.

if ( USER_AGENT.indexOf("Mac")!  = = -1)

Definition at line 333 of file CPCompatibility.j.

Variable Documentation

CPAltEnterTextAreaFeature = 32

Definition at line 81 of file CPCompatibility.j.

CPBlinkBrowserEngine = 1 << 5

Definition at line 32 of file CPCompatibility.j.

CPCanvasParentDrawErrorsOnMovementBug = 1 << 0

Definition at line 88 of file CPCompatibility.j.

CPCSSAnimationFeature = 33

Definition at line 83 of file CPCompatibility.j.

CPCSSRGBAFeature = 5

Definition at line 41 of file CPCompatibility.j.

CPEdgeBrowserEngine = 1 << 6

Definition at line 33 of file CPCompatibility.j.

CPFileAPIFeature = 31

Definition at line 79 of file CPCompatibility.j.

CPGeckoBrowserEngine = 1 << 0

Definition at line 27 of file CPCompatibility.j.

CPHTML5DragAndDropSourceYOffBy1 = 26

Definition at line 68 of file CPCompatibility.j.

CPHTMLCanvasFeature = 6

Definition at line 43 of file CPCompatibility.j.

CPHTMLContentEditableFeature = 7

Definition at line 44 of file CPCompatibility.j.

CPHTMLDragAndDropFeature = 8

Definition at line 45 of file CPCompatibility.j.

CPInput1PxLeftPadding = 29

Definition at line 76 of file CPCompatibility.j.

CPInputOnInputEventFeature = 30

Definition at line 77 of file CPCompatibility.j.

CPInputSetFontOutsideOfDOM = 28

Definition at line 73 of file CPCompatibility.j.

CPInputTypeCanBeChangedFeature = 25

Definition at line 67 of file CPCompatibility.j.

CPInternetExplorerBrowserEngine = 1 << 1

Definition at line 28 of file CPCompatibility.j.

CPJavaScriptCanvasDrawFeature = 13

Definition at line 53 of file CPCompatibility.j.

CPJavaScriptCanvasTransformFeature = 14

Definition at line 54 of file CPCompatibility.j.

CPJavaScriptClipboardAccessFeature = 12

Definition at line 52 of file CPCompatibility.j.

CPJavaScriptClipboardEventsFeature = 11

Definition at line 50 of file CPCompatibility.j.

CPJavaScriptInnerTextFeature = 9

Definition at line 47 of file CPCompatibility.j.

CPJavaScriptMouseWheelValues_8_15 = 23

Definition at line 62 of file CPCompatibility.j.

CPJavaScriptNegativeMouseWheelValues = 22

Definition at line 61 of file CPCompatibility.j.

CPJavaScriptPasteCantRefocus = 1 << 2

Definition at line 93 of file CPCompatibility.j.

CPJavaScriptPasteRequiresEditableTarget = 1 << 1

Definition at line 91 of file CPCompatibility.j.

CPJavaScriptRemedialKeySupport = 16

Definition at line 58 of file CPCompatibility.j.

CPJavaScriptShadowFeature = 20

Definition at line 59 of file CPCompatibility.j.

CPJavaScriptTextContentFeature = 10

Definition at line 48 of file CPCompatibility.j.

CPKHTMLBrowserEngine = 1 << 2

Definition at line 29 of file CPCompatibility.j.

CPMacOperatingSystem = 0

Definition at line 36 of file CPCompatibility.j.

CPOpacityRequiresFilterFeature = 24

Definition at line 64 of file CPCompatibility.j.

CPOperaBrowserEngine = 1 << 3

Definition at line 30 of file CPCompatibility.j.

CPOtherOperatingSystem = 2

Definition at line 38 of file CPCompatibility.j.

CPPlatformActionKeyMask = CPControlKeyMask

Definition at line 350 of file CPCompatibility.j.

CPRedoKeyEquivalent = @"y"

Definition at line 353 of file CPCompatibility.j.

CPRedoKeyEquivalentModifierMask = CPControlKeyMask

Definition at line 356 of file CPCompatibility.j.

CPSOPDisabledFromFileURLs = 27

Definition at line 70 of file CPCompatibility.j.

CPTextSizingAlwaysNeedsSetFontBug = 1 << 3

Definition at line 102 of file CPCompatibility.j.

CPUndoKeyEquivalent = @"z"

Definition at line 352 of file CPCompatibility.j.

CPUndoKeyEquivalentModifierMask = CPControlKeyMask

Definition at line 355 of file CPCompatibility.j.

CPUnknownBrowserEngine = 0

Definition at line 26 of file CPCompatibility.j.

CPVMLFeature = 15

Definition at line 56 of file CPCompatibility.j.

CPWebKitBrowserEngine = 1 << 4

Definition at line 31 of file CPCompatibility.j.

CPWindowsOperatingSystem = 1

Definition at line 37 of file CPCompatibility.j.

else
Initial value:
{
if (USER_AGENT.indexOf("Windows") !== -1)

Definition at line 346 of file CPCompatibility.j.

OPERATING_SYSTEM = CPOtherOperatingSystem

Definition at line 331 of file CPCompatibility.j.

var PLATFORM_BUGS = 0

Definition at line 108 of file CPCompatibility.j.

var PLATFORM_ENGINE = CPUnknownBrowserEngine

Definition at line 106 of file CPCompatibility.j.

PLATFORM_FEATURES[CPAltEnterTextAreaFeature] = []

Definition at line 107 of file CPCompatibility.j.

var PLATFORM_STYLE_JS_PROPERTIES = {}

Definition at line 109 of file CPCompatibility.j.

var USER_AGENT = ""

Definition at line 105 of file CPCompatibility.j.