Revert accidental commit.

git-svn-id: https://develop.svn.wordpress.org/trunk@4163 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2006-09-02 22:08:10 +00:00
parent 8da0ba34e2
commit f58cd3de78
4 changed files with 39 additions and 19 deletions

View File

@ -5,6 +5,7 @@ require_once('admin-db.php');
define('DOING_AJAX', true);
check_ajax_referer();
if ( !is_user_logged_in() )
die('-1');
@ -16,7 +17,7 @@ function wp_ajax_echo_meta( $pid, $mid, $key, $value ) {
$value = wp_specialchars($value, true);
$key_js = addslashes(wp_specialchars($key, 'double'));
$key = wp_specialchars($key, true);
$r = "<meta><id>$mid</id><postid>$pid</postid><newitem><![CDATA[";
$r = "<meta><id>$mid</id><postid>$pid</postid><newitem><![CDATA[<table><tbody>";
$r .= "<tr id='meta-$mid'><td valign='top'>";
$r .= "<input name='meta[$mid][key]' tabindex='6' onkeypress='return killSubmit(\"theList.ajaxUpdater(&#039;meta&#039;,&#039;meta-$mid&#039;);\",event);' type='text' size='20' value='$key' />";
$r .= "</td><td><textarea name='meta[$mid][value]' tabindex='6' rows='2' cols='30'>$value</textarea></td><td align='center'>";
@ -24,7 +25,7 @@ function wp_ajax_echo_meta( $pid, $mid, $key, $value ) {
$r .= "<input name='deletemeta[$mid]' type='submit' onclick=\"return deleteSomething( 'meta', $mid, '";
$r .= sprintf(__("You are about to delete the &quot;%s&quot; custom field on this post.\\n&quot;OK&quot; to delete, &quot;Cancel&quot; to stop."), $key_js);
$r .= "' );\" class='deletemeta' tabindex='6' value='Delete' />";
$r .= "</td></tr>]]></newitem></meta>";
$r .= "</td></tr></tbody></table>]]></newitem></meta>";
return $r;
}
@ -147,9 +148,9 @@ case 'add-cat' : // From Manage->Categories
$cat_full_name = wp_specialchars( $cat_full_name, 1 );
$r = "<?xml version='1.0' standalone='yes'?><ajaxresponse>";
$r .= "<cat><id>$cat->cat_ID</id><name>$cat_full_name</name><newitem><![CDATA[";
$r .= "<cat><id>$cat->cat_ID</id><name>$cat_full_name</name><newitem><![CDATA[<table><tbody>";
$r .= _cat_row( $cat, $level, $cat_full_name );
$r .= "]]></newitem></cat></ajaxresponse>";
$r .= "</tbody></table>]]></newitem></cat></ajaxresponse>";
header('Content-type: text/xml');
die($r);
break;
@ -206,9 +207,9 @@ case 'add-user' :
} elseif ( !$user_id ) {
die('0');
}
$r = "<?xml version='1.0' standalone='yes'?><ajaxresponse><user><id>$user_id</id><newitem><![CDATA[";
$r = "<?xml version='1.0' standalone='yes'?><ajaxresponse><user><id>$user_id</id><newitem><![CDATA[<table><tbody>";
$r .= user_row( $user_id );
$r .= "]]></newitem></user></ajaxresponse>";
$r .= "</tbody></table>]]></newitem></user></ajaxresponse>";
header('Content-type: text/xml');
die($r);
break;

View File

@ -5,10 +5,31 @@ 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;
jaxcat.update('<span id="ajaxcat"><input type="text" name="newcat" id="newcat" size="16" autocomplete="off"/><input type="button" name="Button" id="catadd" value="Add"/><span id="howto"><?php _e('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'); };
if ( !document.getElementById('jaxcat') ) return false;
var ajaxcat = document.createElement('span');
ajaxcat.id = 'ajaxcat';
newcat = document.createElement('input');
newcat.type = 'text';
newcat.name = 'newcat';
newcat.id = 'newcat';
newcat.size = '16';
newcat.setAttribute('autocomplete', 'off');
newcat.onkeypress = function(e) { return killSubmit("catList.ajaxAdder('category','categorydiv');", e); };
var newcatSub = document.createElement('input');
newcatSub.type = 'button';
newcatSub.name = 'Button';
newcatSub.id = 'catadd';
newcatSub.value = 'Add';
newcatSub.onclick = function() { catList.ajaxAdder('category', 'categorydiv'); };
ajaxcat.appendChild(newcat);
ajaxcat.appendChild(newcatSub);
document.getElementById('jaxcat').appendChild(ajaxcat);
howto = document.createElement('span');
howto.innerHTML = "<?php _e('Separate multiple categories with commas.'); ?>";
howto.id = 'howto';
ajaxcat.appendChild(howto);
}

View File

@ -1,8 +1,8 @@
function customFieldsOnComplete() {
var pidEl = $('post_ID');
var pidEl = document.getElementById('post_ID');
pidEl.name = 'post_ID';
pidEl.value = getNodeValue(theList.ajaxAdd.responseXML, 'postid');
var aEl = $('hiddenaction')
var aEl = document.getElementById('hiddenaction')
if ( aEl.value == 'post' ) aEl.value = 'postajaxpost';
}
addLoadEvent(customFieldsAddIn);
@ -21,6 +21,6 @@ function customFieldsAddIn() {
}
}
$('metakeyinput').onkeypress = function(e) {return killSubmit('theList.inputData+="&id="+$("post_ID").value;theList.ajaxAdder("meta", "newmeta");', e); };
$('updatemetasub').onclick = function(e) {return killSubmit('theList.inputData+="&id="+$("post_ID").value;theList.ajaxAdder("meta", "newmeta");', e); };
document.getElementById('metakeyinput').onkeypress = function(e) {return killSubmit('theList.inputData+="&id="+document.getElementById("post_ID").value;theList.ajaxAdder("meta", "newmeta");', e); };
document.getElementById('updatemetasub').onclick = function(e) {return killSubmit('theList.inputData+="&id="+document.getElementById("post_ID").value;theList.ajaxAdder("meta", "newmeta");', e); };
}

View File

@ -19,11 +19,9 @@ class WP_Scripts {
$this->add( 'wp_tiny_mce', '/wp-includes/js/tinymce/tiny_mce_config.php', array('tiny_mce'), '04162006' );
$this->add( 'prototype', '/wp-includes/js/prototype.js', false, '1.5.0');
$this->add( 'autosave', '/wp-includes/js/autosave.js.php', array('prototype', 'sack'), '4107');
$this->add( 'wp-ajax', '/wp-includes/js/wp-ajax-js.php', array('prototype'), rand());
$this->add( 'listman', '/wp-includes/js/list-manipulation-js.php', array('wp-ajax', 'fat'), rand());
if ( is_admin() ) {
$this->add( 'dbx-admin-key', '/wp-admin/dbx-admin-key-js.php', array('dbx'), '3651' );
$this->add( 'listman-old', '/wp-admin/list-manipulation-js.php', array('sack', 'fat'), '4042' ); // Make changeset # the correct one
$this->add( 'listman', '/wp-admin/list-manipulation-js.php', array('sack', 'fat'), '4042' ); // Make changeset # the correct one
$this->add( 'ajaxcat', '/wp-admin/cat-js.php', array('listman'), '3684' );
$this->add( 'admin-categories', '/wp-admin/categories.js', array('listman'), '3684' );
$this->add( 'admin-custom-fields', '/wp-admin/custom-fields.js', array('listman'), '3733' );