main.js 1.9 KB

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