diff --git a/wp-includes/js/wp-ajax.js b/wp-includes/js/wp-ajax.js
deleted file mode 100644
index e3f63f7a48..0000000000
--- a/wp-includes/js/wp-ajax.js
+++ /dev/null
@@ -1,100 +0,0 @@
-var WPAjax = Class.create();
-Object.extend(WPAjax.prototype, Ajax.Request.prototype);
-Object.extend(WPAjax.prototype, {
- WPComplete: false, // onComplete function
- WPError: false, // onWPError function
- defaultUrl: '', // We get these from WPAjaxL10n
- permText: '',
- strangeText: '',
- whoaText: '',
-
- initialize: function(url, responseEl) {
- var tempObj = this;
- this.transport = Ajax.getTransport();
- if ( !this.transport )
- return false;
- this.setOptions( {
- parameters: 'cookie=' + encodeURIComponent(document.cookie),
- onComplete: function(transport) { // transport = XMLHttpRequest object
- if ( tempObj.parseAjaxResponse() ) {
- if ( 'function' == typeof tempObj.WPComplete )
- tempObj.WPComplete(transport);
- } else if ( 'function' == typeof tempObj.WPError ) // if response corresponds to an error (bad data, say, not 404)
- tempObj.WPError(transport);
- }
- });
- this.url = url ? url : this.defaultUrl;
- this.getResponseElement(responseEl);
- },
- addArg: function(key, value) {
- var a = $H();
- a[encodeURIComponent(key)] = encodeURIComponent(value);
- this.options.parameters = $H(this.options.parameters).merge(a);
- },
- getResponseElement: function(r) {
- var p = $(r + '-p');
- if ( !p ) {
- new Insertion.Bottom(r, "");
- var p = $(r + '-p');
- }
- this.myResponseElement = p;
- },
- parseAjaxResponse: function() { // 1 = good, 0 = strange (bad data?), -1 = you lack permission
- if ( this.transport.responseXML && typeof this.transport.responseXML == 'object' && ( this.transport.responseXML.xml || 'undefined' == typeof this.transport.responseXML.xml ) ) {
- var err = this.transport.responseXML.getElementsByTagName('wp_error');
- if ( err[0] ) {
- var msg = $A(err).inject( '', function(a, b) { return a + '
' + b.firstChild.nodeValue + '
'; } );
- Element.update(this.myResponseElement,'' + msg + '
');
- return false;
- }
- return true;
- }
- var r = this.transport.responseText;
- if ( isNaN(r) ) {
- Element.update(this.myResponseElement,'');
- return false;
- }
- var r = parseInt(r,10);
- if ( -1 == r ) {
- Element.update(this.myResponseElement,"");
- return false;
- } else if ( 0 == r ) {
- Element.update(this.myResponseElement,"");
- return false;
- }
- return true;
- },
- addOnComplete: function(f) {
- if ( 'function' == typeof f ) { var of = this.WPComplete; this.WPComplete = function(t) { if ( of ) of(t); f(t); } }
- },
- addOnWPError: function(f) {
- if ( 'function' == typeof f ) { var of = this.WPError; this.WPError = function(t) { if ( of ) of(t); f(t); } }
- },
- notInitialized: function() {
- return this.transport ? false : true;
- }
-});
-
-Event.observe( window, 'load', function() { Object.extend(WPAjax.prototype, WPAjaxL10n); }, false )
-
-Ajax.activeSendCount = 0;
-Ajax.Responders.register( {
- onCreate: function() {
- Ajax.activeSendCount++;
- if ( 1 != Ajax.activeSendCount )
- return;
- wpBeforeUnload = window.onbeforeunload;
- window.onbeforeunload = function() {
- return WPAjax.whoaText;
- }
- },
- onLoading: function() { // Can switch to onLoaded if we lose data
- Ajax.activeSendCount--;
- if ( 0 != Ajax.activeSendCount )
- return;
- window.onbeforeunload = wpBeforeUnload;
- }
-});
-
-//Pretty func adapted from ALA http://www.alistapart.com/articles/gettingstartedwithajax
-function getNodeValue(tree,el){try { var r = tree.getElementsByTagName(el)[0].firstChild.nodeValue; } catch(err) { var r = null; } return r; }
diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php
index 5814e9dfdb..ecbb610552 100644
--- a/wp-includes/script-loader.php
+++ b/wp-includes/script-loader.php
@@ -48,14 +48,6 @@ function wp_default_scripts( $scripts ) {
$scripts->add( 'autosave', '/wp-includes/js/autosave.js', array('schedule', 'wp-ajax-response'), '20080508' );
- $scripts->add( 'wp-ajax', '/wp-includes/js/wp-ajax.js', array('prototype'), '20070306');
- $scripts->localize( 'wp-ajax', 'WPAjaxL10n', array(
- 'defaultUrl' => get_option( 'siteurl' ) . '/wp-admin/admin-ajax.php',
- 'permText' => __("You do not have permission to do that."),
- 'strangeText' => __("Something strange happened. Try refreshing the page."),
- 'whoaText' => __("Slow down, I'm still sending your data!")
- ) );
-
$scripts->add( 'wp-lists', '/wp-includes/js/wp-lists.js', array('wp-ajax-response'), '20080411' );
$scripts->localize( 'wp-lists', 'wpListL10n', array(
'url' => get_option( 'siteurl' ) . '/wp-admin/admin-ajax.php'