Interface appFrameworkStatic

Index

Call signatures

Properties

Methods

Call signatures

(selector: string, context?: any): appFrameworkCollection

This is the internal appframework object that gets extended and added on to it This is also the start of our query selector engine

Parameters

  • selector: string
  • context?: any optional

Returns

appFrameworkCollection

(collection: appFrameworkCollection): appFrameworkCollection

Parameters

Returns

appFrameworkCollection

(element: HTMLElement): appFrameworkCollection

Parameters

  • element: HTMLElement

Returns

appFrameworkCollection

(htmlString: string): appFrameworkCollection

Parameters

  • htmlString: string

Returns

appFrameworkCollection

(object: any): appFrameworkCollection

Parameters

  • object: any

Returns

appFrameworkCollection

Properties

public ajaxSettings: appFrameworkAjaxSettings

public feat: { nativeTouchScroll: boolean; cssPrefix: string; cssTransformStart: string; cssTransformEnd: string; }

public feat.cssPrefix: string

public feat.cssTransformEnd: string

public feat.cssTransformStart: string

public feat.nativeTouchScroll: boolean

public fn: Object

Prototype for afm object. Also extens $.fn

public os: { webkit: boolean; android: boolean; androidICS: boolean; ipad: boolean; iphone: boolean; ios7: boolean; webos: boolean; touchpad: boolean; ios: boolean; playbook: boolean; blackberry: boolean; blackberry10: boolean; chrome: boolean; opera: boolean; fennec: boolean; ie: boolean; ieTouch: boolean; supportsTouch: boolean; }

Helper function to parse the user agent. Sets the following .os.webkit .os.android .os.ipad .os.iphone .os.webos .os.touchpad .os.blackberry .os.opera .os.fennec .os.ie .os.ieTouch .os.supportsTouch .os.playbook .feat.nativetouchScroll

api

private

public os.android: boolean

public os.androidICS: boolean

public os.blackberry: boolean

public os.blackberry10: boolean

public os.chrome: boolean

public os.fennec: boolean

public os.ie: boolean

public os.ieTouch: boolean

public os.ios: boolean

public os.ios7: boolean

public os.ipad: boolean

public os.iphone: boolean

public os.opera: boolean

public os.playbook: boolean

public os.supportsTouch: boolean

public os.touchpad: boolean

public os.webkit: boolean

public os.webos: boolean

Methods

public Event(type: string, props: any): any

Creates a custom event to be used internally.

title

$.Event(type,props);

Parameters

  • type: string
  • props: any

Returns

any

a custom event that can then be dispatched

public ajax(options: appFrameworkAjaxSettings): XMLHttpRequest

Execute an Ajax call with the given options options.type - Type of request options.beforeSend - function to execute before sending the request options.success - success callback options.error - error callback options.complete - complete callback - callled with a success or error options.timeout - timeout to wait for the request options.url - URL to make request against options.contentType - HTTP Request Content Type options.headers - Object of headers to set options.dataType - Data type of request options.data - data to pass into request. $.param is called on objects

var opts={
type:"GET",
success:function(data){},
url:"mypage.php",
data:{bar:'bar'},
}
$.ajax(opts);
title

$.ajax(options)

Parameters

Returns

XMLHttpRequest

public asap(callback: Function, context?: any, args?: Array<any>)

This adds a command to execute in the JS stack, but is faster then setTimeout

$.asap(function,context,args)

Parameters

  • callback: Function
  • context?: any optional
  • args?: Array<any> optional

public bind(object: any, event: string, fn: Function)

Bind an event to an object instead of a DOM Node

$.bind(this,'event',function(){});
title

$.bind(object,event,function);

Parameters

  • object: any
  • event: string

    name

  • fn: Function

public cleanUpContent(node: HTMLElement, itself?: boolean, kill?: boolean)

Function to clean up node content to prevent memory leaks

$.cleanUpContent(node,itself,kill)
title

$.cleanUpContent(node,itself,kill)

Parameters

  • node: HTMLElement
  • itself?: boolean optional
  • kill?: boolean optional

    itself

public create(type: string, params?: any): appFrameworkCollection

$.create - a faster alertnative to $("

this is some text
");

$.create("div",{id:'main',innerHTML:'this is some text'});
$.create("<div id='main'>this is some text</div>");
title

$.create(type,[params])

Parameters

  • type: string
  • params?: any optional

Returns

appFrameworkCollection

Returns an appframework object

public each(collection: Array<any>, fn: (index: number, item: any) => any)

Iterates through elements and executes a callback. Returns if false

$.each([1,2],function(ind){console.log(ind);});
title

$.each(elements,callback)

Parameters

  • collection: Array<any>
  • fn: (index: number, item: any) => any

public each(collection: any, fn: (key: string, value: any) => any)

Parameters

  • collection: any
  • fn: (key: string, value: any) => any

public extend(target: any, sources?: Array<any>): any

Extends an object with additional arguments

$.extend({foo:'bar'});
$.extend(element,{foo:'bar'});
title

$.extend(target,{params})

Parameters

  • target: any
  • sources?: Array<any> optional

Returns

any

[target]

public get(url: string, fn: (data: any, status?: string, xhr?: XMLHttpRequest) => void): XMLHttpRequest

Shorthand call to an Ajax GET request

$.get("mypage.php?foo=bar",function(data){});
title

$.get(url,success)

Parameters

  • url: string

    to hit

  • fn: (data: any, status?: string, xhr?: XMLHttpRequest) => void

Returns

XMLHttpRequest

public getCssMatrix(node: HTMLElement): appFrameworkCssMatrix

Gets the css matrix, or creates a fake one

$.getCssMatrix(domElement)

Parameters

  • node: HTMLElement

Returns

appFrameworkCssMatrix

matrix with postion

public getCssMatrix(elem: appFrameworkCollection): appFrameworkCssMatrix

Parameters

Returns

appFrameworkCssMatrix

public getJSON(url: string, fn: (data: any, status?: string, xhr?: XMLHttpRequest) => void): XMLHttpRequest

Shorthand call to an Ajax request that expects a JSON response

$.getJSON("mypage.php",{bar:'bar'},function(data){});
title

$.getJSON(url,data,success)

Parameters

  • url: string

    to hit

  • fn: (data: any, status?: string, xhr?: XMLHttpRequest) => void

Returns

XMLHttpRequest

public getJSON(url: string, data: any, fn: (data: any, status: string, xhr: XMLHttpRequest) => void): XMLHttpRequest

Parameters

  • url: string
  • data: any
  • fn: (data: any, status: string, xhr: XMLHttpRequest) => void

Returns

XMLHttpRequest

public is$(obj: any): boolean

Checks to see if the parameter is a $afm object

var foo=$('#header');
$.is$(foo);
title

$.is$(param)

Parameters

  • obj: any

Returns

boolean

public isArray(object: any): boolean

Checks to see if the parameter is an array

var arr=[];
$.isArray(arr);
example

$.isArray([1]);

title

$.isArray(param)

Parameters

  • object: any

Returns

boolean

public isFunction(object: any): boolean

Checks to see if the parameter is a function

var func=function(){};
$.isFunction(func);
title

$.isFunction(param)

Parameters

  • object: any

Returns

boolean

public isObject(object: any): boolean

Checks to see if the parameter is a object

var foo={bar:'bar'};
$.isObject(foo);
title

$.isObject(param)

Parameters

  • object: any

Returns

boolean

public jsonP(options: appFrameworkAjaxSettings): {}

Execute a jsonP call, allowing cross domain scripting options.url - URL to call options.success - Success function to call options.error - Error function to call

$.jsonP({url:'mysite.php?callback=?&foo=bar',success:function(){},error:function(){}});
title

$.jsonP(options)

Parameters

Returns

{}

public map(collection: Array<any>, fn: (item: any, index: number) => any): Array<any>

Map takes in elements and executes a callback function on each and returns a collection

$.map([1,2],function(ind){return ind+1});
title

$.map(elements,callback)

Parameters

  • collection: Array<any>
  • fn: (item: any, index: number) => any

Returns

Array<any>

appframework object with elements in it

public param(object: any, prefix?: string): string

Converts an object into a key/value par with an optional prefix. Used for converting objects to a query string

var obj={
foo:'foo',
bar:'bar'
}
var kvp=$.param(obj,'data');
title

$.param(object,[prefix];

Parameters

  • object: any
  • prefix?: string optional

Returns

string

Key/value pair representation

public parseJS(content: string)

this function executes javascript in HTML.

$.parseJS(content)
title

$.parseJS(content);

Parameters

  • content: string

public parseJS(content: HTMLElement)

Parameters

  • content: HTMLElement

public parseJSON(str: string): any

Used for backwards compatibility. Uses native JSON.parse function

var obj=$.parseJSON("{\"bar\":\"bar\"}");
params

{String} string

title

$.parseJSON(string)

Parameters

  • str: string

Returns

any

public parseXML(str: string): any

Helper function to convert XML into the DOM node representation

var xmlDoc=$.parseXML("<xml><foo>bar</foo></xml>");
title

$.parseXML(string)

Parameters

  • str: string

Returns

any

DOM nodes

public post(url: string, fn: (data: any, status?: string, xhr?: XMLHttpRequest) => void, dataType?: string): XMLHttpRequest

Shorthand call to an Ajax POST request

$.post("mypage.php",{bar:'bar'},function(data){});
title

$.post(url,[data],success,[dataType])

Parameters

  • url: string

    to hit

  • fn: (data: any, status?: string, xhr?: XMLHttpRequest) => void
  • dataType?: string optional

Returns

XMLHttpRequest

public post(url: string, data: any, fn: (data: any, status?: string, xhr?: XMLHttpRequest) => void, dataType?: string): XMLHttpRequest

Parameters

  • url: string
  • data: any
  • fn: (data: any, status?: string, xhr?: XMLHttpRequest) => void
  • dataType?: string optional

Returns

XMLHttpRequest

public proxy(callback: Function, context: any)

Creates a proxy function so you can change the 'this' context in the function Update: now also allows multiple argument call or for you to pass your own arguments ``` var newObj={foo:bar} $("#main").bind("click",$.proxy(function(evt){console.log(this)},newObj);

or

( $.proxy(function(foo, bar){console.log(this+foo+bar)}, newObj) )('foo', 'bar');

or

( $.proxy(function(foo, bar){console.log(this+foo+bar)}, newObj, ['foo', 'bar']) )(); ```

title

$.proxy(callback,context);

Parameters

  • callback: Function
  • context: any

public query(selector: string, context?: any): appFrameworkCollection

$.query - a faster alertnative to $("div");

$.query(".panel");
title

$.query(selector,[context])

Parameters

  • selector: string
  • context?: any optional

Returns

appFrameworkCollection

Returns an appframework object

public trigger(object: any, event: string, args?: Array<any>)

Trigger an event to an object instead of a DOM Node

$.trigger(this,'event',arguments);
title

$.trigger(object,event,argments);

Parameters

  • object: any
  • event: string

    name

  • args?: Array<any> optional

public unbind(object: any, event: string, fn: Function)

Unbind an event to an object instead of a DOM Node

$.unbind(this,'event',function(){});
title

$.unbind(object,event,function);

Parameters

  • object: any
  • event: string

    name

  • fn: Function

public uuid(): string

Utility function to create a psuedo GUID

var id= $.uuid();
title

$.uuid

Returns

string