Skip to content
base.js 717 B
Newer Older
import './jquery-importer';
import jQuery from 'jquery';
import * as bootstrap from 'bootstrap';

import select2 from 'select2';
import * as rlUtils from './rlUtils';
import * as bsUtils from './bsUtils';
Andreas Klöckner's avatar
Andreas Klöckner committed
import '../css/base.scss';
document.addEventListener('DOMContentLoaded', () => {
  // document.body is not available until the DOM is loaded.
  document.body.addEventListener('htmx:responseError', (evt) => {
    bsUtils.showToast(
      `HTMX request failed: ${evt.detail.xhr.status}:
      ${evt.detail.xhr.statusText}
      (${evt.detail.xhr.responseURL})`,
    );
  });
});

globalThis.rlUtils = rlUtils;
globalThis.bsUtils = bsUtils;
globalThis.bootstrap = bootstrap;