<commit_before>var regexQuery = function (searchText) {
    return {$regex: searchText, $options: 'i'};
};
var doFilter = function(isFirst){
    var isStar;
    var text;

    if (isFirst) {
        isStar = AppProperties.diagrams.filters.isStar;
        text = AppProperties.diagrams.filters.text;

        $('#starredID').prop( "checked", isStar );
        $('#searchTextID').val(text);
    } else {
        isStar = $('#starredID').prop( "checked" );
        text = $('#searchTextID').val();

        // STORE VALUES
        AppProperties.diagrams.filters.isStar = isStar;
        AppProperties.diagrams.filters.text = text;
    }

    // CREATE QUERY
    var filters = {};
    if (isStar)
        filters.starredBy = Meteor.userId();
    if (text && text.length > 0)
        filters.title = regexQuery(text);

    console.log('query='+JSON.stringify(filters));

    // RUN
    DiagramPages.set({
        filters: filters
        ,sort: {title: 1}
    });
};
/*------------------------------------------------------------------------------------------------------------------------------*/
Template.seqDgmList.helpers({
});
/*------------------------------------------------------------------------------------------------------------------------------*/
Template.seqDgmList.created = function() {
};
/*------------------------------------------------------------------------------------------------------------------------------*/
Template.seqDgmList.destroyed = function() {
};
/*------------------------------------------------------------------------------------------------------------------------------*/
Template.seqDgmList.events({
    //'click input:radio[name=starredRadioName]': function(e){
    'click #starredID': function(e){
        doFilter(false);
    },
    'keyup #searchTextID': function(e) {
        e.preventDefault();
        doFilter(false);
    }
});
/*------------------------------------------------------------------------------------------------------------------------------*/
Template.seqDgmList.rendered = function() {
    doFilter(true);
    $('#searchTextID').focus();
};
/*------------------------------------------------------------------------------------------------------------------------------*/<commit_msg>filter<commit_after>var regexQuery = function (searchText) {
    return {$regex: searchText, $options: 'i'};
};
var doFilter = function(){
    var isStar = $('#starredID').prop( "checked" );
    var text = $('#searchTextID').val();

    // STORE VALUES
    AppProperties.diagrams.filters.isStar = isStar;
    AppProperties.diagrams.filters.text = text;

    // CREATE QUERY
    var filters = {};
    if (isStar)
        filters.starredBy = Meteor.userId();
    if (text && text.length > 0)
        filters.title = regexQuery(text);

    console.log('query='+JSON.stringify(filters));

    // RUN
    DiagramPages.set({
        filters: filters
        ,sort: {title: 1}
    });
};
/*------------------------------------------------------------------------------------------------------------------------------*/
Template.seqDgmList.helpers({
});
/*------------------------------------------------------------------------------------------------------------------------------*/
Template.seqDgmList.created = function() {
};
/*------------------------------------------------------------------------------------------------------------------------------*/
Template.seqDgmList.destroyed = function() {
};
/*------------------------------------------------------------------------------------------------------------------------------*/
Template.seqDgmList.events({
    //'click input:radio[name=starredRadioName]': function(e){
    'click #starredID': function(e){
        doFilter();
    },
    'keyup #searchTextID': function(e) {
        e.preventDefault();
        doFilter();
    }
});
/*------------------------------------------------------------------------------------------------------------------------------*/
Template.seqDgmList.rendered = function() {
    //INIT
    $('#starredID').prop( "checked", AppProperties.diagrams.filters.isStar );
    $('#searchTextID').val(AppProperties.diagrams.filters.text);

    doFilter();

    $('#searchTextID').focus();
};
/*------------------------------------------------------------------------------------------------------------------------------*/
{'fraction_non_alphanumeric': 0.46747874051942084, 'fraction_numerical': 0.0009193288899103654, 'mean_word_length': 0.9402585822559073, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4553050', 'n_tokens_mistral': 965, 'n_tokens_neox': 928, 'n_words': 156}