From 33ccb31e882bd5562468c9389210a12f6894b710 Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 4 Apr 2006 00:16:27 +0000 Subject: [PATCH] List manip improvements from mdawaffe. fixes #2633 git-svn-id: http://svn.automattic.com/wordpress/trunk@3684 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/cat-js.php | 2 +- wp-admin/categories.js | 1 - wp-admin/categories.php | 10 +++++----- wp-admin/custom-fields.js | 2 +- wp-admin/edit-link-form.php | 5 +++-- wp-admin/list-manipulation-js.php | 26 ++++++++++++++------------ wp-admin/users.js | 1 - wp-admin/wp-admin.css | 5 ++++- 8 files changed, 28 insertions(+), 24 deletions(-) diff --git a/wp-admin/cat-js.php b/wp-admin/cat-js.php index 8015fbbc6a..08393b7d1b 100644 --- a/wp-admin/cat-js.php +++ b/wp-admin/cat-js.php @@ -2,7 +2,7 @@ require_once('../wp-config.php'); header('Content-type: text/javascript; charset=' . get_settings('blog_charset'), true); ?> -addLoadEvent(function(){catList=new listMan('categorychecklist');catList.ajaxRespEl='jaxcat';catList.clearInputs.push('newcat');catList.topAdder=1;catList.alt=0}); +addLoadEvent(function(){catList=new listMan('categorychecklist');catList.ajaxRespEl='jaxcat';catList.topAdder=1;catList.alt=0;catList.showLink=0;}); addLoadEvent(newCatAddIn); function newCatAddIn() { if ( !document.getElementById('jaxcat') ) return false; diff --git a/wp-admin/categories.js b/wp-admin/categories.js index d339c5c6c3..5be5a6251a 100644 --- a/wp-admin/categories.js +++ b/wp-admin/categories.js @@ -2,5 +2,4 @@ addLoadEvent(newCategoryAddIn); function newCategoryAddIn() { if (!theList.theList) return false; document.forms.addcat.submit.onclick = function(e) {return killSubmit('theList.ajaxAdder("cat", "addcat");', e); }; - theList.clearInputs.push('cat_name','category_parent','category_description'); } diff --git a/wp-admin/categories.php b/wp-admin/categories.php index 7c46005caf..586794e479 100644 --- a/wp-admin/categories.php +++ b/wp-admin/categories.php @@ -147,8 +147,6 @@ cat_rows(); -
- @@ -159,14 +157,16 @@ cat_rows();

- -


+



+ +
+
+


diff --git a/wp-admin/custom-fields.js b/wp-admin/custom-fields.js index 5b9f479c4c..2e70d6ca60 100644 --- a/wp-admin/custom-fields.js +++ b/wp-admin/custom-fields.js @@ -1,5 +1,6 @@ addLoadEvent(customFieldsAddIn); function customFieldsAddIn() { + theList.showLink=0; if (!theList.theList) return false; inputs = theList.theList.getElementsByTagName('input'); for ( var i=0; i < inputs.length; i++ ) { @@ -14,7 +15,6 @@ function customFieldsAddIn() { document.getElementById('metakeyinput').onkeypress = function(e) {return killSubmit('theList.inputData+="&id="+document.getElementById("post_ID").value;theList.ajaxAdder("meta", "newmeta", customFieldsOnComplete);', e); }; document.getElementById('updatemetasub').onclick = function(e) {return killSubmit('theList.inputData+="&id="+document.getElementById("post_ID").value;theList.ajaxAdder("meta", "newmeta", customFieldsOnComplete);', e); }; - theList.clearInputs.push('metakeyselect','metakeyinput','metavalue'); } function customFieldsOnComplete() { var pidEl = document.getElementById('post_ID'); diff --git a/wp-admin/edit-link-form.php b/wp-admin/edit-link-form.php index 57c82f0719..1f1b83a166 100644 --- a/wp-admin/edit-link-form.php +++ b/wp-admin/edit-link-form.php @@ -40,7 +40,8 @@ function xfn_check($class, $value = '', $type = 'check') {

-
+
+
@@ -250,4 +251,4 @@ function xfn_check($class, $value = '', $type = 'check') { - \ No newline at end of file + diff --git a/wp-admin/list-manipulation-js.php b/wp-admin/list-manipulation-js.php index 6aac0a037e..fc060b7326 100644 --- a/wp-admin/list-manipulation-js.php +++ b/wp-admin/list-manipulation-js.php @@ -7,20 +7,20 @@ function deleteSomething(what,id,message){if(!message)message="'+this.response+'';return false;} + if(isNaN(this.response)){this.myResponseElement.innerHTML='

'+this.response+'

';return false;} this.response=parseInt(this.response,10); - if(-1==this.response){this.myResponseElement.innerHTML="";return false;} - else if(0==this.response){this.myResponseElement.innerHTML="";return false;} + if(-1==this.response){this.myResponseElement.innerHTML="

";return false;} + else if(0==this.response){this.myResponseElement.innerHTML="

";return false;} return true; } this.parseAjaxResponseXML=function(){ if(this.responseXML&&typeof this.responseXML=='object')return true; - if(isNaN(this.response)){this.myResponseElement.innerHTML='
'+this.response+'
';return false;} + if(isNaN(this.response)){this.myResponseElement.innerHTML='

'+this.response+'

';return false;} var r=parseInt(this.response,10); - if(-1==r){this.myResponseElement.innerHTML="";} - else if(0==r){this.myResponseElement.innerHTML="";} + if(-1==r){this.myResponseElement.innerHTML="

";} + else if(0==r){this.myResponseElement.innerHTML="

";} return false; } this.init(file,responseEl); @@ -36,7 +36,7 @@ function WPAjax(file, responseEl){//class WPAjax extends sack function listMan(theListId){ this.theList=null; this.ajaxRespEl=null; - this.inputData='';this.clearInputs=new Array(); + this.inputData='';this.clearInputs=new Array();this.showLink=1; this.topAdder=0;this.alt='alternate';this.recolorPos;this.reg_color='#FFFFFF';this.alt_color='#F1F1F1'; var listType;var listItems; self.aTrap=0; @@ -57,10 +57,12 @@ function listMan(theListId){ if(exists)tempObj.replaceListItem(exists.id,getNodeValue(newItems[c],'newitem'),newItems.length,update); else tempObj.addListItem(getNodeValue(newItems[c],'newitem'),newItems.length); }} - this.myResponseElement.innerHTML='';tempObj.inputData=''; + tempObj.inputData=''; + if(tempObj.showLink){this.myResponseElement.innerHTML='';} + else this.myResponseElement.innerHTML=''; for(var i=0;i