app.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. let 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. // Pages logic
  45. // ====================================
  46. //=include pages/edit.js
  47. });