main.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. // polyfills
  2. import '@babel/polyfill';
  3. import $ from 'jquery';
  4. import './utils/remodal';
  5. import 'simplebar';
  6. import GPM, { Instance as gpm } from './utils/gpm';
  7. import KeepAlive from './utils/keepalive';
  8. import Updates, { Instance as updates, Notifications, Feed } from './updates';
  9. import Dashboard from './dashboard';
  10. import Pages from './pages';
  11. import Forms from './forms';
  12. import Cookies from './utils/cookies';
  13. import './plugins';
  14. import './themes';
  15. import MediaFilter, { Instance as MediaFilterInstance} from './media';
  16. import toastr from './utils/toastr';
  17. import request from './utils/request';
  18. import './utils/2fa';
  19. import './tools';
  20. import './whitelabel';
  21. // bootstrap jQuery extensions
  22. import './utils/bootstrap-transition';
  23. import './utils/bootstrap-collapse';
  24. import './utils/bootstrap-dropdown';
  25. // tabs memory
  26. import './utils/tabs-memory';
  27. // changelog
  28. import './utils/changelog';
  29. // Main Sidebar
  30. import Sidebar, { Instance as sidebar } from './utils/sidebar';
  31. // starts the keep alive, auto runs every X seconds
  32. KeepAlive.start();
  33. // global event to catch sidebar_state changes
  34. $(global).on('sidebar_state._grav', () => {
  35. Object.keys(Dashboard.Chart.Instances).forEach((chart) => {
  36. setTimeout(() => Dashboard.Chart.Instances[chart].chart.update(), 10);
  37. });
  38. });
  39. export default {
  40. GPM: {
  41. GPM,
  42. Instance: gpm
  43. },
  44. KeepAlive,
  45. Dashboard,
  46. Pages,
  47. Forms,
  48. Updates: {
  49. Updates,
  50. Notifications,
  51. Feed,
  52. Instance: updates
  53. },
  54. Sidebar: {
  55. Sidebar,
  56. Instance: sidebar
  57. },
  58. MediaFilter: {
  59. MediaFilter,
  60. Instance: MediaFilterInstance
  61. },
  62. Scrollbar: { Scrollbar: { deprecated: true }, Instance: { deprecated: true } },
  63. Utils: { request, toastr, Cookies }
  64. };