Hash: Browser                        Native: Array                      Element                                           ...
Upcoming SlideShare
Loading in …5
×

Mootools 12-cheat-sheet-pf

1,471 views
1,350 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,471
On SlideShare
0
From Embeds
0
Number of Embeds
7
Actions
Shares
0
Downloads
15
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Mootools 12-cheat-sheet-pf

  1. 1. Hash: Browser Native: Array Element Selectors Class: Request Features * each(fn(el,i){} [, o]) Native: Window Hash: Element.Properties Utility Functions new Request( [opt] ) mootools Basics xpath * every(fn(el,i){} [, o]) $(el) html, [htmlS [,htmlS [,...] ] ] $E(sel s, filter el) opt = { url: s Full CheatSheet for Javascript- xhr * filter(fn(el,i){} [, o]) $$(el a | id a | el | selector s) text, textString $ES(sel s, filter el) Framework mootools rev 1.2 * indexOf(el [,from n]) any combination; commasep tag (only getter) method: post | get, by mediavrog.net/blog/ Engine Native: Element data: s * map(fn(el,i){} [, o]) IE - trident[4 | 5] Native: Element Native: IFrame getElements(sel s) async: asyncReq b Core FF - gecko * some(fn(el,i){} [, o]) new Element(tag s [, opt]) new IFrame([el] [, opt]) getElement (sel s) > $E encoding: s (default: utf-8), * only if not supported natively $chk(m) SFI - webkit[419 | 420] opt = { match(sel s) autoCancel: b $clear(timer n) clean() styles: setStyles, Native: Elements headers: {hdName:hdCont} o OP - presto[925 | 950] $defined(m) associate(a) events: addEvents, new Elements(el a [,opt]) Selectors.Pseudo isSuccess: fn name link(o) anyProp: value filter(sel s) :enabled, :empty onRequest(inst) $arguments(index n) $empty Plugins contains(el) } :contains(s) onSuccess(inst) Flash.version extend(a) getElement(match) Element.Event :even, :odd, :first, :last, :only onFailure(inst) $lambda(o) $extend(orig o, ext o) Flash.build getLast() getElements(match) Native: Element :nth-child(nExpr) onException(hdName ,val) getRandom() match(match) addEvent(e, fn) n - all, 2n - even, 2n+1 - odd onCancel() $merge(o, o [ ,o [,...] ]) Platform odd, even, only, first, last } $each(o | a, fn [, o]) mac, win, linux, ipod, other include(el) getElementsById(s) removeEvent(e, fn) combine(a) set(s, val | o) addEvents( {e:fn} ) Class: Swiff Properties $pick(o, [, o [,...] ]) name running, response $random(min n, max n) erase(el) get(s) removeEvents([e]) new Swiff(path [, opt]) Native: String empty() erase(s) fireEvent(e [, args, delay]) setHeader(name s, val s) $splat(o) opt = { flatten() inject(el [, where s]) cloneEvents(el [,e]) getHeader(name s) $time() test(regex [,params]) id: s rgbToHex(retAsArray b) grab(el [, where]) width: n, height : n send( [opt] ) $try(fn [ ,fn [ ,...] ) escapeRegExp() Hash: Element.Events adopt(el [, el a | el [,...] ]) container: el cancel() $type(o) contains(s [,sep s]) Utility Functions Element.Events.eName = o trim() wraps(el [, where] params: swfParams Hash: Element.Properties element, textnode, number, $A(a) o={ appendText(s) properties: o whitespace, function, date, clean() base: e send [, Request opt] vars: o arguments, array, object, string, camelCase() Native: Hash dispose() condition: fn events: o Native: Element boolean, regexp, class, collection, hyphenate() new Hash( [props] ) clone([childs b, keepId b]) onAdd: fn } send([url s]) window, document, false capitalize() replaces(el) onRemove: fn each(fn(el,i){} [, o]) swfParams = { toInt(), toFloat() has(key s) hasClass(s) } allowScriptAccess: s Class: Request.HTML Native: Class rgbToHex(retAsArray b) keyOf(m) addClass(s) Custom Events quality: s new Request.HTML([opt]) hexToRgb(retAsArray b) hasValue(m) removeClass(s) mouseenter swLiveConnect: b opt = { all opt from Request new Class( props ) stripScripts(evaluate b) extend(props) toggleClass(s) mouseleave wMode: s update: el, special properties: } substitute(o [, regex]) getPrevious([match]) evalScripts: b, Extends: class combine(props) mousewheel getAllPrevious() remote(o, fn) evalResponse: b Implements: class | props erase(key s) Native: Function getNext([match]) Element.Style Object: Cookie onComplete(rTree, rElems, initialize: fn (=constructor) get(key s) create([opt]) rHTML, rJS) implement(class | props) set(key s, val m) getAllNext() Native: Element write(key s, value s [, opt]) pass([args [, o]) } empty() getFirst([match]) setStyle(s, val) opt = { get(opt), post(opt) Class.Extras attempt([args [, o]) include(key s, val m) getLast([match]) setStyles( {s : val, ...} ) domain: s Class: Chain bind([o [, args [, e] ] ]) map(fn(el,i){} [, o]) getParent([match]) getStyle(s) path: s Hash: Element.Properties new Class({Implements: Chain}) bindWithEvent([o [,args [, e] ] ]) getParents() getStyles(s [, s [,...] ]) duration: n load [, opt] filter(fn(el,i){} [, o]) delay([ms [,o [,args] ] ]) getChildren([match]) secure: b chain(fn [, fn [,...] ]) every(fn(el,i){} [, o]) Native: Element } callChain([args]) periodical([ms [,o [,args] ] ]) some(fn(el,i){} [, o]) hasChild(el) Element.Dimensions load(url s) > Rq.HTML.get run(args [, o] ) empty() read(cookie s) clearChain() getClean() Native: Element dispose(cookie s [, opt]) getKeys() destroy() scrollTo(x,y) Class: Events Class: Request.JSON getValues() toQueryString() getSize() Object: JSON new Class({Implements: Events}) Native: Event getSelected() new Request.JSON([opt]) addEvent(s, fn [, internal b]) toQueryString() getScrollSize() JSON.encode(o) opt = { all opt from Request new Event([e [, win] ]) getProperty(s) addEvents(o, fn [, internal b]) getScroll() JSON.decode(s [, secure b]) (shift,control,alt,meta,wheel, Utility Functions getProperties(s [,s [,...] ]) secure: b fireEvent(s[,args,delay ms]) code,page.x,page.y,client.x, $H( [props] ) > new Hash getPosition() WindowEvent: domready onComplete(rJSON, text) setProperty(s, val) getCoordinates() } removeEvent(s, fn) client.y,key,target,relatedTarget) domready setProperties( {s: val, ...} ) removeEvents([s]) stop(), stopPropagation() Native: Number o ~ Object e ~ Event [] ~ optional removeProperty(s) mootools Cheat Sheet v1.2 Class: Options preventDefault() toInt(), toFloat() s ~ String fn ~ Function | ~ choice / or “Basics” by mediavrog © 08 removeProperties(s [,s [,...] ]) a ~ Array el ~ Element > ~ see also new Class({Implements: Options}) Hash: Event.Keys limit(min n, max n), store(s, val) n ~ Number el a ~ Array of el ms ~ Milliseconds setOptions([opt]) Event.Keys.eName = eKey round([n]), times(fn [, o]) retreive(s) “FX/Plugins “ available soon b ~ Boolean m ~ mixed opt ~ Options Obj

×