4 This framework contains dynamic elements wrapping and connecting the
5 excellent Prototype JavaScript library.
7 http://api.rubyonrails.com/classes/ActionView/Helpers/JavaScriptHelper.html#M000394
24 .extend(otherobject) - copy properties of 'otherobject' to receiver
28 .bindAsEventListener(object)
36 .initialize(callback, frequency)
41 - run getElementById() for arguments
42 - return array for multiple, a single for one
49 .clear(...) - resolve names using $() and reset value
50 eg: Field.clear("sender", "from", "to")
51 .present(...) - check whether all elements have values
52 .focus(element) - lookup element using $() and focus
53 .select(element) - lookup element using $() and select
54 .activate(element) - lookup element using $() and focus+select
60 .focusFirstElement(form)
67 Form.Element.Serializers
69 Abstract.TimedObserver
70 .initialize(element, frequency, callback)
72 Form.Element.Observer : Abstract.TimedObserver
75 Form.Observer : Abstract.TimedObserver
83 - return XMLHTTP object depending on browser
92 - states: Uninitialized, Loading, Loaded, Interactive, Complete
93 .initialize(url, options)
96 .initialize(container, url, options)
99 'insertion' => function(container, responseText) => default: .innerHTML
110 document.getElementsByClasName(className)
113 .toggle(...) - toggle style between "None" and ""
116 .remove(elemName) - removed named element (lookup using $())
120 .display(..) - same like Element.toggle()
122 Abstract.Insertion(adjacency)
123 .initialize(element, content)
125 Insertion.Before : Abstract.Insertion
127 Insertion.Top : Abstract.Insertion
129 Insertion.Bottom : Abstract.Insertion
131 Insertion.After : Abstract.Insertion
141 <form action="/articles/comment/46"
143 id="commentform" method="post"
144 onsubmit="new Ajax.Updater('commentList', '/articles/comment/46', {onLoading:function(request){item_loading()}, onComplete:function(request){item_added()}, parameters:Form.serialize(this), insertion:Insertion.Bottom, evalScripts:true, asynchronous:true}); return false;"
148 <td> <input id="comment_author" name="comment[author]" size="20" type="text" value="" /> <small><a href="javascript:Element.toggle('guest_url')">(leave url »)</a></small></td>
152 :url => { :action => "action" },
153 404 => "alert('Not found...? Wrong URL...?')",
154 :failure => "alert('HTTP Error ' + request.status + '!')"
162 :update => { :success => "posts", :failure => "error" }
164 - :before, :top, :bottom, :after
171 :confirm - add confirmation dialog
173 :before - before request is initiated
174 :after - after request was initiated and before :loading