You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.4 KiB

  1. 'use strict'
  2. /* global jQuery, _, io, Sticky, alertsData, Alerts */
  3. /* eslint-disable spaced-comment */
  4. jQuery(document).ready(function ($) {
  5. // ====================================
  6. // Scroll
  7. // ====================================
  8. $('a').smoothScroll({
  9. speed: 400,
  10. offset: -70
  11. })
  12. var sticky = new Sticky('.stickyscroll') // eslint-disable-line no-unused-vars
  13. // ====================================
  14. // Notifications
  15. // ====================================
  16. $(window).bind('beforeunload', () => {
  17. $('#notifload').addClass('active')
  18. })
  19. $(document).ajaxSend(() => {
  20. $('#notifload').addClass('active')
  21. }).ajaxComplete(() => {
  22. $('#notifload').removeClass('active')
  23. })
  24. var alerts = new Alerts()
  25. if (alertsData) {
  26. _.forEach(alertsData, (alertRow) => {
  27. alerts.push(alertRow)
  28. })
  29. }
  30. // ====================================
  31. // Establish WebSocket connection
  32. // ====================================
  33. var socket = io(window.location.origin) // eslint-disable-line no-unused-vars
  34. //=include components/search.js
  35. // ====================================
  36. // Pages logic
  37. // ====================================
  38. //=include pages/view.js
  39. //=include pages/create.js
  40. //=include pages/edit.js
  41. //=include pages/source.js
  42. //=include pages/admin.js
  43. })
  44. //=include helpers/form.js
  45. //=include helpers/pages.js
  46. //=include components/alerts.js
  47. /* eslint-enable spaced-comment */