Andrew Dupont
a1d89b4503
Fixed a faulty variable assignment, the result of my own idiocy last week.
2008-04-04 12:55:59 -05:00
Andrew Dupont
1c00700894
Fix parentheses.
2008-03-31 13:58:10 -05:00
Andrew Dupont
ab8cc48b8d
Account for context to assure Element#down, et al., work properly with Selectors API.
2008-03-31 12:51:44 -05:00
Andrew Dupont
d13a93882c
Fix issue where Safari improperly reports an element as a descendant of itself.
2008-03-30 21:02:47 -05:00
Andrew Dupont
a3f7b712c3
Greatly simplify IE's implementation of Element#descendantOf.
2008-03-30 20:07:47 -05:00
Andrew Dupont
b03d4d40a0
Merge branch 'master' of git@github.com:sstephenson/prototype
2008-03-29 22:23:50 -05:00
Andrew Dupont
7062189fed
Added Prototype.BrowserFeatures.SelectorsAPI boolean.
2008-03-29 22:21:58 -05:00
Andrew Dupont
35a70710b0
Prevent exception when using Selector to search for an attribute that is not present.
2008-03-28 13:31:36 -05:00
Andrew Dupont
55e5d645e1
Fix issues where Firefox improperly returns the wrong node from a call to Event.element. Also fixes possible exception in Event.element in IE.
2008-03-28 13:13:16 -05:00
Andrew Dupont
0c676269e9
Fix issue where Safari 3 deletes custom properties from the document object when the page is returned to via the back button.
2008-03-28 12:48:42 -05:00
Andrew Dupont
03c1530014
Integrate support for the W3C Selectors API into the Selector class. Will now use the API when possible (browser supports the API *and* recognizes the given selector). Means minor changes to the semantics of :enabled, :disabled, and :empty in order to comply with CSS spec.
2008-03-27 01:18:15 -05:00
Tobie Langel
855e27311d
prototype: Avoid re-extending element in Element#getDimensions.
2008-03-19 14:04:52 +00:00
Tobie Langel
598387f137
prototype: Prevent Hash#toQueryString from serializing objets.
2008-03-19 13:01:47 +00:00
Tobie Langel
32b1b6b7cd
prototype: Fix Event#pointer in IE standard mode. Closes #9920 .
2008-03-19 07:01:49 +00:00
Andrew Dupont
6a2d81ce62
Fixed an improperly-encoded apostrophe in a comment.
2008-03-17 15:59:58 +00:00
Tobie Langel
6bae548e0a
prototype: Refactor String#escapeHTML to avoid using the with statement.
2008-03-16 19:08:34 +00:00
Tobie Langel
addfdef8ff
prototype: Make Element#writeAttribute handle frameborder attribute in IE. Closes #11068 .
2008-03-09 08:05:29 +00:00
Tobie Langel
359e8810de
prototype: Minor clean-up of selector.js. Closes #10844 .
2008-03-09 07:27:02 +00:00
Tobie Langel
c7e0a3d93c
prototype: Make String#unescapeHTML strip tags in IE. Closes #10173 .
2008-03-09 07:21:45 +00:00
Tobie Langel
5a50e4d2c0
prototype: Performance improvements for Enumerables. Closes #11264 .
2008-03-09 06:56:03 +00:00
Tobie Langel
5630369f42
prototype: Make Prototype tagName comparisons XHTML-compliant. Closes #11012 , #11013 , #11014 .
2008-02-05 03:35:04 +00:00
Tobie Langel
7821b989fe
prototype: Avoid breaking Element.prototype in browsers which support it. Closes #11004 .
2008-02-04 23:22:18 +00:00
Tobie Langel
2830ac2ac5
prototype: Prevent Element#cumulativeOffset, Element#getOffsetParent, Element#positionedOffset, Element#viewportOffset and Element#clonePosition from throwing an error in IE when called on a parent-less element. Closes #9416 , #10192 , #10248 .
2008-02-03 22:29:29 +00:00
Tobie Langel
d770a6c704
prototype: Prevent Enumerable#eachSlice from entering into an endless loop if passed an argument smaller than 1. Closes #10665 .
2008-02-03 21:08:13 +00:00
Tobie Langel
f4d68350f3
prototype: Allow Selector to correctly detect the presence of namespaced attributes. Closes #10987 .
2008-02-03 19:45:32 +00:00
Tobie Langel
ea9d81eea1
prototype: Make Element#absolutize and Element#relativize always return element. Closes #10983 .
2008-02-03 19:36:35 +00:00
Andrew Dupont
c24a390c49
Ensure positionedOffset properly considers "position: fixed" elements. Also ensure IE reports offsets correctly by triggering hasLayout when a "static" element has a "fixed" element as an offset parent. Closes #10644 . [heygrady, kangax, Andrew Dupont]
2008-01-25 22:02:12 +00:00
Andrew Dupont
ffa0d0943c
Roll back the fix for #9609 , since it does not work in Opera. Instead, avoid using "valueOf" or "toString" as field names in forms.
2008-01-25 18:54:22 +00:00
Andrew Dupont
a1ec25cddb
Prevent DOM node expandos _countedByPrototype and _prototypeEventID from being serialized into (inner|outer)HTML in IE. Closes #10909 . [dcpedit, Tobie Langel, Andrew Dupont]
2008-01-25 18:49:40 +00:00
Tobie Langel
794457da75
Make Ajax.Request#isSameOrigin JavaScript Lint compliant. Backport fix to 1.5.1.2.
2008-01-24 03:02:34 +00:00
Andrew Dupont
0f97f4ce20
Properly serialize form fields with names that collide with built-in JS properties (like "length" or "toString"). Closes #9609 . [gryn, kangax]
2008-01-24 02:24:33 +00:00
Tobie Langel
17cd2f9f8d
prototype: Make Object.isArray correctly identify arrays created in another frame. Closes #10374 .
2008-01-24 01:33:28 +00:00
Andrew Dupont
7942a9e5c9
Fixed issue where Element#match failed on attribute selectors with single or double quotes. Closes #10067 . [Cezary Okupski, Andrew Dupont]
2008-01-23 20:05:17 +00:00
Tobie Langel
b26f4e349e
prototype: Fix Element#writeAttribute to work with 'cellspacing' and 'cellpadding' attributes in IE. Closes #9983 .
2008-01-23 12:17:26 +00:00
Tobie Langel
02cc9992e9
prototype: Prevent a potential security issue for cross-site ajax requests.
2008-01-23 00:51:25 +00:00
Tobie Langel
dcada47c6d
prototype: Test for attribute existence before applying more complex CSS3 selectors. Closes #10870 .
2008-01-23 00:33:04 +00:00
Andrew Dupont
c200c27f48
Fix "function $A" declaration inside of a conditional (confuses IE). Fixes #10882 . [Jacco, Andrew Dupont]
2008-01-22 23:36:47 +00:00
Andrew Dupont
c67fe0b2f3
Fixed selector parsing so that "#foo [bar=baz]" is treated the same way as "#foo *[bar=baz]". Closes #10734 . [jlukas, kangax, Andrew Dupont]
2008-01-18 04:52:38 +00:00
Andrew Dupont
89cbe08e1c
Fix Element#descendantOf logic in IE. Closes #10413 . [martymix, kamil.szot]
2008-01-18 04:31:23 +00:00
Tobie Langel
7052c5a60c
prototype: Fix missing var in Element#insert. Closes #10838 .
2008-01-17 16:41:34 +00:00
Tobie Langel
7cd956d9c4
prototype: Remove useless binding in Template#evaluate.
2008-01-14 01:38:28 +00:00
Tobie Langel
ac48714ada
prototype: Make Object.inspect more robust.
2008-01-14 01:22:37 +00:00
Tobie Langel
a246e777f5
prototype: Fix Selector.matchElements to allow for coma-separated selectors in Element#up/next/previous and Event#findElement.
2008-01-06 21:49:16 +00:00
Tobie Langel
0008fe4aed
prototype: Test.Unit refactoring. Allow running multiple instances of Test.Unit.Runner on the same page. Allow rake to run specific testcases. Closes #10704 , #10705 , #10706 .
2008-01-06 00:34:39 +00:00
Tobie Langel
7c86e29805
prototype: Optimize property detection of outerHTML. Avoids triggering FOUC in Safari 3.0.4. Closes #10702 .
2008-01-04 23:56:27 +00:00
Tobie Langel
6f0def19c5
prototype: Add document.loaded, a boolean that is set to true once dom:loaded is fired.
2008-01-04 00:30:53 +00:00
Tobie Langel
b4735bca7c
prototype: Make Element#insert standard-compliant. Fixes an issue in FF3b2 when inserting HTML or text inside DOM nodes which aren't (yet) appended to the document.
2008-01-03 01:50:36 +00:00
Tobie Langel
f553d2210e
prototype: Add some missing semicolons to the source tree. Closes #10659 .
2007-12-31 16:16:14 +00:00
Tobie Langel
c9a07576be
prototype: Ensure Ajax.Response#getHeader returns null for missing headers in Opera.
2007-12-30 10:59:23 +00:00
Tobie Langel
f0d54a48bd
prototype: Ensure Ajax.Response#getHeader returns null for missing headers.
2007-12-29 11:09:43 +00:00
Tobie Langel
5a37860ffb
prototype: Ensure creates an empty array when its argument's length is undefined. Closes #10574
2007-12-20 15:47:32 +00:00
Tobie Langel
23f7cb642c
prototype: Fix incorrect variable declaration in Event.fire. Closes #10329 .
2007-12-20 13:10:42 +00:00
Andrew Dupont
c691de7810
Fix the way Selector handles [pseudoclass + combinator] with no space in between. Closes #9696 . [kangax, fearphage, Andrew Dupont]
2007-12-20 00:17:24 +00:00
Andrew Dupont
cb239625b3
Optimize Element#up/down/next/previous. Closes #10353 . [Dylan Bruzenak, Nick Stackenburg, Andrew Dupont]
2007-12-19 23:43:48 +00:00
Andrew Dupont
6f0e0ad649
Handle case-sensitivity in Selector tag names better. Closes #5052 . [mexx, Andrew Dupont]
2007-12-19 23:32:21 +00:00
Andrew Dupont
4d3ebf0912
Change document.viewport.getDimensions to exclude scrollbars in all cases. Closes #10148 , #9288 . [Nick Stackenburg]
2007-12-04 04:28:27 +00:00
Andrew Dupont
ae76169baf
Add logic to Element#getStyle in Opera that fixes inaccurate reporting of computed 'width' and 'height' properties. [Andrew Dupont]
2007-12-04 04:03:56 +00:00
Sam Stephenson
769ae42fcc
prototype: Ensure that an Ajax.Request's parameters option can be a Hash. Closes #10172 .
2007-11-29 00:24:54 +00:00
Andrew Dupont
c85285496b
* Ensure no comment nodes are returned in Selector queries (IE improperly returns comment nodes on getElementsByTagName("*")). Change Element#descendants to use Element#getElementsBySelector in order to avoid this issue. Closes #10220 . [Jeff Gobel, Andrew Dupont]
2007-11-27 18:43:56 +00:00
Andrew Dupont
b01903d92f
* Re-enable the XPath approach in Selector for Safari 3. Falls back to the non-XPath version when it sees a problematic token. [Andrew Dupont]
2007-11-27 18:21:50 +00:00
Andrew Dupont
26b8033295
* Fix a bug in the IE-specific Element#descendantOf logic. [Nicholas, Andrew Dupont]
2007-11-27 17:59:46 +00:00
Tobie Langel
23823048d1
prototype: Prevent memory leaks in Ajax.PeriodicalUpdater. Closes #10049
2007-11-15 23:14:36 +00:00
Tobie Langel
c371096a71
prototype: Remove useless variable in Selector.handlers.child. Closes #10006 .
2007-11-15 22:21:08 +00:00
Tobie Langel
d20cc77e0c
prototype: Don't redeclare previously declared variables. Closes #10007
2007-11-15 22:15:24 +00:00
Tobie Langel
07a16464e8
prototype: use Object.isUndefined where possible.
2007-11-15 21:53:15 +00:00
Tobie Langel
b058e24a05
prototype: Make String#isJSON return false for empty or blank strings. Make Ajax.Response#responseJSON null when Ajax.Response#responseText is empty or blank.
2007-11-15 19:37:26 +00:00
Tobie Langel
f8ffe7b40f
prototype: Make Ajax.Response#_getResponseJSON use Ajax.Response#responseText.
2007-11-15 14:02:25 +00:00
Tobie Langel
74c005c678
prototype: Remove the now redundant forked declaration of Hash#_each.
2007-11-14 11:56:15 +00:00
Tobie Langel
0b6a6e2f2f
prototype: Ensure Event#fire always returns an extended event. Make Event#findElement's expression argument optional. Perf optimizations for Event#findElement.
2007-11-13 21:48:09 +00:00
Sam Stephenson
9b78edb9de
prototype: Fix Class#addMethods for "toString" and "valueOf" methods in Internet Explorer. Closes #9901 .
2007-11-06 01:44:24 +00:00
Andrew Dupont
b14c9afa58
Exclude Opera from using the sourceIndex approach in Element#descendantOf. [Tobie Langel, Andrew Dupont]
2007-11-05 17:54:13 +00:00
Tobie Langel
d6b843c9cb
Ensure Element#hasClassName always returns a boolean. Closes #10075 .
2007-11-05 17:43:56 +00:00
Andrew Dupont
8cd85d12a2
Ensure selectors of the form "[href]" (attribute token with no preceding tag name) work properly. Closes #8870 . [chao, kangax, Andrew Dupont]
2007-11-05 17:11:41 +00:00
Andrew Dupont
e457edbcf4
Simplified the bitmask in Element#descendantOf.
2007-11-01 19:06:02 +00:00
Andrew Dupont
7cf17c7bec
Performance optimizations for Element#descendantOf. Costliness should no longer be dependent on the difference in depth between the parent and the child. [Andrew Dupont]
2007-11-01 15:11:52 +00:00
Thomas Fuchs
916cbbaf4c
Apply the workaround for the Firefox "blinking element" opacity=1 bug only to Firefox 1.5.
2007-10-29 23:06:15 +00:00
Andrew Dupont
67cf750956
Add event.stopped, a boolean that is set to when Event#stop is called.
2007-10-26 19:15:35 +00:00
Tobie Langel
4dece6b277
Use String#include wherever possible.
2007-10-22 22:16:32 +00:00
Tobie Langel
16127b024a
prototype: In IE, allow opacity to be set on elements not yet attached to the document. Closes #9904 .
2007-10-22 13:14:56 +00:00
Tobie Langel
f870fba94f
prototype: Avoid the try..catch block in Ajax.Response#_getResponseJSON unless required.
2007-10-22 12:04:06 +00:00
Tobie Langel
44c9d8937a
prototype: Make the Ajax.Response#headerJSON property correctly decode unicode characters. Closes #9285
2007-10-22 11:20:21 +00:00
Tobie Langel
827c8c6b48
prototype: Prevent a Firefox bug from throwing errors on page load/unload. Closes #5393 , #9421 .
2007-10-22 01:04:17 +00:00
Tobie Langel
37bab18999
prototype: previous changeset Closes #9917 , #9463 , #8260 .
2007-10-18 15:52:26 +00:00
Tobie Langel
29c0de6937
prototype: Make submitting forms work in Opera < 9.1.
2007-10-18 15:46:30 +00:00
Sam Stephenson
b83ae95d90
prototype: Fix template evaluation with empty replacements. Closes #9692 .
2007-10-17 14:14:27 +00:00
Sam Stephenson
8327ffd8ae
prototype: Hash#toTemplateReplacements is an alias for Hash#toObject so you can once again pass hashes to Template#evaluate and String#interpolate.
2007-10-17 13:39:46 +00:00
Sam Stephenson
d114e76e97
prototype: Fix Event#is(Left|Middle|Right)Click in IE. Closes #7520 .
2007-10-17 13:26:49 +00:00
Andrew Dupont
aada1abb56
* Ensure Event.* generic methods work in IE, even when the event is not extended. [Viktor Kojouharov, Andrew Dupont]
2007-10-16 05:11:42 +00:00
Sam Stephenson
bfd5353cbf
prototype: Don't translate "keypress" events into "keydown" events.
2007-10-16 03:36:58 +00:00
Andrew Dupont
8d3d6cdb04
* Changed Element#makeClipping to remember the original overflow value, even if it's a non-inline style. [Andrew Dupont]
2007-10-16 03:29:19 +00:00
Sam Stephenson
3dd7bd5b4b
prototype: Cross-browser Event#isLeftClick with the addition of is(Middle|Right)Click. Closes #7520 .
2007-10-16 03:19:38 +00:00
Andrew Dupont
6cd34be0c4
* Change Selector to use the non-XPath approach for Safari 3 because of bugs in its version of document.evaluate. [Andrew Dupont]
2007-10-16 03:08:31 +00:00
Andrew Dupont
0dd4ba70f6
* Changed the Selector regex that tests whether the selector can be expressed in XPath; added :checked, since XPath can't detect all scenarios in which an <input> is checked. Fixes #9776 . [StelardActek, kangax, Andrew Dupont]
2007-10-16 02:28:28 +00:00
Andrew Dupont
88f8d3b9af
* Changed Selector pattern match so that descendant combinators after pseudoclass tokens are properly handled. Fixes #9696 . [wiktor, kangax, Andrew Dupont]
2007-10-16 02:21:24 +00:00
Tobie Langel
865ac01937
prototype: Make sure $w always returns an array.
2007-10-15 17:19:16 +00:00
Tobie Langel
941359b2f7
Performance enhancements to . Closes #9464
2007-10-14 11:12:08 +00:00
Tobie Langel
7dda50a7c9
Make Function#argumentNames work with named functions. Closes #9826
2007-10-14 10:54:06 +00:00
Tobie Langel
96af1b7579
Add Object.isHash.
2007-10-14 08:08:42 +00:00
Tobie Langel
d195111a9d
Performance improvements to String#times.
2007-10-13 19:05:19 +00:00
Tobie Langel
db371ddb5a
Make Ajax.Response#getHeaderJSON and Ajax.Response#getResponseJSON pseudo private instance methods.
2007-10-13 11:37:26 +00:00
Tobie Langel
e7bb042aa6
Make ObjectRange use the new Class.create syntax.
2007-10-13 11:24:23 +00:00
Tobie Langel
d25b863c9a
Complete rewrite of the Hash class.
2007-10-13 10:55:52 +00:00
Sam Stephenson
4607e29fa2
prototype: Element#wrap now returns the wrapper instead of the element being wrapped.
2007-10-11 06:11:26 +00:00
Sam Stephenson
115d3e456d
prototype: Namespace all custom event names to avoid conflicts with native DOM events.
2007-10-11 06:00:45 +00:00
Sam Stephenson
c35598ca2b
prototype: Clean up the new class API.
2007-10-11 05:02:07 +00:00
Sam Stephenson
8ca43a5c88
prototype: Fix contentloaded event initialization in IE. Closes #9457 , #9488 , #9707 .
2007-10-08 22:37:15 +00:00
Sam Stephenson
c904fe7664
prototype: Deprecate document.getElementsByClassName and Element#getElementsByClassName since native versions return a NodeList and we can only return an Array. Please use $$ or Element#select instead.
2007-10-08 21:29:27 +00:00
Sam Stephenson
cf88669931
prototype: Fix missing "var" in selector.js. Closes #9761 .
2007-10-08 21:15:46 +00:00
Sam Stephenson
4b1fb7e03a
prototype: Date#toJSON now returns times in UTC for better compatibility with json.js. Closes #9332 .
2007-10-08 21:14:24 +00:00
Sam Stephenson
8cf1f895f7
prototype: Ensure document._getElementsByXPath extends the elements it returns; fixes $$ not returning extended elements in Opera 9.2. Closes #8843 .
2007-10-08 19:01:31 +00:00
Sam Stephenson
05e48f6feb
prototype: Update Prototype.Browser.MobileSafari for iPod touch compatibility.
2007-10-08 17:30:40 +00:00
Thomas Fuchs
6c94af703d
Make sure setting opacity works on elements that have "no layout" in IE.
2007-08-27 18:37:49 +00:00
Sam Stephenson
6ed9095df9
prototype: Simplify Class.create by establishing a prototype chain when subclassing. Closes #9342 .
2007-08-23 21:12:02 +00:00
Sam Stephenson
5d3fd6f3b7
prototype: Fix Ajax.PeriodicalUpdater for compatibility with Ajax.Response. Closes #9321 .
2007-08-21 16:18:07 +00:00
Sam Stephenson
001b54865c
prototype: Ensure that classes always have an initialize method.
2007-08-21 16:15:59 +00:00
Sam Stephenson
6086db40a7
prototype: Update Template, Selector, Ajax.*, and ObjectRange classes to use the new class system.
2007-08-18 23:21:29 +00:00
Sam Stephenson
75b3f3c844
prototype: Change Abstract.TimedObserver to subclass PeriodicalExecuter and tweak its subclasses to use new inheritance functionality. TimedObserver can now be stopped the same way as PeriodicalExecuter. Closes #8589 .
2007-08-18 23:04:28 +00:00
Sam Stephenson
bfba40e0cd
prototype: Fix Class.mixin to extend the class's prototype.
2007-08-18 22:58:13 +00:00
Sam Stephenson
b923d6dd52
prototype: Fix superclass method call breakage from [7337].
2007-08-18 22:55:35 +00:00
Sam Stephenson
702d968841
prototype: Change Class.extend to allow for superclass method resolution and remove Class.inherit. Closes #9274 .
2007-08-17 17:35:22 +00:00
Sam Stephenson
b2f884b4fa
prototype: Event handlers are now bound to the observed element, not the event's target element.
2007-08-17 16:17:26 +00:00
Thomas Fuchs
aa1a7f5bf0
prototype: Define Node constants conditionally after checking for Node.ELEMENT_NODE presence. Add unit test to check the values of all constants. Closes #7625 .
2007-08-17 11:20:56 +00:00
Thomas Fuchs
194fda0b6d
prototype: Make sure Enumerable#include doesnt do type comparision. [Mislav Marohnić]
2007-08-17 11:06:07 +00:00
Thomas Fuchs
f86ac770d4
Prototype: Add contextmenu to Event.DOMEvents.
2007-08-14 12:05:20 +00:00
Sam Stephenson
d8b8c6586d
prototype: Fix readAttribute-related failure in form.html in IE.
2007-08-14 05:08:18 +00:00
Sam Stephenson
c27f2de373
prototype: Fix failing dom.html and selector.html tests in IE.
2007-08-14 04:14:22 +00:00
Sam Stephenson
c603fc5d42
prototype: Make sure the WebKit redefinition of Element#cumulativeOffset uses Element._returnOffset. Closes #9245 .
2007-08-13 15:15:01 +00:00
Sam Stephenson
11f25aa995
prototype: Make sure Element#observe is always chainable.
2007-08-11 19:53:39 +00:00
Sam Stephenson
d2974cfca3
prototype: Make sure Element#stopObserving is always chainable.
2007-08-11 19:07:21 +00:00
Sam Stephenson
14ea77ef39
prototype: Event.fire/Element#fire now returns the newly-fired event instead of the event's target element.
2007-08-11 18:46:02 +00:00
Sam Stephenson
d7da841c80
prototype: Restrict Event.DOMEvents to include only events that can be supported in all browsers
2007-08-11 18:14:20 +00:00
Sam Stephenson
ffa744e4aa
prototype: Fix a failing test in base.html in Safari 2.
2007-08-11 01:36:20 +00:00
Thomas Fuchs
5f76c255a1
Fix Element#positionedOffset and Element#getOffsetParent for static elements on IE. DOM unit tests now pass on IE.
2007-08-10 14:19:30 +00:00
Sam Stephenson
2fbb49001c
prototype: Make sure event handlers and their wrappers are removed from the cache by Event.stopObserving.
2007-08-09 23:45:59 +00:00
Sam Stephenson
e75cd0acdd
prototype: Fix Function#argumentNames for IE
2007-08-09 00:27:51 +00:00
Sam Stephenson
220f6379f1
prototype: Fix Function#argumentNames for Opera
2007-08-08 23:50:36 +00:00
Sam Stephenson
df71a6b54f
prototype: Add Object.isString, Object.isNumber, and Object.isUndefined, and clean up the source to make use of Object.isXXX where possible.
2007-08-08 23:19:45 +00:00
Sam Stephenson
ae2ab03294
prototype: Add the document.viewport object for querying dimensions and scroll offsets of the browser viewport.
2007-08-08 20:42:46 +00:00
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
c9a0485b60
prototype: Add some missing semicolons to the source tree. Closes #9140 .
2007-08-07 19:41:13 +00:00
Sam Stephenson
12f87a77a7
prototype: We can just use HTMLEvents in every non-IE browser instead of special-casing for Safari 2
2007-08-07 19:33:37 +00:00
Thomas Fuchs
cbaec757e2
Prototype: Fix event extensions and custom events firing for Safari 2.0
2007-08-07 14:55:34 +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
5645a0783f
prototype: Add Prototype.Browser.MobileSafari which evaluates to true on the iPhone's browser.
2007-07-26 02:03:40 +00:00
Sam Stephenson
1575435f5e
prototype: Element#classNames should still use the Element.ClassNames API for now
2007-07-24 20:53:32 +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
a529bcf590
prototype: Remove the dependency on Element.ClassNames from Element#addClassName/removeClassName/toggleClassName, and deprecate Element.ClassNames. Closes #9073 .
2007-07-24 20:42:21 +00:00
Sam Stephenson
59c3dfd87a
prototype: Use Object.isElement
2007-07-24 19:10:44 +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
Sam Stephenson
29cd62ebeb
prototype: Temporary workaround for Prototype.BrowserFeatures.SpecificElementExtensions incorrectly evaluating to true on iPhone.
2007-06-30 16:38:18 +00:00
Thomas Fuchs
1d971c5e4d
Prototype: remove a slash from the HEADER comment, as this could possibly cause issues with some javascript interpreters
2007-06-28 13:56:48 +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
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
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
afbef44cd6
Prototype: save a few lines in Element.Methods.hasClassName
2007-06-17 22:14:07 +00:00
Thomas Fuchs
1b8ef5af86
Fix a Safari rendering issue when floating elements could temporarily disappear when opacity was set to 1. Closes #7063 . References #3044 , #3813 , #6706 . [Thomas Fuchs, davidjrice]
2007-06-17 18:13:37 +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
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
Sam Stephenson
ae2ea8a2e9
prototype: Ensure HTMLElement exists before creating Element.extend.
2007-06-09 01:51:26 +00:00
Thomas Fuchs
4a648c6434
Use methodize() for the Math aliases
2007-06-06 16:28:18 +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
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
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
Sam Stephenson
b61bca10da
prototype: Event.findElement behaves as expected when the element passed matches the given selector. Closes #8395 .
2007-05-24 07:13:55 +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
55b658ac57
prototype: Event.findElement now uses Element#up (and as a result can take a CSS selector instead of just a tag name).
2007-05-18 01:44:26 +00:00
Sam Stephenson
a8a19eb439
prototype: Minor cleanup of the position methods
2007-05-18 01:21:41 +00:00
Sam Stephenson
7d2ae294a9
prototype: Fix Element#clonePosition to call Element#viewportOffset. Closes #8372 .
2007-05-18 01:12:35 +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
a7a0edd830
Make Prototype.ScriptFragment behave when including Prototype inline.
2007-05-18 00:44:20 +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
cbf8be9869
no, really!
2007-04-28 03:53:50 +00:00
Sam Stephenson
8a382ff853
prototype: Set window.$continue to an Error with a helpful message for anyone who may still be using 'throw $continue'.
2007-04-28 03:00:57 +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
4174060d5b
prototype: Don't call evalResponse() when an Ajax response has no Content-type header. Closes #7827 .
2007-04-24 03:34:30 +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
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
bbd0e6eb54
Make Event.element extend the returned element. Closes #7870 .
2007-04-17 17:31:20 +00:00
Thomas Fuchs
a0532bd933
Rolling back #7683 as it breaks existing effects in certain scenarios
2007-04-05 12:50:59 +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
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
1c8e6c170e
prototype: Give credit where credit is due. Add an attribution to YUI-Ext's DomQuery to the top of selector.js.
2007-03-12 20:27:19 +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
c9199c804d
Remove the first-element special treatment from Selector unique
2007-03-11 16:19:02 +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
811fb86286
prototype: 1.5.1_rc1: Fix readAttribute for IE7.
2007-03-09 19:17:50 +00:00
Sam Stephenson
fb0013a193
prototype: Give the parens some breathing room
2007-03-09 04:23:28 +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
1bf16af3bc
We dont like tabs
2007-03-08 22:45:07 +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
a9ec09115b
Prototype: Form.Element.disable() will now call blur(), removed blur() call from Form.Element.enable(). Closes #6034 . [tdd]
2007-03-05 16:03:11 +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
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
91dd60c5a2
Prototype: some more Element.setStyle optimizations
2007-03-02 12:16:42 +00:00
Sam Stephenson
94d8333448
prototype: Fix a bug in the simulated hasAttribute for IE due to getAttributeNode sometimes returning null.
2007-02-28 01:16:52 +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
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
225bf0e6ec
prototype: remove redundant conditional
2007-01-28 07:34:43 +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
Sam Stephenson
c556c89627
prototype: Improve performance of String.prototype.escapeHTML by using a cached div and text node. Closes #6937 .
2007-01-27 18:33:03 +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
ce639c2c8b
prototype: Update HEADER to reflect new URL.
2007-01-18 22:33:49 +00:00
Sam Stephenson
bb4d189b37
prototype: Reorganize the source tree.
2007-01-18 22:24:27 +00:00