| 1 |
|
| 2 |
|
| 3 |
jQuery(document).ready( function(){ |
| 4 |
|
| 5 |
jQuery('ul.wp-submenu li:contains("Upgrade to Pro") a').attr( 'target', '_blank' ); // makes pro link open in a new tab |
| 6 |
jQuery('tr[data-plugin="charitable/charitable.php"]').addClass('wpcharitable-plugin-row').find('.proupgrade a').attr( 'target', '_blank' ); |
| 7 |
|
| 8 |
// check and see if the admin menu for Charitable exists at all. |
| 9 |
// added in 1.8.0.5. |
| 10 |
if( jQuery('li#toplevel_page_charitable ul.wp-submenu').length ) { |
| 11 |
// go through Charitable admin menu and based on the text, add a css class to the parent li. |
| 12 |
jQuery('li#toplevel_page_charitable ul.wp-submenu li').each( function(){ |
| 13 |
var text = jQuery(this).text(), |
| 14 |
cssClass = text.toLowerCase().replace(/\s/g, '-'); |
| 15 |
|
| 16 |
// cleanup class a bit. |
| 17 |
cssClass = cssClass.replace('new!', ''); |
| 18 |
cssClass = cssClass.replace('--', '-'); |
| 19 |
cssClass = cssClass.replace(/-$/, ''); |
| 20 |
|
| 21 |
jQuery(this).addClass( cssClass ); |
| 22 |
}); |
| 23 |
} |
| 24 |
|
| 25 |
var setup_dashboard_widgets = function() { |
| 26 |
var $widget = jQuery( '#charitable_dashboard_donations' ); |
| 27 |
|
| 28 |
if ( $widget.length ) { |
| 29 |
jQuery.ajax({ |
| 30 |
type: "GET", |
| 31 |
data: { |
| 32 |
action: 'charitable_load_dashboard_donations_widget' |
| 33 |
}, |
| 34 |
url: ajaxurl, |
| 35 |
success: function (response) { |
| 36 |
$widget.find( '.inside' ).html( response ); |
| 37 |
} |
| 38 |
}); |
| 39 |
} |
| 40 |
}; |
| 41 |
|
| 42 |
setup_dashboard_widgets(); |
| 43 |
|
| 44 |
}); |
| 45 |
|
| 46 |
|