aboutsummaryrefslogtreecommitdiffstats
path: root/interface/js/main.js
blob: 5ed33137d784396c21ad60d93608ec090e7c5819 (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
/* global d3:true, require:false, requirejs:false */ // eslint-disable-line no-unused-vars

requirejs.config({
    baseUrl: "js/lib",
    paths: {
        app: "../app",
        jquery: "jquery-3.3.1.min",
        visibility: "visibility.min",
        humanize: "humanize.min",
        bootstrap: "bootstrap.min",
        d3: "d3.min",
        d3evolution: "d3evolution.min",
        d3pie: "d3pie.min",
        footable: "footable.min",
        nprogress: "nprogress.min",
    },
    shim: {
        bootstrap: {exports: "bootstrap", deps: ["jquery"]},
        d3pie: {exports: "d3pie", deps: ["d3.global", "jquery"]},
        d3evolution: {exports: "D3Evolution", deps: ["d3", "jquery"]},
        footable: {deps: ["bootstrap", "jquery"]}
    }
});

document.title = window.location.hostname +
    (window.location.port ? ":" + window.location.port : "") +
    (window.location.pathname !== "/" ? window.location.pathname : "") +
    " - Rspamd Web Interface";

// Ugly hack to get d3pie work with requirejs
define("d3.global", ["d3"], function (d3global) { // eslint-disable-line strict
    d3 = d3global;
});

// Load main UI
require(["app/rspamd"],
    function (rspamd) {
        "use strict";
        rspamd.setup();
        rspamd.connect();
    }
);