Make WordPress Core


Ignore:
Timestamp:
04/21/2006 04:54:01 AM (20 years ago)
Author:
ryan
Message:

Change number of comments awaiting moderation in menu when number changes. Props mdawaffe. fixes #2677

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/list-manipulation-js.php

    r3695 r3733  
    3939    this.inputData='';this.clearInputs=new Array();this.showLink=1;
    4040    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;
    4142    var listType;var listItems;
    4243    self.aTrap=0;
    4344
    44     this.ajaxAdder=function(what,where,onComplete,update){//for TR, server must wrap TR in TABLE TBODY. this.makeEl cleans it
     45    this.ajaxAdder=function(what,where,update){//for TR, server must wrap TR in TABLE TBODY. this.makeEl cleans it
    4546        if(self.aTrap)return;self.aTrap=1;setTimeout('aTrap=0',300);
    4647        this.ajaxAdd=new WPAjax('admin-ajax.php',this.ajaxRespEl?this.ajaxRespEl:'ajax-response');
     
    6263            else this.myResponseElement.innerHTML='';
    6364            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);
    6566            tempObj.recolorList(tempObj.recolorPos,1000);
    6667        }
     
    6869        return false;
    6970    }
    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){
    7273        if(self.aTrap)return;self.aTrap=1;setTimeout('aTrap=0',300);
    7374        this.ajaxDel=new WPAjax('admin-ajax.php',this.ajaxRespEl?this.ajaxRespEl:'ajax-response');
    7475        if(this.ajaxDel.failed)return true;
    7576        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)}};
    7778        this.ajaxDel.runAJAX('action=delete-'+what+'&id='+id);
    7879        return false;
    7980    }
    80     this.ajaxDimmer=function(what,id,dimClass,onComplete){
     81    this.ajaxDimmer=function(what,id,dimClass){
    8182        if(self.aTrap)return;self.aTrap=1;setTimeout('aTrap=0',300);
    8283        this.ajaxDim=new WPAjax('admin-ajax.php',this.ajaxRespEl?this.ajaxRespEl:'ajax-response');
    8384        if(this.ajaxDim.failed)return true;
    8485        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);}};
    8687        this.ajaxDim.runAJAX('action=dim-'+what+'&id='+id);
    8788        return false;
Note: See TracChangeset for help on using the changeset viewer.