WordPress.org

Make WordPress Core

Changeset 17784


Ignore:
Timestamp:
04/30/11 23:31:34 (4 years ago)
Author:
azaozz
Message:

Cleanup in dashboard.js, props scribu, fixes 17292

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/js/dashboard.dev.js

    r17783 r17784  
    1111 
    1212    ajaxPopulateWidgets = function(el) { 
    13         show = function(id, i) { 
     13        function show(i, id) { 
    1414            var p, e = $('#' + id + ' div.inside:visible').find('.widget-loading'); 
    1515            if ( e.length ) { 
     
    2424            } 
    2525        } 
     26 
    2627        if ( el ) { 
    2728            el = el.toString(); 
    2829            if ( $.inArray(el, ajaxWidgets) != -1 ) 
    29                 show(el, 0); 
     30                show(0, el); 
    3031        } else { 
    31             $.each( ajaxWidgets, function(i, id) { 
    32                 show(id, i); 
    33             }); 
     32            $.each( ajaxWidgets, show ); 
    3433        } 
    3534    }; 
  • trunk/wp-admin/js/dashboard.js

    r17783 r17784  
    1 var ajaxWidgets,ajaxPopulateWidgets,quickPressLoad;jQuery(document).ready(function(a){ajaxWidgets=["dashboard_incoming_links","dashboard_primary","dashboard_secondary","dashboard_plugins"];ajaxPopulateWidgets=function(b){show=function(g,c){var f,d=a("#"+g+" div.inside:visible").find(".widget-loading");if(d.length){f=d.parent();setTimeout(function(){f.load(ajaxurl.replace("/admin-ajax.php","")+"/index-extra.php?jax="+g,"",function(){f.hide().slideDown("normal",function(){a(this).css("display","")})})},c*500)}};if(b){b=b.toString();if(a.inArray(b,ajaxWidgets)!=-1){show(b,0)}}else{a.each(ajaxWidgets,function(c,d){show(d,c)})}};ajaxPopulateWidgets();postboxes.add_postbox_toggles(pagenow,{pbshow:ajaxPopulateWidgets});quickPressLoad=function(){var b=a("#quickpost-action"),c;c=a("#quick-press").submit(function(){a("#dashboard_quick_press #publishing-action img.waiting").css("visibility","visible");a('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').attr("disabled","disabled");if("post"==b.val()){b.val("post-quickpress-publish")}a("#dashboard_quick_press div.inside").load(c.attr("action"),c.serializeArray(),function(){a("#dashboard_quick_press #publishing-action img.waiting").css("visibility","hidden");a('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').attr("disabled","");a("#dashboard_quick_press ul").next("p").remove();a("#dashboard_quick_press ul").find("li").each(function(){a("#dashboard_recent_drafts ul").prepend(this)}).end().remove();quickPressLoad()});return false});a("#publish").click(function(){b.val("post-quickpress-publish")})};quickPressLoad()}); 
     1var ajaxWidgets,ajaxPopulateWidgets,quickPressLoad;jQuery(document).ready(function(a){ajaxWidgets=["dashboard_incoming_links","dashboard_primary","dashboard_secondary","dashboard_plugins"];ajaxPopulateWidgets=function(c){function b(d,h){var g,f=a("#"+h+" div.inside:visible").find(".widget-loading");if(f.length){g=f.parent();setTimeout(function(){g.load(ajaxurl.replace("/admin-ajax.php","")+"/index-extra.php?jax="+h,"",function(){g.hide().slideDown("normal",function(){a(this).css("display","")})})},d*500)}}if(c){c=c.toString();if(a.inArray(c,ajaxWidgets)!=-1){b(0,c)}}else{a.each(ajaxWidgets,b)}};ajaxPopulateWidgets();postboxes.add_postbox_toggles(pagenow,{pbshow:ajaxPopulateWidgets});quickPressLoad=function(){var b=a("#quickpost-action"),c;c=a("#quick-press").submit(function(){a("#dashboard_quick_press #publishing-action img.waiting").css("visibility","visible");a('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').attr("disabled","disabled");if("post"==b.val()){b.val("post-quickpress-publish")}a("#dashboard_quick_press div.inside").load(c.attr("action"),c.serializeArray(),function(){a("#dashboard_quick_press #publishing-action img.waiting").css("visibility","hidden");a('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').attr("disabled","");a("#dashboard_quick_press ul").next("p").remove();a("#dashboard_quick_press ul").find("li").each(function(){a("#dashboard_recent_drafts ul").prepend(this)}).end().remove();quickPressLoad()});return false});a("#publish").click(function(){b.val("post-quickpress-publish")})};quickPressLoad()}); 
  • trunk/wp-includes/script-loader.php

    r17783 r17784  
    413413        $scripts->add( 'farbtastic', '/wp-admin/js/farbtastic.js', array('jquery'), '1.2' ); 
    414414 
    415         $scripts->add( 'dashboard', "/wp-admin/js/dashboard$suffix.js", array( 'jquery', 'admin-comments', 'postbox' ), '20110430' ); 
     415        $scripts->add( 'dashboard', "/wp-admin/js/dashboard$suffix.js", array( 'jquery', 'admin-comments', 'postbox' ), '20110430a' ); 
    416416        $scripts->add_data( 'dashboard', 'group', 1 ); 
    417417 
Note: See TracChangeset for help on using the changeset viewer.