2018-07-12 11:50:47 +02:00
|
|
|
import Turbolinks from 'turbolinks';
|
|
|
|
import Rails from 'rails-ujs';
|
|
|
|
import * as ActiveStorage from 'activestorage';
|
|
|
|
import Chartkick from 'chartkick';
|
|
|
|
import Highcharts from 'highcharts';
|
|
|
|
import Bloodhound from 'bloodhound-js';
|
|
|
|
import jQuery from 'jquery';
|
|
|
|
|
2018-08-06 15:49:12 +02:00
|
|
|
// Include runtime-polyfills for older browsers.
|
|
|
|
// Due to .babelrc's 'useBuiltIns', only polyfills actually
|
|
|
|
// required by the browsers we support will be included.
|
|
|
|
import 'babel-polyfill';
|
|
|
|
|
2018-07-12 11:50:47 +02:00
|
|
|
import 'typeahead.js';
|
|
|
|
|
|
|
|
import '../shared/rails-ujs-fix';
|
|
|
|
import '../shared/direct-uploads';
|
|
|
|
|
|
|
|
// Start Rails helpers
|
|
|
|
Chartkick.addAdapter(Highcharts);
|
|
|
|
Rails.start();
|
|
|
|
Turbolinks.start();
|
|
|
|
ActiveStorage.start();
|
|
|
|
|
2018-08-01 11:39:47 +02:00
|
|
|
// Disable jQuery-driven animations during tests
|
|
|
|
if (process.env['RAILS_ENV'] === 'test') {
|
|
|
|
jQuery.fx.off = true;
|
|
|
|
}
|
|
|
|
|
2018-07-12 11:50:47 +02:00
|
|
|
// Expose globals
|
|
|
|
window.Bloodhound = Bloodhound;
|
|
|
|
window.Chartkick = Chartkick;
|
2018-08-01 11:39:47 +02:00
|
|
|
// Export jQuery globally for legacy Javascript files used in the old design
|
2018-07-12 11:50:47 +02:00
|
|
|
window.$ = jQuery;
|
|
|
|
window.jQuery = jQuery;
|