Please login or register. Welcome to the Studio, guest!


Quick Links:


newBookmarkLockedFalling

Aaron

Aaron Avatar
Bad Wolf

****
Dedicated Studio Member

859


November 2006
I know this won't get much attention as a bundle. So i'll break up the functions in time.

This is an on-going project while I get back into the swing of things. I'm knocking out all the generic functions (and some DOM) before doing anything remotely interesting. Feel free to toss ideas my way if you've got them.

Intent: A light-weight library of generic and specialized functions. Few, if any, "shortcut" functions (those that just cut keystrokes).

Links:Examples:
  • Create a new element.
    • $.createElement("a", { href: "#", onclick: new Function() })

  • Compare properties of one object to another.
    • $.correlate(document.body, { firstChild: { nodeName: "DIV" } })
    • $.correlate(["K", document.body], ["K", { nodeName: "BODY" }])

  • Isolate elements in an array.
    • $.capture([ "I", "i2", "K", "I 3" ], /i/i)
    • $.capture([ [ "A", "C" ], [ "B", "C" ], "ABC" ], { 1: "C" })
    • $.capture(document.images, { height: "50px", src: "blah.PNG" })

  • Return Element, Array, or HTMLCollection
    • $.get("id")
    • $.get("div")
    • $.get(document.body, "div")
    • $.get("div", { align: "right", firstChild: { nodeName: "#text" } })
    • $.get(document.body, "div", { align: "right" })

  • Assign/overwrite properties of one object to another.
    • $.assign([ "B", "B" ], { 0: "A", 2: "C" })
    • $.assign(document.body, { style: { color: "#00FFFF" } })
    • $.assign(new Image(40, 40), { src: "blah.PNG" })
Updates:
  • Tuesday, June 22, 2010
    • Fixed a silly oversight in the fragment function.
    • Optimized correlate, descend, insert, and replace functions for speed.
  • Sunday, June 20, 2010
    • Sped up assign function.
    • Improved speed and functionality of correlate function.
Plans:
  • Hex and RGB to Hue/Sat/Lum conversion.
  • [ DONE - testing ] Drag (inspiration from Dragdealer).
    • Set x, y limits (i.e. 0 to 400 x, fixed y).
    • Base speed for "trace" and "snap" drag types.
    • Speed increments/decrements.
    • type "snap" - target(s) snaps to cursor position.
    • type "trace" - target(s) trace cursor path.
    • type "visit" - target(s) glide to cursor position at mousedown.



Last Edit: Jun 25, 2010 0:48:00 GMT by Aaron

Chris

Chris Avatar

******
Head Coder

19,519


June 2005
So, I'm having trouble telling what correlate does from your examples. Can you elaborate?

And looks good Der. :) Good to see you're still around.

Aaron

Aaron Avatar
Bad Wolf

****
Dedicated Studio Member

859


November 2006
correlate(Object, reference Object)

Returns true when all properties (and property values) of reference Object match those of Object.

The documentation page provides descriptions, syntax, and in-depth examples.

Chris

Chris Avatar

******
Head Coder

19,519


June 2005
I don't read documentation. I should know what everything does by looking at it.

:P But makes sense.

newBookmarkLockedFalling