WordPress.org

Make WordPress Core

Changeset 23446


Ignore:
Timestamp:
02/16/2013 07:03:59 PM (7 years ago)
Author:
nacin
Message:

Remove unused admin-categories and admin-custom-fields JavaScript files. props ocean90. fixes #23486.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/js/categories.js

    r21592 r23446  
    1 jQuery(document).ready(function($) {
    2     var options = false, addAfter, delBefore, delAfter;
    3     if ( document.forms['addcat'].category_parent )
    4         options = document.forms['addcat'].category_parent.options;
    5 
    6     addAfter = function( r, settings ) {
    7         var name, id;
    8 
    9         name = $("<span>" + $('name', r).text() + "</span>").text();
    10         id = $('cat', r).attr('id');
    11         options[options.length] = new Option(name, id);
    12     }
    13 
    14     delAfter = function( r, settings ) {
    15         var id = $('cat', r).attr('id'), o;
    16         for ( o = 0; o < options.length; o++ )
    17             if ( id == options[o].value )
    18                 options[o] = null;
    19     }
    20 
    21     delBefore = function(s) {
    22         if ( 'undefined' != showNotice )
    23             return showNotice.warn() ? s : false;
    24 
    25         return s;
    26     }
    27 
    28     if ( options )
    29         $('#the-list').wpList( { addAfter: addAfter, delBefore: delBefore, delAfter: delAfter } );
    30     else
    31         $('#the-list').wpList({ delBefore: delBefore });
    32 
    33     $('.delete a[class^="delete"]').live('click', function(){return false;});
    34 });
  • trunk/wp-admin/js/categories.min.js

    r21592 r23446  
    1 jQuery(document).ready(function(d){var b=false,e,c,a;if(document.forms.addcat.category_parent){b=document.forms.addcat.category_parent.options}e=function(h,g){var f,i;f=d("<span>"+d("name",h).text()+"</span>").text();i=d("cat",h).attr("id");b[b.length]=new Option(f,i)};a=function(g,f){var i=d("cat",g).attr("id"),h;for(h=0;h<b.length;h++){if(i==b[h].value){b[h]=null}}};c=function(f){if("undefined"!=showNotice){return showNotice.warn()?f:false}return f};if(b){d("#the-list").wpList({addAfter:e,delBefore:c,delAfter:a})}else{d("#the-list").wpList({delBefore:c})}d('.delete a[class^="delete"]').live("click",function(){return false})});
  • trunk/wp-admin/js/custom-fields.js

    r21592 r23446  
    1 jQuery(document).ready( function($) {
    2     var before, addBefore, addAfter, delBefore;
    3 
    4     before = function() {
    5         var nonce = $('#newmeta [name="_ajax_nonce"]').val(), postId = $('#post_ID').val();
    6         if ( !nonce || !postId ) { return false; }
    7         return [nonce,postId];
    8     }
    9 
    10     addBefore = function( s ) {
    11         var b = before();
    12         if ( !b ) { return false; }
    13         s.data = s.data.replace(/_ajax_nonce=[a-f0-9]+/, '_ajax_nonce=' + b[0]) + '&post_id=' + b[1];
    14         return s;
    15     };
    16 
    17     addAfter = function( r, s ) {
    18         var postId = $('postid', r).text(), h;
    19         if ( !postId ) { return; }
    20         $('#post_ID').attr( 'name', 'post_ID' ).val( postId );
    21         h = $('#hiddenaction');
    22         if ( 'post' == h.val() ) { h.val( 'postajaxpost' ); }
    23     };
    24 
    25     delBefore = function( s ) {
    26         var b = before(); if ( !b ) return false;
    27         s.data._ajax_nonce = b[0]; s.data.post_id = b[1];
    28         return s;
    29     }
    30 
    31     $('#the-list')
    32         .wpList( { addBefore: addBefore, addAfter: addAfter, delBefore: delBefore } )
    33         .find('.updatemeta, .deletemeta').attr( 'type', 'button' );
    34 } );
  • trunk/wp-admin/js/custom-fields.min.js

    r21592 r23446  
    1 jQuery(document).ready(function(d){var c,b,e,a;c=function(){var g=d('#newmeta [name="_ajax_nonce"]').val(),f=d("#post_ID").val();if(!g||!f){return false}return[g,f]};b=function(g){var f=c();if(!f){return false}g.data=g.data.replace(/_ajax_nonce=[a-f0-9]+/,"_ajax_nonce="+f[0])+"&post_id="+f[1];return g};e=function(j,i){var f=d("postid",j).text(),g;if(!f){return}d("#post_ID").attr("name","post_ID").val(f);g=d("#hiddenaction");if("post"==g.val()){g.val("postajaxpost")}};a=function(g){var f=c();if(!f){return false}g.data._ajax_nonce=f[0];g.data.post_id=f[1];return g};d("#the-list").wpList({addBefore:b,addAfter:e,delBefore:a}).find(".updatemeta, .deletemeta").attr("type","button")});
  • trunk/wp-includes/script-loader.php

    r23442 r23446  
    357357        ) );
    358358
    359         $scripts->add( 'admin-categories', "/wp-admin/js/categories$suffix.js", array('wp-lists'), false, 1 );
    360 
    361359        $scripts->add( 'admin-tags', "/wp-admin/js/tags$suffix.js", array('jquery', 'wp-ajax-response'), false, 1 );
    362360        did_action( 'init' ) && $scripts->localize( 'admin-tags', 'tagsl10n', array(
     
    364362            'broken' => __('An unidentified error has occurred.')
    365363        ));
    366 
    367         $scripts->add( 'admin-custom-fields', "/wp-admin/js/custom-fields$suffix.js", array('wp-lists'), false, 1 );
    368364
    369365        $scripts->add( 'admin-comments', "/wp-admin/js/edit-comments$suffix.js", array('wp-lists', 'quicktags', 'jquery-query'), false, 1 );
Note: See TracChangeset for help on using the changeset viewer.