<commit_before>{% extends 'style/bootstrap3/base_section.html' %}
{% load i18n %}
{% load hq_shared_tags %}

{% block js-inline %}{{ block.super }}
<script>
    var contactListTable = null;

    function FilterViewModel() {
        'use strict';
        var self = this;

        self.filterText = ko.observable();

        self.performFilter = function() {
            contactListTable.fnFilter(self.filterText());
        };

        self.clearFilter = function() {
            self.filterText("");
            self.performFilter();
        };
    }

    $(function(){
        contactListTable = $("#contact_list").dataTable({
            "aoColumnDefs": [
                {
                    "aTargets": [0],
                    "fnRender": function(obj) {
                        return '<a target="_blank" href="'+obj.aData[4]+'">'+obj.aData[0]+'</a>'+
                               '<span class="btn btn-primary pull-right" '+
                               'onClick="window.open(\''+obj.aData[5]+'\', \'_blank\', \'location=no,menubar=no,scrollbars=no,status=no,toolbar=no,height=400,width=400\');">'+
                               '{% trans "Chat" %} <i class="fa fa-share"></i></span>';
                    }
                }
            ],
            "bProcessing": true,
            "bServerSide": true,
            "bSort": false,
            "bFilter": true,
            "oLanguage": {
                "sLengthMenu": "{% trans "Show" %} _MENU_ {% trans "contacts per page" %}",
                "sProcessing": '<img src="{% new_static "hqwebapp/img/ajax-loader.gif" %}" alt="loading indicator" /> {% trans "Loading Contacts..." %}',
                "sInfo": "{% trans "Showing _START_ to _END_ of _TOTAL_ contacts" %}",
                "sInfoFiltered": "{% trans "(filtered from _MAX_ total contacts)" %}",
            },
            "sAjaxSource": "{% url "chat_contact_list" domain %}",
            "sDom": "lrtip",
            "useBootstrap3": true,
            "paginationType": "bs_normal"
        });
        var filterViewModel = new FilterViewModel();
        $('#id_filter').koApplyBindings(filterViewModel);
    });
</script><commit_msg>[ci skip] datatables 1.10 upgrade: fnRender -> render<commit_after>{% extends 'style/bootstrap3/base_section.html' %}
{% load i18n %}
{% load hq_shared_tags %}

{% block js-inline %}{{ block.super }}
<script>
    var contactListTable = null;

    function FilterViewModel() {
        'use strict';
        var self = this;

        self.filterText = ko.observable();

        self.performFilter = function() {
            contactListTable.fnFilter(self.filterText());
        };

        self.clearFilter = function() {
            self.filterText("");
            self.performFilter();
        };
    }

    $(function(){
        contactListTable = $("#contact_list").dataTable({
            "aoColumnDefs": [
                {
                    "aTargets": [0],
                    "render": function(data, type, row, meta) {
                        return '<a target="_blank" href="'+row[4]+'">'+row[0]+'</a>'+
                               '<span class="btn btn-primary pull-right" '+
                               'onClick="window.open(\''+row[5]+'\', \'_blank\', \'location=no,menubar=no,scrollbars=no,status=no,toolbar=no,height=400,width=400\');">'+
                               '{% trans "Chat" %} <i class="fa fa-share"></i></span>';
                    }
                }
            ],
            "bProcessing": true,
            "bServerSide": true,
            "bSort": false,
            "bFilter": true,
            "oLanguage": {
                "sLengthMenu": "{% trans "Show" %} _MENU_ {% trans "contacts per page" %}",
                "sProcessing": '<img src="{% new_static "hqwebapp/img/ajax-loader.gif" %}" alt="loading indicator" /> {% trans "Loading Contacts..." %}',
                "sInfo": "{% trans "Showing _START_ to _END_ of _TOTAL_ contacts" %}",
                "sInfoFiltered": "{% trans "(filtered from _MAX_ total contacts)" %}",
            },
            "sAjaxSource": "{% url "chat_contact_list" domain %}",
            "sDom": "lrtip",
            "useBootstrap3": true,
            "paginationType": "bs_normal"
        });
        var filterViewModel = new FilterViewModel();
        $('#id_filter').koApplyBindings(filterViewModel);
    });
</script>
{'fraction_non_alphanumeric': 0.17032967032967034, 'fraction_numerical': 0.007097069597069597, 'mean_word_length': 1.8296632124352332, 'pattern_counts': {'":': 32, '<': 21, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7582256', 'n_tokens_mistral': 1307, 'n_tokens_neox': 1227, 'n_words': 234}