Changeset 8276
- Timestamp:
- 12/05/07 03:08:29 (7 months ago)
- Files:
-
- trunk/actionpack/CHANGELOG (modified) (1 diff)
- trunk/actionpack/lib/action_view/helpers/javascripts/prototype.js (modified) (5 diffs)
- trunk/railties/CHANGELOG (modified) (1 diff)
- trunk/railties/html/javascripts/prototype.js (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionpack/CHANGELOG
r8268 r8276 1 1 *SVN* 2 3 * Update Prototype to 1.6.0.1. [sam] 2 4 3 5 * Update script.aculo.us to 1.8.0.1. [madrobby] trunk/actionpack/lib/action_view/helpers/javascripts/prototype.js
r8234 r8276 1 /* Prototype JavaScript framework, version 1.6.0 1 /* Prototype JavaScript framework, version 1.6.0.1 2 2 * (c) 2005-2007 Sam Stephenson 3 3 * … … 8 8 9 9 var Prototype = { 10 Version: '1.6.0 ',10 Version: '1.6.0.1', 11 11 12 12 Browser: { … … 2195 2195 2196 2196 if (Prototype.Browser.Opera) { 2197 Element.Methods._getStyle = Element.Methods.getStyle; 2198 Element.Methods.getStyle = function(element, style) { 2199 switch(style) { 2200 case 'left': 2201 case 'top': 2202 case 'right': 2203 case 'bottom': 2204 if (Element._getStyle(element, 'position') == 'static') return null; 2205 default: return Element._getStyle(element, style); 2206 } 2207 }; 2208 Element.Methods._readAttribute = Element.Methods.readAttribute; 2209 Element.Methods.readAttribute = function(element, attribute) { 2210 if (attribute == 'title') return element.title; 2211 return Element._readAttribute(element, attribute); 2212 }; 2197 Element.Methods.getStyle = Element.Methods.getStyle.wrap( 2198 function(proceed, element, style) { 2199 switch (style) { 2200 case 'left': case 'top': case 'right': case 'bottom': 2201 if (proceed(element, 'position') === 'static') return null; 2202 case 'height': case 'width': 2203 // returns '0px' for hidden elements; we want it to return null 2204 if (!Element.visible(element)) return null; 2205 2206 // returns the border-box dimensions rather than the content-box 2207 // dimensions, so we subtract padding and borders from the value 2208 var dim = parseInt(proceed(element, style), 10); 2209 2210 if (dim !== element['offset' + style.capitalize()]) 2211 return dim + 'px'; 2212 2213 var properties; 2214 if (style === 'height') { 2215 properties = ['border-top-width', 'padding-top', 2216 'padding-bottom', 'border-bottom-width']; 2217 } 2218 else { 2219 properties = ['border-left-width', 'padding-left', 2220 'padding-right', 'border-right-width']; 2221 } 2222 return properties.inject(dim, function(memo, property) { 2223 var val = proceed(element, property); 2224 return val === null ? memo : memo - parseInt(val, 10); 2225 }) + 'px'; 2226 default: return proceed(element, style); 2227 } 2228 } 2229 ); 2230 2231 Element.Methods.readAttribute = Element.Methods.readAttribute.wrap( 2232 function(proceed, element, attribute) { 2233 if (attribute === 'title') return element.title; 2234 return proceed(element, attribute); 2235 } 2236 ); 2213 2237 } 2214 2238 … … 2381 2405 2382 2406 // Safari returns margins on body which is incorrect if the child is absolutely 2383 // positioned. For performance reasons, redefine Position.cumulativeOffset for2407 // positioned. For performance reasons, redefine Element#cumulativeOffset for 2384 2408 // KHTML/WebKit only. 2385 2409 Element.Methods.cumulativeOffset = function(element) { … … 2670 2694 getDimensions: function() { 2671 2695 var dimensions = { }; 2696 var B = Prototype.Browser; 2672 2697 $w('width height').each(function(d) { 2673 2698 var D = d.capitalize(); 2674 dimensions[d] = self['inner' + D] ||2675 (document.documentElement['client' + D] || document.body['client' + D]);2699 dimensions[d] = (B.WebKit && !document.evaluate) ? self['inner' + D] : 2700 (B.Opera) ? document.body['client' + D] : document.documentElement['client' + D]; 2676 2701 }); 2677 2702 return dimensions; trunk/railties/CHANGELOG
r8268 r8276 1 1 *SVN* 2 3 * Update Prototype to 1.6.0.1. [sam] 2 4 3 5 * Update script.aculo.us to 1.8.0.1. [madrobby] trunk/railties/html/javascripts/prototype.js
r8234 r8276 1 /* Prototype JavaScript framework, version 1.6.0 1 /* Prototype JavaScript framework, version 1.6.0.1 2 2 * (c) 2005-2007 Sam Stephenson 3 3 * … … 8 8 9 9 var Prototype = { 10 Version: '1.6.0 ',10 Version: '1.6.0.1', 11 11 12 12 Browser: { … … 2195 2195 2196 2196 if (Prototype.Browser.Opera) { 2197 Element.Methods._getStyle = Element.Methods.getStyle; 2198 Element.Methods.getStyle = function(element, style) { 2199 switch(style) { 2200 case 'left': 2201 case 'top': 2202 case 'right': 2203 case 'bottom': 2204 if (Element._getStyle(element, 'position') == 'static') return null; 2205 default: return Element._getStyle(element, style); 2206 } 2207 }; 2208 Element.Methods._readAttribute = Element.Methods.readAttribute; 2209 Element.Methods.readAttribute = function(element, attribute) { 2210 if (attribute == 'title') return element.title; 2211 return Element._readAttribute(element, attribute); 2212 }; 2197 Element.Methods.getStyle = Element.Methods.getStyle.wrap( 2198 function(proceed, element, style) { 2199 switch (style) { 2200 case 'left': case 'top': case 'right': case 'bottom': 2201 if (proceed(element, 'position') === 'static') return null; 2202 case 'height': case 'width': 2203 // returns '0px' for hidden elements; we want it to return null 2204 if (!Element.visible(element)) return null; 2205 2206 // returns the border-box dimensions rather than the content-box 2207 // dimensions, so we subtract padding and borders from the value 2208 var dim = parseInt(proceed(element, style), 10); 2209 2210 if (dim !== element['offset' + style.capitalize()]) 2211 return dim + 'px'; 2212 2213 var properties; 2214 if (style === 'height') { 2215 properties = ['border-top-width', 'padding-top', 2216 'padding-bottom', 'border-bottom-width']; 2217 } 2218 else { 2219 properties = ['border-left-width', 'padding-left', 2220 'padding-right', 'border-right-width']; 2221 } 2222 return properties.inject(dim, function(memo, property) { 2223 var val = proceed(element, property); 2224 return val === null ? memo : memo - parseInt(val, 10); 2225 }) + 'px'; 2226 default: return proceed(element, style); 2227 } 2228 } 2229 ); 2230 2231 Element.Methods.readAttribute = Element.Methods.readAttribute.wrap( 2232 function(proceed, element, attribute) { 2233 if (attribute === 'title') return element.title; 2234 return proceed(element, attribute); 2235 } 2236 ); 2213 2237 } 2214 2238 … … 2381 2405 2382 2406 // Safari returns margins on body which is incorrect if the child is absolutely 2383 // positioned. For performance reasons, redefine Position.cumulativeOffset for2407 // positioned. For performance reasons, redefine Element#cumulativeOffset for 2384 2408 // KHTML/WebKit only. 2385 2409 Element.Methods.cumulativeOffset = function(element) { … … 2670 2694 getDimensions: function() { 2671 2695 var dimensions = { }; 2696 var B = Prototype.Browser; 2672 2697 $w('width height').each(function(d) { 2673 2698 var D = d.capitalize(); 2674 dimensions[d] = self['inner' + D] ||2675 (document.documentElement['client' + D] || document.body['client' + D]);2699 dimensions[d] = (B.WebKit && !document.evaluate) ? self['inner' + D] : 2700 (B.Opera) ? document.body['client' + D] : document.documentElement['client' + D]; 2676 2701 }); 2677 2702 return dimensions;