Make WordPress Core


Ignore:
Timestamp:
09/13/2006 09:39:53 PM (18 years ago)
Author:
ryan
Message:

AJAX responsiveness improvements from mdawaffe. fixes #3099

File:
1 edited

Legend:

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

    r4170 r4187  
    66addLoadEvent(newCatAddIn);
    77function newCatAddIn() {
    8     if ( !document.getElementById('jaxcat') ) return false;
    9     var ajaxcat = document.createElement('span');
    10     ajaxcat.id = 'ajaxcat';
    11 
    12     newcat = document.createElement('input');
    13     newcat.type = 'text';
    14     newcat.name = 'newcat';
    15     newcat.id = 'newcat';
    16     newcat.size = '16';
    17     newcat.setAttribute('autocomplete', 'off');
    18     newcat.onkeypress = function(e) { return killSubmit("catList.ajaxAdder('category','categorydiv');", e); };
    19 
    20     var newcatSub = document.createElement('input');
    21     newcatSub.type = 'button';
    22     newcatSub.name = 'Button';
    23     newcatSub.id = 'catadd';
    24     newcatSub.value = '<?php _e('Add'); ?>';
    25     newcatSub.onclick = function() { catList.ajaxAdder('category', 'categorydiv'); };
    26 
    27     ajaxcat.appendChild(newcat);
    28     ajaxcat.appendChild(newcatSub);
    29     document.getElementById('jaxcat').appendChild(ajaxcat);
    30 
    31     howto = document.createElement('span');
    32     howto.innerHTML = "<?php _e('Separate multiple categories with commas.'); ?>";
    33     howto.id = 'howto';
    34     ajaxcat.appendChild(howto);
     8    var jaxcat = $('jaxcat');
     9    if ( !jaxcat )
     10        return false;
     11    jaxcat.update('<span id="ajaxcat"><input type="text" name="newcat" id="newcat" size="16" autocomplete="off"/><input type="button" name="Button" id="catadd" value="<?php _e('Add'); ?>"/><span id="howto"><?php _e('Separate multiple categories with commas.'); ?></span></span>');
     12    $('newcat').onkeypress = function(e) { return killSubmit("catList.ajaxAdder('category','jaxcat');", e); };
     13    $('catadd').onclick = function() { catList.ajaxAdder('category', 'jaxcat'); };
    3514}
Note: See TracChangeset for help on using the changeset viewer.