Skip to content

Instantly share code, notes, and snippets.

@sj26
Created March 11, 2012 00:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sj26/2014198 to your computer and use it in GitHub Desktop.
Save sj26/2014198 to your computer and use it in GitHub Desktop.
FFW =
g: (i) -> document.getElementById(i)
gv: (i) -> @g(i).value
sv: (i, v) -> @g(i).value = v
a: (i, c=document) -> c.getElementsByTagName(i)
ss: (i, v, n) -> @g(i).style[v] = n
misc: {}
effect: {}
event: {}
browser: {}
number: {}
form: {}
ajax: {}
string: {}
dbm: false
ssfaiw: (style, stylename, whereitem, wherevalue, tag, findcontext) ->
findcontext &&= @g findcontext
findcontext ||= document
elements = @a tag, findcontext
for element in elements
if element[whereitem] is wherevalue
element.style[style] = stylename
ssfai: (style, stylename, tag, findcontext) ->
findcontext and= @g findcontext
findcontext or= @g findcontext
elements = @a tag, fc
element.style[style] = stylename for element in elements
ssfawonly: (style, stylename, stylenotname, whereitem, wherevalue, tag, findcontext) ->
@ssfai style, stylenotname, tag, findcontext
@ssfaiw style, stylename, whereitem, wherevalue, tag, findcontext
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment