Modules
detect
-
detect
-
.getUserAgent ⇒
Object
-
.hasHistory :
Boolean
-
.hasTouch :
Boolean
-
.isAndroid :
Boolean
-
.isIOS :
Boolean
-
.isLinux :
Boolean
-
.isMac :
Boolean
-
.isWindows :
Boolean
-
.supportBoxModel ⇒
Boolean
-
.supportsHTML5Video ⇒
Boolean
-
.getUserAgent ⇒
Object
detect.getUserAgent ⇒ Creates an object with user agent information
Kind: static property of detect
Url: http://stackoverflow.com/questions/5916900/how-can-you-detect-the-version-of-a-browser
Boolean
detect.hasHistory : window.history support
Kind: static property of detect
Boolean
detect.hasTouch : Touch support
Kind: static property of detect
Boolean
detect.isAndroid : Android useragent sniff
Kind: static property of detect
Boolean
detect.isIOS : iOS useragent sniff
Kind: static property of detect
Boolean
detect.isLinux : Linux useragent sniff
Kind: static property of detect
Boolean
detect.isMac : Macintoch useragent sniff
Kind: static property of detect
Boolean
detect.isWindows : Windows useragent sniff
Kind: static property of detect
Boolean
detect.supportBoxModel ⇒ Box model support
Kind: static property of detect
Boolean
detect.supportsHTML5Video ⇒ HTML5 video support
Kind: static property of detect
functions
-
functions
- .addClass(el, cls)
- .addEvent(el, type, fn)
- .addEventOnce(el, type, fn)
- .addHtml(node)
-
.ajax(options) ⇒
Promise
-
.assign(target, ...source) ⇒
Object
-
.clamp(min, max, value1) ⇒
Number/Function
-
.cloneArray(src) ⇒
Array
-
.cloneArrayDeep(src) ⇒
Array
-
.cloneObject(src) ⇒
Object
-
.cloneObjectDeep(src) ⇒
Object
-
.createEventTemplate(type, target, eventData) ⇒
Object
-
.debounce(fn, wait, scope, immediate) ⇒
function
-
.delegate(selector, fn, ctx) ⇒
function
- .exitFullscreen(el)
-
.fireEvent(el, type, bubble, cancelable) ⇒
Boolean
- .forEachShift(collection, fn)
-
.getElementOffset(el) ⇒
Object
-
.getEventTarget(e) ⇒
*
-
.getIframeFromWindow(window) ⇒
HTMLNode/Boolean
-
.getObjectValues(obj, keys) ⇒
Array.<*>
-
.getParent(el, selector) ⇒
HTMLNode/Boolean
-
.getPrevious(el, selector) ⇒
HTMLElement/Boolean
-
.getParentUntil(el, selector) ⇒
Object
-
.getPreviousElementUntil(el, selector) ⇒
Object
-
.getScrollLeft(el) ⇒
Number
-
.getScrollTop(el) ⇒
Number
-
.getNamespaceKey(abbr) ⇒
String
-
.getWindowScrollLeft() ⇒
Number
-
.getWindowScrollTop() ⇒
Number
-
.hasClass(el, cls) ⇒
Boolean
-
.hasOwnProperty(obj, key) ⇒
Boolean
-
.inherit(src, props) ⇒
Object
-
.insertBefore(child, ref) ⇒
HTMLElement
-
.isArray(src) ⇒
Boolean
-
.isArticleAdSlot(placement) ⇒
Boolean
-
.isDefined(value) ⇒
Boolean
-
.isEmptyString(value) ⇒
Boolean
-
.isElement(value) ⇒
Boolean
-
.isHeaderAdSlot(placement) ⇒
Boolean
-
.isObject(src) ⇒
Boolean
-
.isSplashAdSlot(placement) ⇒
Boolean
-
.isWindow(win) ⇒
Boolean
-
.loadScript(url, options) ⇒
Promise
-
.loadSocialScripts() ⇒
Promise
-
.not(value) ⇒
Boolean
- .onPageLoad(loadFn)
- .onPageReady(readyFn)
-
.padValue(value, width, chr) ⇒
String
-
.randomUUID() ⇒
String
- .removeClass(el, cls)
- .removeElement(el)
- .removeEvent(el, type, fn)
-
.throttle(fn, threshhold, scope) ⇒
function
-
.toBoolean(value) ⇒
Boolean
- .toggleClass(el, cls)
-
.unescapeJinjaValue(value) ⇒
*
functions.addClass(el, cls)
Adds a class to an element
Kind: static method of functions
Param | Type |
---|---|
el | HTMLNode |
cls | String |
functions.addEvent(el, type, fn)
Adds an event to an element
Kind: static method of functions
Param | Type |
---|---|
el | HTMLNode |
type | String |
fn | function |
functions.addEventOnce(el, type, fn)
Adds an event that will fire once and then remove itself
Kind: static method of functions
Param | Type |
---|---|
el | HTMLNode |
type | String |
fn | function |
functions.addHtml(node)
Adds html to a node
Kind: static method of functions
Param | Type |
---|---|
node | HTMLElement |
Promise
functions.ajax(options) ⇒ Basic ajax function
Kind: static method of functions
Param | Type |
---|---|
options | Object |
Object
functions.assign(target, ...source) ⇒ Assigns the values of the other sources to the target
Kind: static method of functions
Param | Type |
---|---|
target | Object |
...source | Object |
Number/Function
functions.clamp(min, max, value1) ⇒ Clamps a value to the min and max. Also set up to allow currying.
Kind: static method of functions
Param | Type |
---|---|
min | Number |
max | Number |
value1 | Number |
Array
functions.cloneArray(src) ⇒ Clones an array
Kind: static method of functions
Param | Type |
---|---|
src | Array |
Array
functions.cloneArrayDeep(src) ⇒ Clones an array while recursively cloning the items inside
Kind: static method of functions
Param | Type |
---|---|
src | Array |
Object
functions.cloneObject(src) ⇒ Clones an object
Kind: static method of functions
Param | Type |
---|---|
src | Object |
Object
functions.cloneObjectDeep(src) ⇒ Clones an object whilst recursively cloning the descendants
Kind: static method of functions
Param | Type |
---|---|
src | Object |
Object
functions.createEventTemplate(type, target, eventData) ⇒ Creates an object for events
Kind: static method of functions
Param | Type | Description |
---|---|---|
type | String |
The type of event |
target | Object |
The thing that emitted the event |
eventData | Object |
Some data |
function
functions.debounce(fn, wait, scope, immediate) ⇒ Debounce function, allows one function to be ran wait
milliseconds after.
Kind: static method of functions
Param | Type | Description |
---|---|---|
fn | function |
|
wait | Number |
Number of milliseconds |
scope | Object |
|
immediate | Boolean |
function
functions.delegate(selector, fn, ctx) ⇒ Creates a function that will delegate events to a selector
Kind: static method of functions
Param | Type |
---|---|
selector | String |
fn | function |
ctx | * |
functions.exitFullscreen(el)
Exits fullscreen mode for the element
Kind: static method of functions
Param | Type |
---|---|
el | HTMLNode |
Boolean
functions.fireEvent(el, type, bubble, cancelable) ⇒ Fires an event on an element
Kind: static method of functions
Returns: Boolean
- Was the event cancelled?
Param | Type | Description |
---|---|---|
el | HTMLElement |
|
type | String |
The type of event |
bubble | Boolean |
Should the event bubble? |
cancelable | Boolean |
Should the event be cancelable? |
functions.forEachShift(collection, fn)
Loop over a collection and shift the item from the collection
Kind: static method of functions
Param | Type |
---|---|
collection | Array |
fn | function |
Object
functions.getElementOffset(el) ⇒ Gets the elements offset. Based off of jquerys implementation
Kind: static method of functions
Param | Type |
---|---|
el | HTMLNode |
*
functions.getEventTarget(e) ⇒ Gets the event target
Kind: static method of functions
Returns: *
- The target of the event
Param | Type | Description |
---|---|---|
e | Object |
The event information |
HTMLNode/Boolean
functions.getIframeFromWindow(window) ⇒ Gets the iframe element based on the window
Kind: static method of functions
Param | Type |
---|---|
window | Window |
Array.<*>
functions.getObjectValues(obj, keys) ⇒ Gets the values from an object. If keys are specified, it will only get the values of those keys.
Kind: static method of functions
Param | Type | Description |
---|---|---|
obj | Object |
Source object |
keys | Array.<String> |
HTMLNode/Boolean
functions.getParent(el, selector) ⇒ Gets the parent element matching the selector. If it doesn't match, returns nothing
Kind: static method of functions
Param | Type |
---|---|
el | HTMLNode |
selector | String |
HTMLElement/Boolean
functions.getPrevious(el, selector) ⇒ Gets the previous element matching the selector. If it doesn't match, returns false
Kind: static method of functions
Param | Type |
---|---|
el | HTMLElement |
selector | String |
Object
functions.getParentUntil(el, selector) ⇒ Gets the parent till the selector or the root.
Kind: static method of functions
Param | Type |
---|---|
el | HTMLNode |
selector | String |
Object
functions.getPreviousElementUntil(el, selector) ⇒ Gets the previous element till the selector or the root
Kind: static method of functions
Param | Type |
---|---|
el | HTMLNode |
selector | String |
Number
functions.getScrollLeft(el) ⇒ Gets the scroll left of the element
Kind: static method of functions
Param | Type |
---|---|
el | HTMLNode/Window |
Number
functions.getScrollTop(el) ⇒ Gets the scroll top of the element
Kind: static method of functions
Param | Type |
---|---|
el | HTMLNode/Window |
String
functions.getNamespaceKey(abbr) ⇒ Creates a key based on the brand abbreviation
Kind: static method of functions
Param | Type |
---|---|
abbr | String |
Number
functions.getWindowScrollLeft() ⇒ Gets the scrollleft of the window
Kind: static method of functions
Number
functions.getWindowScrollTop() ⇒ Gets the scrolltop of the window
Kind: static method of functions
Boolean
functions.hasClass(el, cls) ⇒ Checks if the element has a class
Kind: static method of functions
Param | Type |
---|---|
el | HTMLNode |
cls | String |
Boolean
functions.hasOwnProperty(obj, key) ⇒ hasOwnProperty that prevents contamination from the object being tested
Kind: static method of functions
Param | Type |
---|---|
obj | Object |
key | String |
Object
functions.inherit(src, props) ⇒ Creates a new object based from src. Then copies over any properties.
Kind: static method of functions
Param | Type |
---|---|
src | Object |
props |
Object | Undefined
|
HTMLElement
functions.insertBefore(child, ref) ⇒ Inserts the child element before the reference
Kind: static method of functions
Returns: HTMLElement
- The child
Param | Type |
---|---|
child | HTMLElement |
ref | HTMLElement |
Boolean
functions.isArray(src) ⇒ Checks if the src is an array
Kind: static method of functions
Param | Type |
---|---|
src | * |
Boolean
functions.isArticleAdSlot(placement) ⇒ Checks if the placement is in an article slot
Kind: static method of functions
Param | Type |
---|---|
placement | String |
Boolean
functions.isDefined(value) ⇒ Checks if a value is defined
Kind: static method of functions
Param | Type |
---|---|
value | * |
Boolean
functions.isEmptyString(value) ⇒ Checks if the value is an empty string
Kind: static method of functions
Param | Type |
---|---|
value | * |
Boolean
functions.isElement(value) ⇒ Checks if the value is an element
Kind: static method of functions
Param | Type |
---|---|
value | * |
Boolean
functions.isHeaderAdSlot(placement) ⇒ Checks if the placement is a header slot
Kind: static method of functions
Param | Type |
---|---|
placement | String |
Boolean
functions.isObject(src) ⇒ Checks if the src is an object
Kind: static method of functions
Param | Type |
---|---|
src | * |
Boolean
functions.isSplashAdSlot(placement) ⇒ Checks if the placement is a splash slot
Kind: static method of functions
Param | Type |
---|---|
placement | String |
Boolean
functions.isWindow(win) ⇒ Checks if win is a window element
Kind: static method of functions
Param | Type |
---|---|
win | * |
Promise
functions.loadScript(url, options) ⇒ Loads a script file into the page
Kind: static method of functions
Param | Type |
---|---|
url | String |
options | Object |
Promise
functions.loadSocialScripts() ⇒ Loads any social scripts. Includes twitter, facebook, vine, instagram and imgur
Kind: static method of functions
Boolean
functions.not(value) ⇒ Inverts the value
Kind: static method of functions
Param | Type |
---|---|
value | * |
functions.onPageLoad(loadFn)
Runs loadFn once the page has loaded
Kind: static method of functions
Param | Type |
---|---|
loadFn | function |
functions.onPageReady(readyFn)
Runs readyFn once the page is ready
Kind: static method of functions
Param | Type |
---|---|
readyFn | function |
String
functions.padValue(value, width, chr) ⇒ Pads a number
Kind: static method of functions
Param | Type |
---|---|
value | Number |
width | Number |
chr | String |
String
functions.randomUUID() ⇒ Generates a random id
Kind: static method of functions
functions.removeClass(el, cls)
Removes a class from an element
Kind: static method of functions
Param | Type |
---|---|
el | HTMLNode |
cls | String |
functions.removeElement(el)
Removes the element from the tree
Kind: static method of functions
Param | Type |
---|---|
el | HTMLElement |
functions.removeEvent(el, type, fn)
Removes an event from an element
Kind: static method of functions
Param | Type |
---|---|
el | HTMLNode |
type | String |
fn | function |
function
functions.throttle(fn, threshhold, scope) ⇒ Throttles an event being fired by the threshold
Kind: static method of functions
Param | Type | Description |
---|---|---|
fn | function |
|
threshhold | Number |
Milliseconds to throttle by |
scope | Object |
Boolean
functions.toBoolean(value) ⇒ Converts a value to a boolean
Kind: static method of functions
Param | Type |
---|---|
value | * |
functions.toggleClass(el, cls)
Toggles a class on an element
Kind: static method of functions
Param | Type |
---|---|
el | HTMLNode |
cls | String |
*
functions.unescapeJinjaValue(value) ⇒ Unescapes a value from jinja
Kind: static method of functions
Param | Type |
---|---|
value | * |