--- Webpacus/root/js/prototype.js 2006/02/20 15:33:19 408 +++ Webpacus/root/js/prototype.js 2006/02/20 17:12:22 409 @@ -1,17 +1,13 @@ -/* Prototype JavaScript framework, version 1.4.0_rc4 +/* Prototype JavaScript framework, version 1.4.0 * (c) 2005 Sam Stephenson * - * THIS FILE IS AUTOMATICALLY GENERATED. When sending patches, please diff - * against the source tree, available from the Prototype darcs repository. - * * Prototype is freely distributable under the terms of an MIT-style license. - * * For details, see the Prototype web site: http://prototype.conio.net/ * /*--------------------------------------------------------------------------*/ var Prototype = { - Version: '1.4.0_rc4', + Version: '1.4.0', ScriptFragment: '(?:)((\n|\r|.)*?)(?:<\/script>)', emptyFunction: function() {}, @@ -46,10 +42,10 @@ } } -Function.prototype.bind = function(object) { - var __method = this; +Function.prototype.bind = function() { + var __method = this, args = $A(arguments), object = args.shift(); return function() { - return __method.apply(object, arguments); + return __method.apply(object, args.concat($A(arguments))); } } @@ -393,6 +389,7 @@ entries: Enumerable.toArray }); var $A = Array.from = function(iterable) { + if (!iterable) return []; if (iterable.toArray) { return iterable.toArray(); } else { @@ -456,6 +453,14 @@ return (inline !== false ? this : this.toArray())._reverse(); }, + shift: function() { + var result = this[0]; + for (var i = 0; i < this.length - 1; i++) + this[i] = this[i + 1]; + this.length--; + return result; + }, + inspect: function() { return '[' + this.map(Object.inspect).join(', ') + ']'; } @@ -1253,9 +1258,17 @@ var method = element.tagName.toLowerCase(); var parameter = Form.Element.Serializers[method](element); - if (parameter) - return encodeURIComponent(parameter[0]) + '=' + - encodeURIComponent(parameter[1]); + if (parameter) { + var key = encodeURIComponent(parameter[0]); + if (key.length == 0) return; + + if (parameter[1].constructor != Array) + parameter[1] = [parameter[1]]; + + return parameter[1].map(function(value) { + return key + '=' + encodeURIComponent(value); + }).join('&'); + } }, getValue: function(element) { @@ -1765,4 +1778,4 @@ return [valueL, valueT]; } -} +} \ No newline at end of file