Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/clone/wp-inclu.../js/jquery
File: jquery.table-hotkeys.js
(function($){
[0] Fix | Delete
$.fn.filter_visible = function(depth) {
[1] Fix | Delete
depth = depth || 3;
[2] Fix | Delete
var is_visible = function() {
[3] Fix | Delete
var p = $(this), i;
[4] Fix | Delete
for(i=0; i<depth-1; ++i) {
[5] Fix | Delete
if (!p.is(':visible')) return false;
[6] Fix | Delete
p = p.parent();
[7] Fix | Delete
}
[8] Fix | Delete
return true;
[9] Fix | Delete
};
[10] Fix | Delete
return this.filter(is_visible);
[11] Fix | Delete
};
[12] Fix | Delete
$.table_hotkeys = function(table, keys, opts) {
[13] Fix | Delete
opts = $.extend($.table_hotkeys.defaults, opts);
[14] Fix | Delete
var selected_class, destructive_class, set_current_row, adjacent_row_callback, get_adjacent_row, adjacent_row, prev_row, next_row, check, get_first_row, get_last_row, make_key_callback, first_row;
[15] Fix | Delete
[16] Fix | Delete
selected_class = opts.class_prefix + opts.selected_suffix;
[17] Fix | Delete
destructive_class = opts.class_prefix + opts.destructive_suffix;
[18] Fix | Delete
set_current_row = function (tr) {
[19] Fix | Delete
if ($.table_hotkeys.current_row) $.table_hotkeys.current_row.removeClass(selected_class);
[20] Fix | Delete
tr.addClass(selected_class);
[21] Fix | Delete
tr[0].scrollIntoView(false);
[22] Fix | Delete
$.table_hotkeys.current_row = tr;
[23] Fix | Delete
};
[24] Fix | Delete
adjacent_row_callback = function(which) {
[25] Fix | Delete
if (!adjacent_row(which) && typeof opts[which+'_page_link_cb'] === 'function' ) {
[26] Fix | Delete
opts[which+'_page_link_cb']();
[27] Fix | Delete
}
[28] Fix | Delete
};
[29] Fix | Delete
get_adjacent_row = function(which) {
[30] Fix | Delete
var first_row, method;
[31] Fix | Delete
[32] Fix | Delete
if (!$.table_hotkeys.current_row) {
[33] Fix | Delete
first_row = get_first_row();
[34] Fix | Delete
$.table_hotkeys.current_row = first_row;
[35] Fix | Delete
return first_row[0];
[36] Fix | Delete
}
[37] Fix | Delete
method = 'prev' == which? $.fn.prevAll : $.fn.nextAll;
[38] Fix | Delete
return method.call($.table_hotkeys.current_row, opts.cycle_expr).filter_visible()[0];
[39] Fix | Delete
};
[40] Fix | Delete
adjacent_row = function(which) {
[41] Fix | Delete
var adj = get_adjacent_row(which);
[42] Fix | Delete
if (!adj) return false;
[43] Fix | Delete
set_current_row($(adj));
[44] Fix | Delete
return true;
[45] Fix | Delete
};
[46] Fix | Delete
prev_row = function() { return adjacent_row('prev'); };
[47] Fix | Delete
next_row = function() { return adjacent_row('next'); };
[48] Fix | Delete
check = function() {
[49] Fix | Delete
$(opts.checkbox_expr, $.table_hotkeys.current_row).each(function() {
[50] Fix | Delete
this.checked = !this.checked;
[51] Fix | Delete
});
[52] Fix | Delete
};
[53] Fix | Delete
get_first_row = function() {
[54] Fix | Delete
return $(opts.cycle_expr, table).filter_visible().eq(opts.start_row_index);
[55] Fix | Delete
};
[56] Fix | Delete
get_last_row = function() {
[57] Fix | Delete
var rows = $(opts.cycle_expr, table).filter_visible();
[58] Fix | Delete
return rows.eq(rows.length-1);
[59] Fix | Delete
};
[60] Fix | Delete
make_key_callback = function(expr) {
[61] Fix | Delete
return function() {
[62] Fix | Delete
if ( null == $.table_hotkeys.current_row ) return false;
[63] Fix | Delete
var clickable = $(expr, $.table_hotkeys.current_row);
[64] Fix | Delete
if (!clickable.length) return false;
[65] Fix | Delete
if (clickable.is('.'+destructive_class)) next_row() || prev_row();
[66] Fix | Delete
clickable.trigger( 'click' );
[67] Fix | Delete
};
[68] Fix | Delete
};
[69] Fix | Delete
first_row = get_first_row();
[70] Fix | Delete
if (!first_row.length) return;
[71] Fix | Delete
if (opts.highlight_first)
[72] Fix | Delete
set_current_row(first_row);
[73] Fix | Delete
else if (opts.highlight_last)
[74] Fix | Delete
set_current_row(get_last_row());
[75] Fix | Delete
$.hotkeys.add(opts.prev_key, opts.hotkeys_opts, function() {return adjacent_row_callback('prev');});
[76] Fix | Delete
$.hotkeys.add(opts.next_key, opts.hotkeys_opts, function() {return adjacent_row_callback('next');});
[77] Fix | Delete
$.hotkeys.add(opts.mark_key, opts.hotkeys_opts, check);
[78] Fix | Delete
$.each(keys, function() {
[79] Fix | Delete
var callback, key;
[80] Fix | Delete
[81] Fix | Delete
if ( typeof this[1] === 'function' ) {
[82] Fix | Delete
callback = this[1];
[83] Fix | Delete
key = this[0];
[84] Fix | Delete
$.hotkeys.add(key, opts.hotkeys_opts, function(event) { return callback(event, $.table_hotkeys.current_row); });
[85] Fix | Delete
} else {
[86] Fix | Delete
key = this;
[87] Fix | Delete
$.hotkeys.add(key, opts.hotkeys_opts, make_key_callback('.'+opts.class_prefix+key));
[88] Fix | Delete
}
[89] Fix | Delete
});
[90] Fix | Delete
[91] Fix | Delete
};
[92] Fix | Delete
$.table_hotkeys.current_row = null;
[93] Fix | Delete
$.table_hotkeys.defaults = {cycle_expr: 'tr', class_prefix: 'vim-', selected_suffix: 'current',
[94] Fix | Delete
destructive_suffix: 'destructive', hotkeys_opts: {disableInInput: true, type: 'keypress'},
[95] Fix | Delete
checkbox_expr: ':checkbox', next_key: 'j', prev_key: 'k', mark_key: 'x',
[96] Fix | Delete
start_row_index: 2, highlight_first: false, highlight_last: false, next_page_link_cb: false, prev_page_link_cb: false};
[97] Fix | Delete
})(jQuery);
[98] Fix | Delete
[99] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function