diff options
author | Thomas Fuchs <thomas@fesch.at> | 2006-11-17 23:52:54 +0000 |
---|---|---|
committer | Thomas Fuchs <thomas@fesch.at> | 2006-11-17 23:52:54 +0000 |
commit | bc76044fde8701d19ab85d244789a69ba5ed9bbd (patch) | |
tree | cc0082fc4ed90e19a81fefe520bdae11d8ee5d52 /actionpack/lib | |
parent | f92d6a07d0d01226fb80c82608d332843c01f2d6 (diff) | |
download | rails-bc76044fde8701d19ab85d244789a69ba5ed9bbd.tar.gz rails-bc76044fde8701d19ab85d244789a69ba5ed9bbd.tar.bz2 rails-bc76044fde8701d19ab85d244789a69ba5ed9bbd.zip |
Update Prototype in trunk to [5550]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5551 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_view/helpers/javascripts/prototype.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/helpers/javascripts/prototype.js b/actionpack/lib/action_view/helpers/javascripts/prototype.js index ce1e5a028b..ba2d9e501b 100644 --- a/actionpack/lib/action_view/helpers/javascripts/prototype.js +++ b/actionpack/lib/action_view/helpers/javascripts/prototype.js @@ -261,6 +261,14 @@ Object.extend(String.prototype, { return camelizedString; }, + underscore: function() { + return this.gsub(/::/, '/').gsub(/([A-Z]+)([A-Z][a-z])/,'#{1}_#{2}').gsub(/([a-z\d])([A-Z])/,'#{1}_#{2}').gsub(/-/,'-').toLowerCase(); + }, + + dasherize: function() { + return this.gsub(/_/,'-'); + }, + inspect: function(useDoubleQuotes) { var escapedString = this.replace(/\\/g, '\\\\'); if (useDoubleQuotes) @@ -580,6 +588,22 @@ Object.extend(Array.prototype, { }); Array.prototype.toArray = Array.prototype.clone; + +if(window.opera){ + Array.prototype.concat = function(){ + var array = []; + for(var i = 0, length = this.length; i < length; i++) array.push(this[i]); + for(var i = 0, length = arguments.length; i < length; i++) { + if(arguments[i].constructor == Array) { + for(var j = 0, arrayLength = arguments[i].length; j < arrayLength; j++) + array.push(arguments[i][j]); + } else { + array.push(arguments[i]); + } + } + return array; + } +} var Hash = { _each: function(iterator) { for (var key in this) { |