WordPress.org

Make WordPress Core

Ticket #10133: dashboard-ajax-load-rss.patch

File dashboard-ajax-load-rss.patch, 6.0 KB (added by azaozz, 9 years ago)
  • wp-admin/includes/dashboard.php

     
    605605}
    606606
    607607function wp_dashboard_incoming_links() {
    608         wp_dashboard_cached_rss_widget( 'dashboard_incoming_links', 'wp_dashboard_incoming_links_output' );
     608        echo '<p class="widget-loading hide-if-no-js">' . __( 'Loading&#8230;' ) . '</p><p class="describe hide-if-js">' . __('This widget requires JavaScript.') . '</p>';
    609609}
    610610
    611611/**
     
    690690}
    691691
    692692function wp_dashboard_primary() {
    693         wp_dashboard_cached_rss_widget( 'dashboard_primary', 'wp_dashboard_rss_output' );
     693        echo '<p class="widget-loading hide-if-no-js">' . __( 'Loading&#8230;' ) . '</p><p class="describe hide-if-js">' . __('This widget requires JavaScript.') . '</p>';
    694694}
    695695
    696696function wp_dashboard_primary_control() {
     
    712712}
    713713
    714714function wp_dashboard_secondary() {
    715         wp_dashboard_cached_rss_widget( 'dashboard_secondary', 'wp_dashboard_secondary_output' );
     715        echo '<p class="widget-loading hide-if-no-js">' . __( 'Loading&#8230;' ) . '</p><p class="describe hide-if-js">' . __('This widget requires JavaScript.') . '</p>';
    716716}
    717717
    718718function wp_dashboard_secondary_control() {
     
    747747}
    748748
    749749function wp_dashboard_plugins() {
    750         wp_dashboard_cached_rss_widget( 'dashboard_plugins', 'wp_dashboard_plugins_output', array(
    751                 'http://wordpress.org/extend/plugins/rss/browse/popular/',
    752                 'http://wordpress.org/extend/plugins/rss/browse/new/',
    753                 'http://wordpress.org/extend/plugins/rss/browse/updated/'
    754         ) );
     750        echo '<p class="widget-loading hide-if-no-js">' . __( 'Loading&#8230;' ) . '</p><p class="describe hide-if-js">' . __('This widget requires JavaScript.') . '</p>';
    755751}
    756752
    757753/**
  • wp-admin/js/dashboard.dev.js

     
    1010        ];
    1111
    1212        ajaxPopulateWidgets = function() {
    13                 $.each( ajaxWidgets, function() {
    14                         var e = jQuery('#' + this + ':visible div.inside').find('.widget-loading');
    15                         if ( e.size() ) { e.parent().load('index-extra.php?jax=' + this); }
    16                 } );
     13                $.each( ajaxWidgets, function(i) {
     14                        var p, t = this, e = jQuery('#' + t + ':visible div.inside').find('.widget-loading');
     15                        if ( e.size() ) {
     16                                p = e.parent();
     17                                setTimeout( function(){ p.slideUp().load('index-extra.php?jax=' + t, '', function() { p.slideDown(); } ); }, i * 500 );
     18                        }
     19                });
    1720        };
    1821        ajaxPopulateWidgets();
    1922
  • wp-admin/js/dashboard.js

     
    1 jQuery(document).ready(function(c){var a,b,d;a=["dashboard_incoming_links","dashboard_primary","dashboard_secondary","dashboard_plugins"];b=function(){c.each(a,function(){var f=jQuery("#"+this+":visible div.inside").find(".widget-loading");if(f.size()){f.parent().load("index-extra.php?jax="+this)}})};b();postboxes.add_postbox_toggles("dashboard",{onShow:b});d=function(){var e=c("#quickpost-action"),f;f=c("#quick-press").submit(function(){c("#dashboard_quick_press h3").append('<img src="images/wpspin_light.gif" style="margin: 0 6px 0 0; vertical-align: middle" />');c('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').attr("disabled","disabled");if("post"==e.val()){e.val("post-quickpress-publish")}c("#dashboard_quick_press div.inside").load(f.attr("action"),f.serializeArray(),function(){c("#dashboard_quick_press h3 img").remove();c('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').attr("disabled","");c("#dashboard_quick_press ul").find("li").each(function(){c("#dashboard_recent_drafts ul").prepend(this)}).end().remove();tb_init("a.thickbox");d()});return false});c("#publish").click(function(){e.val("post-quickpress-publish")})};d()});
    2  No newline at end of file
     1jQuery(document).ready(function(c){var a,b,d;a=["dashboard_incoming_links","dashboard_primary","dashboard_secondary","dashboard_plugins"];b=function(){c.each(a,function(g){var j,f=this,h=jQuery("#"+f+":visible div.inside").find(".widget-loading");if(h.size()){j=h.parent();setTimeout(function(){j.slideUp().load("index-extra.php?jax="+f,"",function(){j.slideDown()})},g*500)}})};b();postboxes.add_postbox_toggles("dashboard",{onShow:b});d=function(){var e=c("#quickpost-action"),f;f=c("#quick-press").submit(function(){c("#dashboard_quick_press h3").append('<img src="images/wpspin_light.gif" style="margin: 0 6px 0 0; vertical-align: middle" />');c('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').attr("disabled","disabled");if("post"==e.val()){e.val("post-quickpress-publish")}c("#dashboard_quick_press div.inside").load(f.attr("action"),f.serializeArray(),function(){c("#dashboard_quick_press h3 img").remove();c('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').attr("disabled","");c("#dashboard_quick_press ul").find("li").each(function(){c("#dashboard_recent_drafts ul").prepend(this)}).end().remove();tb_init("a.thickbox");d()});return false});c("#publish").click(function(){e.val("post-quickpress-publish")})};d()});
     2 No newline at end of file
  • wp-includes/script-loader.php

     
    377377
    378378                $scripts->add( 'farbtastic', '/wp-admin/js/farbtastic.js', array('jquery'), '1.2' );
    379379
    380                 $scripts->add( 'dashboard', "/wp-admin/js/dashboard$suffix.js", array( 'jquery', 'admin-comments', 'postbox' ), '20090201' );
     380                $scripts->add( 'dashboard', "/wp-admin/js/dashboard$suffix.js", array( 'jquery', 'admin-comments', 'postbox' ), '20090618' );
    381381                $scripts->add_data( 'dashboard', 'group', 1 );
    382382
    383383                $scripts->add( 'hoverIntent', "/wp-includes/js/hoverIntent$suffix.js", array('jquery'), '20090102' );