All Downloads are FREE. Search and download functionalities are using the official Maven repository.

js.flamer-filter-threads.js Maven / Gradle / Ivy

There is a newer version: 0.23
Show newest version
(function($, doc, wnd) {    
    
    function text(t) {
        return doc.createTextNode(t);
    }
    
    function createThreadFilterHandler(flameModel) {

        var suppressUpdate = false;
        var updater = function(){};
        var panel$ = null;

        function updateFilter() {            
            var nfilter = [];
            panel$.find("p input").each(function() {
                var info = $(this).data("thread");
                if ($(this).prop("checked")) {
                    nfilter.push(info.name);
                }                
            });
            debug("update thread filter: " + nfilter);
            if ("" + nfilter != "" + flameModel.filters.threads) {
                flameModel.filters.threads = nfilter;
                if (flameModel.update) {
                    flameModel.update();
                }
            }          
            updater(); // notify visuals            
        }
        
        function makePanel(histo) {
            function up() {
                updateFilter(panel$);
            }
            var box = $("
"); for(var x in histo) { if (histo[x].count > 0) { box.append( createStateItem(histo[x], up)); } } box.appendTo(panel$); makeToolbar(); } function updateVisibility() { var filter = panel$.find(".search input").prop("value"); debug("filter threads: " + filter); var vcnt = 0; panel$.find("p").each(function() { var p = $(this); p.find("input").each(function() { var info = $(this).data("thread"); if (filter.length == 0 || info.name.indexOf(filter) >= 0) { vcnt++; p.show(); } else { p.hide(); } }); }); if (vcnt == 0) { panel$.find("p.empty").show(); } else { panel$.find("p.empty").hide(); } } function all() { suppressUpdate = true; panel$.find("p>input").each(function() { if ($(this).is(":visible")) { this.checked = true; } }); suppressUpdate = false; updateFilter(); } function none() { suppressUpdate = true; panel$.find("p>input").each(function() { if ($(this).is(":visible")) { this.checked = false; } }); suppressUpdate = false; updateFilter(); } function only() { suppressUpdate = true; panel$.find("p>input").each(function() { this.checked = $(this).is(":visible"); }); suppressUpdate = false; updateFilter(); } function makeToolbar() { var div = $("




© 2015 - 2024 Weber Informatics LLC | Privacy Policy