Index: wp-includes/js/wp-ajax.js
===================================================================
--- wp-includes/js/wp-ajax.js	(revision 4968)
+++ wp-includes/js/wp-ajax.js	(working copy)
@@ -1,9 +1,13 @@
-<?php @require_once('../../wp-config.php'); cache_javascript_headers(); ?>
 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();
@@ -19,7 +23,7 @@
 					tempObj.WPError(transport);
 			}
 		});
-		this.url = url ? url : '<?php bloginfo( 'wpurl' ); ?>/wp-admin/admin-ajax.php';
+		this.url = url ? url : this.defaultUrl;
 		this.getResponseElement(responseEl);
 	},
 	addArg: function(key, value) {
@@ -52,10 +56,10 @@
 		}
 		var r = parseInt(r,10);
 		if ( -1 == r ) {
-			Element.update(this.myResponseElement,"<div class='error'><p><?php _e("You don't have permission to do that."); ?></p></div>");
+			Element.update(this.myResponseElement,"<div class='error'><p>" + this.permText + "</p></div>");
 			return false;
 		} else if ( 0 == r ) {
-			Element.update(this.myResponseElement,"<div class='error'><p><?php _e("Something strange happened.  Try refreshing the page."); ?></p></div>");
+			Element.update(this.myResponseElement,"<div class='error'><p>" + this.strangeText + "</p></div>");
 			return false;
 		}
 		return true;
@@ -71,6 +75,8 @@
 	}
 });
 
+Event.observe( window, 'load', function() { Object.extend(WPAjax.prototype, WPAjaxL10n); }, false )
+
 Ajax.activeSendCount = 0;
 Ajax.Responders.register( {
 	onCreate: function() {
@@ -79,7 +85,7 @@
 			return;
 		wpBeforeUnload = window.onbeforeunload;
 		window.onbeforeunload = function() {
-			return "<?php js_escape(__("Slow down, I'm still sending your data!")); ?>";
+			return WPAjax.whoaText;
 		}
 	},
 	onLoading: function() { // Can switch to onLoaded if we lose data
Index: wp-includes/js/list-manipulation.js
===================================================================
--- wp-includes/js/list-manipulation.js	(revision 4968)
+++ wp-includes/js/list-manipulation.js	(working copy)
@@ -8,7 +8,7 @@
 	if ( !obj )
 		obj=theList;
 	if ( !message )
-		message = obj.delText.replace(/%/g, what);
+		message = obj.delText.replace(/%thing%/g, what);
 	if( confirm(message) )
 		return obj.ajaxDelete( what, id );
 	else return false;
@@ -36,8 +36,8 @@
 	dataStore: null,
 	formStore: null,
 
-	jumpText: 'Jump to new item',
-	delText: 'Are you sure you want to delete this %s?',
+	jumpText: '', // We get these from listManL10n
+	delText: '',
 
 	initialize: function(theListId) {
 		this.theList = $(theListId ? theListId : 'the-list');
Index: wp-includes/js/autosave-js.php
===================================================================
--- wp-includes/js/autosave-js.php	(revision 4968)
+++ wp-includes/js/autosave-js.php	(working copy)
@@ -1,161 +0,0 @@
-<?php @require_once('../../wp-config.php');
-cache_javascript_headers();
-?>
-var autosaveLast = '';
-var autosavePeriodical;
-
-function autosave_start_timer() {
-	var form = $('post');
-	autosaveLast = form.post_title.value+form.content.value;
-	// Keep autosave_interval in sync with edit_post().
-	autosavePeriodical = new PeriodicalExecuter(autosave, <?php echo apply_filters('autosave_interval', '120'); ?>);
-	//Disable autosave after the form has been submitted
-	if(form.addEventListener) {
-		form.addEventListener("submit", function () { autosavePeriodical.currentlyExecuting = true; }, false);
-	}
-	if(form.attachEvent) {
-		form.save ? form.save.attachEvent("onclick", function () { autosavePeriodical.currentlyExecuting = true; }) : null;
-		form.submit ? form.submit.attachEvent("onclick", function () { autosavePeriodical.currentlyExecuting = true; }) : null;
-		form.publish ? form.publish.attachEvent("onclick", function () { autosavePeriodical.currentlyExecuting = true; }) : null;
-		form.deletepost ? form.deletepost.attachEvent("onclick", function () { autosavePeriodical.currentlyExecuting = true; }) : null;
-	}
-}
-addLoadEvent(autosave_start_timer)
-
-function autosave_cur_time() {
-	var now = new Date();
-	return "" + ((now.getHours() >12) ? now.getHours() -12 : now.getHours()) + 
-	((now.getMinutes() < 10) ? ":0" : ":") + now.getMinutes() +
-	((now.getSeconds() < 10) ? ":0" : ":") + now.getSeconds();
-}
-
-function autosave_update_nonce() {
-	var response = nonceAjax.response;
-	document.getElementsByName('_wpnonce')[0].value = response;
-}
-
-function autosave_update_post_ID() {
-	var response = autosaveAjax.response;
-	var res = parseInt(response);
-	var message;
-
-	if(isNaN(res)) {
-		message = "<?php echo js_escape(__('Error: ')); ?>" + response;
-	} else {
-		message = "<?php echo js_escape(__('Saved at ')); ?>" + autosave_cur_time();
-		$('post_ID').name = "post_ID";
-		$('post_ID').value = res;
-		// We need new nonces
-		nonceAjax = new sack();
-		nonceAjax.element = null;
-		nonceAjax.setVar("action", "autosave-generate-nonces");
-		nonceAjax.setVar("post_ID", res);
-		nonceAjax.setVar("cookie", document.cookie);
-		nonceAjax.setVar("post_type", $('post_type').value);
-		nonceAjax.requestFile = "<?php echo get_option('siteurl'); ?>/wp-admin/admin-ajax.php";
-		nonceAjax.onCompletion = autosave_update_nonce;
-		nonceAjax.method = "POST";
-		nonceAjax.runAJAX();
-		$('hiddenaction').value = 'editpost';
-	}
-	$('autosave').innerHTML = message;
-	autosave_enable_buttons();
-}
-
-function autosave_loading() {
-	$('autosave').innerHTML = "<?php echo js_escape(__('Saving Draft...')); ?>";
-}
-
-function autosave_saved() {
-	var response = autosaveAjax.response;
-	var res = parseInt(response);
-	var message;
-
-	if(isNaN(res)) {
-		message = "<?php echo js_escape(__('Error: ')); ?>" + response;
-	} else {
-		message = "<?php echo js_escape(__('Saved at ')); ?>" + autosave_cur_time() + ".";
-	}
-	$('autosave').innerHTML = message;
-	autosave_enable_buttons();
-}
-
-function autosave_disable_buttons() {
-	var form = $('post');
-	form.save ? form.save.disabled = 'disabled' : null;
-	form.submit ? form.submit.disabled = 'disabled' : null;
-	form.publish ? form.publish.disabled = 'disabled' : null;
-	form.deletepost ? form.deletepost.disabled = 'disabled' : null;
-	setTimeout('autosave_enable_buttons();', 1000); // Re-enable 1 sec later.  Just gives autosave a head start to avoid collisions.
-}
-
-function autosave_enable_buttons() {
-	var form = $('post');
-	form.save ? form.save.disabled = '' : null;
-	form.submit ? form.submit.disabled = '' : null;
-	form.publish ? form.publish.disabled = '' : null;
-	form.deletepost ? form.deletepost.disabled = '' : null;
-}
-
-function autosave() {
-	var form = $('post');
-	var rich = ((typeof tinyMCE != "undefined") && tinyMCE.getInstanceById('content')) ? true : false;
-
-	autosaveAjax = new sack();
-
-	/* Gotta do this up here so we can check the length when tinyMCE is in use */
-	if ( typeof tinyMCE == "undefined" || tinyMCE.configs.length < 1 || rich == false ) {
-		autosaveAjax.setVar("content", form.content.value);
-	} else {
-		// Don't run while the TinyMCE spellcheck is on.
-		if(tinyMCE.selectedInstance.spellcheckerOn) return;
-		tinyMCE.wpTriggerSave();
-		autosaveAjax.setVar("content", form.content.value);
-	}
-
-	if(form.post_title.value.length==0 || form.content.value.length==0 || form.post_title.value+form.content.value == autosaveLast)
-		return;
-
-	autosave_disable_buttons();
-
-	autosaveLast = form.post_title.value+form.content.value;
-
-	cats = document.getElementsByName("post_category[]");
-	goodcats = ([]);
-	for(i=0;i<cats.length;i++) {
-		if(cats[i].checked)
-			goodcats.push(cats[i].value);
-	}
-	catslist = goodcats.join(",");
-
-	autosaveAjax.setVar("action", "autosave");
-	autosaveAjax.setVar("cookie", document.cookie);
-	autosaveAjax.setVar("catslist", catslist);
-	autosaveAjax.setVar("post_ID", $("post_ID").value);
-	autosaveAjax.setVar("post_title", form.post_title.value);
-	autosaveAjax.setVar("post_type", form.post_type.value);
-	if ( form.comment_status.checked )
-		autosaveAjax.setVar("comment_status", 'open');
-	if ( form.ping_status.checked )
-		autosaveAjax.setVar("ping_status", 'open');
-	if(form.excerpt)
-		autosaveAjax.setVar("excerpt", form.excerpt.value);
-
-	if ( typeof tinyMCE == "undefined" || tinyMCE.configs.length < 1 || rich == false ) {
-		autosaveAjax.setVar("content", form.content.value);
-	} else {
-		tinyMCE.wpTriggerSave();
-		autosaveAjax.setVar("content", form.content.value);
-	}
-
-	autosaveAjax.requestFile = "<?php echo get_option('siteurl'); ?>/wp-admin/admin-ajax.php";
-	autosaveAjax.method = "POST";
-	autosaveAjax.element = null;
-	autosaveAjax.onLoading = autosave_loading;
-	autosaveAjax.onInteractive = autosave_loading;
-	if(parseInt($("post_ID").value) < 1)
-		autosaveAjax.onCompletion = autosave_update_post_ID;
-	else
-		autosaveAjax.onCompletion = autosave_saved;
-	autosaveAjax.runAJAX();
-}
Index: wp-includes/js/autosave.js
===================================================================
--- wp-includes/js/autosave.js	(revision 4968)
+++ wp-includes/js/autosave.js	(working copy)
@@ -1,6 +1,3 @@
-<?php @require_once('../../wp-config.php');
-cache_javascript_headers();
-?>
 var autosaveLast = '';
 var autosavePeriodical;
 
@@ -8,7 +5,7 @@
 	var form = $('post');
 	autosaveLast = form.post_title.value+form.content.value;
 	// Keep autosave_interval in sync with edit_post().
-	autosavePeriodical = new PeriodicalExecuter(autosave, <?php echo apply_filters('autosave_interval', '120'); ?>);
+	autosavePeriodical = new PeriodicalExecuter(autosave, autosaveL10n.autosaveInterval);
 	//Disable autosave after the form has been submitted
 	if(form.addEventListener) {
 		form.addEventListener("submit", function () { autosavePeriodical.currentlyExecuting = true; }, false);
@@ -40,9 +37,9 @@
 	var message;
 
 	if(isNaN(res)) {
-		message = "<?php echo js_escape(__('Error: ')); ?>" + response;
+		message = autosaveL10n.errorText.replace(/%response%/g, response);
 	} else {
-		message = "<?php echo js_escape(__('Saved at ')); ?>" + autosave_cur_time();
+		message = autosaveL10n.saveText.replace(/%time%/g, autosave_cur_time());
 		$('post_ID').name = "post_ID";
 		$('post_ID').value = res;
 		// We need new nonces
@@ -52,7 +49,7 @@
 		nonceAjax.setVar("post_ID", res);
 		nonceAjax.setVar("cookie", document.cookie);
 		nonceAjax.setVar("post_type", $('post_type').value);
-		nonceAjax.requestFile = "<?php echo get_option('siteurl'); ?>/wp-admin/admin-ajax.php";
+		nonceAjax.requestFile = autosaveL10n.requestFile;
 		nonceAjax.onCompletion = autosave_update_nonce;
 		nonceAjax.method = "POST";
 		nonceAjax.runAJAX();
@@ -63,7 +60,7 @@
 }
 
 function autosave_loading() {
-	$('autosave').innerHTML = "<?php echo js_escape(__('Saving Draft...')); ?>";
+	$('autosave').innerHTML = autosaveL10n.savingText;
 }
 
 function autosave_saved() {
@@ -72,9 +69,9 @@
 	var message;
 
 	if(isNaN(res)) {
-		message = "<?php echo js_escape(__('Error: ')); ?>" + response;
+		message = autosaveL10n.errorText.replace(/%response%/g, response);
 	} else {
-		message = "<?php echo js_escape(__('Saved at ')); ?>" + autosave_cur_time() + ".";
+		message = autosaveL10n.saveText.replace(/%time%/g, autosave_cur_time());
 	}
 	$('autosave').innerHTML = message;
 	autosave_enable_buttons();
@@ -148,7 +145,7 @@
 		autosaveAjax.setVar("content", form.content.value);
 	}
 
-	autosaveAjax.requestFile = "<?php echo get_option('siteurl'); ?>/wp-admin/admin-ajax.php";
+	autosaveAjax.requestFile = autosaveL10n.requestFile;
 	autosaveAjax.method = "POST";
 	autosaveAjax.element = null;
 	autosaveAjax.onLoading = autosave_loading;
Index: wp-includes/js/wp-ajax-js.php
===================================================================
--- wp-includes/js/wp-ajax-js.php	(revision 4968)
+++ wp-includes/js/wp-ajax-js.php	(working copy)
@@ -1,94 +0,0 @@
-<?php @require_once('../../wp-config.php'); cache_javascript_headers(); ?>
-var WPAjax = Class.create();
-Object.extend(WPAjax.prototype, Ajax.Request.prototype);
-Object.extend(WPAjax.prototype, {
-	WPComplete: false, // onComplete function
-	WPError: false, // onWPError function
-	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 : '<?php bloginfo( 'wpurl' ); ?>/wp-admin/admin-ajax.php';
-		this.getResponseElement(responseEl);
-	},
-	addArg: function(key, value) {
-		var a = [];
-		a[encodeURIComponent(key)] = encodeURIComponent(value);
-		this.options.parameters = $H(this.options.parameters).merge($H(a));
-	},
-	getResponseElement: function(r) {
-		var p = $(r + '-p');
-		if ( !p ) {
-			new Insertion.Bottom(r, "<span id='" + r + "-p'></span>");
-			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 + '<p>' + b.firstChild.nodeValue + '</p>'; } );
-				Element.update(this.myResponseElement,'<div class="error">' + msg + '</div>');
-				return false;
-			}
-			return true;
-		}
-		var r = this.transport.responseText;
-		if ( isNaN(r) ) {
-			Element.update(this.myResponseElement,'<div class="error"><p>' + r + '</p></div>');
-			return false;
-		}
-		var r = parseInt(r,10);
-		if ( -1 == r ) {
-			Element.update(this.myResponseElement,"<div class='error'><p><?php _e("You don't have permission to do that."); ?></p></div>");
-			return false;
-		} else if ( 0 == r ) {
-			Element.update(this.myResponseElement,"<div class='error'><p><?php _e("Something strange happened.  Try refreshing the page."); ?></p></div>");
-			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;
-	}
-});
-
-Ajax.activeSendCount = 0;
-Ajax.Responders.register( {
-	onCreate: function() {
-		Ajax.activeSendCount++;
-		if ( 1 != Ajax.activeSendCount )
-			return;
-		wpBeforeUnload = window.onbeforeunload;
-		window.onbeforeunload = function() {
-			return "<?php js_escape(__("Slow down, I'm still sending your data!")); ?>";
-		}
-	},
-	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; }
Index: wp-includes/script-loader.php
===================================================================
--- wp-includes/script-loader.php	(revision 4968)
+++ wp-includes/script-loader.php	(working copy)
@@ -19,12 +19,25 @@
 		$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'), '20070225' );
 		$this->add( 'prototype', '/wp-includes/js/prototype.js', false, '1.5.0-0');
-		$this->add( 'autosave', '/wp-includes/js/autosave-js.php', array('prototype', 'sack'), '20070116');
-		$this->add( 'wp-ajax', '/wp-includes/js/wp-ajax-js.php', array('prototype'), '20070118');
-		$this->add( 'listman', '/wp-includes/js/list-manipulation.js', array('wp-ajax', 'fat'), '20070305');
+		$this->add( 'autosave', '/wp-includes/js/autosave.js', array('prototype', 'sack'), '20070306');
+		$this->localize( 'autosave', 'autosaveL10n', array(
+			'autosaveInterval' => apply_filters('autosave_interval', '120'),
+			'errorText' => __('Error: %response%'),
+			'saveText' => __('Saved at %time%.'),
+			'requestFile' => get_option( 'siteurl' ) . '/wp-admin/admin-ajax.php',
+			'savingText' => __('Saving Draft...')
+		) );
+		$this->add( 'wp-ajax', '/wp-includes/js/wp-ajax.js', array('prototype'), '20070306');
+		$this->localize( 'wp-ajax', 'WPAjaxL10n', array(
+			'defaultUrl' => get_option( 'siteurl' ) . '/wp-admin/admin-ajax.php',
+			'permText' => __("You don't have permission to do that."),
+			'strangeText' => __("Something strange happened.  Try refreshing the page."),
+			'whoaText' => __("Slow down, I'm still sending your data!")
+		) );
+		$this->add( 'listman', '/wp-includes/js/list-manipulation.js', array('wp-ajax', 'fat'), '20070306');
 		$this->localize( 'listman', 'listManL10n', array(
 			'jumpText' => __('Jump to new item'),
-			'delText' => __('Are you sure you want to delete this %s?')
+			'delText' => __('Are you sure you want to delete this %thing%?')
 		) );
 		$this->add( 'scriptaculous-root', '/wp-includes/js/scriptaculous/wp-scriptaculous.js', array('prototype'), '1.7.0');
 		$this->add( 'scriptaculous-builder', '/wp-includes/js/scriptaculous/builder.js', array('scriptaculous-root'), '1.7.0');
@@ -37,14 +50,66 @@
 		$this->add( 'jquery', '/wp-includes/js/jquery/jquery.js', false, '1.1.1');
 		$this->add( 'interface', '/wp-includes/js/jquery/interface.js', array('jquery'), '1.1.1');
 		if ( is_admin() ) {
-			$this->add( 'dbx-admin-key', '/wp-admin/dbx-admin-key-js.php', array('dbx'), '3651' );
-			$this->add( 'ajaxcat', '/wp-admin/cat-js.php', array('listman'), '20070118' );
+			global $pagenow;
+			$man = false;
+			switch ( $pagenow ) :
+			case 'post.php' :
+			case 'post-new.php' :
+				$man = 'postmeta';
+				break;
+			case 'page.php' :
+			case 'page-new.php' :
+				$man = 'pagemeta';
+				break;
+			case 'link.php' :
+				$man = 'linkmeta';
+				break;
+			endswitch;
+			if ( $man ) {
+				$this->add( 'dbx-admin-key', '/wp-admin/dbx-admin-key.js', array('dbx'), '3651' );
+				$this->localize( 'dbx-admin-key', 'dbxL10n', array(
+					'manager' => $man,
+					'open' => __('open'),
+					'close' => __('close'),
+					'moveMouse' => __('click-down and drag to move this box'),
+					'toggleMouse' => __('click to %toggle% this box'),
+					'moveKey' => __('use the arrow keys to move this box'),
+					'toggleKey' => __(', or press the enter key to %toggle% it'),
+				) );
+			}
+			$this->add( 'ajaxcat', '/wp-admin/cat.js', array('listman'), '20070118' );
+			$this->localize( 'ajaxcat', 'catL10n', array(
+				'add' => attribute_escape(__('Add')),
+				'how' => __('Separate multiple categories with commas.')
+			) );
 			$this->add( 'admin-categories', '/wp-admin/categories.js', array('listman'), '3684' );
 			$this->add( 'admin-custom-fields', '/wp-admin/custom-fields.js', array('listman'), '3733' );
 			$this->add( 'admin-comments', '/wp-admin/edit-comments.js', array('listman'), '3847' );
 			$this->add( 'admin-users', '/wp-admin/users.js', array('listman'), '4583' );
 			$this->add( 'xfn', '/wp-admin/xfn.js', false, '3517' );
-			$this->add( 'upload', '/wp-admin/upload-js.php', array('prototype'), '20070118' );
+			$this->add( 'upload', '/wp-admin/upload.js', array('prototype'), '20070118' );
+			$this->localize( 'upload', 'uploadL10n', array(
+				'browseTitle' => attribute_escape(__('Browse your files')),
+				'back' => __('&laquo; Back'),
+				'directTitle' => attribute_escape(__('Direct link to file')),
+				'edit' => __('Edit'),
+				'thumb' => __('Thumbnail'),
+				'full' => __('Full size'),
+				'icon' => __('Icon'),
+				'title' => __('Title'),
+				'show' => __('Show:'),
+				'link' => __('Link to:'),
+				'file' => __('File'),
+				'page' => __('Page'),
+				'none' => __('None'),
+				'editorText' => attribute_escape(__('Send to editor &raquo;')),
+				'insert' => __('Insert'),
+				'urlText' => __('URL'),
+				'desc' => __('Description'),
+				'deleteText' => attribute_escape(__('Delete File')),
+				'saveText' => attribute_escape(__('Save &raquo;')),
+				'confirmText' => __("Are you sure you want to delete the file '%title%'?\nClick ok to delete or cancel to go back.")
+			) );
 		}
 	}
 
Index: wp-admin/upload-js.php
===================================================================
--- wp-admin/upload-js.php	(revision 4968)
+++ wp-admin/upload-js.php	(working copy)
@@ -1,271 +0,0 @@
-<?php require_once('admin.php'); cache_javascript_headers(); ?>
-addLoadEvent( function() {
-	theFileList = {
-		currentImage: {ID: 0},
-		nonce: '',
-		tab: '',
-		postID: 0,
-
-		initializeVars: function() {
-			this.urlData  = document.location.href.split('?');
-			this.params = this.urlData[1].toQueryParams();
-			this.postID = this.params['post_id'];
-			this.tab = this.params['tab'];
-			this.style = this.params['style'];
-			this.ID = this.params['ID'];
-			if ( !this.style )
-				this.style = 'default';
-			var nonceEl = $('nonce-value');
-			if ( nonceEl )
-				this.nonce = nonceEl.value;
-			if ( this.ID ) {
-				this.grabImageData( this.ID );
-				this.imageView( this.ID );
-			}
-		},
-
-		initializeLinks: function() {
-			if ( this.ID )
-				return;
-			$$('a.file-link').each( function(i) {
-				var id = i.id.split('-').pop();
-				i.onclick = function(e) { theFileList[ 'inline' == theFileList.style ? 'imageView' : 'editView' ](id, e); }
-			} );
-		},
-
-		grabImageData: function(id) {
-			if ( id == this.currentImage.ID )
-				return;
-			var thumbEl = $('attachment-thumb-url-' + id);
-			if ( thumbEl ) {
-				this.currentImage.thumb = ( 0 == id ? '' : thumbEl.value );
-				this.currentImage.thumbBase = ( 0 == id ? '' : $('attachment-thumb-url-base-' + id).value );
-			} else {
-				this.currentImage.thumb = false;
-			}
-			this.currentImage.src = ( 0 == id ? '' : $('attachment-url-' + id).value );
-			this.currentImage.srcBase = ( 0 == id ? '' : $('attachment-url-base-' + id).value );
-			this.currentImage.page = ( 0 == id ? '' : $('attachment-page-url-' + id).value );
-			this.currentImage.title = ( 0 == id ? '' : $('attachment-title-' + id).value );
-			this.currentImage.description = ( 0 == id ? '' : $('attachment-description-' + id).value );
-			var widthEl = $('attachment-width-' + id);
-			if ( widthEl ) {
-				this.currentImage.width = ( 0 == id ? '' : widthEl.value );
-				this.currentImage.height = ( 0 == id ? '' : $('attachment-height-' + id).value );
-			} else {
-				this.currentImage.width = false;
-				this.currentImage.height = false;
-			}
-			this.currentImage.isImage = ( 0 == id ? 0 : $('attachment-is-image-' + id).value );
-			this.currentImage.ID = id;
-		},
-
-		imageView: function(id, e) {
-			this.prepView(id);
-			var h = '';
-
-			h += "<div id='upload-file'>"
-			if ( this.ID ) {
-				var params = $H(this.params);
-				params.ID = '';
-				params.action = '';
-				h += "<a href='" + this.urlData[0] + '?' + params.toQueryString() + "' title='<?php echo attribute_escape(__('Browse your files')); ?>' class='back'><?php echo attribute_escape(__('&laquo; Back')); ?></a>";
-			} else {
-				h += "<a href='#' onclick='return theFileList.cancelView();'  title='<?php echo attribute_escape(__('Browse your files')); ?>' class='back'><?php echo attribute_escape(__('&laquo; Back')) ?></a>";
-			}
-			h += "<div id='file-title'>"
-			if ( 0 == this.currentImage.isImage )
-				h += "<h2><a href='" + this.currentImage.srcBase + this.currentImage.src + "' onclick='return false;' title='<?php echo attribute_escape(__('Direct link to file')); ?>'>" + this.currentImage.title + "</a></h2>";
-			else
-				h += "<h2>" + this.currentImage.title + "</h2>";
-			h += " &#8212; <span>";
-			h += "<a href='#' onclick='return theFileList.editView(" + id + ");'><?php echo attribute_escape(__('Edit')); ?></a>"
-			h += "</span>";
-			h += '</div>'
-			h += "<div id='upload-file-view' class='alignleft'>";
-			if ( 1 == this.currentImage.isImage ) {
-				h += "<a href='" + this.currentImage.srcBase + this.currentImage.src + "' onclick='return false;' title='<?php echo attribute_escape(__('Direct link to file')); ?>'>";
-				h += "<img src='" + ( this.currentImage.thumb ? this.currentImage.thumb : this.currentImage.src ) + "' alt='" + this.currentImage.title + "' width='" + this.currentImage.width + "' height='" + this.currentImage.height + "' />";
-				h += "</a>";
-			} else
-				h += '&nbsp;';
-			h += "</div>";
-
-			h += "<form name='uploadoptions' id='uploadoptions' class='alignleft'>";
-			h += "<table>";
-			var display = [];
-			var checked = 'display-title';
-			if ( 1 == this.currentImage.isImage ) {
-				checked = 'display-full';
-				if ( this.currentImage.thumb ) {
-					display.push("<label for='display-thumb'><input type='radio' name='display' id='display-thumb' value='thumb' /> <?php echo attribute_escape(__('Thumbnail')); ?></label><br />");
-					checked = 'display-thumb';
-				}
-				display.push("<label for='display-full'><input type='radio' name='display' id='display-full' value='full' /> <?php echo attribute_escape(__('Full size')); ?></label>");
-			} else if ( this.currentImage.thumb ) {
-				display.push("<label for='display-thumb'><input type='radio' name='display' id='display-thumb' value='thumb' /> <?php echo attribute_escape(__('Icon')); ?></label>");
-			}
-			if ( display.length ) {
-				display.push("<br /><label for='display-title'><input type='radio' name='display' id='display-title' value='title' /> <?php echo attribute_escape(__('Title')); ?></label>");
-				h += "<tr><th style='padding-bottom:.5em'><?php echo attribute_escape(__('Show:')); ?></th><td style='padding-bottom:.5em'>";
-				$A(display).each( function(i) { h += i; } );
-				h += "</td></tr>";
-			}
-
-			h += "<tr><th><?php echo attribute_escape(__('Link to:')); ?></th><td>";
-			h += "<label for='link-file'><input type='radio' name='link' id='link-file' value='file' checked='checked'/> <?php echo attribute_escape(__('File')); ?></label><br />";
-			h += "<label for='link-page'><input type='radio' name='link' id='link-page' value='page' /> <?php echo attribute_escape(__('Page')); ?></label><br />";
-			h += "<label for='link-none'><input type='radio' name='link' id='link-none' value='none' /> <?php echo attribute_escape(__('None')); ?></label>";
-			h += "</td></tr>";
-
-			h += "<tr><td colspan='2'><p class='submit'>";
-			h += "<input type='button' class='button' name='send' onclick='theFileList.sendToEditor(" + id + ")' value='<?php echo attribute_escape(__('Send to editor &raquo;')); ?>' />";
-			h += "</p></td></tr></table>";
-			h += "</form>";
-
-			h += "</div>";
-
-			new Insertion.Top('upload-content', h);
-			var displayEl = $(checked);
-			if ( displayEl )
-				displayEl.checked = true;
-
-			if (e) Event.stop(e);
-			return false;
-		},
-
-		editView: function(id, e) {
-			this.prepView(id);
-			var h = '';
-
-			var action = 'upload.php?style=' + this.style + '&amp;tab=upload';
-			if ( this.postID )
-				action += '&amp;post_id=' + this.postID;
-
-			h += "<form id='upload-file' method='post' action='" + action + "'>";
-			if ( this.ID ) {
-				var params = $H(this.params);
-				params.ID = '';
-				params.action = '';
-				h += "<a href='" + this.urlData[0] + '?' + params.toQueryString() + "'  title='<?php echo attribute_escape(__('Browse your files')); ?>' class='back'><?php echo attribute_escape(__('&laquo; Back')); ?></a>";
-			} else {
-				h += "<a href='#' onclick='return theFileList.cancelView();'  title='<?php echo attribute_escape(__('Browse your files')); ?>' class='back'><?php echo attribute_escape(__('&laquo; Back')); ?></a>";
-			}
-			h += "<div id='file-title'>"
-			if ( 0 == this.currentImage.isImage )
-				h += "<h2><a href='" + this.currentImage.srcBase + this.currentImage.src + "' onclick='return false;' title='<?php echo attribute_escape(__('Direct link to file')); ?>'>" + this.currentImage.title + "</a></h2>";
-			else
-				h += "<h2>" + this.currentImage.title + "</h2>";
-			h += " &#8212; <span>";
-			h += "<a href='#' onclick='return theFileList.imageView(" + id + ");'><?php echo attribute_escape(__('Insert')); ?></a>"
-			h += "</span>";
-			h += '</div>'
-			h += "<div id='upload-file-view' class='alignleft'>";
-			if ( 1 == this.currentImage.isImage ) {
-				h += "<a href='" + this.currentImage.srcBase + this.currentImage.src + "' onclick='return false;' title='<?php echo wp_specialchars(__('Direct link to file')); ?>'>";
-				h += "<img src='" + ( this.currentImage.thumb ? this.currentImage.thumb : this.currentImage.src ) + "' alt='" + this.currentImage.title + "' width='" + this.currentImage.width + "' height='" + this.currentImage.height + "' />";
-				h += "</a>";
-			} else
-				h += '&nbsp;';
-			h += "</div>";
-
-
-			h += "<table><col /><col class='widefat' /><tr>"
-			h += "<th scope='row'><label for='url'><?php echo attribute_escape(__('URL')); ?></label></th>";
-			h += "<td><input type='text' id='url' class='readonly' value='" + this.currentImage.srcBase + this.currentImage.src + "' readonly='readonly' /></td>";
-			h += "</tr><tr>";
-			h += "<th scope='row'><label for='post_title'><?php echo attribute_escape(__('Title')); ?></label></th>";
-			h += "<td><input type='text' id='post_title' name='post_title' value='" + this.currentImage.title + "' /></td>";
-			h += "</tr><tr>";
-			h += "<th scope='row'><label for='post_content'><?php echo attribute_escape(__('Description')); ?></label></th>";
-			h += "<td><textarea name='post_content' id='post_content'>" + this.currentImage.description + "</textarea></td>";
-			h += "</tr><tr id='buttons' class='submit'><td colspan='2'><input type='button' id='delete' name='delete' class='delete alignleft' value='<?php echo attribute_escape(__('Delete File')); ?>' onclick='theFileList.deleteFile(" + id + ");' />";
-			h += "<input type='hidden' name='from_tab' value='" + this.tab + "' />";
-			h += "<input type='hidden' name='action' id='action-value' value='save' />";
-			h += "<input type='hidden' name='ID' value='" + id + "' />";
-			h += "<input type='hidden' name='_wpnonce' value='" + this.nonce + "' />";
-			h += "<div class='submit'><input type='submit' value='<?php echo attribute_escape(__('Save &raquo;')); ?>' /></div>";
-			h += "</td></tr></table></form>";
-
-			new Insertion.Top('upload-content', h);
-			if (e) Event.stop(e);
-			return false;
-		},
-
-		prepView: function(id) {
-			this.cancelView( true );
-			var filesEl = $('upload-files');
-			if ( filesEl )
-				filesEl.hide();
-			var navEl = $('current-tab-nav');
-			if ( navEl )
-				navEl.hide();
-			this.grabImageData(id);
-		},
-
-		cancelView: function( prep ) {
-			if ( !prep ) {
-				var filesEl = $('upload-files');
-				if ( filesEl )
-					Element.show(filesEl);
-				var navEl = $('current-tab-nav');
-				if ( navEl )
-					Element.show(navEl);
-			}
-			if ( !this.ID )
-				this.grabImageData(0);
-			var div = $('upload-file');
-			if ( div )
-				Element.remove(div);
-			return false;
-		},
-
-		sendToEditor: function(id) {
-			this.grabImageData(id);
-			var link = '';
-			var display = '';
-			var h = '';
-
-			link = $A(document.forms.uploadoptions.elements.link).detect( function(i) { return i.checked; } ).value;
-			displayEl = $A(document.forms.uploadoptions.elements.display).detect( function(i) { return i.checked; } )
-			if ( displayEl )
-				display = displayEl.value;
-			else if ( 1 == this.currentImage.isImage )
-				display = 'full';
-
-			if ( 'none' != link )
-				h += "<a href='" + ( 'file' == link ? ( this.currentImage.srcBase + this.currentImage.src ) : ( this.currentImage.page + "' rel='attachment wp-att-" + this.currentImage.ID ) ) + "' title='" + this.currentImage.title + "'>";
-			if ( display && 'title' != display )
-				h += "<img src='" + ( 'thumb' == display ? ( this.currentImage.thumbBase + this.currentImage.thumb ) : ( this.currentImage.srcBase + this.currentImage.src ) ) + "' alt='" + this.currentImage.title + "' />";
-			else
-				h += this.currentImage.title;
-			if ( 'none' != link )
-				h += "</a>";
-
-			var win = window.opener ? window.opener : window.dialogArguments;
-			if ( !win )
-				win = top;
-			tinyMCE = win.tinyMCE;
-			if ( typeof tinyMCE != 'undefined' && tinyMCE.getInstanceById('content') ) {
-				tinyMCE.selectedInstance.getWin().focus();
-				tinyMCE.execCommand('mceInsertContent', false, h);
-			} else
-				win.edInsertContent(win.edCanvas, h);
-			if ( !this.ID )
-				this.cancelView();
-			return false;
-		},
-
-		deleteFile: function(id) {
-			if ( confirm("<?php printf(js_escape(__("Are you sure you want to delete the file '%s'?\nClick ok to delete or cancel to go back.")), '" + this.currentImage.title + "'); ?>") ) {
-				$('action-value').value = 'delete';
-				$('upload-file').submit();
-				return true;
-			}
-			return false;
-		}
-
-	};
-	theFileList.initializeVars();
-	theFileList.initializeLinks();
-} );
Index: wp-admin/upload.js
===================================================================
--- wp-admin/upload.js	(revision 4968)
+++ wp-admin/upload.js	(working copy)
@@ -1,4 +1,3 @@
-<?php require_once('admin.php'); cache_javascript_headers(); ?>
 addLoadEvent( function() {
 	theFileList = {
 		currentImage: {ID: 0},
@@ -69,22 +68,23 @@
 				var params = $H(this.params);
 				params.ID = '';
 				params.action = '';
-				h += "<a href='" + this.urlData[0] + '?' + params.toQueryString() + "' title='<?php echo attribute_escape(__('Browse your files')); ?>' class='back'><?php echo attribute_escape(__('&laquo; Back')); ?></a>";
+				h += "<a href='" + this.urlData[0] + '?' + params.toQueryString() + "'";
 			} else {
-				h += "<a href='#' onclick='return theFileList.cancelView();'  title='<?php echo attribute_escape(__('Browse your files')); ?>' class='back'><?php echo attribute_escape(__('&laquo; Back')) ?></a>";
+				h += "<a href='#' onclick='return theFileList.cancelView();'";
 			}
+			h += " title='" + this.browseTitle + "' class='back'>" + this.back + "</a>";
 			h += "<div id='file-title'>"
 			if ( 0 == this.currentImage.isImage )
-				h += "<h2><a href='" + this.currentImage.srcBase + this.currentImage.src + "' onclick='return false;' title='<?php echo attribute_escape(__('Direct link to file')); ?>'>" + this.currentImage.title + "</a></h2>";
+				h += "<h2><a href='" + this.currentImage.srcBase + this.currentImage.src + "' onclick='return false;' title='" + this.directTitle + "'>" + this.currentImage.title + "</a></h2>";
 			else
 				h += "<h2>" + this.currentImage.title + "</h2>";
 			h += " &#8212; <span>";
-			h += "<a href='#' onclick='return theFileList.editView(" + id + ");'><?php echo attribute_escape(__('Edit')); ?></a>"
+			h += "<a href='#' onclick='return theFileList.editView(" + id + ");'>" + this.edit + "</a>"
 			h += "</span>";
 			h += '</div>'
 			h += "<div id='upload-file-view' class='alignleft'>";
 			if ( 1 == this.currentImage.isImage ) {
-				h += "<a href='" + this.currentImage.srcBase + this.currentImage.src + "' onclick='return false;' title='<?php echo attribute_escape(__('Direct link to file')); ?>'>";
+				h += "<a href='" + this.currentImage.srcBase + this.currentImage.src + "' onclick='return false;' title='" + this.directTitle + "'>";
 				h += "<img src='" + ( this.currentImage.thumb ? this.currentImage.thumb : this.currentImage.src ) + "' alt='" + this.currentImage.title + "' width='" + this.currentImage.width + "' height='" + this.currentImage.height + "' />";
 				h += "</a>";
 			} else
@@ -98,28 +98,28 @@
 			if ( 1 == this.currentImage.isImage ) {
 				checked = 'display-full';
 				if ( this.currentImage.thumb ) {
-					display.push("<label for='display-thumb'><input type='radio' name='display' id='display-thumb' value='thumb' /> <?php echo attribute_escape(__('Thumbnail')); ?></label><br />");
+					display.push("<label for='display-thumb'><input type='radio' name='display' id='display-thumb' value='thumb' /> " + this.thumb + "</label><br />");
 					checked = 'display-thumb';
 				}
-				display.push("<label for='display-full'><input type='radio' name='display' id='display-full' value='full' /> <?php echo attribute_escape(__('Full size')); ?></label>");
+				display.push("<label for='display-full'><input type='radio' name='display' id='display-full' value='full' /> " + this.full + "</label>");
 			} else if ( this.currentImage.thumb ) {
-				display.push("<label for='display-thumb'><input type='radio' name='display' id='display-thumb' value='thumb' /> <?php echo attribute_escape(__('Icon')); ?></label>");
+				display.push("<label for='display-thumb'><input type='radio' name='display' id='display-thumb' value='thumb' /> " + this.icon + "</label>");
 			}
 			if ( display.length ) {
-				display.push("<br /><label for='display-title'><input type='radio' name='display' id='display-title' value='title' /> <?php echo attribute_escape(__('Title')); ?></label>");
-				h += "<tr><th style='padding-bottom:.5em'><?php echo attribute_escape(__('Show:')); ?></th><td style='padding-bottom:.5em'>";
+				display.push("<br /><label for='display-title'><input type='radio' name='display' id='display-title' value='title' /> " + this.title + "</label>");
+				h += "<tr><th style='padding-bottom:.5em'>" + this.show + "</th><td style='padding-bottom:.5em'>";
 				$A(display).each( function(i) { h += i; } );
 				h += "</td></tr>";
 			}
 
-			h += "<tr><th><?php echo attribute_escape(__('Link to:')); ?></th><td>";
-			h += "<label for='link-file'><input type='radio' name='link' id='link-file' value='file' checked='checked'/> <?php echo attribute_escape(__('File')); ?></label><br />";
-			h += "<label for='link-page'><input type='radio' name='link' id='link-page' value='page' /> <?php echo attribute_escape(__('Page')); ?></label><br />";
-			h += "<label for='link-none'><input type='radio' name='link' id='link-none' value='none' /> <?php echo attribute_escape(__('None')); ?></label>";
+			h += "<tr><th>" + this.link + "</th><td>";
+			h += "<label for='link-file'><input type='radio' name='link' id='link-file' value='file' checked='checked'/> " + this.file + "</label><br />";
+			h += "<label for='link-page'><input type='radio' name='link' id='link-page' value='page' /> " + this.page + "</label><br />";
+			h += "<label for='link-none'><input type='radio' name='link' id='link-none' value='none' /> " + this.none + "</label>";
 			h += "</td></tr>";
 
 			h += "<tr><td colspan='2'><p class='submit'>";
-			h += "<input type='button' class='button' name='send' onclick='theFileList.sendToEditor(" + id + ")' value='<?php echo attribute_escape(__('Send to editor &raquo;')); ?>' />";
+			h += "<input type='button' class='button' name='send' onclick='theFileList.sendToEditor(" + id + ")' value='" + this.editorText + "' />";
 			h += "</p></td></tr></table>";
 			h += "</form>";
 
@@ -147,22 +147,23 @@
 				var params = $H(this.params);
 				params.ID = '';
 				params.action = '';
-				h += "<a href='" + this.urlData[0] + '?' + params.toQueryString() + "'  title='<?php echo attribute_escape(__('Browse your files')); ?>' class='back'><?php echo attribute_escape(__('&laquo; Back')); ?></a>";
+				h += "<a href='" + this.urlData[0] + '?' + params.toQueryString() + "'";
 			} else {
-				h += "<a href='#' onclick='return theFileList.cancelView();'  title='<?php echo attribute_escape(__('Browse your files')); ?>' class='back'><?php echo attribute_escape(__('&laquo; Back')); ?></a>";
+				h += "<a href='#' onclick='return theFileList.cancelView();'";
 			}
+			h += " title='" + this.browseTitle + "' class='back'>" + this.back + "</a>";
 			h += "<div id='file-title'>"
 			if ( 0 == this.currentImage.isImage )
-				h += "<h2><a href='" + this.currentImage.srcBase + this.currentImage.src + "' onclick='return false;' title='<?php echo attribute_escape(__('Direct link to file')); ?>'>" + this.currentImage.title + "</a></h2>";
+				h += "<h2><a href='" + this.currentImage.srcBase + this.currentImage.src + "' onclick='return false;' title='" + this.directTitle + "'>" + this.currentImage.title + "</a></h2>";
 			else
 				h += "<h2>" + this.currentImage.title + "</h2>";
 			h += " &#8212; <span>";
-			h += "<a href='#' onclick='return theFileList.imageView(" + id + ");'><?php echo attribute_escape(__('Insert')); ?></a>"
+			h += "<a href='#' onclick='return theFileList.imageView(" + id + ");'>" + this.insert + "</a>";
 			h += "</span>";
 			h += '</div>'
 			h += "<div id='upload-file-view' class='alignleft'>";
 			if ( 1 == this.currentImage.isImage ) {
-				h += "<a href='" + this.currentImage.srcBase + this.currentImage.src + "' onclick='return false;' title='<?php echo wp_specialchars(__('Direct link to file')); ?>'>";
+				h += "<a href='" + this.currentImage.srcBase + this.currentImage.src + "' onclick='return false;' title='" + this.directTitle + "'>";
 				h += "<img src='" + ( this.currentImage.thumb ? this.currentImage.thumb : this.currentImage.src ) + "' alt='" + this.currentImage.title + "' width='" + this.currentImage.width + "' height='" + this.currentImage.height + "' />";
 				h += "</a>";
 			} else
@@ -170,21 +171,21 @@
 			h += "</div>";
 
 
-			h += "<table><col /><col class='widefat' /><tr>"
-			h += "<th scope='row'><label for='url'><?php echo attribute_escape(__('URL')); ?></label></th>";
+			h += "<table><col /><col class='widefat' /><tr>";
+			h += "<th scope='row'><label for='url'>" + this.urlText + "</label></th>";
 			h += "<td><input type='text' id='url' class='readonly' value='" + this.currentImage.srcBase + this.currentImage.src + "' readonly='readonly' /></td>";
 			h += "</tr><tr>";
-			h += "<th scope='row'><label for='post_title'><?php echo attribute_escape(__('Title')); ?></label></th>";
+			h += "<th scope='row'><label for='post_title'>" + this.title + "</label></th>";
 			h += "<td><input type='text' id='post_title' name='post_title' value='" + this.currentImage.title + "' /></td>";
 			h += "</tr><tr>";
-			h += "<th scope='row'><label for='post_content'><?php echo attribute_escape(__('Description')); ?></label></th>";
+			h += "<th scope='row'><label for='post_content'>" + this.desc + "</label></th>";
 			h += "<td><textarea name='post_content' id='post_content'>" + this.currentImage.description + "</textarea></td>";
-			h += "</tr><tr id='buttons' class='submit'><td colspan='2'><input type='button' id='delete' name='delete' class='delete alignleft' value='<?php echo attribute_escape(__('Delete File')); ?>' onclick='theFileList.deleteFile(" + id + ");' />";
+			h += "</tr><tr id='buttons' class='submit'><td colspan='2'><input type='button' id='delete' name='delete' class='delete alignleft' value='" + this.deleteText + "' onclick='theFileList.deleteFile(" + id + ");' />";
 			h += "<input type='hidden' name='from_tab' value='" + this.tab + "' />";
 			h += "<input type='hidden' name='action' id='action-value' value='save' />";
 			h += "<input type='hidden' name='ID' value='" + id + "' />";
 			h += "<input type='hidden' name='_wpnonce' value='" + this.nonce + "' />";
-			h += "<div class='submit'><input type='submit' value='<?php echo attribute_escape(__('Save &raquo;')); ?>' /></div>";
+			h += "<div class='submit'><input type='submit' value='" + this.saveText + "' /></div>";
 			h += "</td></tr></table></form>";
 
 			new Insertion.Top('upload-content', h);
@@ -257,7 +258,7 @@
 		},
 
 		deleteFile: function(id) {
-			if ( confirm("<?php printf(js_escape(__("Are you sure you want to delete the file '%s'?\nClick ok to delete or cancel to go back.")), '" + this.currentImage.title + "'); ?>") ) {
+			if ( confirm( this.confirmText.replace(/%title%/g, this.currentImage.title) ) ) {
 				$('action-value').value = 'delete';
 				$('upload-file').submit();
 				return true;
@@ -266,6 +267,7 @@
 		}
 
 	};
+	Object.extend( theFileList, uploadL10n );
 	theFileList.initializeVars();
 	theFileList.initializeLinks();
 } );
Index: wp-admin/cat-js.php
===================================================================
--- wp-admin/cat-js.php	(revision 4968)
+++ wp-admin/cat-js.php	(working copy)
@@ -1,14 +0,0 @@
-<?php
-require_once('../wp-config.php');
-cache_javascript_headers();
-?>
-addLoadEvent(function(){catList=new listMan('categorychecklist');catList.ajaxRespEl='jaxcat';catList.topAdder=1;catList.alt=0;catList.showLink=0;});
-addLoadEvent(newCatAddIn);
-function newCatAddIn() {
-	var jaxcat = $('jaxcat');
-	if ( !jaxcat )
-		return false;
-	Element.update(jaxcat,'<span id="ajaxcat"><input type="text" name="newcat" id="newcat" size="16" autocomplete="off"/><input type="button" name="Button" id="catadd" value="<?php echo js_escape(__('Add')); ?>"/><span id="howto"><?php echo js_escape(__('Separate multiple categories with commas.')); ?></span></span>');
-	$('newcat').onkeypress = function(e) { return killSubmit("catList.ajaxAdder('category','jaxcat');", e); };
-	$('catadd').onclick = function() { catList.ajaxAdder('category', 'jaxcat'); };
-}
Index: wp-admin/cat.js
===================================================================
--- wp-admin/cat.js	(revision 4968)
+++ wp-admin/cat.js	(working copy)
@@ -1,14 +1,10 @@
-<?php
-require_once('../wp-config.php');
-cache_javascript_headers();
-?>
 addLoadEvent(function(){catList=new listMan('categorychecklist');catList.ajaxRespEl='jaxcat';catList.topAdder=1;catList.alt=0;catList.showLink=0;});
 addLoadEvent(newCatAddIn);
 function newCatAddIn() {
 	var jaxcat = $('jaxcat');
 	if ( !jaxcat )
 		return false;
-	Element.update(jaxcat,'<span id="ajaxcat"><input type="text" name="newcat" id="newcat" size="16" autocomplete="off"/><input type="button" name="Button" id="catadd" value="<?php echo js_escape(__('Add')); ?>"/><span id="howto"><?php echo js_escape(__('Separate multiple categories with commas.')); ?></span></span>');
+	Element.update(jaxcat,'<span id="ajaxcat"><input type="text" name="newcat" id="newcat" size="16" autocomplete="off"/><input type="button" name="Button" id="catadd" value="' + catL10n.add + '"/><span id="howto">' + catL10n.how + '</span></span>');
 	$('newcat').onkeypress = function(e) { return killSubmit("catList.ajaxAdder('category','jaxcat');", e); };
 	$('catadd').onclick = function() { catList.ajaxAdder('category', 'jaxcat'); };
 }
Index: wp-admin/dbx-admin-key-js.php
===================================================================
--- wp-admin/dbx-admin-key-js.php	(revision 4968)
+++ wp-admin/dbx-admin-key-js.php	(working copy)
@@ -1,68 +0,0 @@
-<?php
-require_once('admin.php');
-cache_javascript_headers();
-
-switch ( $_GET['pagenow'] ) :
-	case 'post.php' :
-	case 'post-new.php' :
-		$man = 'postmeta';
-		break;
-	case 'page.php' :
-	case 'page-new.php' :
-		$man = 'pagemeta';
-		break;
-	case 'link.php' :
-		$man = 'linkmeta';
-		break;
-	default:
-		exit;
-		break;
-endswitch;
-?>
-addLoadEvent( function() {var manager = new dbxManager('<?php echo $man; ?>');} );
-
-addLoadEvent( function()
-{
-	//create new docking boxes group
-	var meta = new dbxGroup(
-		'grabit', 		// container ID [/-_a-zA-Z0-9/]
-		'vertical', 	// orientation ['vertical'|'horizontal']
-		'10', 			// drag threshold ['n' pixels]
-		'no',			// restrict drag movement to container axis ['yes'|'no']
-		'10', 			// animate re-ordering [frames per transition, or '0' for no effect]
-		'yes', 			// include open/close toggle buttons ['yes'|'no']
-		'closed', 		// default state ['open'|'closed']
-		'<?php echo js_escape(__('open')); ?>', 		// word for "open", as in "open this box"
-		'<?php echo js_escape(__('close')); ?>', 		// word for "close", as in "close this box"
-		'<?php echo js_escape(__('click-down and drag to move this box')); ?>', // sentence for "move this box" by mouse
-		'<?php echo js_escape(__('click to %toggle% this box')); ?>', // pattern-match sentence for "(open|close) this box" by mouse
-		'<?php echo js_escape(__('use the arrow keys to move this box')); ?>', // sentence for "move this box" by keyboard
-		'<?php echo js_escape(__(', or press the enter key to %toggle% it')); ?>',  // pattern-match sentence-fragment for "(open|close) this box" by keyboard
-		'%mytitle%  [%dbxtitle%]' // pattern-match syntax for title-attribute conflicts
-		);
-
-	// Boxes are closed by default. Open the Category box if the cookie isn't already set.
-	var catdiv = document.getElementById('categorydiv');
-	if ( catdiv ) {
-		var button = catdiv.getElementsByTagName('A')[0];
-		if ( dbx.cookiestate == null && /dbx\-toggle\-closed/.test(button.className) )
-			meta.toggleBoxState(button, true);
-	}
-
-	var advanced = new dbxGroup(
-		'advancedstuff', 		// container ID [/-_a-zA-Z0-9/]
-		'vertical', 		// orientation ['vertical'|'horizontal']
-		'10', 			// drag threshold ['n' pixels]
-		'yes',			// restrict drag movement to container axis ['yes'|'no']
-		'10', 			// animate re-ordering [frames per transition, or '0' for no effect]
-		'yes', 			// include open/close toggle buttons ['yes'|'no']
-		'closed', 		// default state ['open'|'closed']
-		'<?php echo js_escape(__('open')); ?>', 		// word for "open", as in "open this box"
-		'<?php echo js_escape(__('close')); ?>', 		// word for "close", as in "close this box"
-		'<?php echo js_escape(__('click-down and drag to move this box')); ?>', // sentence for "move this box" by mouse
-		'<?php echo js_escape(__('click to %toggle% this box')); ?>', // pattern-match sentence for "(open|close) this box" by mouse
-		'<?php echo js_escape(__('use the arrow keys to move this box')); ?>', // sentence for "move this box" by keyboard
-		'<?php echo js_escape(__(', or press the enter key to %toggle% it')); ?>',  // pattern-match sentence-fragment for "(open|close) this box" by keyboard
-		'%mytitle%  [%dbxtitle%]' // pattern-match syntax for title-attribute conflicts
-		);
-});
Index: wp-admin/dbx-admin-key.js
===================================================================
--- wp-admin/dbx-admin-key.js	(revision 4968)
+++ wp-admin/dbx-admin-key.js	(working copy)
@@ -1,43 +1,22 @@
-<?php
-require_once('admin.php');
-cache_javascript_headers();
+addLoadEvent( function() {var manager = new dbxManager( dbxL10n.mananger );} );
 
-switch ( $_GET['pagenow'] ) :
-	case 'post.php' :
-	case 'post-new.php' :
-		$man = 'postmeta';
-		break;
-	case 'page.php' :
-	case 'page-new.php' :
-		$man = 'pagemeta';
-		break;
-	case 'link.php' :
-		$man = 'linkmeta';
-		break;
-	default:
-		exit;
-		break;
-endswitch;
-?>
-addLoadEvent( function() {var manager = new dbxManager('<?php echo $man; ?>');} );
-
 addLoadEvent( function()
 {
 	//create new docking boxes group
 	var meta = new dbxGroup(
 		'grabit', 		// container ID [/-_a-zA-Z0-9/]
-		'vertical', 	// orientation ['vertical'|'horizontal']
+		'vertical', 		// orientation ['vertical'|'horizontal']
 		'10', 			// drag threshold ['n' pixels]
 		'no',			// restrict drag movement to container axis ['yes'|'no']
 		'10', 			// animate re-ordering [frames per transition, or '0' for no effect]
 		'yes', 			// include open/close toggle buttons ['yes'|'no']
 		'closed', 		// default state ['open'|'closed']
-		'<?php echo js_escape(__('open')); ?>', 		// word for "open", as in "open this box"
-		'<?php echo js_escape(__('close')); ?>', 		// word for "close", as in "close this box"
-		'<?php echo js_escape(__('click-down and drag to move this box')); ?>', // sentence for "move this box" by mouse
-		'<?php echo js_escape(__('click to %toggle% this box')); ?>', // pattern-match sentence for "(open|close) this box" by mouse
-		'<?php echo js_escape(__('use the arrow keys to move this box')); ?>', // sentence for "move this box" by keyboard
-		'<?php echo js_escape(__(', or press the enter key to %toggle% it')); ?>',  // pattern-match sentence-fragment for "(open|close) this box" by keyboard
+		dbxL10n.open, 		// word for "open", as in "open this box"
+		dbxL10n.close, 		// word for "close", as in "close this box"
+		dbxL10n.moveMouse,	// sentence for "move this box" by mouse
+		dbxL10n.toggleMouse,	// pattern-match sentence for "(open|close) this box" by mouse
+		dbxL10n.moveKey,	// sentence for "move this box" by keyboard
+		dbxL10n.toggleKey,	// pattern-match sentence-fragment for "(open|close) this box" by keyboard
 		'%mytitle%  [%dbxtitle%]' // pattern-match syntax for title-attribute conflicts
 		);
 
@@ -50,19 +29,19 @@
 	}
 
 	var advanced = new dbxGroup(
-		'advancedstuff', 		// container ID [/-_a-zA-Z0-9/]
-		'vertical', 		// orientation ['vertical'|'horizontal']
-		'10', 			// drag threshold ['n' pixels]
+		'advancedstuff',
+		'vertical',
+		'10',
 		'yes',			// restrict drag movement to container axis ['yes'|'no']
-		'10', 			// animate re-ordering [frames per transition, or '0' for no effect]
-		'yes', 			// include open/close toggle buttons ['yes'|'no']
-		'closed', 		// default state ['open'|'closed']
-		'<?php echo js_escape(__('open')); ?>', 		// word for "open", as in "open this box"
-		'<?php echo js_escape(__('close')); ?>', 		// word for "close", as in "close this box"
-		'<?php echo js_escape(__('click-down and drag to move this box')); ?>', // sentence for "move this box" by mouse
-		'<?php echo js_escape(__('click to %toggle% this box')); ?>', // pattern-match sentence for "(open|close) this box" by mouse
-		'<?php echo js_escape(__('use the arrow keys to move this box')); ?>', // sentence for "move this box" by keyboard
-		'<?php echo js_escape(__(', or press the enter key to %toggle% it')); ?>',  // pattern-match sentence-fragment for "(open|close) this box" by keyboard
+		'10',
+		'yes',
+		'closed',
+		dbxL10n.open,
+		dbxL10n.close,
+		dbxL10n.moveMouse,
+		dbxL10n.toggleMouse,
+		dbxL10n.moveKey,
+		dbxL10n.toggleKey,
 		'%mytitle%  [%dbxtitle%]' // pattern-match syntax for title-attribute conflicts
 		);
 });

