Make WordPress Core


Ignore:
Timestamp:
01/12/2009 01:43:17 PM (18 years ago)
Author:
azaozz
Message:

Cleanup js files and prepare for concatenating, move most inline js to files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/template.php

    r10343 r10348  
    30773077                </div>
    30783078        </div>
    3079         <script type="text/javascript">
    3080         /* <![CDATA[ */
    3081         (function($){
    3082                 findPosts = {
    3083                         open : function(af_name, af_val) {
    3084                                 var st = document.documentElement.scrollTop || $(document).scrollTop();
    3085 
    3086                                 if ( af_name && af_val )
    3087                                         $('#affected').attr('name', af_name).val(af_val);
    3088 
    3089                                 $('#find-posts').show().draggable({
    3090                                         handle: '#find-posts-head'
    3091                                 }).resizable({
    3092                                         handles: 'all',
    3093                                         minHeight: 150,
    3094                                         minWidth: 280
    3095                                 }).css({'top':st+'px','left':'50%','marginLeft':'-200px'});
    3096 
    3097                                 $('.ui-resizable-handle').css({
    3098                                         'backgroundColor': '#e5e5e5'
    3099                                 });
    3100 
    3101                                 $('.ui-resizable-se').css({
    3102                                         'border': '0 none',
    3103                                         'width': '15px',
    3104                                         'height': '16px',
    3105                                         'background': 'transparent url(images/se.png) no-repeat scroll 0 0'
    3106                                 });
    3107 
    3108                                 $('#find-posts-input').focus().keyup(function(e){
    3109                                         if (e.which == 27) findPosts.close(); // close on Escape
    3110                                 });
    3111 
    3112                                 return false;
    3113                         },
    3114 
    3115                         close : function() {
    3116                                 $('#find-posts-response').html('');
    3117                                 $('#find-posts').draggable('destroy').resizable('destroy').hide();
    3118                         },
    3119 
    3120                         send : function() {
    3121                                 var post = {};
    3122 
    3123                                 post['ps'] = $('#find-posts-input').val();
    3124                                 post['action'] = 'find_posts';
    3125                                 post['_ajax_nonce'] = $('#_ajax_nonce').val();
    3126 
    3127                                 if ( $('#find-posts-pages:checked').val() )
    3128                                         post['pages'] = 1;
    3129                                 else
    3130                                         post['posts'] = 1;
    3131 
    3132                                 $.ajax({
    3133                                         type : 'POST',
    3134                                         url : '<?php echo admin_url('admin-ajax.php'); ?>',
    3135                                         data : post,
    3136                                         success : function(x) { findPosts.show(x); },
    3137                                         error : function(r) { findPosts.error(r); }
    3138                                 });
    3139                         },
    3140 
    3141                         show : function(x) {
    3142 
    3143                                 if ( typeof(x) == 'string' ) {
    3144                                         this.error({'responseText': x});
    3145                                         return;
    3146                                 }
    3147 
    3148                                 var r = wpAjax.parseAjaxResponse(x);
    3149 
    3150                                 if ( r.errors )
    3151                                         this.error({'responseText': wpAjax.broken});
    3152 
    3153                                 r = r.responses[0];
    3154                                 $('#find-posts-response').html(r.data);
    3155                         },
    3156 
    3157                         error : function(r) {
    3158                                 var er = r.statusText;
    3159 
    3160                                 if ( r.responseText )
    3161                                         er = r.responseText.replace( /<.[^<>]*?>/g, '' );
    3162 
    3163                                 if ( er )
    3164                                         $('#find-posts-response').html(er);
    3165                         }
    3166                 };
    3167 
    3168                 $(document).ready(function(){
    3169                         $('#find-posts-submit').click(function(e) {
    3170                                 if ( '' == $('#find-posts-response').html() )
    3171                                         e.preventDefault();
    3172                         });
    3173                 });
    3174         })(jQuery);
    3175         /* ]]> */
    3176         </script>
    31773079<?php
    31783080}
Note: See TracChangeset for help on using the changeset viewer.