Namespace Jelo.Core

Basic and support functions. Note: Every method of Jelo.Core is also available beneath Jelo itself. For example, the "each" function can be used as Jelo.Core.each(...) or Jelo.each(...)
Defined in: Jelo.Core.js.

Namespace Summary
Constructor Attributes Constructor Name and Description
 
Method Summary
Method Attributes Method Name and Description
<static>  
Jelo.Core.cutHexHash(hex)
Mainly used by internal Jelo functions.
<static>  
Jelo.Core.each(enum, fn, scope)
<static>  
Jelo.Core.hexToB(hex)
Returns the "blue" value from a CSS-style hex string.
<static>  
Jelo.Core.hexToG(hex)
Returns the "green" value from a CSS-style hex string.
<static>  
Jelo.Core.hexToR(hex)
Returns the "red" value from a CSS-style hex string.
<static>  
Jelo.Core.hexToRGB(hex)
Splits a CSS-style hex value into a array of Red, Green, and Blue values.
<static>  
Jelo.Core.isEnumerable(a)
<static>  
Jelo.Core.rgbToArray(hex)
Converts a CSS RGB string to an array of RGB values.
<static>  
Jelo.Core.rgbToHex(hex)
Converts a CSS RGB string to a CSS hex string.
<static>  
Jelo.Core.toCamel(str)
Converts a string from hyphenated to camelCase.
<static>  
Jelo.Core.uID()
Can be used to create unique IDs or global counters.
<static>  
Jelo.Core.urlDecode(str)
<static>  
Jelo.Core.urldecode(str)
Port of http://php.net/urldecode by http://kevin.vanzonneveld.net
<static>  
Jelo.Core.urlEncode(str)
<static>  
Jelo.Core.urlencode(str)
Port of http://php.net/urlencode by http://kevin.vanzonneveld.net
Namespace Detail
Jelo.Core
Method Detail
<static> {String} Jelo.Core.cutHexHash(hex)
Mainly used by internal Jelo functions. If a hash mark (#) appears at the beginning of the string, it will be stripped.
Parameters:
{String} hex
A value such as "#0080FF"
Returns:
{String} A value such as "0080FF"

<static> {Mixed} Jelo.Core.each(enum, fn, scope)
Parameters:
{Array|Object} enum
An enumerable object, typically an Array.
{Function} fn
Code to execute for each item in the enumerable object. The method is passed the current item, the current index, and the complete enumerable as arguments. If fn() returns Boolean false, no further items will be processed, and that index will be returned. The return value can be safely ignored, but it may be useful in some circumstances.
{Object} scope
An optional execution context in which to run your function.
    Jelo.each(['A', 'B', 'C'], function(item, index, arr) {
        alert('Item ' + item + ' is at index ' + index); // "Item A is at index 0", etc.
        alert('Arr has ' + arr.length + ' total items.'); // "Arr has 3 total items"
    });
    var letterB = Jelo.each(['A', 'B', 'C'], function(item, index, arr) {
        return item != 'B'; // returns the Number 1 ('C' will not be processed)
    });
Returns:
{Mixed} The index of the first loop that returned false, otherwise true. NOTE: The "true" return value is deprecated, soon the number -1 will be returned for consistency with other Array methods.

<static> {String} Jelo.Core.hexToB(hex)
Returns the "blue" value from a CSS-style hex string.
Parameters:
{String} hex
A value such as "#9966CC"
Returns:
{String} For the above example, "CC"

<static> {String} Jelo.Core.hexToG(hex)
Returns the "green" value from a CSS-style hex string.
Parameters:
{String} hex
A value such as "#9966CC"
Returns:
{String} For the above example, "66"

<static> {String} Jelo.Core.hexToR(hex)
Returns the "red" value from a CSS-style hex string.
Parameters:
{String} hex
A value such as "#9966CC"
Returns:
{String} For the above example, "99"

<static> {Array} Jelo.Core.hexToRGB(hex)
Splits a CSS-style hex value into a array of Red, Green, and Blue values.
Parameters:
{String} hex
A value such as "#9966CC"
Returns:
{Array} For the above example, ["99", "66", "CC"]

<static> {Boolean} Jelo.Core.isEnumerable(a)
Parameters:
{Mixed} a
An object to test.
Returns:
{Boolean} True if the object is likely enumerable, meaning it seems to be an Array or Array-like object.

<static> {Array} Jelo.Core.rgbToArray(hex)
Converts a CSS RGB string to an array of RGB values. Mainly useful to internal Jelo functions.
Parameters:
{String} hex
A value such as "rgb(0, 128, 255)"
Returns:
{Array} For the above example, [0, 128, 255]

<static> {Array} Jelo.Core.rgbToHex(hex)
Converts a CSS RGB string to a CSS hex string. Mainly useful to internal Jelo functions.
Parameters:
{String} hex
A value such as "rgb(0, 128, 255)"
Returns:
{Array} For the above example, "#0080FF"

<static> {String} Jelo.Core.toCamel(str)
Converts a string from hyphenated to camelCase. For example, Jelo.Core.toCamel("margin-left") becomes "marginLeft".
Parameters:
{String} str
A value such as 'margin-left';
Returns:
{String} A value such as 'marginLeft';

<static> {Number} Jelo.Core.uID()
Can be used to create unique IDs or global counters. Every time this function is called, a number will be returned which is 1 greater than the number previously returned, no matter where this function was called. Note that some internal functions may also use uID(), so you should not expect these numbers to always be consecutive.
Returns:
{Number} An autoincrementing positive integer. The first number returned is 1.

<static> Jelo.Core.urlDecode(str)
Parameters:
str

<static> {String} Jelo.Core.urldecode(str)
Port of http://php.net/urldecode by http://kevin.vanzonneveld.net
Parameters:
{String} str
Returns:
{String}
See:
PHP documentation
Original port

<static> Jelo.Core.urlEncode(str)
Parameters:
str

<static> {String} Jelo.Core.urlencode(str)
Port of http://php.net/urlencode by http://kevin.vanzonneveld.net
Parameters:
{String} str
Returns:
{String}
See:
PHP documentation
Original port


recent changes — (see all)
random jelo shots — (see all)