Enyo Functions
From WebOS101
Enyo Functions and Events
Non-inclusive list of functions and events contained within the Enyo object
Functions
enyo.fetchConfigFile(inFile) - returns JSON object with the contents of the specified config file
enyo.logTimers(inMessage) - Uses console.log() to record a log of everything in enyo.time.timed
enyo.setAllowedOrientation(inOrientation) - Accepts a string in the set: "up", "down", "left", "right", "free". Locks the orientation to the specified direction.
enyo.getWindowOrientation() - Returns a string from the set "up", "down", "left", "right".
enyo.setFullScreen(inMode) - Accepts true/false. Turns on "full screen" mode, which will "remove the system UI around the application".
enyo.fetchAppId() - returns a string containing the application ID, "com.example.myapplication"
- note that this function may return undefined when running in Chrome
enyo.fetchAppRootPath() - returns a string containing the application's file system path
enyo.fetchAppInfo() - returns a JSON object containing the appinfo.json file information
- note that this function may return undefined when running in Chrome
enyo.fetchFrameworkConfig() - returns a JSON object containing the framework_config.json for the application
enyo.fetchRootFrameworkConfig() - returns a JSON object containing the Enyo framework's framework_config.json
enyo.fetchDeviceInfo() - returns a JS object containing information about the device:
-- bluetoothAvailable - boolean - does device have bluetooth? (what does this return if bluetooth is turned off?)
-- carrierName - string - name of carrier if a cell-network device
-- coreNaviButton - boolean - true if "physical core navi button available"
-- keyboardAvailable - boolean - true if physical keyboard is available (what does this return if a bluetooth keyboard is available?)
-- keyboardSlider - boolean - true if keyboard slider is available
-- keyboardType - string - Keyboard type: "QWERTY", "AZERTY", "AZERTY_FR", "QWERTZ", "QWERTZ_DE"
-- maximumCardWidth - integer - maximum card width in pixels
-- maximumCardHeight - integer - maximum card height in pixels
-- minimumCardWidth - integer - minimum card width in pixels
-- minimumCardHeight - integer - minimum card height in pixels
-- modelName - string - Model name of device (UTF8)
-- modelNameAscii - string - Model name of device (ASCII)
-- platformVersion - string - OS Version ("3.0.2.0")
-- platformVersionDot - string - "Dot" version, ie, third bit of Version
-- platformVersionMajor - string - Major version, first bit of Version
-- platformVersionMinor - string - Minor version, second bit of Version
-- screenWidth - integer - display Width in pixels
-- screenHeight - integer - display Height in pixels
-- serialNumber - string - device Serial Number
-- wifiAvailable - boolean - true if WiFi is available on device (what does this return if Wifi is turned off?)
See also DeviceInfo
enyo.stopEvent(inEvent) - stops propagation of an event and prevents default actions on the event
enyo.byId(id, doc) - returns getElementById on document doc (or on document if not specified), or returns what was passed into it if there is no element by that name
enyo.loadSheet(inUrl) - loads a style sheet on the fly
enyo.loadScript(inUrl) - loads a javascript on the fly
enyo.getCookie(inName) - returns the (string) value of the specified cookie
enyo.setCookie(inName, inValue, inProps) - sets the cookie named inName to the value inValue, with properties of inProps. Properties may include an "expires" property, which can be a number of days, a Date object, or a UTC time string. "To remove a cookie, use a inProps value of { "Max-Age": 0 }".
enyo.dom.setClipboard(inText) - overwrites the OS clipboard with the value of inText
enyo.dom.getClipboard(inCallback) - sets up a callback function to receive the contents of the clipboard
Events
enyo.ready() - Called by framework to inform us that app UI is ready to display - called at window's "load" event
enyo.sendOrientationChange() - Forces the windowRotated event to occur if the current orientation does not match what was last known - called by the window's "resize" event

