AwesomeQuery

AwesomeQuery is an extension of AwesomeScript that allows you to manipulate an array of items and select subsets of items. AwesomeQuery is based completely around arrays and selecting a set of objects from a web page.

Objects

Group Object containing a subset of items from an array with a Key and Value used to determine the grouping.

Enumerations

SortOrder The order to sort by for the Sort function on arrays.

Functions

From(Array array) QueryClause Creates a QueryClause that allows you to select subsets from an array. In depth

Objects

QueryClause Used to select subsets of an array or object with a length and numerical indexer In depth

Extensions

All elements have been provided the follow extension.

Query(String selector) Array Selects elements that match the CSS selector inside of the given element. In depth

 

The Array object has been given the following new functions.

As(Function type) CollectiveFunction Allows the entire array to be treated as the given type. Functions can them be called on this new type that will be applied to all items. Property functions will return all values as an array.  
Disctinct(String property) Array Selects all the distinct elements if property is not provided. If property is provided, selects the distinct values for each property of each item.  
Flatten() Array Flattens a 2D array into a single array.  
Group(String property) Array Places all the items in a group using the provided property as a key. This function returns an array of Group objects containing the grouping.  
Max() Array Returns the highest value item in the array.  
Minimum() Array Returns the lowest value item in the array.  
Sort(String property,  SortOrder order, Boolean ignoreCase)   Sorts the array in place (modifies the array). If property is provided, this value will be used in sorting. SortOrder determines the sort order to sort the array and igoreCase, if provided, determines if string values are to have their case ignored.  
Sum() Number or String For arrays of numbers, returns the sum of all the items. For arrays of strings, returns the concatenation of all the strings.  

Last edited Sep 18, 2011 at 2:40 PM by dahrkdaiz, version 4

Comments

No comments yet.