').addClass('wprss-slider-button').text( wprss_admin_custom.cancel ).click( function() {
fields.each( function(){
$(this).val( $(this).attr( 'data-old-value' ) );
$(this).removeAttr( 'data-old-value' );
});
});
// Add the buttons
slider.append( $('
') ).append( $('
') ).append( okBtn ).append( cancelBtn );
// Make both buttons close the div
slider.find('.wprss-slider-button').click( function(){
slider.slideUp().removeClass('wprss-open');
});
// Update when ready
update();
});
});
})(jQuery, wprss_admin_custom);
// For Blacklist
(function($, wprss_admin_custom) {
$(document).ready( function(){
if ( $('body').hasClass('post-type-wprss_blacklist') ) {
$('').text( wprss_admin_custom.blacklist_desc )
.insertBefore( $('.tablenav.top') );
// Construct the bulk delete button
$('').addClass('button').attr('href', '#').text( wprss_admin_custom.blacklist_remove )
// Add it to the page
.appendTo( $('div.tablenav.top div.bulkactions') )
// Bind the click event
.click( function(e){
var ids = [];
$('table.wp-list-table tbody th.check-column').each( function(){
var checkbox = $(this).find('input[type="checkbox"]');
if ( checkbox.is(':checked') ) {
var idAttr = checkbox.attr('id');
var id = idAttr.split('-')[2];
ids.push( id );
}
});
var id_str = ids.join();
var blacklist_selected_url = wprss_admin_custom.blacklist_remove_url + id_str;
$(this).attr('href', blacklist_selected_url);
//e.preventDefault();
});
// Unlink the titles in the table
$('table.wp-list-table a.row-title').contents().unwrap();
}
});
})(jQuery, wprss_admin_custom);
// Utility string trim method, if it does not exist
if ( !String.prototype.trim ) {
String.prototype.trim = function(){
return this.replace(/^\s+|\s+$/g, '');
};
}
// For add-ons page
(function($) {
$(window).load(function(){
$('#add-ons .add-on-group').each(function(){
var $el = $(this),
h = 0;
$el.find('.add-on').each(function(){
h = Math.max( $(this).height(), h );
});
$el.find('.add-on').height( h );
});
});
})(jQuery);