$(function() {
    $.expr[':'].textEquals = $.expr.createPseudo(function(arg) {
        return function( elem ) {
            return $(elem).text().match("^" + arg + "$");
        };
    });

    $('#btn-toggle-unplayed').on('click', function(e) {
        e.preventDefault();

        $("#tbl-report").find("td.num_plays:textEquals('0')").closest('tr').toggle();
        return false;
    });

    $(".data-table").bootgrid({
        caseSensitive: false,
        formatters: {
            "length": function (column, row) {
                return row.length;
            }
        }
    });
});
