<commit_before>(function($){
    var actionLabels = {
        "opened"   : "label-warning",
        "closed"   : "label-danger",
        "accepted" : "label-success"
    };

    $(document).ready(function(){
        if(!chrome){
            return;
        }

        var projects = config.getActiveProjects();

        // remove notification count when show popup
        // because) can not use both chrome.browserAction.onClicked and popup
        // https://developer.chrome.com/extensions/browserAction.html#event-onClicked
        chrome.browserAction.setBadgeText({text: ""});

        var current_time = new Date();
        var new_milli_seconds = config.getNewMarkMinute() * 60 * 1000;
        $.each(config.getNotifiedHistories(), function(index, project_event){
            var li = $("<li/>");

            if(current_time.getTime() - new_milli_seconds < (new Date(project_event.notified_at)).getTime()){
                li.addClass("new");
            }

            util.createEventIcon(project_event.target_type).appendTo(li);

            var project_url = config.getGitlabPath() + project_event.project_name;

            $("<span/>").text(" ").appendTo(li);
            $("<span/>").addClass("label").addClass(actionLabels[project_event.action_name]).text(project_event.action_name).appendTo(li);
            $("<span/>").text(" ").appendTo(li);
            $("<abbr/>").addClass("timeago").attr({title: project_event.notified_at}).appendTo(li);

            $("<span/>").text(" ").appendTo(li);
            $("<a/>").attr({href: project_url, target: "_blank"}).text("["+ project_event.project_name +"]").appendTo(li);
            // add 'remove' button, set id as project_event._id
            $("<span/>").addClass("pull-right glyphicon glyphicon-remove remove-btn")
                .attr({
                    'id'   : project_event._id,
                    'title': 'Remove this notification'
                }).appendTo(li);

            var message = project_event.message;
            if(!message){
                // for previous version cache
                if(project_event.target_type === "Commit"){
                    message = project_event.target_title;
                } else{
                    message = "#" + project_event.target_id + " " + project_event.target_title;
                }
            }
            $("<a/>").attr({href: project_event.target_url, target: "_blank"}).addClass("eventLink").text(message).appendTo(li);

            li.appendTo($("#notifyHistories"));
        });

        $("abbr.timeago").timeago();

        $("span.remove-btn").click(function(){
            config.removeNotifiedHistory(this.id);
            $(this).parent().remove();
        });

        $("button.clear").click(function(){
            config.clearCache();
            $("#notifyHistories").empty();
        });

        $("button.goto").click(function() {
            if (localStorage.gitlabPath) {
                window.open(localStorage.gitlabPath);
            }
        });
    });

})(jQuery);<commit_msg>Save _id in 'data-notification-id' attribute<commit_after>(function($){
    var actionLabels = {
        "opened"   : "label-warning",
        "closed"   : "label-danger",
        "accepted" : "label-success"
    };

    $(document).ready(function(){
        if(!chrome){
            return;
        }

        var projects = config.getActiveProjects();

        // remove notification count when show popup
        // because) can not use both chrome.browserAction.onClicked and popup
        // https://developer.chrome.com/extensions/browserAction.html#event-onClicked
        chrome.browserAction.setBadgeText({text: ""});

        var current_time = new Date();
        var new_milli_seconds = config.getNewMarkMinute() * 60 * 1000;
        $.each(config.getNotifiedHistories(), function(index, project_event){
            var li = $("<li/>");

            if(current_time.getTime() - new_milli_seconds < (new Date(project_event.notified_at)).getTime()){
                li.addClass("new");
            }

            util.createEventIcon(project_event.target_type).appendTo(li);

            var project_url = config.getGitlabPath() + project_event.project_name;

            $("<span/>").text(" ").appendTo(li);
            $("<span/>").addClass("label").addClass(actionLabels[project_event.action_name]).text(project_event.action_name).appendTo(li);
            $("<span/>").text(" ").appendTo(li);
            $("<abbr/>").addClass("timeago").attr({title: project_event.notified_at}).appendTo(li);

            $("<span/>").text(" ").appendTo(li);
            $("<a/>").attr({href: project_url, target: "_blank"}).text("["+ project_event.project_name +"]").appendTo(li);
            // add 'remove' button
            $("<span/>").addClass("remove-btn pull-right glyphicon glyphicon-remove")
                .attr({
                    'data-notification-id': project_event._id,
                    'title': 'Remove this notification'
                }).appendTo(li);

            var message = project_event.message;
            if(!message){
                // for previous version cache
                if(project_event.target_type === "Commit"){
                    message = project_event.target_title;
                } else{
                    message = "#" + project_event.target_id + " " + project_event.target_title;
                }
            }
            $("<a/>").attr({href: project_event.target_url, target: "_blank"}).addClass("eventLink").text(message).appendTo(li);

            li.appendTo($("#notifyHistories"));
        });

        $("abbr.timeago").timeago();

        $("span.remove-btn").click(function(){
            var $target = $(this);
            // remove with slide animation
            $target.parent().slideUp("fast", function(){
              $(this).remove();
            });
            config.removeNotifiedHistory($target.attr('data-notification-id'));
        });

        $("button.clear").click(function(){
            config.clearCache();
            $("#notifyHistories").empty();
        });

        $("button.goto").click(function() {
            if (localStorage.gitlabPath) {
                window.open(localStorage.gitlabPath);
            }
        });
    });

})(jQuery);
{'fraction_non_alphanumeric': 0.16640178003814368, 'fraction_numerical': 0.0019071837253655435, 'mean_word_length': 2.078767123287671, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 21, 'https://': 2, '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': '1143411', 'n_tokens_mistral': 1778, 'n_tokens_neox': 1687, 'n_words': 254}