/**
 * CustomAstDB admin-side UI.
 * Status page only needs a client-side filter — the extension tab form
 * is plain HTML and the framework handles its submit through the regular
 * Extensions edit page save.
 */
$(document).ready(function () {
    var $input = $('#cad-filter');
    if (!$input.length) return;

    $input.on('input keyup', function () {
        var q = $.trim($(this).val()).toLowerCase();
        var $rows = $('#cad-table tbody tr');
        if (q === '') {
            $rows.show();
            return;
        }
        $rows.each(function () {
            var hay = ($(this).data('haystack') || '').toString();
            $(this).toggle(hay.indexOf(q) !== -1);
        });
    });
});
