API  0.9.10
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("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
 
 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

◆ CPBrowserBackingStorePixelRatio()

function CPBrowserBackingStorePixelRatio ( context  )

Definition at line 473 of file CPCompatibility.j.

◆ CPBrowserCSSProperty()

function CPBrowserCSSProperty ( aProperty  )

Definition at line 436 of file CPCompatibility.j.

◆ CPBrowserIsEngine()

function CPBrowserIsEngine ( anEngine  )

Definition at line 298 of file CPCompatibility.j.

◆ CPBrowserIsOperatingSystem()

function CPBrowserIsOperatingSystem ( anOperatingSystem  )

Definition at line 303 of file CPCompatibility.j.

◆ CPBrowserStyleProperty()

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 353 of file CPCompatibility.j.

◆ CPFeatureIsCompatible()

function CPFeatureIsCompatible ( aFeature  )

Definition at line 288 of file CPCompatibility.j.

◆ CPPlatformHasBug()

function CPPlatformHasBug ( aBug  )

Definition at line 293 of file CPCompatibility.j.

◆ CPSetPlatformFeature()

function CPSetPlatformFeature ( aFeature  ,
aBool   
)

Sets a feature with the given value.

Definition at line 339 of file CPCompatibility.j.

◆ if() [1/6]

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

Definition at line 119 of file CPCompatibility.j.

◆ if() [2/6]

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

Definition at line 148 of file CPCompatibility.j.

◆ if() [3/6]

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

Definition at line 201 of file CPCompatibility.j.

◆ if() [4/6]

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

Definition at line 207 of file CPCompatibility.j.

◆ if() [5/6]

if ( typeof document !  = "undefined")

Definition at line 239 of file CPCompatibility.j.

◆ if() [6/6]

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

Definition at line 310 of file CPCompatibility.j.

Variable Documentation

◆ CPAltEnterTextAreaFeature

CPAltEnterTextAreaFeature = 32

Definition at line 80 of file CPCompatibility.j.

◆ CPBlinkBrowserEngine

CPBlinkBrowserEngine = 1 << 5

Definition at line 32 of file CPCompatibility.j.

◆ CPCanvasParentDrawErrorsOnMovementBug

CPCanvasParentDrawErrorsOnMovementBug = 1 << 0

Definition at line 87 of file CPCompatibility.j.

◆ CPCSSAnimationFeature

CPCSSAnimationFeature = 33

Definition at line 82 of file CPCompatibility.j.

◆ CPCSSRGBAFeature

CPCSSRGBAFeature = 5

Definition at line 40 of file CPCompatibility.j.

◆ CPFileAPIFeature

CPFileAPIFeature = 31

Definition at line 78 of file CPCompatibility.j.

◆ CPGeckoBrowserEngine

CPGeckoBrowserEngine = 1 << 0

Definition at line 27 of file CPCompatibility.j.

◆ CPHTML5DragAndDropSourceYOffBy1

CPHTML5DragAndDropSourceYOffBy1 = 26

Definition at line 67 of file CPCompatibility.j.

◆ CPHTMLCanvasFeature

CPHTMLCanvasFeature = 6

Definition at line 42 of file CPCompatibility.j.

◆ CPHTMLContentEditableFeature

CPHTMLContentEditableFeature = 7

Definition at line 43 of file CPCompatibility.j.

◆ CPHTMLDragAndDropFeature

CPHTMLDragAndDropFeature = 8

Definition at line 44 of file CPCompatibility.j.

◆ CPInput1PxLeftPadding

CPInput1PxLeftPadding = 29

Definition at line 75 of file CPCompatibility.j.

◆ CPInputOnInputEventFeature

CPInputOnInputEventFeature = 30

Definition at line 76 of file CPCompatibility.j.

◆ CPInputSetFontOutsideOfDOM

CPInputSetFontOutsideOfDOM = 28

Definition at line 72 of file CPCompatibility.j.

◆ CPInputTypeCanBeChangedFeature

CPInputTypeCanBeChangedFeature = 25

Definition at line 66 of file CPCompatibility.j.

◆ CPInternetExplorerBrowserEngine

CPInternetExplorerBrowserEngine = 1 << 1

Definition at line 28 of file CPCompatibility.j.

◆ CPJavaScriptCanvasDrawFeature

CPJavaScriptCanvasDrawFeature = 13

Definition at line 52 of file CPCompatibility.j.

◆ CPJavaScriptCanvasTransformFeature

CPJavaScriptCanvasTransformFeature = 14

Definition at line 53 of file CPCompatibility.j.

◆ CPJavaScriptClipboardAccessFeature

CPJavaScriptClipboardAccessFeature = 12

Definition at line 51 of file CPCompatibility.j.

◆ CPJavaScriptClipboardEventsFeature

CPJavaScriptClipboardEventsFeature = 11

Definition at line 49 of file CPCompatibility.j.

◆ CPJavaScriptInnerTextFeature

CPJavaScriptInnerTextFeature = 9

Definition at line 46 of file CPCompatibility.j.

◆ CPJavaScriptMouseWheelValues_8_15

CPJavaScriptMouseWheelValues_8_15 = 23

Definition at line 61 of file CPCompatibility.j.

◆ CPJavaScriptNegativeMouseWheelValues

CPJavaScriptNegativeMouseWheelValues = 22

Definition at line 60 of file CPCompatibility.j.

◆ CPJavaScriptPasteCantRefocus

CPJavaScriptPasteCantRefocus = 1 << 2

Definition at line 92 of file CPCompatibility.j.

◆ CPJavaScriptPasteRequiresEditableTarget

CPJavaScriptPasteRequiresEditableTarget = 1 << 1

Definition at line 90 of file CPCompatibility.j.

◆ CPJavaScriptRemedialKeySupport

CPJavaScriptRemedialKeySupport = 16

Definition at line 57 of file CPCompatibility.j.

◆ CPJavaScriptShadowFeature

CPJavaScriptShadowFeature = 20

Definition at line 58 of file CPCompatibility.j.

◆ CPJavaScriptTextContentFeature

CPJavaScriptTextContentFeature = 10

Definition at line 47 of file CPCompatibility.j.

◆ CPKHTMLBrowserEngine

CPKHTMLBrowserEngine = 1 << 2

Definition at line 29 of file CPCompatibility.j.

◆ CPMacOperatingSystem

CPMacOperatingSystem = 0

Definition at line 35 of file CPCompatibility.j.

◆ CPOpacityRequiresFilterFeature

CPOpacityRequiresFilterFeature = 24

Definition at line 63 of file CPCompatibility.j.

◆ CPOperaBrowserEngine

CPOperaBrowserEngine = 1 << 3

Definition at line 30 of file CPCompatibility.j.

◆ CPOtherOperatingSystem

CPOtherOperatingSystem = 2

Definition at line 37 of file CPCompatibility.j.

◆ CPPlatformActionKeyMask

CPPlatformActionKeyMask = CPControlKeyMask

Definition at line 327 of file CPCompatibility.j.

◆ CPRedoKeyEquivalent

CPRedoKeyEquivalent = @"y"

Definition at line 330 of file CPCompatibility.j.

◆ CPRedoKeyEquivalentModifierMask

CPRedoKeyEquivalentModifierMask = CPControlKeyMask

Definition at line 333 of file CPCompatibility.j.

◆ CPSOPDisabledFromFileURLs

CPSOPDisabledFromFileURLs = 27

Definition at line 69 of file CPCompatibility.j.

◆ CPTextSizingAlwaysNeedsSetFontBug

CPTextSizingAlwaysNeedsSetFontBug = 1 << 3

Definition at line 101 of file CPCompatibility.j.

◆ CPUndoKeyEquivalent

CPUndoKeyEquivalent = @"z"

Definition at line 329 of file CPCompatibility.j.

◆ CPUndoKeyEquivalentModifierMask

CPUndoKeyEquivalentModifierMask = CPControlKeyMask

Definition at line 332 of file CPCompatibility.j.

◆ CPUnknownBrowserEngine

CPUnknownBrowserEngine = 0

Definition at line 26 of file CPCompatibility.j.

◆ CPVMLFeature

CPVMLFeature = 15

Definition at line 55 of file CPCompatibility.j.

◆ CPWebKitBrowserEngine

CPWebKitBrowserEngine = 1 << 4

Definition at line 31 of file CPCompatibility.j.

◆ CPWindowsOperatingSystem

CPWindowsOperatingSystem = 1

Definition at line 36 of file CPCompatibility.j.

◆ else

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

Definition at line 323 of file CPCompatibility.j.

◆ OPERATING_SYSTEM

OPERATING_SYSTEM = CPOtherOperatingSystem

Definition at line 308 of file CPCompatibility.j.

◆ PLATFORM_BUGS

var PLATFORM_BUGS = 0

Definition at line 107 of file CPCompatibility.j.

◆ PLATFORM_ENGINE

var PLATFORM_ENGINE = CPUnknownBrowserEngine

Definition at line 105 of file CPCompatibility.j.

◆ PLATFORM_FEATURES

PLATFORM_FEATURES[CPAltEnterTextAreaFeature] = []

Definition at line 106 of file CPCompatibility.j.

◆ PLATFORM_STYLE_JS_PROPERTIES

var PLATFORM_STYLE_JS_PROPERTIES = {}

Definition at line 108 of file CPCompatibility.j.

◆ USER_AGENT

var USER_AGENT = ""

Definition at line 104 of file CPCompatibility.j.