Skip to content
Jason Mulligan edited this page May 6, 2012 · 3 revisions

$

Method

Queries the DOM using CSS selectors and returns an Element, or Array of Elements when not specifying an ID

@param  {String}  arg      Comma delimited string of target #id, .class, tag or selector
@param  {Boolean} nodelist [Optional] True will return a NodeList (by reference) for tags & classes
@return {Mixed} Element or Array of Elements

Example

var obj = $("#id"),
    arr = $(".class");

Syntactic Sugar

abaaso is aliased onto $ for syntactic sugar (a$ in "no conflict" mode), making a sweet & short syntax

$.alias

Method

Creates an alias of an Object on another Object (getters & setters when supported).

@param obj    {Object} Object to alias origin
@param origin {Object} Object providing structure to obj
@returns {Object} Object to alias origin

Example

abaaso.alias($, abaaso);

$.aliased

Property

Name of global variable with syntactic sugar of abaaso.

Example

(function (global, abaaso) {
  var $ = global[abaaso.aliased];
})(this, abaaso);

$.allows

Method

Alias of client.allows

$.append

Method

Alias of el.create

$.clear

Method

Alias of el.clear

$.clone

Method

Clones an Object

@param {Object}  obj  Object to clone
@return {Object} Clone of obj

Example

var a = {indices: [1,2,3,4,5]},
    b = $.clone(a);

$.create

Method

Alias of el.create

$.css

Method

Alias of el.css

$.decode

Method

Alias of json.decode

$.defer

Method

Defers the execution of Function by at least the supplied milliseconds

Timing may vary under "heavy load" relative to the CPU & client JavaScript engine

@param  {Function} fn Function to defer execution of
@param  {Number}   ms Milliseconds to defer execution
@param  {Number}   id [Optional] ID of the deferred function

Example

$.defer(someFunction, 250);

$.define

Method

Affords deep setting of properties without knowing if the structure is valid.

@param  {String} args  Dot delimited string of the structure
@param  {Mixed}  value Value to set
@param  {Object} obj   Object receiving value
@return {Object} Object receiving value

Example

var x = {};
$.define("some.nested.node", true, x);

$.del

Method

Alias of client.del

$.destroy

Method

Alias of el.destroy

$.encode

Method

Alias of json.encode

$.error

Method

Error handling, with history in $.error.log

@param  {Mixed}   e        Error object or message to display
@param  {Array}   args     Array of arguments from the callstack
@param  {Mixed}   scope    Entity that was "this"
@param  {Boolean} warning  [Optional] Will display as console warning if true

Example

$.error("Something went wrong");

$.error.log

Property

Array of caught Errors as Objects with extended properties

$.expire

Method

Alias of client.expire

$.expires

Property

Cached URI garbarge collection timeout

$.extend

Method

Creates a class extending obj, with optional decoration

@param  {Object} obj Object to extend
@param  {Object} arg [Optional] Object for decoration
@return {Object} Decorated obj

Example

var extObj = $.extend(myObj, {newProperty: true});

$.fire

Method

Alias of observer.fire

$.genId

Method

Generates an ID value

@param  {Mixed} obj [Optional] Object to receive id
@return {Mixed} Object or id

Example

var id = $.genId();

$.get

Method

Alias of client.get

$.guid

Method

Generates a GUID

@param {Boolean} safe [Optional] Strips - from GUID
@return {String} GUID

Example

var guid = $.guid();

$.headers

Method

Alias of client.headers

$.hidden

Method

Returns a Boolean indidcating if the Object is hidden

@param  {Mixed} obj Element or $ query
@return {Mixed} Boolean indicating if Object is hidden

Example

var obj = $("#id");
if (typeof obj !== "undefined" && obj.isHidden()) obj.show();

$.id

Property

abaaso

$.iterate

Method

Iterates an Object and executes a function against the properties

Parameters for fn are value & key

@param  {Object}   obj Object to iterate
@param  {Function} fn  Function to execute against properties
@return {Object} Object

Example

$.iterate(myObj, function (val, key) { doSomething(val); });

$.jsonp

Method

Alias of client.jsonp

$.listeners

Method

Alias of observer.list

$.log

Property

Alias of observer.log

$.merge

Method

Merges obj with arg

@param {Object} obj Object to decorate @param {Object} arg Object to decorate with @return {Object} Object to decorate

Example

$.merge(myObj, newObj); // myObj will have the properties & values of newObj

$.module

Method

Registers a module in the abaaso namespace

@param  {String} arg Module name
@param  {Object} obj Module structure
@return {Object} abaaso

Example

$.module("myClass", {});
$.myClass.someFunction();

$.object

Method

Returns Object, or reference to Element

@param  {Mixed} obj Entity or $ query
@returns {Mixed} Entity

Example

function (arg) {
  var obj = $.object(arg);
  
}

$.on

Method

Alias of observer.add

$.options

Method

Alias of client.options

$.permissions

Method

Alias of client.permissions

$.position

Method

Alias of el.position

$.post

Method

Alias of client.post

$.prepend

Method

Alias of el.prependChild

$.put

Method

Alias of client.put

$.queryString

Method

Returns an Object containing 1 or all key:value pairs from the querystring

@param  {String} arg [Optional] Key to find in the querystring
@return {Object} Object of 1 or all key:value pairs in the querystring

Example

var qs = $.queryString();

$.ready

Property

Boolean indicating if abaaso is ready

Example

$.ready;

$.reflect

Method

Returns an Array of parameters of a Function

Does not work on minified / obfuscated functions

@param  {Function} arg Function to reflect
@return {Array} Array of parameters

Example

var result = $.reflect(someFunction);

$.repeat

Method

Creates a timed recursive function

Return false from the function to halt recursion

@param  {Function} fn      Function to execute repeatedly
@param  {Number}   timeout Milliseconds to stagger the execution
@param  {String}   id      [Optional] Timeout ID
@return {String} Timeout ID

Example

$.repeat(function () {
  // repeating
  

  if (something) return false;
}

$.timer

Property

Collection of timers

$.tpl

Method

Transforms JSON to HTML and appends to Body or target Element

@param  {Object} data   JSON Object describing HTML
@param  {Mixed}  target [Optional] Target Element or Element.id to receive the HTML
@return {Object} Target Element

Example

$("#id").tpl({
  h1: "Header",
  p : "Content"
});

$.un

Method

Alias of observer.remove

$.update

Method

Alias of el.update

$.version

Property

Version of abaaso

Example

$.version;