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.

76 lines
1.7 KiB

  1. "use strict";
  2. jQuery( document ).ready(function( $ ) {
  3. // ====================================
  4. // Scroll
  5. // ====================================
  6. $('a').smoothScroll({
  7. speed: 400,
  8. offset: -20
  9. });
  10. var sticky = new Sticky('.stickyscroll');
  11. // ====================================
  12. // Notifications
  13. // ====================================
  14. $(window).bind('beforeunload', () => {
  15. $('#notifload').addClass('active');
  16. });
  17. $(document).ajaxSend(() => {
  18. $('#notifload').addClass('active');
  19. }).ajaxComplete(() => {
  20. $('#notifload').removeClass('active');
  21. });
  22. var alerts = new Alerts();
  23. if(alertsData) {
  24. _.forEach(alertsData, (alertRow) => {
  25. alerts.push(alertRow);
  26. });
  27. }
  28. // ====================================
  29. // Markdown Editor
  30. // ====================================
  31. if($('#mk-editor').length === 1) {
  32. var mde = new SimpleMDE({
  33. autofocus: true,
  34. autoDownloadFontAwesome: false,
  35. element: $("#mk-editor").get(0),
  36. hideIcons: ['heading', 'quote'],
  37. placeholder: 'Enter Markdown formatted content here...',
  38. showIcons: ['strikethrough', 'heading-1', 'heading-2', 'heading-3', 'code', 'table', 'horizontal-rule'],
  39. spellChecker: false,
  40. status: false
  41. });
  42. }
  43. // ====================================
  44. // Establish WebSocket connection
  45. // ====================================
  46. var socket = io(ioHost);
  47. //=include components/search.js
  48. // ====================================
  49. // Pages logic
  50. // ====================================
  51. //=include pages/view.js
  52. //=include pages/create.js
  53. //=include pages/edit.js
  54. //=include pages/source.js
  55. });
  56. //=include helpers/form.js
  57. //=include helpers/pages.js
  58. //=include components/alerts.js