Functions
tags
- el: gets an element by id
- els: gets an element's style object by elm's id
- tags: get tags into array by tag name
- aCSS: adds a new stylesheet from a string containing css text
- dom: several methods to simplify working with the dom:
- dom.div(nodeName, content) - quickly creates a new element with the value/innerHTML of content
- dom.attribs(elm, attribOb) - binds an object of attribs and properties to an element
- dom.create(nodeName, content, attribs) - a new element filled with content and bound to attribs object
- dom.prependChild(newChild, parentElement) - makes newChild the first sub-tag inside parentElement
- dom.text(elm) - returns the text content of an element. handles inputs and regular tags.
- dom.kill(elm) - removes an element from the document
- dom.encodeHTML(str) - allows source code to be display without parsing
- dom.getParent(elm, tagName) - finds the first tagName tag wrapping the element
- dom.replace(newNode, oldNode) - replaces one element with another
Array extras
- map: applies a function to each index of an array
- filter: filters array elements according to truthfulness of function's return
- indexOf: gives arrays an indexOf feature
- pluck: build a new array of objects from a passed array of keynames
- random: a random element of an array
- unique: returns a duplicate-free array
- valids: array stripped of undefined elements
- _: a property of each element
- bind: adds propert(y/ies) /methods to each element
- iif: a conditional to filter an array of objects ex: tags("*").iif(".className=='active' ")
data handlers
- ping(url): send a GET request to any URL on any domain
- store(key, val): client-side persistence. if !! val then set else get key (ff+ie only)
- IO : file saving and loading. loads synchronous, saves asynch
- jsGet(url): simple remote scripting tag adder
- tmpl8: a substitution template using json: **key**- tmpl8( [{a:1},{a:4}] , "#: **a**\t") ="#: 1 #: 4 "
- Object.toSource(): json serializer for all browsers
rakes
- obKeys: array of object's key names
- obMap: 2 column array from objects key and values : {k:v, k2:v2} => [ [k,v], [k2,v2] ]
- obVals: array of object's values
- obValsl: returns an array of objects from objects with native .length properties (like nodeLists and collections)