public
Description: Prototype JavaScript framework
Homepage: http://prototypejs.org/
Clone URL: git://github.com/sstephenson/prototype.git
Search Repo:
prototype: Reorganize the source tree.
sstephenson (author)
Thu Jan 18 14:24:27 -0800 2007
commit  bb4d189b37b196dcd8bb0b5cb551e1cd7084596f
tree    bfad2aa29d6ba09341655405c2b1a27d6862a977
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
0
@@ -0,0 +1,365 @@
0
+*SVN*
0
+
0
+* Add test to ensure Content-type header is set for simulated verbs. [sam]
0
+
0
+* Fix Content-Type header for HTTP methods simulated with POST not defaulting to application/x-www-form-urlencoded. [Thomas Fuchs]
0
+
0
+* Simplify form serialization and add support for fields with the same name as Hash methods. Closes #6649. [Mislav Marohnić]
0
+
0
+* Fix attribute selectors for IE. Closes #5170. [Tobie Langel, Andrew Dupont]
0
+
0
+* A slew of dom.js improvements. Closes #4217, #6589, #7001. [Tobie]
0
+ - Fix Element.getDimensions() for hidden elements, make Element.getHeight() use .getDimensions()
0
+ - Add Element.getWidth()
0
+ - Make Element.replace() call .toString() on the html argument (alike .update())
0
+ - Fix an issue with Element.get/setStyle() and Safari with 'float'
0
+ - Add a bunch of missing unit tests
0
+
0
+* Fix an issue with Element.setStyle({opacity:''}) setting the opacity to 0 instead of removing the set inline opacity style. [Thomas Fuchs]
0
+
0
+* Ensure Ajax.Request's evalResponse is called before onComplete so that onComplete can reference any elements created during the response. Closes #6727. [jonathan]
0
+
0
+* Ensure the WEBrick test runner sets the correct Content-Type for tests and fixtures. [sam]
0
+
0
+* Form.serialize once again works with non-form elements. This is a temporary change to prevent the Rails link_to_remote regression described in #6898. Prototype 1.5.1 will introduce an API for working with collections of arbitrary form elements. References #6887. Closes #6898. [sam]
0
+
0
+* Make selectors match forms that have an element with name="id" correctly, fixes #5759 [mislav]
0
+
0
+* Remove support for HTTP authorization in Ajax calls introduced with #6366. Closes #6638 [jmecham]
0
+
0
+* Add Enumerable.size() to count elements in an enumerable and the corresponding Array.size() method, fixes #6710 [ZenCocoon]
0
+
0
+* Add String.succ() method to allow for String ranges, fixes #6037 [Cory Hudson, mislav]
0
+ Examples:
0
+ 'abcd'.succ(); -> 'abce'
0
+ $R('a','d').map(function(char){ return char; }); -> ['a','b','c','d']
0
+
0
+* Make Element.scrollTo() correctly consider offsets of parent DOM nodes, fixes #6625 [ohader, savetheclocktower]
0
+
0
+* Fix Enumerable.inGroupsOf() to correctly work with fill values that evaluate to false, fixes #6782 [hawk]
0
+
0
+* Remove/cleanup redundant $() calls in dom.js, fixes #6817 [Tobie]
0
+
0
+* Don't cache files in automatic unit tests, fixes #6218 [voidlock]
0
+
0
+* Add $w() to easily create arrays from strings like Ruby's %w, fixes #5682 [glazedginger, brendon.aaron]
0
+
0
+* Add Element.toggleClassName() to toggle CSS classes on elements, fixes #6759 [Tobie]
0
+
0
+* Make Form.getInputs always return an array for consistency, fixes #6475 [Justin Gehtland, savetheclocktower]
0
+
0
+* Make TimedObserver work correctly for SELECT MULTIPLE elements, fixes #6593 [clemos, tdd]
0
+
0
+* Fix Template.prototype.evaluate to correctly interpret 0 and false values, add String.interpret() for safely interpreting and converting values to strings, fixes #6675 [hawk]
0
+
0
+* Make Element.getStyle() work with camelCased argument, fixes #6686 [Tobie]
0
+
0
+* Fix a redundant check in Array.prototype.compact, fixes #4739 [wlodarcz, mislav]
0
+
0
+* Fix $() to correctly pass back the results of document.getElementById(), notably returning "null" on elements not found, fixes #6582 [adsmart]
0
+
0
+* Change/add assertNull, assertUndefined, assertNullOrUndefined and not-* variants in unittest.js, fixes #6582 [adsmart]
0
+
0
+* Cleanup String.prototype.camelize, fix an issue with String.prototype.underscore, fixes #4714, #6685 [Tobie, Thomas Fuchs]
0
+
0
+* Add String.prototype.capitalize, which returns a string with the first character in upper case, fixes #6666 [Tobie]
0
+
0
+* Make Element.getStyle() and Element.setStyle() handle the CSS 'opacity' property transparently in IE, fixes #6093 [brandon.aaron, Tobie]
0
+
0
+* Fix handling of CSS 'float' property for Element.getStyle() and Element.setStyle(), fixes #4160 [Thomas Fuchs, ericf]
0
+
0
+* Fix that onComplete would be called twice with synchronous Ajax requests on Safari (provides units tests for #5756) [Thomas Fuchs]
0
+
0
+* Fix Form.Field.activate to not select text on buttons in IE, fixes #2653 [sutch, mislav, Thomas Fuchs]
0
+
0
+* Fix String.unescapeHTML() on Firefox for strings that are longer than 2048 bytes, fixes #5789 [Paul Moers, Thomas Fuchs]
0
+
0
+* Redefine Array.prototype.concat for Opera, as the native implemenation doesn't work correctly [Thomas Fuchs]
0
+
0
+* Add unit tests for Function.prototype.bind() [Thomas Fuchs]
0
+
0
+* Add String.prototype.underscore and String.prototype.dasherize [Thomas Fuchs]
0
+ Examples:
0
+ 'Hello_World'.dasherize() -> 'Hello-World'
0
+ 'borderBottomWidth'.underscore() -> 'border_bottom_width'
0
+ 'borderBottomWidth'.underscore().dasherize() -> 'border-bottom-width'
0
+
0
+*1.5.0_rc2* (November 11, 2006)
0
+
0
+* Ensure that existing DOM properties take precedence over extended element methods in all browsers. Closes #5115. [Sean Kleinjung, sam]
0
+
0
+* Add Element.Methods.readAttribute as a simple wrapper around getAttribute (which isn't a "real" function and doesn't have .apply or .call in Safari and IE). Useful in conjunction with Enumerable.invoke for extracting the values of a custom attribute from a collection of elements. [sam]
0
+ Example:
0
+ <div id="widgets">
0
+ <div class="widget" widget_id="7">...</div>
0
+ <div class="widget" widget_id="8">...</div>
0
+ <div class="widget" widget_id="9">...</div>
0
+ </div>
0
+
0
+ $$('div.widget').invoke('readAttribute', 'widget_id')
0
+ // ["7", "8", "9"]
0
+
0
+* Add Element.Methods.immediateDescendants, like $A($(element).childNodes) but without text nodes. [sam]
0
+
0
+* More consistency. Closes #6573. [Bob Silva]
0
+
0
+* String.prototype.toQueryParams and Hash.prototype.toQueryString now properly serialize arrays as multiple values. Closes #4436. [mislav, altblue, L`OcuS]
0
+
0
+* Fix Form.serialize for options with empty values. Closes #5033. [tdd, Thomas Fuchs, sam]
0
+
0
+* Add Element.Methods.Simulated for simulating HTMLElement methods in lesser browsers. Add hasAttribute as the first simulated method. [tdd, Thomas Fuchs, sam]
0
+
0
+* Add a "retry with throw" button for test error messages. [sam]
0
+
0
+* rake test now runs test/unit/*.html by default. Additionally, you can specify individual tests to run with the TESTS environment variable, and you can restrict the tests to particular browsers using the BROWSERS environment variable. [sam]
0
+
0
+ Examples:
0
+ % BROWSERS=safari,firefox rake test
0
+ % TESTS=dom rake test
0
+
0
+* Element.hasClassName now bypasses the Element.ClassNames API for performance. [sam]
0
+
0
+* Pick some low-hanging performance and DRYness fruit. [sam]
0
+ - Inline length property accesses in for loops
0
+ - Enumerable-ize for loops where it makes sense
0
+ - Make better use of Element.Methods and Form.Methods/Form.Element.Methods
0
+
0
+* A slew of Ajax improvements. Closes #6366. [mislav, sam]
0
+
0
+ Public-facing changes include:
0
+ - HTTP method can be specified in either lowercase or uppercase, and uppercase is always used when opening the XHR connection
0
+ - Added 'encoding' option (for POST) with a default of 'UTF-8'
0
+ - Ajax.Request now recognizes all the JavaScript MIME types we're aware of
0
+ - PUT body support with the 'postBody' option
0
+ - HTTP authentication support with the 'username' and 'password' options
0
+ - Query parameters can be passed as a string or as a hash
0
+ - Fixed both String.toQueryParams and Hash.toQueryString when handling empty values
0
+ - Request headers can now be specified as a hash with the 'requestHeaders' option
0
+
0
+* Improve performance of the common case where $ is called with a single argument. Closes #6347. [sam, rvermillion, mislav]
0
+
0
+* Fix Object.inspect to correctly distinguish between null and undefined, fixes #5941 [tdd, mislav]
0
+
0
+* Don't serialize disabled form elements, fixes #4586 [tdd]
0
+
0
+* Make HTML element classes extension mechanism for Safari not throw errors on WebKit beta versions [Thomas Fuchs]
0
+
0
+* Add support for using Element.update() with no or a non-string parameter [Thomas Fuchs]
0
+
0
+ Example:
0
+ $('empty_me').update() -> clears the element
0
+ $('easy_as').update(123) -> set element content to '123'
0
+
0
+* Add unit tests for hashes, fixes #6344 [Tobie Langel]
0
+
0
+* Add clone() method to arrays, fixes #6338 [Tobie Langel]
0
+
0
+* Backing out of [5194] (Element.clear) because of issues with IE on certain elements, #6051
0
+
0
+* Add Element.clear for easily emptying out elements, fixes #6051 [brandon.aaron@gmail.com]
0
+
0
+* Enumerable.each now returns the enumerable to allow for method chaining, fixes #6250 [eventualbuddha]
0
+
0
+* Make makeClipping and undoClipping always return their element to stay chainable
0
+
0
+* Fix an issue with certain Element chain calls not correctly extending elements with Prototype element methods on IE [Thomas Fuchs]
0
+
0
+* Add Enumerable.eachSlice and Enumerable.inGroupsOf, fixes #6046 [rails@tddsworld.com, Thomas Fuchs]
0
+
0
+ Example:
0
+ [1,2,3,4,5].inGroupsOf(3) -> [[1,2,3],[4,5,null]]
0
+ [1,2,3].inGroupsOf(4,'x') -> [[1,2,3,'x']]
0
+
0
+* Complete unit tests for array.js and string.js [Thomas Fuchs]
0
+
0
+* Performance improvements for document.getElementsByClassName, including querying with XPath in supported browsers. [Andrew Dupont]
0
+
0
+* Make Form.getElements() return elements in the correct order, fix broken Form.serialize return, fixes #4249, #6172 [lars@pinds.com, Thomas Fuchs, john]
0
+
0
+* Add various DOM unit tests, fixes #6176, #6177 [tdd]
0
+
0
+* Split Form.serialize into Form.serialize and Form.serializeElements. The latter can be used stand-alone to serialize an array of elements you pass in, instead of the entire form [DHH]
0
+
0
+* Form.Element.disable() and .enable() will now work correctly, fixes #6034 [dresselm@businesslogic.com]
0
+
0
+* Fix IE and Safari issues with Position.positionedOffset, add position.html unit tests, fixes #5621 [renggli@iam.unibe.ch]
0
+
0
+* Fix an issue with Element.undoClipping and IE [Thomas Fuchs]
0
+
0
+* Element.cleanWhitespace now correctly removes consecutive empty text nodes, fixes #3209 [livier.duroselle@gmail.com]
0
+
0
+* Element.extend now does not try to extend text nodes, fixes #4642 [siegfried.puchbauer@gmail.com]
0
+
0
+*1.5.0_rc1* (September 4, 2006)
0
+
0
+* bindAsEventListener now passes along any provided arguments after the event argument. Closes #5508. [todd.fisher@revolution.com]
0
+
0
+* Fix makeClipping and undoClipping with local overflow style values other than visible and hidden, fixes #3672 [Thomas Fuchs]
0
+
0
+* Add Element.up, Element.down, Element.previous, and Element.next for easily traversing the DOM. (Inspired by Thomas Fuchs' original implementation of Element.up: http://pastie.caboo.se/7702) [sam]
0
+
0
+ Examples:
0
+ <div id="sidebar"> -> $('nav').up() or $('menu').up('div')
0
+ <ul id="nav"> -> $('sidebar').down() or $('sidebar').down('ul') or $('menu').previous()
0
+ <li>...</li> -> $('sidebar').down(1) or $('sidebar').down('li')
0
+ <li>...</li> -> $('sidebar').down(2) or $('sidebar').down('li', 2) or $('sidebar').down('li').next('li')
0
+ <li class="selected">...</li> -> $('sidebar').down('li.selected')
0
+ </ul>
0
+ <ul id="menu"> -> $('sidebar').down('ul').next()
0
+ ...
0
+
0
+* Refactor $$ and Element.getElementsBySelector into Selector.findChildElements. [sam]
0
+
0
+* Add Element.match, which takes a single CSS selector expression and returns true if it matches the element. [sam]
0
+
0
+* Add Element.ancestors, Element.descendants, Element.previousSiblings, Element.nextSiblings, and Element.siblings. [sam]
0
+
0
+* Add Element.inspect for better DOM debugging. [sam]
0
+
0
+* Add an optional boolean argument to String.prototype.inspect which, when true, makes the string double-quoted instead of single-quoted. [sam]
0
+
0
+* Add the uniq() method to Arrays, which returns a new Array with duplicates removed, fixes #3810 [secondlife]
0
+
0
+* Add stop() method to PeriodicalExecutor, fixes #4801 [Jon Evans]
0
+
0
+* Fix issues with Enumerable.any, ObjectRange.toArray, added unit tests, fixes #4419 [miyamuko, Thomas Fuchs]
0
+
0
+* Fix two instances of unneccesarily redeclared variables, fixes #5229 [Thomas Fuchs]
0
+
0
+* Fix a loop in Element.extend to properly use local variable, fixes #5128 [arrix]
0
+
0
+* Add constants for additional keys in Event, fixes #5411, #5795 [simone_b]
0
+
0
+* Workaround a DOM API bug in Opera in Position.page(), fixes #2407, #5848 [Thomas Fuchs]
0
+
0
+* Remove duplicate definition of Position.clone(), fixes #3765 [Thomas Fuchs]
0
+
0
+* Make destructive Element, Form, and Form.Element methods return their first argument, so that multiple calls can be chained together. [sam]
0
+
0
+ ex. $("sidebar").addClassName("selected").show();
0
+
0
+ The following methods now return their first argument: Element.toggle, Element.hide, Element.show, Element.remove, Element.update, Element.replace, Element.addClassName, Element.removeClassName, Element.observe, Element.stopObserving, Element.cleanWhitespace, Element.scrollTo, Element.setStyle, Element.makePositioned, Element.undoPositioned, Element.makeClipping, Element.undoClipping, Form.reset, Form.disable, Form.enable, Form.focusFirstElement, Form.Element.focus, Form.Element.select, Form.Element.clear, Form.Element.activate, Form.Element.disable, Form.Element.enable.
0
+
0
+* For consistency, Element.toggle, Element.show, Element.hide, Field.clear, and Field.present no longer take an arbitrary number of arguments. [sam]
0
+
0
+ !! BACKWARDS COMPATIBILITY CHANGE !!
0
+
0
+ If you have code that looks like this:
0
+ Element.show('page', 'sidebar', 'content');
0
+ You need to replace it with code like this:
0
+ ['page', 'sidebar', 'content'].each(Element.show);
0
+
0
+* Mix in Form and Form.Element methods to forms and form field elements with $() and $$(). Closes #4448. [Dan Webb, sam]
0
+
0
+* Add Object.clone [sam]
0
+
0
+* Add Form.Element.disable and Form.Element.enable. Closes #4943. [jan@prima.de]
0
+
0
+* Field is now simply an alias for Form.Element. [sam]
0
+
0
+* Add Element.Methods.getElementsByClassName and Element.Methods.getElementsBySelector. Closes #4669. [Andrew Dupont, DHH, sam]
0
+
0
+* Avoid race condition when stopping an Ajax.PeriodicalUpdater. Closes #4809. [e98cuenc@gmail.com]
0
+
0
+* Improve support for synchronous requests. Closes #5916. [sam, jthrom@gmail.com]
0
+
0
+* Add serialization and observation support for input type=search. Closes #4096. [rpnielsen@gmail.com]
0
+
0
+* Properly decode query components in String.prototype.toQueryParams. Closes #3487. [sam]
0
+
0
+* Add Array.prototype.reduce [sam]:
0
+ [1, 2].reduce() // [1, 2]
0
+ [1].reduce() // 1
0
+ [].reduce() // undefined
0
+
0
+* Add Object.keys and Object.values [sam]
0
+
0
+* Simulate non-GET/POST requests by POSTing with a _method parameter set to the actual verb [DHH]
0
+
0
+* Make Element.update() handle TABLE-related elements with the DOM API because of IE's missing .innerHTML property on them [Thomas Fuchs, thx to Rick Olson]
0
+
0
+* Sync to script.aculo.us unittest.js library as of 2006/08/29 [Thomas Fuchs]
0
+
0
+* Add additional unit tests to test/unit/dom.html for testing Element.update and $().update in various enviroments [Thomas Fuchs]
0
+
0
+* Prevent possible exceptions on unloading the page in IE [Thomas Fuchs]
0
+
0
+*1.5.0_rc0* (April 5, 2006)
0
+
0
+* Modify HTMLElement.prototype and short-circuit Element.extend where possible. Closes #4477. [Thomas Fuchs]
0
+
0
+* Only observe window.onunload in IE for Mozilla bfcache support. Closes #3726. [Mike A. Owens]
0
+
0
+* Don't redefine Array.prototype.shift. Closes #4138. [leeo]
0
+
0
+* Prevent redefining Array.prototype.reverse more than once. Closes #3951. [brettdgibson@gmail.com]
0
+
0
+* Fix Enumerable.min/Enumerable.max to recognize the value 0. Closes #3847, #4190. [rubyonrails@brainsick.com, Martin Bialasinski]
0
+
0
+* Change Ajax.getTransport to prefer XMLHttpRequest in anticipation of IE 7. Closes #3688. [jschrab@malicstower.org, sam]
0
+
0
+* Make Array.prototype.flatten more robust. Closes #3453. [Martin Bialasinski, sam]
0
+
0
+* Fix evalScripts from crashing Firefox if script includes 'var'. Closes #3288, #4165. [rahul@ntag.com, sam]
0
+
0
+* Scope iterators locally. Closes #4589. [sam]
0
+
0
+* Support Insertion.Before/Insertion.After for <tr> elements in IE. Closes #3925. [rails-venkatp@sneakemail.com]
0
+
0
+* Add a contentType option for overriding application/x-www-form-urlencoded in Ajax.Request. Closes #3564. [avif@arc90.com, sam]
0
+
0
+* Surround values in the X-JSON header in parenthesis for better compatibility with Firefox. Closes #4118. [bigsmoke@gmail.com]
0
+
0
+* Fix Form.serialize to properly encode option values in multiple selects in IE. Closes #3291. [rubyonrails@brainsick.com]
0
+
0
+* Cache methods added to DOM elements with Element.extend to prevent memory leaks in IE. Closes #4465. [jaen@laborint.com, sam]
0
+
0
+* 1.5.0_pre1* (March 26, 2006)
0
+
0
+* Add attribute selector support for Selector (and $$). Closes #4368. [devslashnull@gmail.com]
0
+ Example:
0
+ $$('form#foo input[type=text]').each(function(input) {
0
+ input.setStyle({color: 'red'});
0
+ });
0
+
0
+* Send Accept header containing 'text/javascript, text/html, application/xml, text/xml */*'' to inform Rails that we prefer RJS, but we'll take HTML or XML or whatever if you can't deliver the goods [DHH]
0
+
0
+* Make $$ work in IE. Closes #3715. [rubyonrails@brainsick.com]
0
+
0
+* Add test/browser.html, which provides a simple object browser for the Prototype source (Firefox/Safari only). [sam]
0
+
0
+* Add Element.extend, which mixes Element methods into a single HTML element. This means you can now write $('foo').show() instead of Element.show('foo'). $, $$ and document.getElementsByClassName automatically call Element.extend on any returned elements. [sam]
0
+
0
+* Add Element.replace as a cross-browser implementation of the "outerHTML" property. References #3246. [tom@craz8.com]
0
+
0
+* Fix Enumerable.zip iterator behavior. [Marcin Kaszynski, sam]
0
+
0
+*1.5.0_pre0* (January 18, 2006)
0
+
0
+* Add String.prototype.truncate to complement the Action View truncate helper. [sam]
0
+
0
+* Add String.prototype.gsub, String.prototype.sub, and String.prototype.scan, all of which take a pattern and an iterator (or a pattern and a replacement template string in the case of gsub and sub). [sam]
0
+
0
+* Add a Template class for interpolating named keys from an object in a string. [sam]
0
+
0
+* Add the $$ function for finding DOM elements by simple CSS selector strings. [sam]
0
+ Example: Find all <img> elements inside <p> elements with class "summary", all inside
0
+ the <div> with id "page". Hide each matched <img> tag.
0
+ $$('div#page p.summary img').each(Element.hide)
0
+
0
+* Add a Selector class for matching elements by single CSS selector tokens. [sam]
0
+
0
+* Add Test.Unit.Assertions.assertEnumEqual for comparing Enumerables in tests. [sam]
0
+
0
+* Add Element.childOf(element, ancestor) which returns true when element is a child of ancestor. [sam]
0
+
0
+* Fix escaping in String.prototype.inspect. [sam]
0
+
0
+* Add String.prototype.strip to remove leading and trailing whitespace from a string. [sam]
0
+
0
+* Move Prototype to Rails SVN. [sam]
0
+ http://dev.rubyonrails.org/svn/rails/spinoffs/prototype/
0
+
0
+* Make the console nicer. [sam]
0
+
0
+* Prune the source tree. [sam]
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
0
@@ -0,0 +1,16 @@
0
+Copyright (c) 2005 Sam Stephenson
0
+
0
+Permission is hereby granted, free of charge, to any person obtaining a copy
0
+of this software and associated documentation files (the "Software"), to deal
0
+in the Software without restriction, including without limitation the rights
0
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
0
+copies of the Software, and to permit persons to whom the Software is
0
+furnished to do so, subject to the following conditions:
0
+
0
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
0
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
0
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
0
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
0
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
0
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
0
+SOFTWARE.
0
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
0
@@ -0,0 +1,55 @@
0
+= Prototype
0
+==== An object-oriented JavaScript framework
0
+
0
+Prototype is a JavaScript framework that aims to ease development of dynamic
0
+web applications. It offers a familiar class-style OO framework, extensive
0
+Ajax support, higher-order programming constructs, and easy DOM manipulation.
0
+
0
+=== Targeted platforms
0
+
0
+Prototype currently targets the following platforms:
0
+
0
+* Microsoft Internet Explorer for Windows, version 6.0 and higher
0
+* Mozilla Firefox 1.0/Mozilla 1.7 and higher
0
+* Apple Safari 1.2 and higher
0
+
0
+== Using Prototype
0
+
0
+To use Prototype in your application, download the latest release from the
0
+Prototype web site (http://prototype.conio.net/) and copy
0
+<tt>dist/prototype.js</tt> to a suitable location. Then include it in your HTML
0
+like so:
0
+
0
+ <script type="text/javascript" src="/path/to/prototype.js"></script>
0
+
0
+=== Building Prototype from source
0
+
0
+<tt>prototype.js</tt> is a composite file generated from many source files in
0
+the <tt>src/</tt> directory. To build Prototype, you'll need:
0
+
0
+* a copy of the Prototype source tree, either from a distribution tarball or
0
+ from the Subversion repository (see below)
0
+* Ruby 1.8.2 or higher (http://www.ruby-lang.org/)
0
+* Rake -- Ruby Make (http://rake.rubyforge.org/)
0
+* RDoc, if your Ruby distribution does not include it
0
+
0
+From the root Prototype directory,
0
+
0
+* <tt>rake dist</tt> will preprocess the Prototype source using ERB and
0
+ generate the composite <tt>dist/prototype.js</tt>.
0
+* <tt>rake package</tt> will create a distribution tarball in the
0
+ <tt>pkg/</tt> directory.
0
+
0
+== Contributing to Prototype
0
+
0
+Check out the Prototype source with
0
+ $ svn co http://dev.rubyonrails.org/svn/rails/spinoffs/prototype/
0
+
0
+Modify the files in <tt>src/</tt>, add tests in <tt>test/</tt> if possible,
0
+and post a patch to http://dev.rubyonrails.org/newticket (please make sure
0
+to pick "Prototype" as the component).
0
+
0
+== Documentation
0
+
0
+Please see the Prototype documentation on the script.aculo.us wiki:
0
+ http://wiki.script.aculo.us/scriptaculous/show/Prototype
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
0
@@ -0,0 +1,59 @@
0
+require 'rake'
0
+require 'rake/packagetask'
0
+
0
+PROTOTYPE_ROOT = File.expand_path(File.dirname(__FILE__))
0
+PROTOTYPE_SRC_DIR = File.join(PROTOTYPE_ROOT, 'src')
0
+PROTOTYPE_DIST_DIR = File.join(PROTOTYPE_ROOT, 'dist')
0
+PROTOTYPE_PKG_DIR = File.join(PROTOTYPE_ROOT, 'pkg')
0
+PROTOTYPE_VERSION = '1.5.0'
0
+
0
+task :default => [:dist, :package, :clean_package_source]
0
+
0
+task :dist do
0
+ $:.unshift File.join(PROTOTYPE_ROOT, 'lib')
0
+ require 'protodoc'
0
+
0
+ Dir.chdir(PROTOTYPE_SRC_DIR) do
0
+ File.open(File.join(PROTOTYPE_DIST_DIR, 'prototype.js'), 'w+') do |dist|
0
+ dist << Protodoc::Preprocessor.new('prototype.js')
0
+ end
0
+ end
0
+end
0
+
0
+Rake::PackageTask.new('prototype', PROTOTYPE_VERSION) do |package|
0
+ package.need_tar_gz = true
0
+ package.package_dir = PROTOTYPE_PKG_DIR
0
+ package.package_files.include(
0
+ '[A-Z]*',
0
+ 'dist/prototype.js',
0
+ 'lib/**',
0
+ 'src/**',
0
+ 'test/**'
0
+ )
0
+end
0
+
0
+task :test => [:dist, :test_units]
0
+
0
+require 'test/lib/jstest'
0
+desc "Runs all the JavaScript unit tests and collects the results"
0
+JavaScriptTestTask.new(:test_units) do |t|
0
+ tests_to_run = ENV['TESTS'] && ENV['TESTS'].split(',')
0
+ browsers_to_test = ENV['BROWSERS'] && ENV['BROWSERS'].split(',')
0
+
0
+ t.mount("/dist")
0
+ t.mount("/test")
0
+
0
+ Dir["test/unit/*.html"].each do |test_file|
0
+ test_file = "/#{test_file}"
0
+ test_name = test_file[/.*\/(.+?)\.html/, 1]
0
+ t.run(test_file) unless tests_to_run && !tests_to_run.include?(test_name)
0
+ end
0
+
0
+ %w( safari firefox ie konqueror ).each do |browser|
0
+ t.browser(browser.to_sym) unless browsers_to_test && !browsers_to_test.include?(browser)
0
+ end
0
+end
0
+
0
+task :clean_package_source do
0
+ rm_rf File.join(PROTOTYPE_PKG_DIR, "prototype-#{PROTOTYPE_VERSION}")
0
+end
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
0
@@ -0,0 +1,36 @@
0
+require 'erb'
0
+
0
+class String
0
+ def lines
0
+ split $/
0
+ end
0
+
0
+ def strip_whitespace_at_line_ends
0
+ lines.map {|line| line.gsub(/\s+$/, '')} * $/
0
+ end
0
+end
0
+
0
+module Protodoc
0
+ module Environment
0
+ def include(*filenames)
0
+ filenames.map {|filename| Preprocessor.new(filename).to_s}.join("\n")
0
+ end
0
+ end
0
+
0
+ class Preprocessor
0
+ include Environment
0
+
0
+ def initialize(filename)
0
+ @filename = File.expand_path(filename)
0
+ @template = ERB.new(IO.read(@filename), nil, '%')
0
+ end
0
+
0
+ def to_s
0
+ @template.result(binding).strip_whitespace_at_line_ends
0
+ end
0
+ end
0
+end
0
+
0
+if __FILE__ == $0
0
+ print Protodoc::Preprocessor.new(ARGV.first)
0
+end
...
 
 
 
 
 
 
 
0
...
1
2
3
4
5
6
7
8
0
@@ -0,0 +1,7 @@
0
+/* Prototype JavaScript framework, version <%= PROTOTYPE_VERSION %>
0
+ * (c) 2005-2007 Sam Stephenson
0
+ *
0
+ * Prototype is freely distributable under the terms of an MIT-style license.
0
+ * For details, see the Prototype web site: http://prototype.conio.net/
0
+ *
0
+/*--------------------------------------------------------------------------*/
0
\ No newline at end of file
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
0
@@ -0,0 +1,313 @@
0
+var Ajax = {
0
+ getTransport: function() {
0
+ return Try.these(
0
+ function() {return new XMLHttpRequest()},