Upgrade to Prototype 1.5.1.1 (bugfix release). Props Nazgul. fixes #4502

git-svn-id: http://svn.automattic.com/wordpress/trunk@5743 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
markjaquith 2007-06-21 22:01:21 +00:00
parent 37dbcc2a80
commit eefdd4cef7
2 changed files with 15 additions and 9 deletions

View File

@ -1,4 +1,4 @@
/* Prototype JavaScript framework, version 1.5.1 /* Prototype JavaScript framework, version 1.5.1.1
* (c) 2005-2007 Sam Stephenson * (c) 2005-2007 Sam Stephenson
* *
* Prototype is freely distributable under the terms of an MIT-style license. * Prototype is freely distributable under the terms of an MIT-style license.
@ -7,7 +7,7 @@
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
var Prototype = { var Prototype = {
Version: '1.5.1', Version: '1.5.1.1',
Browser: { Browser: {
IE: !!(window.attachEvent && !window.opera), IE: !!(window.attachEvent && !window.opera),
@ -24,8 +24,8 @@ var Prototype = {
document.createElement('form').__proto__) document.createElement('form').__proto__)
}, },
ScriptFragment: '<script[^>]*>([\\s\\S]*?)<\/script>', ScriptFragment: '<script[^>]*>([\\S\\s]*?)<\/script>',
JSONFilter: /^\/\*-secure-\s*(.*)\s*\*\/\s*$/, JSONFilter: /^\/\*-secure-([\s\S]*)\*\/\s*$/,
emptyFunction: function() { }, emptyFunction: function() { },
K: function(x) { return x } K: function(x) { return x }
@ -364,11 +364,15 @@ Object.extend(String.prototype, {
return this.sub(filter || Prototype.JSONFilter, '#{1}'); return this.sub(filter || Prototype.JSONFilter, '#{1}');
}, },
isJSON: function() {
var str = this.replace(/\\./g, '@').replace(/"[^"\\\n\r]*"/g, '');
return (/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str);
},
evalJSON: function(sanitize) { evalJSON: function(sanitize) {
var json = this.unfilterJSON(); var json = this.unfilterJSON();
try { try {
if (!sanitize || (/^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/.test(json))) if (!sanitize || json.isJSON()) return eval('(' + json + ')');
return eval('(' + json + ')');
} catch (e) { } } catch (e) { }
throw new SyntaxError('Badly formed JSON string: ' + this.inspect()); throw new SyntaxError('Badly formed JSON string: ' + this.inspect());
}, },
@ -1270,10 +1274,12 @@ if (Prototype.BrowserFeatures.XPath) {
} else document.getElementsByClassName = function(className, parentElement) { } else document.getElementsByClassName = function(className, parentElement) {
var children = ($(parentElement) || document.body).getElementsByTagName('*'); var children = ($(parentElement) || document.body).getElementsByTagName('*');
var elements = [], child; var elements = [], child, pattern = new RegExp("(^|\\s)" + className + "(\\s|$)");
for (var i = 0, length = children.length; i < length; i++) { for (var i = 0, length = children.length; i < length; i++) {
child = children[i]; child = children[i];
if (Element.hasClassName(child, className)) var elementClassName = child.className;
if (elementClassName.length == 0) continue;
if (elementClassName == className || elementClassName.match(pattern))
elements.push(Element.extend(child)); elements.push(Element.extend(child));
} }
return elements; return elements;

View File

@ -35,7 +35,7 @@ class WP_Scripts {
$mce_config = apply_filters('tiny_mce_config_url', '/wp-includes/js/tinymce/tiny_mce_config.php'); $mce_config = apply_filters('tiny_mce_config_url', '/wp-includes/js/tinymce/tiny_mce_config.php');
$this->add( 'wp_tiny_mce', $mce_config, array('tiny_mce'), '20070528' ); $this->add( 'wp_tiny_mce', $mce_config, array('tiny_mce'), '20070528' );
$this->add( 'prototype', '/wp-includes/js/prototype.js', false, '1.5.1'); $this->add( 'prototype', '/wp-includes/js/prototype.js', false, '1.5.1.1');
$this->add( 'autosave', '/wp-includes/js/autosave.js', array('prototype', 'sack'), '20070306'); $this->add( 'autosave', '/wp-includes/js/autosave.js', array('prototype', 'sack'), '20070306');
$this->localize( 'autosave', 'autosaveL10n', array( $this->localize( 'autosave', 'autosaveL10n', array(