ANN: Utils.js version 1.0 - DOM, CSS, Screen, Event, Sort, etc

M

Matt Kruse

I have released version 1.0 of my "Utils" package:
http://www.javascripttoolbox.com/lib/util/

It contains many useful functions which can be used to build more advanced
functionality.
Many of these functions already exist in some form (indeed, most experiences
javascript programmers will probably have their own versions of most of
these) but hopefully it will help out some who have not built up their own
repository of util functions yet.

Suggestions and code critiques are welcome from experienced developers who
are actually trying to help ;)

This is a list of functions provided:
Global Functions
isArray (object) : boolean
isObject (object) : boolean
defined (val) : boolean
map (function, object*) : Array
setDefaultValues (objectToChange, objectDefaultValues) : Object
DOM Methods
DOM.getParentByTagName (HTMLElement, stringTagName) : HTMLElement
DOM.removeNode (HTMLElement) : boolean
DOM.getOuterWidth (HTMLElement) : int
DOM.getOuterHeight (HTMLElement) : int
DOM.resolve (*) : *
CSS Methods
CSS.rgb2hex (stringRGB) : string
CSS.hyphen2camel (stringProperty) : string
CSS.hasClass ([string|HTMLElement], stringClassName) : boolean
CSS.addClass (HTMLElement, stringClassName) : boolean
CSS.removeClass (HTMLElement, stringClassName) : boolean
CSS.replaceClass (HTMLElement, stringOldClassName, stringNewClassName) :
boolean
CSS.getStyle (HTMLElement, property-name) : string ( alias: CSS.get() )
CSS.setStyle (HTMLElement, property-name, value) : boolean ( alias:
CSS.set() )
CSS.createId ([HTMLElement]) : string
Event Methods
Event.resolve (EventObject) : EventObject
Event.add (HTMLElement, stringEventType, function, booleanCapture) : boolean
Event.getMouseX (EventObject) : int
Event.getMouseY (EventObject) : int
Event.cancelBubble (EventObject) ( alias: Event.stopPropagation() )
Screen Methods
Screen.getBody() : HTMLBodyElement
Screen.getScrollTop() : int
Screen.getScrollLeft() : int
Screen.getDocumentWidth() : int
Screen.getDocumentHeight() : int
Screen.getViewportWidth() : int
Screen.getViewportHeight() : int
Sort Methods
Sort.AlphaNumeric
Sort.Numeric
Sort.IgnoreCase
Sort.Currency
Sort.Date
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top