Changeset 3733 for trunk/wp-admin/list-manipulation-js.php
- Timestamp:
- 04/21/2006 04:54:01 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/list-manipulation-js.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/list-manipulation-js.php
r3695 r3733 39 39 this.inputData='';this.clearInputs=new Array();this.showLink=1; 40 40 this.topAdder=0;this.alt='alternate';this.recolorPos;this.reg_color='#FFFFFF';this.alt_color='#F1F1F1'; 41 this.addComplete=null;this.delComplete=null;this.dimComplete=null; 41 42 var listType;var listItems; 42 43 self.aTrap=0; 43 44 44 this.ajaxAdder=function(what,where, onComplete,update){//for TR, server must wrap TR in TABLE TBODY. this.makeEl cleans it45 this.ajaxAdder=function(what,where,update){//for TR, server must wrap TR in TABLE TBODY. this.makeEl cleans it 45 46 if(self.aTrap)return;self.aTrap=1;setTimeout('aTrap=0',300); 46 47 this.ajaxAdd=new WPAjax('admin-ajax.php',this.ajaxRespEl?this.ajaxRespEl:'ajax-response'); … … 62 63 else this.myResponseElement.innerHTML=''; 63 64 for(var i=0;i<tempObj.clearInputs.length;i++){try{var theI=document.getElementById(tempObj.clearInputs[i]);if(theI.tagName.match(/select/i))theI.selectedIndex=0;else theI.value='';}catch(e){}} 64 if( onComplete&&typeof onComplete=='function')onComplete();65 if(tempObj.addComplete&&typeof tempObj.addComplete=='function')tempObj.addComplete(what,where,update); 65 66 tempObj.recolorList(tempObj.recolorPos,1000); 66 67 } … … 68 69 return false; 69 70 } 70 this.ajaxUpdater=function(what,where ,onComplete){return this.ajaxAdder(what,where,onComplete,true);}71 this.ajaxDelete=function(what,id ,onComplete){71 this.ajaxUpdater=function(what,where){return this.ajaxAdder(what,where,true);} 72 this.ajaxDelete=function(what,id){ 72 73 if(self.aTrap)return;self.aTrap=1;setTimeout('aTrap=0',300); 73 74 this.ajaxDel=new WPAjax('admin-ajax.php',this.ajaxRespEl?this.ajaxRespEl:'ajax-response'); 74 75 if(this.ajaxDel.failed)return true; 75 76 var tempObj=this; 76 this.ajaxDel.onCompletion=function(){if(this.parseAjaxResponse()){tempObj.removeListItem(what.replace('-as-spam','')+'-'+id);this.myResponseElement.innerHTML='';if( onComplete&&typeof onComplete=='function')onComplete();tempObj.recolorList(tempObj.recolorPos,1000)}};77 this.ajaxDel.onCompletion=function(){if(this.parseAjaxResponse()){tempObj.removeListItem(what.replace('-as-spam','')+'-'+id);this.myResponseElement.innerHTML='';if(tempObj.delComplete&&typeof tempObj.delComplete=='function')tempObj.delComplete(what,where);tempObj.recolorList(tempObj.recolorPos,1000)}}; 77 78 this.ajaxDel.runAJAX('action=delete-'+what+'&id='+id); 78 79 return false; 79 80 } 80 this.ajaxDimmer=function(what,id,dimClass ,onComplete){81 this.ajaxDimmer=function(what,id,dimClass){ 81 82 if(self.aTrap)return;self.aTrap=1;setTimeout('aTrap=0',300); 82 83 this.ajaxDim=new WPAjax('admin-ajax.php',this.ajaxRespEl?this.ajaxRespEl:'ajax-response'); 83 84 if(this.ajaxDim.failed)return true; 84 85 var tempObj=this; 85 this.ajaxDim.onCompletion=function(){if(this.parseAjaxResponse()){tempObj.dimItem(what+'-'+id,dimClass);this.myResponseElement.innerHTML='';if( onComplete&&typeof onComplete=='function')onComplete();}};86 this.ajaxDim.onCompletion=function(){if(this.parseAjaxResponse()){tempObj.dimItem(what+'-'+id,dimClass);this.myResponseElement.innerHTML='';if(tempObj.dimComplete&&typeof tempObj.dimComplete=='function')tempObj.dimComplete(what,id,dimClass);}}; 86 87 this.ajaxDim.runAJAX('action=dim-'+what+'&id='+id); 87 88 return false;
Note: See TracChangeset
for help on using the changeset viewer.