2018-09-11 17:53:11 +02:00
|
|
|
import '../shared/polyfills';
|
2018-07-12 11:50:47 +02:00
|
|
|
import Turbolinks from 'turbolinks';
|
|
|
|
import Rails from 'rails-ujs';
|
2018-08-02 15:49:14 +02:00
|
|
|
import ActiveStorage from '../shared/activestorage/ujs';
|
2018-07-12 11:50:47 +02:00
|
|
|
import Chartkick from 'chartkick';
|
|
|
|
import Highcharts from 'highcharts';
|
2018-08-01 11:39:47 +02:00
|
|
|
import jQuery from 'jquery';
|
2018-07-12 11:50:47 +02:00
|
|
|
|
2018-08-09 16:45:56 +02:00
|
|
|
import '../shared/sentry';
|
2018-07-12 11:50:47 +02:00
|
|
|
import '../shared/rails-ujs-fix';
|
2018-08-31 12:56:56 +02:00
|
|
|
import '../shared/safari-11-file-xhr-workaround';
|
2018-08-22 15:06:19 +02:00
|
|
|
import '../shared/autocomplete';
|
2018-08-28 16:42:16 +02:00
|
|
|
import '../shared/remote-input';
|
2018-07-12 11:50:47 +02:00
|
|
|
|
2018-09-06 19:23:27 +02:00
|
|
|
import '../new_design/spinner';
|
2018-07-12 11:50:47 +02:00
|
|
|
import '../new_design/buttons';
|
|
|
|
import '../new_design/form-validation';
|
|
|
|
import '../new_design/carto';
|
2018-08-22 14:47:56 +02:00
|
|
|
import '../new_design/select2';
|
2018-07-12 11:50:47 +02:00
|
|
|
|
|
|
|
import '../new_design/champs/linked-drop-down-list';
|
|
|
|
|
|
|
|
import { toggleCondidentielExplanation } from '../new_design/avis';
|
|
|
|
import { togglePrintMenu } from '../new_design/dossier';
|
|
|
|
import { toggleHeaderMenu } from '../new_design/header';
|
|
|
|
import { scrollMessagerie } from '../new_design/messagerie';
|
|
|
|
import { showMotivation, motivationCancel } from '../new_design/state-button';
|
|
|
|
import { toggleChart } from '../new_design/toggle-chart';
|
|
|
|
|
|
|
|
// This is the global application namespace where we expose helpers used from rails views
|
|
|
|
const DS = {
|
|
|
|
toggleCondidentielExplanation,
|
|
|
|
togglePrintMenu,
|
|
|
|
toggleHeaderMenu,
|
|
|
|
scrollMessagerie,
|
|
|
|
showMotivation,
|
|
|
|
motivationCancel,
|
|
|
|
toggleChart
|
|
|
|
};
|
|
|
|
|
|
|
|
// 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.DS = window.DS || DS;
|
|
|
|
window.Chartkick = Chartkick;
|