Commit Graph

195 Commits

Author SHA1 Message Date
Sam Stephenson c488384f90 prototype: Add support for brackets in quoted attribute value selectors. Closes #9157. 2007-08-07 20:33:53 +00:00
Sam Stephenson 30aa7a6532 prototype: Add RegExp.escape for escaping regular expression strings. Closes #9094. 2007-08-04 07:31:52 +00:00
Sam Stephenson aa4602b459 prototype: Merge -r7242:HEAD from ../branches/1-6-0-events. Adds support for DOM-based custom events with Event.fire/Element.Methods.fire, cross-browser DOMContentLoaded support, extended and normalized event objects, and improvements to the observe and stopObserving APIs. 2007-08-04 07:20:45 +00:00
Sam Stephenson 52cf3f2550 prototype: Merge -r7016:HEAD from ../branches/ajax. Add Ajax.Response object which supports the following methods: responseJSON, headerJSON, getHeader, getAllHeaders and handles browser discrepancies in the other response methods. Add sanitizeJSON, evalJS and evalJSON to Ajax.Request. Closes #8122, #8006, #7295. 2007-08-04 04:40:22 +00:00
Sam Stephenson 281ac64876 prototype: Merge -r6792:HEAD from ../branches/inheritance/{src/base.js,test/base.html}. Robust inheritance support for Class.create. Closes #5459. 2007-08-04 04:03:51 +00:00
Sam Stephenson 90c9c69ff0 prototype: Add Function#argumentNames, which returns an ordered array of the function's named arguments. 2007-07-30 04:38:20 +00:00
Sam Stephenson 82bedcee84 prototype: Optimize Selector#match and Element#match for simple selectors. Closes #9082. 2007-07-24 20:49:55 +00:00
Sam Stephenson c0735dba77 prototype: Make Element#wrap accept a second argument for setting attributes on the wrapper. Allow wrapping elements which are not part of the document. Closes #9071. 2007-07-24 19:08:55 +00:00
Sam Stephenson 44ef74813b prototype: Improvements for Element#replace, Element#update and Element#insert. Closes #7429, #9060. 2007-07-24 18:52:17 +00:00
Sam Stephenson 7b2ce66e88 prototype: Make Element#setStyle accept a string argument of CSS rules. Deprecate uncamelized style property names when setting styles using an object (for performance reasons). Closes #9059. 2007-07-24 18:14:36 +00:00
Sam Stephenson c6f3daadaa prototype: Add Element#identify, which returns the element's ID if it exists, or sets and returns a unique, auto-generated ID (of the form 'anonymous_element_' + auto-incremented digit) otherwise. Use this when you need to ensure an element has an ID. Closes #9012. 2007-07-24 17:41:27 +00:00
Sam Stephenson 7e6481bcd7 prototype: Make Element#readAttribute work for cloned elements in IE. Closes #8481. 2007-07-24 17:31:23 +00:00
Sam Stephenson ff45622e39 prototype: Template enhancements. Closes #8166. 2007-07-24 17:24:25 +00:00
Sam Stephenson b59399bdd3 prototype: Extended grep semantics. The first argument to Enumerable#grep is now a filter (an object with a match() method) so you can now e.g. filter an array of DOM nodes by CSS selector. Closes #7596. 2007-07-24 16:47:12 +00:00
Sam Stephenson 38fa39af92 prototype: Make String#scan explicitly return a string. Closes #6350. 2007-07-24 16:30:19 +00:00
Thomas Fuchs 513042dd98 Add Array#intersect for set intersection. Returns a new array containing all items common to the array and the argument, with duplicates removed (clone of the Ruby & method). 2007-07-18 21:07:31 +00:00
Thomas Fuchs cea24d6cc2 Prototype: Rename Element#getElementsBySelector to Element#select and add alias for Element#getElementsBySelector. Add Element#adjacent as a shortcut to selecting all adjacent nodes (and their children) that match a CSS selector. 2007-07-13 08:36:14 +00:00
Sam Stephenson 1c17b6381a prototype: Enhance the Enumerable and Array APIs to more closely match those of JavaScript 1.6 as implemented in Firefox 1.5. Closes #6650, #8409. 2007-07-09 18:55:58 +00:00
Thomas Fuchs 9e7efd5361 Prototype: merges from form branch. Closes #5031, #5902, #7595, #8401, #8483, #8767. [Mislav Marohnić, Tomas, Christophe Porteneuve, Jonathan Viney] 2007-06-27 10:38:54 +00:00
Sam Stephenson f2d304b3ee prototype: Merge [7066] from branches/1-5-1-1 2007-06-19 23:31:41 +00:00
Sam Stephenson d6bf5e40ce prototype: Make document.getElementsByClassName match a subset of the WHATWG Web Applications 1.0 specification which was adopted in Firefox 3 (http://www.whatwg.org/specs/web-apps/current-work/#getelementsbyclassname). It now supports multiple class names given as a whitespace-separated list in a string. Array argument is not supported. The method will only return the nodes that match all the class names. In browsers that implement the method natively it will not be overwritten. Closes #8401. 2007-06-19 20:59:14 +00:00
Thomas Fuchs 0894f235b8 Begone, test artifacts 2007-06-17 22:29:44 +00:00
Thomas Fuchs 03ae9dd3ee * Make document.getElementsByClassName match the WHATWG Web Applications 1.0 specification which was adopted in Firefox 3 (http://www.whatwg.org/specs/web-apps/current-work/#getelementsbyclassname). It now supports multiple class names given as an array or a space-separated list in a string. The method will only return the nodes that match all the class names. In browsers that implement the method natively it will not be overwritten. Closes #8401. [Mislav Marohnic] 2007-06-17 22:26:46 +00:00
Thomas Fuchs 9ff57b042d Prevent a crash in Safari when calling String#evalJSON(true) on very large strings. Add String#isJSON. Closes #7834. [Tobie Langel] 2007-06-17 16:03:38 +00:00
Thomas Fuchs 1e13c1d0b7 Prototype: Prevent a crash in Safari 1.3 on String#stripScripts and String#extractScripts. Closes #8332. Allow JSON data to contain line breaks. Closes #8271. 2007-06-13 20:57:19 +00:00
Thomas Fuchs d5665e0d22 Prototype: add failing unit test (IE) for Element.Methods.getStyle on auto-calculated widths. References #8564. 2007-06-10 12:58:32 +00:00
Thomas Fuchs 51bb86dc39 Add Hash.prototype.index which returns the first found property that has a specific value. Closes #8528. [Thomas Fuchs, slusarz, Mislav Marohnic] 2007-06-10 11:09:06 +00:00
Thomas Fuchs 86118c3cb5 Prototype: Add Number.prototype.round/ceil/floor/abs as an aliases to the respective methods in Math. Refactor to seperate number extensions from base.js. [Thomas Fuchs] 2007-06-06 16:10:16 +00:00
Thomas Fuchs 0c7bac17f0 Prototype: Make Element#absolutize and Element#relativize properly use Element#getStyle. Closes #8580. [Christophe Porteneuve] 2007-06-06 14:30:01 +00:00
Thomas Fuchs 225597cb35 Prototype: Add Number.prototype.round as an alias to Math.round(). [Thomas Fuchs] 2007-06-06 12:08:15 +00:00
Thomas Fuchs 431dd4e994 Prototype: Test library fixes: make rake dist work on Windows, only teardown if a browser is supported. Closes #8463, #8498. [Mislav Marohnic, grant] 2007-06-04 10:02:01 +00:00
Thomas Fuchs ae8d11d819 Prototype: make new insertion syntax work again on Ajax.Updater 2007-06-02 16:32:43 +00:00
Thomas Fuchs 5f4bab4dcb Prototype: Fix Element.insert for null values and numeric values when defaulting to bottom 2007-06-02 16:00:47 +00:00
Thomas Fuchs d4d4fddc7c Prototype: Change Element.insert syntax to allow multiple positions. 2007-06-02 15:08:50 +00:00
Thomas Fuchs 67783190f4 whitespace is my homeboy 2007-05-31 22:35:13 +00:00
Thomas Fuchs 4cafec8a9c Prototype: String.prototype.truncate now explicitly converts its return value into a string if no truncation takes place. This prevents possible issues with methods expecting input data that is typeof == string. 2007-05-31 22:32:25 +00:00
Thomas Fuchs f099e670f5 Element.setOpacity now calls removeAttribute on the filter style on IE if no more filters remain, which makes Cleartype work properly. Closes #8376. 2007-05-19 00:11:46 +00:00
Sam Stephenson beeb12e7dd prototype: Prevent an error being thrown by $$ when #id does not exist in $$("div #id"). Closes #8325. 2007-05-18 00:51:34 +00:00
Thomas Fuchs df33e410b0 testElementMethodInsert: add test for non-lowercase position argument 2007-05-12 19:12:04 +00:00
Sam Stephenson 83b4b337e1 Merge -r6634:HEAD from ../branches/dom.
* Make Element#update and Element#insert work for SELECT tags in IE and Opera. [Tobie Langel]

* Make Element#insert and Element#update better handle TABLE related elements in IE and Opera. Closes #7776, #8040, #7550, #7776, #7938. [Tobie Langel]

* Make Element#readAttribute('title') work in Opera. [Tobie Langel]

* Make Element#replace work with form elements in Firefox and Safari. Closes #8010, #7989. [dsl239, Tobie Langel]

* Add Element#wrap which wraps the element inside a new one. Closes #5732. [P. Vande, Tobie Langel]

* Make Element into a constructor: new Element(tagName, attributes). Add Element#writeAttribute which accepts a hash of attributes or a name/value pair. Closes #7476. [Mislav Marohnić, haraldmartin, Tobie Langel]

* Insertion overhaul: Add Element.insert(content[, position = 'Bottom']). Deprecate Insertion (kept for backwards compatibility). Make Ajax.Updater option.insertion accept both Insertion.Top or the now preferred 'Top'. Closes #7907. [Tobie Langel]
2007-05-12 05:01:56 +00:00
Sam Stephenson 67a4d00588 prototype: Refactor Element.extend and eliminate Element.extend.cache. 2007-05-12 04:32:30 +00:00
Sam Stephenson f457c98673 prototype: Merge -r6639:HEAD from branches/rel_1-5-1 into trunk. 2007-05-01 04:19:46 +00:00
Sam Stephenson 562e61fc8c prototype: Add Function#curry, Function#delay, Function#defer, and Function#wrap. Closes #8134. 2007-04-29 05:37:07 +00:00
Sam Stephenson d6c7cd9c9e prototype: Fix $F breakage from [6598]. 2007-04-28 03:28:13 +00:00
Sam Stephenson 310b3eccfa prototype: Fix jstest.rb IE support so you don't have to close the IE window after each test (yay!). Closes #8207. 2007-04-28 02:41:00 +00:00
Sam Stephenson b360a93999 prototype: Fix jstest.rb Konqueror support. Closes #7140. 2007-04-28 02:37:53 +00:00
Sam Stephenson b76d34e7bb prototype: Fix regression in which no-argument calls to Element.addMethods() would not add the methods defined in Form.Methods and Form.Element.Methods. Closes #8206. 2007-04-28 02:32:21 +00:00
Sam Stephenson 1886b03d60 prototype: Fix Element#readAttribute to work with the 'type' attribute in IE. Closes #8160. 2007-04-28 02:23:26 +00:00
Sam Stephenson 47bfeb5083 prototype: Add Element#childElements as an alias for Element#immediateDescendants. 2007-04-24 06:17:59 +00:00
Sam Stephenson 5784d78f6e prototype: Add Element#firstDescendant to retrieve the first non-text child node of an element. Optimize DOM navigation methods (Element#up, Element#down, Element#previous, Element#next) for no-argument calls. Closes #7848. 2007-04-24 06:06:44 +00:00
Sam Stephenson 63342b9c01 prototype: Element.addMethods should add methods to Element as well as Element.Methods. Closes #7888. 2007-04-24 05:23:41 +00:00
Sam Stephenson 7a324b859c prototype: Add support for per-request onCreate callbacks to Ajax.Request. Closes #8011. 2007-04-24 03:58:34 +00:00
Sam Stephenson fea6bc1a21 prototype: Automatically strip security delimiter comments from JSON strings before evaling them. The default delimiter is '/*-secure- ... */' or you can specify your own with the Prototype.JSONFilter regular expression. If you wrap your JSON response bodies in this delimiter on the server side, rogue external sites can't hijack potentially sensitive data via <script> tags. Closes #7910. 2007-04-24 03:31:14 +00:00
Sam Stephenson 643b7bec37 prototype: Add extra spacing so Array#toJSON and Hash#toJSON generate YAML-loadable JSON. Closes #7883. 2007-04-24 02:50:52 +00:00
Thomas Fuchs 193104ac33 Trivial dom.html cleanups, dont do the hidden element getDimensions test for now 2007-04-18 16:30:40 +00:00
Thomas Fuchs 95ac141bd9 Fix Form.request for forms containing an input element with name="action". Closes #8063. 2007-04-17 17:41:22 +00:00
Thomas Fuchs 4c90be6a30 Prevent a crash on Safari on String.prototype.stripScripts and extractScripts with large <script> tags. 2007-04-03 22:21:58 +00:00
Thomas Fuchs c0509c7f5f Prototype: clean (un)escapeHTML IE special casing and optimize speed for IE and Safari 2007-03-29 17:39:48 +00:00
Thomas Fuchs 9a7dcd54fb Prevent linefeed normalisation in String.prototype.escapeHTML and unescapeHTML on IE for consistency with other browsers 2007-03-28 11:35:05 +00:00
Thomas Fuchs 5f2acb4be5 Make Hash.toQueryString serialize undefined values. Ensure consistency with String.prototype.toQueryParams. Closes #7806. [Mislav Marohnic] 2007-03-27 20:55:56 +00:00
Thomas Fuchs 296cada736 Prototype: Make automatic unit testing work smoother on non-english versions of Windows 2007-03-27 18:31:25 +00:00
Thomas Fuchs 4506db2df2 Fix Selector issues with :not and attribute selector double quotes, fixes #7901. [Andrew Dupont] 2007-03-27 18:20:35 +00:00
Thomas Fuchs 779cd337b8 Fix issues with Selector an+b logic, performance improvements. Closes #7873. [Andrew Dupont] 2007-03-27 18:14:53 +00:00
Thomas Fuchs 930c8f2665 Fix an issue with Element.getDimensions with some element types on non IE-browsers. Closes #7683. [Andrew Dupont] 2007-03-27 18:04:59 +00:00
Thomas Fuchs db2ee67799 Fix Form.disable to work again on non-form elements. Closes #6887. [Mislav Marohnic] 2007-03-27 17:53:52 +00:00
Thomas Fuchs fc91a3e456 Fix an issue with String.prototype.endsWith. Closes #7822. [altblue] 2007-03-27 17:43:30 +00:00
Sam Stephenson cb1ad0e2cd prototype: Add a tab character via innerHTML to the selector whitespace test. 2007-03-12 21:26:21 +00:00
Thomas Fuchs e9501d63e5 Make Element.extend work on IE for Nodes with the same ID that where discarded. 2007-03-11 22:40:24 +00:00
Thomas Fuchs d03e70c4d1 Fix toJSON unit tests in array.html to use array toJSON methods [Tobie Langel] 2007-03-11 21:16:10 +00:00
Thomas Fuchs b2845e4557 Prototype: Make Selector correctly extend the first element it returns on IE. [Thomas Fuchs] 2007-03-11 14:51:14 +00:00
Thomas Fuchs a6984e692b Prevent a crash in Safari when using $A() on NodeList objects that contain text nodes. [Thomas Fuchs] 2007-03-11 13:42:40 +00:00
Thomas Fuchs 881b7dc00f Prototype: Fix Element.Methods.descendants() to properly extend elements on IE. 2007-03-11 10:59:06 +00:00
Sam Stephenson 7544938291 prototype: Detabify test/unit/selector.html 2007-03-09 04:15:48 +00:00
Sam Stephenson 00bce412d2 prototype: Merge the selector branch into trunk, bringing vast performance improvements, bug fixes, and near-complete CSS3 compliance to $$ and Selector. Closes #7568. 2007-03-09 04:12:13 +00:00
Sam Stephenson f160bc4d4d prototype: Add support for JSON encoding and decoding. Closes #7427. 2007-03-09 03:23:24 +00:00
Sam Stephenson f281192758 prototype: Fix double escaping of query parameters in Hash.prototype.toQueryString, and prevent Safari from iterating over shadowed properties when creating hashes. Closes #7421. 2007-03-09 03:15:03 +00:00
Thomas Fuchs 752eebdd26 Prototype: Fix simulated attribute reading for IE for "href", "src" and boolean attributes. 2007-03-08 22:43:18 +00:00
Thomas Fuchs fcc23f0d70 Optimize document.getElementsByClassName and finalize DOM performance optimization refactoring. Closes #6696 2007-03-04 22:55:08 +00:00
Thomas Fuchs 3c743a35f5 Add missing semicolons in hash unit tests 2007-03-04 21:57:29 +00:00
Thomas Fuchs ebd3351b20 Fix an issue with serializing empty array inputs, fixes #7516, merges [6309] and [6312] from from branch 2007-03-04 21:54:09 +00:00
Thomas Fuchs aa7ba0d4ff Prototype: Add optional third parameter "camlized" to Element.setStyle, for optimized performance if style names are known to be camelCased. [Thomas Fuchs] 2007-03-02 12:36:09 +00:00
Thomas Fuchs 60bb0686ba Prototype: Optimize Element.getStyle and add new Element.getOpacity method. Special case IE and Opera getStyle methods. Closes #7648. [Tobie Langel, Thomas Fuchs] 2007-02-27 11:35:21 +00:00
Thomas Fuchs 80f6f4076b Prototype: Optimize Element.setStyle and add new Element.setOpacity method, special case IE and Gecko opacity methods. Closes #7585. [savetheclocktower] 2007-02-23 01:19:18 +00:00
Thomas Fuchs d1481932b9 Prototype: Add unified Browser detection by providing Prototype.Browser.(IE|Gecko|WebKit|Opera) booleans. Closes #6800. [savetheclocktower] 2007-02-19 22:23:10 +00:00
Thomas Fuchs 5224f0fc4f Prototype: Add String.prototype.empty and String.prototype.blank (tests if empty or whitespace-only). Closes #7016. [Jonathan Viney, Thomas Fuchs] 2007-02-19 21:32:37 +00:00
Thomas Fuchs 06cf9616f9 Prototype: add form elements methods chaining test 2007-02-10 16:22:56 +00:00
Sam Stephenson 6eca3f0eea prototype: Array.prototype.uniq optimization. Closes #7417. 2007-02-05 05:09:41 +00:00
Sam Stephenson 74596ac289 prototype: String.prototype.endsWith should not fail on multiple occurrences. Closes #7416. 2007-02-05 04:56:46 +00:00
Sam Stephenson 343eae8bfc prototype: Add Form.Methods.request as a convenience method for serializing and submitting a form via Ajax.Request to the URL in the form's action attribute. 2007-01-28 07:30:04 +00:00
Sam Stephenson 7044da8138 prototype: Fix $(form).serialize() in Safari and add support for extending specific tags to Element.addMethods. Closes #7358. 2007-01-27 19:45:34 +00:00
Sam Stephenson 5345085b33 prototype: Add String.prototype.startsWith, String.prototype.endsWith, and String.prototype.include. Closes #7075. 2007-01-27 18:45:54 +00:00
Thomas Fuchs 8ea007df28 Prototype: Make setStyle() with opacity: 0 in Internet Explorer work correctly. [Thomas Fuchs] 2007-01-19 18:01:43 +00:00
Sam Stephenson 84901897c8 prototype: Form.Element.activate shouldn't raise an exception when the form or field is hidden. 2007-01-18 23:07:02 +00:00
Sam Stephenson c89875ce8c prototype: Remove support for "throw $continue" in Enumerable. Use "return" instead. 2007-01-18 22:59:23 +00:00
Sam Stephenson bb4d189b37 prototype: Reorganize the source tree. 2007-01-18 22:24:27 +00:00