WordPress.org

Make WordPress Core


Ignore:
Timestamp:
04/02/2006 12:31:26 AM (12 years ago)
Author:
ryan
Message:

AJAXify user addition. Props mdawaffe. fixes #2624

File:
1 edited

Legend:

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

    r3669 r3677  
    1010    this.getResponseElement=function(r){var p=document.getElementById(r+'-p');if(!p){p=document.createElement('span');p.id=r+'ajax-response-p';document.getElementById(r).appendChild(p);}this.myResponseElement=p; }
    1111    this.parseAjaxResponse=function(){
    12         if(isNaN(this.response)){this.myResponseElement.innerHTML="<?php _e('Error: '); ?>"+this.response;return false;}
     12        if(isNaN(this.response)){this.myResponseElement.innerHTML='<div class="error">'+this.response+'</div>';return false;}
    1313        this.response=parseInt(this.response,10);
    1414        if(-1==this.response){this.myResponseElement.innerHTML="<?php _e("You don't have permission to do that."); ?>";return false;}
     
    1818    this.parseAjaxResponseXML=function(){
    1919        if(this.responseXML&&typeof this.responseXML=='object')return true;
    20         if(isNaN(this.response)){this.myResponseElement.innerHTML="<?php _e('Error: '); ?>"+this.response;return false;}
     20        if(isNaN(this.response)){this.myResponseElement.innerHTML='<div class="error">'+this.response+'</div>';return false;}
    2121        var r=parseInt(this.response,10);
    2222        if(-1==r){this.myResponseElement.innerHTML="<?php _e("You don't have permission to do that."); ?>";}
     
    154154}
    155155//No submit unless eval(code) returns true.
    156 function killSubmit(code,e){if(!e){if(window.event)e=window.event;else return;}var t=e.target?e.target:e.srcElement;if(('text'==t.type&&e.keyCode==13)||('submit'==t.type&&'click'==e.type)){if(!eval(code));e.returnValue=false;e.cancelBubble=true;return false;}}
     156function killSubmit(code,e){if(!e){if(window.event)e=window.event;else return;}var t=e.target?e.target:e.srcElement;if(('text'==t.type&&e.keyCode==13)||('submit'==t.type&&'click'==e.type)){if(!eval(code)){e.returnValue=false;e.cancelBubble=true;return false;}}}
    157157//Pretty func from ALA http://www.alistapart.com/articles/gettingstartedwithajax
    158158function getNodeValue(tree,el){return tree.getElementsByTagName(el)[0].firstChild.nodeValue;}
Note: See TracChangeset for help on using the changeset viewer.