Changeset 11614
- Timestamp:
- 06/20/2009 10:32:09 AM (15 years ago)
- Location:
- branches/2.8
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.8/wp-admin/includes/dashboard.php
r11605 r11614 606 606 607 607 function 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…' ) . '</p><p class="describe hide-if-js">' . __('This widget requires JavaScript.') . '</p>'; 609 609 } 610 610 … … 691 691 692 692 function 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…' ) . '</p><p class="describe hide-if-js">' . __('This widget requires JavaScript.') . '</p>'; 694 694 } 695 695 … … 713 713 714 714 function 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…' ) . '</p><p class="describe hide-if-js">' . __('This widget requires JavaScript.') . '</p>'; 716 716 } 717 717 … … 748 748 749 749 function 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…' ) . '</p><p class="describe hide-if-js">' . __('This widget requires JavaScript.') . '</p>'; 755 751 } 756 752 -
branches/2.8/wp-admin/js/dashboard.dev.js
r11203 r11614 1 var ajaxWidgets, ajaxPopulateWidgets, quickPressLoad; 1 2 2 3 jQuery(document).ready( function($) { 3 var ajaxWidgets, ajaxPopulateWidgets, quickPressLoad;4 4 // These widgets are sometimes populated via ajax 5 5 ajaxWidgets = [ … … 10 10 ]; 11 11 12 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 } ); 12 ajaxPopulateWidgets = function(el) { 13 show = function(id, i) { 14 var p, e = $('#' + id + ' div.inside:visible').find('.widget-loading'); 15 if ( e.length ) { 16 p = e.parent(); 17 setTimeout( function(){ 18 p.load('index-extra.php?jax=' + id, '', function() { 19 p.hide().slideDown('normal', function(){ 20 $(this).css('display', ''); 21 if ( 'dashboard_plugins' == id && $.isFunction(tb_init) ) 22 tb_init('#dashboard_plugins a.thickbox'); 23 }); 24 }); 25 }, i * 500 ); 26 } 27 } 28 if ( el ) { 29 el = el.toString(); 30 if ( $.inArray(el, ajaxWidgets) != -1 ) 31 show(el, 0); 32 } else { 33 $.each( ajaxWidgets, function(i) { 34 show(this, i); 35 }); 36 } 17 37 }; 18 38 ajaxPopulateWidgets(); 19 39 20 postboxes.add_postbox_toggles('dashboard', { onShow: ajaxPopulateWidgets } );40 postboxes.add_postbox_toggles('dashboard', { pbshow: ajaxPopulateWidgets } ); 21 41 22 42 /* QuickPress */ -
branches/2.8/wp-admin/js/dashboard.js
r11203 r11614 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()});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("index-extra.php?jax="+g,"",function(){f.hide().slideDown("normal",function(){a(this).css("display","");if("dashboard_plugins"==g&&a.isFunction(tb_init)){tb_init("#dashboard_plugins a.thickbox")}})})},c*500)}};if(b){b=b.toString();if(a.inArray(b,ajaxWidgets)!=-1){show(b,0)}}else{a.each(ajaxWidgets,function(c){show(this,c)})}};ajaxPopulateWidgets();postboxes.add_postbox_toggles("dashboard",{pbshow:ajaxPopulateWidgets});quickPressLoad=function(){var b=a("#quickpost-action"),c;c=a("#quick-press").submit(function(){a("#dashboard_quick_press h3").append('<img src="images/wpspin_light.gif" style="margin: 0 6px 0 0; vertical-align: middle" />');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 h3 img").remove();a('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').attr("disabled","");a("#dashboard_quick_press ul").find("li").each(function(){a("#dashboard_recent_drafts ul").prepend(this)}).end().remove();tb_init("a.thickbox");quickPressLoad()});return false});a("#publish").click(function(){b.val("post-quickpress-publish")})};quickPressLoad()}); -
branches/2.8/wp-admin/js/postbox.dev.js
r10849 r11614 5 5 this.init(page,args); 6 6 $('.postbox h3, .postbox .handlediv').click( function() { 7 var p = $(this).parent('.postbox'); 8 /* 9 if ( p.hasClass('noclick') ) { 10 p.removeClass('noclick'); 11 return false; 12 } 13 */ 7 var p = $(this).parent('.postbox'), id = p.attr('id'); 14 8 p.toggleClass('closed'); 15 9 postboxes.save_state(page); 10 if ( id ) { 11 if ( !p.hasClass('closed') && $.isFunction(postboxes.pbshow) ) 12 postboxes.pbshow(id); 13 else if ( p.hasClass('closed') && $.isFunction(postboxes.pbhide) ) 14 postboxes.pbhide(id); 15 } 16 16 } ); 17 17 $('.postbox h3 a').click( function(e) { -
branches/2.8/wp-admin/js/postbox.js
r10849 r11614 1 var postboxes;(function(a){postboxes={add_postbox_toggles:function(c,b){this.init(c,b);a(".postbox h3, .postbox .handlediv").click(function(){var e=a(this).parent(".postbox") ;e.toggleClass("closed");postboxes.save_state(c)});a(".postbox h3 a").click(function(f){f.stopPropagation()});a(".hide-postbox-tog").click(function(){var e=a(this).val();if(a(this).attr("checked")){a("#"+e).show();if(a.isFunction(postboxes.pbshow)){postboxes.pbshow(e)}}else{a("#"+e).hide();if(a.isFunction(postboxes.pbhide)){postboxes.pbhide(e)}}postboxes.save_state(c)});a('.columns-prefs input[type="radio"]').click(function(){var e=a(this).val(),f,g,h=a("#poststuff");if(h.length){if(e==2){h.addClass("has-right-sidebar");a("#side-sortables").addClass("temp-border")}else{if(e==1){h.removeClass("has-right-sidebar");a("#normal-sortables").append(a("#side-sortables").children(".postbox"))}}}else{for(f=4;(f>e&&f>1);f--){g=a("#"+d(f)+"-sortables");a("#"+d(f-1)+"-sortables").append(g.children(".postbox"));g.parent().hide()}for(f=1;f<=e;f++){g=a("#"+d(f)+"-sortables");if(g.parent().is(":hidden")){g.addClass("temp-border").parent().show()}}a(".postbox-container:visible").css("width",98/e+"%")}postboxes.save_order(c)});function d(e){switch(e){case 1:return"normal";break;case 2:return"side";break;case 3:return"column3";break;case 4:return"column4";break;default:return""}}},init:function(c,b){a.extend(this,b||{});a("#wpbody-content").css("overflow","hidden");a(".meta-box-sortables").sortable({placeholder:"sortable-placeholder",connectWith:".meta-box-sortables",items:".postbox",handle:".hndle",cursor:"move",distance:2,tolerance:"pointer",forcePlaceholderSize:true,helper:"clone",opacity:0.65,start:function(f,d){a("body").css({WebkitUserSelect:"none",KhtmlUserSelect:"none"})},stop:function(f,d){postboxes.save_order(c);d.item.parent().removeClass("temp-border");a("body").css({WebkitUserSelect:"",KhtmlUserSelect:""})}})},save_state:function(d){var b=a(".postbox").filter(".closed").map(function(){return this.id}).get().join(","),c=a(".postbox").filter(":hidden").map(function(){return this.id}).get().join(",");a.post(postboxL10n.requestFile,{action:"closed-postboxes",closed:b,hidden:c,closedpostboxesnonce:jQuery("#closedpostboxesnonce").val(),page:d})},save_order:function(c){var b,d=a(".columns-prefs input:checked").val()||0;b={action:"meta-box-order",_ajax_nonce:a("#meta-box-order-nonce").val(),page_columns:d,page:c};a(".meta-box-sortables").each(function(){b["order["+this.id.split("-")[0]+"]"]=a(this).sortable("toArray").join(",")});a.post(postboxL10n.requestFile,b)},pbshow:false,pbhide:false}}(jQuery));1 var postboxes;(function(a){postboxes={add_postbox_toggles:function(c,b){this.init(c,b);a(".postbox h3, .postbox .handlediv").click(function(){var e=a(this).parent(".postbox"),f=e.attr("id");e.toggleClass("closed");postboxes.save_state(c);if(f){if(!e.hasClass("closed")&&a.isFunction(postboxes.pbshow)){postboxes.pbshow(f)}else{if(e.hasClass("closed")&&a.isFunction(postboxes.pbhide)){postboxes.pbhide(f)}}}});a(".postbox h3 a").click(function(f){f.stopPropagation()});a(".hide-postbox-tog").click(function(){var e=a(this).val();if(a(this).attr("checked")){a("#"+e).show();if(a.isFunction(postboxes.pbshow)){postboxes.pbshow(e)}}else{a("#"+e).hide();if(a.isFunction(postboxes.pbhide)){postboxes.pbhide(e)}}postboxes.save_state(c)});a('.columns-prefs input[type="radio"]').click(function(){var e=a(this).val(),f,g,h=a("#poststuff");if(h.length){if(e==2){h.addClass("has-right-sidebar");a("#side-sortables").addClass("temp-border")}else{if(e==1){h.removeClass("has-right-sidebar");a("#normal-sortables").append(a("#side-sortables").children(".postbox"))}}}else{for(f=4;(f>e&&f>1);f--){g=a("#"+d(f)+"-sortables");a("#"+d(f-1)+"-sortables").append(g.children(".postbox"));g.parent().hide()}for(f=1;f<=e;f++){g=a("#"+d(f)+"-sortables");if(g.parent().is(":hidden")){g.addClass("temp-border").parent().show()}}a(".postbox-container:visible").css("width",98/e+"%")}postboxes.save_order(c)});function d(e){switch(e){case 1:return"normal";break;case 2:return"side";break;case 3:return"column3";break;case 4:return"column4";break;default:return""}}},init:function(c,b){a.extend(this,b||{});a("#wpbody-content").css("overflow","hidden");a(".meta-box-sortables").sortable({placeholder:"sortable-placeholder",connectWith:".meta-box-sortables",items:".postbox",handle:".hndle",cursor:"move",distance:2,tolerance:"pointer",forcePlaceholderSize:true,helper:"clone",opacity:0.65,start:function(f,d){a("body").css({WebkitUserSelect:"none",KhtmlUserSelect:"none"})},stop:function(f,d){postboxes.save_order(c);d.item.parent().removeClass("temp-border");a("body").css({WebkitUserSelect:"",KhtmlUserSelect:""})}})},save_state:function(d){var b=a(".postbox").filter(".closed").map(function(){return this.id}).get().join(","),c=a(".postbox").filter(":hidden").map(function(){return this.id}).get().join(",");a.post(postboxL10n.requestFile,{action:"closed-postboxes",closed:b,hidden:c,closedpostboxesnonce:jQuery("#closedpostboxesnonce").val(),page:d})},save_order:function(c){var b,d=a(".columns-prefs input:checked").val()||0;b={action:"meta-box-order",_ajax_nonce:a("#meta-box-order-nonce").val(),page_columns:d,page:c};a(".meta-box-sortables").each(function(){b["order["+this.id.split("-")[0]+"]"]=a(this).sortable("toArray").join(",")});a.post(postboxL10n.requestFile,b)},pbshow:false,pbhide:false}}(jQuery)); -
branches/2.8/wp-includes/script-loader.php
r11547 r11614 250 250 $scripts->add( 'xfn', "/wp-admin/js/xfn$suffix.js", false, '3517m' ); 251 251 252 $scripts->add( 'postbox', "/wp-admin/js/postbox$suffix.js", array('jquery-ui-sortable'), '20090 327' );252 $scripts->add( 'postbox', "/wp-admin/js/postbox$suffix.js", array('jquery-ui-sortable'), '20090618' ); 253 253 $scripts->add_data( 'postbox', 'group', 1 ); 254 254 $scripts->localize( 'postbox', 'postboxL10n', array( … … 378 378 $scripts->add( 'farbtastic', '/wp-admin/js/farbtastic.js', array('jquery'), '1.2' ); 379 379 380 $scripts->add( 'dashboard', "/wp-admin/js/dashboard$suffix.js", array( 'jquery', 'admin-comments', 'postbox' ), '20090 201' );380 $scripts->add( 'dashboard', "/wp-admin/js/dashboard$suffix.js", array( 'jquery', 'admin-comments', 'postbox' ), '20090618' ); 381 381 $scripts->add_data( 'dashboard', 'group', 1 ); 382 382
Note: See TracChangeset
for help on using the changeset viewer.