Monitus UI Library

util  4

Monitus UI Library > util > MUI.util
Search:
 
Filters

static Class MUI.util

These utilities provide generic utilities for manipulating the DOM, or other general functionalities.

Properties

kbottom_center - final String

Position Bottom Center.
Default Value: "bc"

kbottom_left - final String

Position Bottom Left.
Default Value: "bl"

kbottom_right - final String

Position Bottom Right.
Default Value: "br"

ktop_center - final String

Position Top Center.
Default Value: "tc"

ktop_left - final String

Position Top Left.
Default Value: "tl"

ktop_right - final String

Position Top Right.
Default Value: "tr"

Methods

cookie_value

static string cookie_value ( pName , pDefault )
Get the value of a cookie.
Parameters:
pName <string> name of the cookie to get.
pDefault <string> default value, if the cookie value is not found.
Returns: string
the value of the cookie, or the default value if the cookie does not yet exists.

indexOfInArray

static integer indexOfInArray ( pNeedle , pHaystack , pFrom )
Find an item in an Array by value.
Parameters:
pNeedle <anything> the object to look for in pHaystack.
pHaystack <array> the array to look in.
pFrom <integer> thje index at which to start the search. Optional; defaults to 0.
Returns: integer
the index of the object in the array OR -1 if not found.

is_landing_page

static boolean is_landing_page ( pIgnoreDomains )
Find out if the currently viewed page is a landing page.

A page is considered a landing page if it is not on the same domain as the referrer.

Parameters:
pIgnoreDomains <array> a list of domains to ignore; domains in this list will, for all intents and purposes, be considered the same domain as the current domain.
Returns: boolean
is the currently viewed page a landing page?

set_cookie_value

static void set_cookie_value ( pName , pHours , pPath , pDomain , pValue )
Set the value of a cookie, or delete it completely.
Parameters:
pName <string> name of the cookie to set.
pHours <string|number> how long should ht ecookie be vlaid for? "-" is forever; "." is no expiry date; "x" deletes the cookie; a number is hte number of hours the cookie is good for
pPath <string> path to set the cookie on.
pDomain <string> domain to set the cookie on.
pValue <string> value of the cookie to set.
Returns: void

url_parameter

static string url_parameter ( pURL , pParameterName , pDefault )
Get a particular parameter from a URL string.
Parameters:
pURL <string> URL string to anlayze.
pParameterName <string> the name of the parameter to extract.
pDefault <string> default value, if the parameter value is not found.
Returns: string
the value of the URL parameter, or the default value if the not found.


Copyright © 2017 Yahoo! Inc. All rights reserved.