]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/js/categories.js
Wordpress 2.8.4-scripts
[autoinstalls/wordpress.git] / wp-admin / js / categories.js
index 3cee6c68e2ffd3de189216cff4a92e2dc322ef8b..43f60ca1dcf419591d40434c822ed7aaab8455eb 100644 (file)
@@ -1,16 +1 @@
-addLoadEvent(function() {
-       if (!theList.theList) return false;
-       document.forms.addcat.submit.onclick = function(e) {return killSubmit('theList.ajaxAdder("cat", "addcat");', e); };
-       theList.addComplete = function(what, where, update, transport) {
-               var name = getNodeValue(transport.responseXML, 'name').unescapeHTML();
-               var id = transport.responseXML.getElementsByTagName(what)[0].getAttribute('id');
-               var options = document.forms['addcat'].category_parent.options;
-               options[options.length] = new Option(name, id);
-       };
-       theList.delComplete = function(what, id) {
-               var options = document.forms['addcat'].category_parent.options;
-               for ( var o = 0; o < options.length; o++ )
-                       if ( id == options[o].value )
-                               options[o] = null;
-       };
-});
+jQuery(document).ready(function(d){var b=false,f,e,c,a;if(document.forms.addcat.category_parent){b=document.forms.addcat.category_parent.options}f=function(i,h){var g,j;g=d("<span>"+d("name",i).text()+"</span>").html();j=d("cat",i).attr("id");b[b.length]=new Option(g,j);e(i,h)};e=function(g,i){var h=d(i.parsed.responses[0].data);if(h.length==1){inlineEditTax.addEvents(d(h.id))}};a=function(h,g){var j=d("cat",h).attr("id"),i;for(i=0;i<b.length;i++){if(j==b[i].value){b[i]=null}}};c=function(g){if("undefined"!=showNotice){return showNotice.warn()?g:false}return g};if(b){d("#the-list").wpList({addAfter:f,delBefore:c,delAfter:a})}else{d("#the-list").wpList({addAfter:e,delBefore:c})}d('.delete a[class^="delete"]').click(function(){return false})});
\ No newline at end of file