-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathapplication.js
86 lines (77 loc) · 3.19 KB
/
application.js
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
79
80
81
82
83
84
85
86
/* eslint no-console:0 */
// This file is automatically compiled by Webpack, along with any other files
// present in this directory. You're encouraged to place your actual application logic in
// a relevant structure within app/javascript and only use these pack files to reference
// that code so it'll be compiled.
//
// To reference this file, add <%= javascript_pack_tag 'application' %> to the appropriate
// layout file, like app/views/layouts/application.html.slim
// JS
import 'jquery';
import 'jquery-ujs'
import * as bootstrap from 'bootstrap/dist/js/bootstrap.bundle';
import 'chosen-js/chosen.jquery';
import 'jstree';
import * as _ from 'underscore';
import * as d3 from 'd3';
import * as Sentry from '@sentry/browser';
import 'sorttable';
window.bootstrap = bootstrap; // Publish bootstrap in global namespace
window._ = _; // Publish underscore's `_` in global namespace
window.d3 = d3; // Publish d3 in global namespace
window.Sentry = Sentry; // Publish sentry in global namespace
window.SentryIntegrations = function() { // Publish sentry integration in global namespace
return [
Sentry.browserProfilingIntegration(),
Sentry.browserSessionIntegration(),
Sentry.browserTracingIntegration(),
Sentry.extraErrorDataIntegration(),
Sentry.httpClientIntegration(),
Sentry.replayIntegration(),
Sentry.reportingObserverIntegration(),
]
};
// CSS
import 'chosen-js/chosen.css';
import 'chosen-dark.scss';
import 'jstree/dist/themes/default/style.min.css';
import 'jstree/dist/themes/default-dark/style.min.css';
// custom jquery-ui library for minimal mouse interaction support
import 'jquery-ui/ui/widget'
import 'jquery-ui/ui/data'
import 'jquery-ui/ui/disable-selection'
import 'jquery-ui/ui/scroll-parent'
import 'jquery-ui/ui/widgets/draggable'
import 'jquery-ui/ui/widgets/droppable'
import 'jquery-ui/ui/widgets/resizable'
import 'jquery-ui/ui/widgets/selectable'
import 'jquery-ui/ui/widgets/sortable'
import 'jquery-ui/themes/base/draggable.css'
import 'jquery-ui/themes/base/core.css'
import 'jquery-ui/themes/base/resizable.css'
import 'jquery-ui/themes/base/selectable.css'
import 'jquery-ui/themes/base/sortable.css'
// I18n locales
import { I18n } from "i18n-js";
import locales from "./generated/locales.json";
// Fetch user locale from html#lang.
// This value is being set on `app/views/layouts/application.html.slim` and
// is inferred from `ACCEPT-LANGUAGE` header.
const userLocale = document.documentElement.lang;
export const i18n = new I18n();
i18n.store(locales);
i18n.defaultLocale = "en";
i18n.enableFallback = true;
i18n.locale = userLocale;
window.I18n = i18n;
// Routes
import * as Routes from 'generated/routes';
window.Routes = Routes;
// ACE editor
import ace from 'ace-builds';
import "ace-builds/webpack-resolver"; // Enable webpack resolver, requires `file-loader` to be installed
// Enable ACE editor extensions. See https://github.com/ajaxorg/ace/wiki/Extensions
import "ace-builds/src-noconflict/ext-language_tools"; // Enable autocompletion
import "ace-builds/src-noconflict/ext-modelist"; // Enable language mode detection
ace.config.set("useStrictCSP", true); // Enable strict CSP mode
window.ace = ace; // Publish ace in global namespace