Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 8276

Show
Ignore:
Timestamp:
12/05/07 03:08:29 (7 months ago)
Author:
sam
Message:

Update Prototype to 1.6.0.1

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/CHANGELOG

    r8268 r8276  
    11*SVN* 
     2 
     3* Update Prototype to 1.6.0.1.  [sam] 
    24 
    35* 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 
    22 *  (c) 2005-2007 Sam Stephenson 
    33 * 
     
    88 
    99var Prototype = { 
    10   Version: '1.6.0', 
     10  Version: '1.6.0.1', 
    1111 
    1212  Browser: { 
     
    21952195 
    21962196if (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  ); 
    22132237} 
    22142238 
     
    23812405 
    23822406  // Safari returns margins on body which is incorrect if the child is absolutely 
    2383   // positioned.  For performance reasons, redefine Position.cumulativeOffset for 
     2407  // positioned.  For performance reasons, redefine Element#cumulativeOffset for 
    23842408  // KHTML/WebKit only. 
    23852409  Element.Methods.cumulativeOffset = function(element) { 
     
    26702694  getDimensions: function() { 
    26712695    var dimensions = { }; 
     2696    var B = Prototype.Browser; 
    26722697    $w('width height').each(function(d) { 
    26732698      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]
    26762701    }); 
    26772702    return dimensions; 
  • trunk/railties/CHANGELOG

    r8268 r8276  
    11*SVN* 
     2 
     3* Update Prototype to 1.6.0.1.  [sam] 
    24 
    35* 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 
    22 *  (c) 2005-2007 Sam Stephenson 
    33 * 
     
    88 
    99var Prototype = { 
    10   Version: '1.6.0', 
     10  Version: '1.6.0.1', 
    1111 
    1212  Browser: { 
     
    21952195 
    21962196if (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  ); 
    22132237} 
    22142238 
     
    23812405 
    23822406  // Safari returns margins on body which is incorrect if the child is absolutely 
    2383   // positioned.  For performance reasons, redefine Position.cumulativeOffset for 
     2407  // positioned.  For performance reasons, redefine Element#cumulativeOffset for 
    23842408  // KHTML/WebKit only. 
    23852409  Element.Methods.cumulativeOffset = function(element) { 
     
    26702694  getDimensions: function() { 
    26712695    var dimensions = { }; 
     2696    var B = Prototype.Browser; 
    26722697    $w('width height').each(function(d) { 
    26732698      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]
    26762701    }); 
    26772702    return dimensions;