Welcome to mirror list, hosted at ThFree Co, Russian Federation.

visitorLog.js « javascripts « Live « plugins - github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 102f46ff3ad19d534373a986e9c6cd44cd877eee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/**
 * Matomo - free/libre analytics platform
 *
 * Visitor profile popup control.
 *
 * @link https://matomo.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 */

(function ($, require) {

    var exports = require('piwik/UI'),
        DataTable = exports.DataTable,
        dataTablePrototype = DataTable.prototype;

    /**
     * DataTable UI class for jqPlot graph datatable visualizations.
     *
     * @constructor
     */
    exports.VisitorLog = function (element) {
        DataTable.call(this, element);
    };

    $.extend(exports.VisitorLog.prototype, dataTablePrototype, {

        handleColumnHighlighting: function () {

        },

        setFixWidthToMakeEllipsisWork: function () {

        },

        /**
         * Initializes this class.
         */
        init: function () {
            dataTablePrototype.init.call(this);

            var self = this;
            initializeVisitorActions(this.$element);

            // launch visitor profile on visitor profile link click
            this.$element.on('click', '.visitor-log-visitor-profile-link', function (e) {
                e.preventDefault();
                broadcast.propagateNewPopoverParameter('visitorProfile', $(this).attr('data-visitor-id'));
                return false;
            });

            this.$element.on('click', '.addSegmentToMatomo.dataTableAction', function (e) {
                e.preventDefault();
                e.stopPropagation();

                var url = window.location.href;
                url = broadcast.updateParamValue('addSegmentAsNew=' + decodeURIComponent(self.param.segment), url);
                url = broadcast.updateParamValue('popover=', url);
                // Show user the Visits Log so that they can easily refine their new segment if needed
                url = broadcast.updateParamValue('category=General_Visitors', url);
                url = broadcast.updateParamValue('subcategory=Live_VisitorLog', url);
                url = broadcast.updateParamValue('segment=' + self.param.segment, url);

                window.open(url, "_blank");
            });
        },

        _destroy: function () {
            try {
                this.$element.tooltip('destroy');
            } catch (e) {
                // ignore
            }

            dataTablePrototype._destroy.call(this);
        }
    });

})(jQuery, require);