Utils
Utils class
Static Member Summary
Static Public Members | ||
public static |
promise: * |
|
public static |
reject: * |
|
public static |
resolve: * |
Static Method Summary
Static Public Methods | ||
public static |
cleanLink(url: *): * |
|
public static |
deferred(): Deferred Return a new "Deferred" object https://developer.mozilla.org/en-US/docs/Mozilla/JavaScript_code_modules/Promise.jsm/Deferred |
|
public static |
Get current url |
|
public static |
getNormRatio(val: Number, min: Number, max: Number): Number Gets normalized ratio of value inside range. |
|
public static |
getPort(p: *): * Get port |
|
public static |
getRandomInt(min: Number, max: Number): Number Get random integer. |
|
public static |
getRandomNumber(min: Number, max: Number, decimal: Number): Number Get random number. |
|
public static |
Match CSS media queries and JavaScript window width. |
|
public static |
logCredits(siteName: String, bgColor: String, creditsList: Array, thanksList: Array, textColor: String) Log credits to console for code lovers. |
|
public static |
prefixProperty(property: String): String Get a css property with the vendor prefix. |
|
public static |
Start a fetch request |
|
public static |
Request timeout (in ms) |
|
public static |
stripTrailingSlash(str: String): String |
|
public static |
Send a GA page view event when context is AJAX. |
Static Public Members
public static promise: * source
public static reject: * source
public static resolve: * source
Static Public Methods
public static deferred(): Deferred source
Return a new "Deferred" object https://developer.mozilla.org/en-US/docs/Mozilla/JavaScript_code_modules/Promise.jsm/Deferred
Return:
Deferred |
public static getNormRatio(val: Number, min: Number, max: Number): Number source
Gets normalized ratio of value inside range.
from https://github.com/mout/mout/blob/master/src/math/norm.js
public static getRandomNumber(min: Number, max: Number, decimal: Number): Number source
Get random number.
public static logCredits(siteName: String, bgColor: String, creditsList: Array, thanksList: Array, textColor: String) source
Log credits to console for code lovers.
public static prefixProperty(property: String): String source
Get a css property with the vendor prefix.
Params:
Name | Type | Attribute | Description |
property | String | the css property |