Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
53 lines (41 sloc) 2.21 KB

iTech Utils

Many utils such as browser info, download, cookies, DOM manipulation, and onReady

All feattures are available under plugins.itechutils*

Browser Example Usages:

plugins.itechutilsBrowser allows you to get browser information. It is is based on https://github.com/faisalman/ua-parser-js

Get Browser Info:

//each call returns a JSON object.  See UAParser docs for details
plugins.itechutilsBrowser.getBrowser().name

Many more functions available. See code completion.

Cookie Example Usages:

plugins.itechutilsCookies allows you to get and set browser cookies. It is is based on https://github.com/js-cookie/js-cookie

//get a cookie
plugins.itechutilsCookies.getCookie(name)
//set a cookie
plugins.itechutilsCookies.setCookie(name,value,expireInDays)

DOM Example Usages:

plugins.itechutilsDOM has various DOM manipulation functions, like getting the height of elements, viewport settings, visiblity, etc.

Download Example Usages:

plugins.itechutilsDownload allows you to send a download link to the browser automatic download handling

//each call returns a JSON object.  See UAParser docs for details
plugins.itechutilsDownload.downloadFile(URL)

onReady Example Usages:

plugins.itechutilsOnReady allows you to hook Servoy events into the browsers onReady event. This is useful if you need to manipulate some DOM elements but need to wait until after the full page has loaded. Its also usefull to get a reliable event to fire when the browser first shows or refreshes.

//setup the handler
plugins.itechutilsOnReady.onReadyCallback = yourServoyCallbackHandlerFunction
//init the service
plugins.itechutilsOnReady.onReady()

License

All source code in the repository is licensed under a dual license. To use these components and services in your commercial or corporate internal projects, please contact sales@itechpros.com for licensing costs and information.

© iTech Professionals, Inc. http://itechpros.com

You can’t perform that action at this time.