5 open : function(af_name, af_val) {
6 var st = document.documentElement.scrollTop || $(document).scrollTop();
8 if ( af_name && af_val ) {
9 $('#affected').attr('name', af_name).val(af_val);
11 $('#find-posts').show().draggable({
12 handle: '#find-posts-head'
13 }).css({'top':st + 50 + 'px','left':'50%','marginLeft':'-250px'});
15 $('#find-posts-input').focus().keyup(function(e){
16 if (e.which == 27) { findPosts.close(); } // close on Escape
23 $('#find-posts-response').html('');
24 $('#find-posts').draggable('destroy').hide();
29 ps: $('#find-posts-input').val(),
31 _ajax_nonce: $('#_ajax_nonce').val(),
32 post_type: $('input[name="find-posts-what"]:checked').val()
39 success : function(x) { findPosts.show(x); },
40 error : function(r) { findPosts.error(r); }
46 if ( typeof(x) == 'string' ) {
47 this.error({'responseText': x});
51 var r = wpAjax.parseAjaxResponse(x);
54 this.error({'responseText': wpAjax.broken});
57 $('#find-posts-response').html(r.data);
61 var er = r.statusText;
63 if ( r.responseText ) {
64 er = r.responseText.replace( /<.[^<>]*?>/g, '' );
67 $('#find-posts-response').html(er);
72 $(document).ready(function() {
73 $('#find-posts-submit').click(function(e) {
74 if ( '' == $('#find-posts-response').html() )
77 $( '#find-posts .find-box-search :input' ).keypress( function( event ) {
78 if ( 13 == event.which ) {
83 $( '#find-posts-search' ).click( findPosts.send );
84 $( '#find-posts-close' ).click( findPosts.close );
85 $('#doaction, #doaction2').click(function(e){
86 $('select[name^="action"]').each(function(){
87 if ( $(this).val() == 'attach' ) {