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.

81 lines
2.5KB

  1. window.addEventListener('load', (event) => {
  2. SovNotification.init();
  3. SovWidgets.setDateRange();
  4. SovWidgets.setAutoCompleteField();
  5. /* Tooltip */
  6. $('[data-toggle="tooltip"]').tooltip();
  7. /* Select2 */
  8. if ($('.select2, select.form-control').length) {
  9. $('form .form-widget>select.form-control, .select2').each(function (i, elm) {
  10. if (!$(this).hasClass('disable-select2')) {
  11. SovWidgets.setSelect2($(elm));
  12. }
  13. });
  14. $('form select.form-control').each(function (i, elm) {
  15. if (!$(this).hasClass('disable-select2')) {
  16. SovWidgets.setSelect2($(elm));
  17. }
  18. });
  19. }
  20. $('.action-delete').on('click', function (e) {
  21. e.preventDefault();
  22. const formAction = $(this).attr('formaction');
  23. $('#modal-delete').modal({backdrop: true, keyboard: true})
  24. .off('click', '#modal-delete-button')
  25. .on('click', '#modal-delete-button', function () {
  26. let deleteForm = $('#delete-form');
  27. deleteForm.attr('action', formAction);
  28. deleteForm.submit();
  29. });
  30. });
  31. var elements = $('.lc-ckeditor');
  32. if (elements.length) {
  33. for (var i = 0; i < elements.length; ++i) {
  34. if ($(elements[i]).data('config') === 'simple_config') {
  35. CKEDITOR.replace(elements[i], {
  36. "toolbar": [
  37. {
  38. items: ['Bold', 'Italic', 'Underline', 'Strike']
  39. },
  40. {
  41. items: ["TextColor"]
  42. }
  43. ],
  44. "language": "fr",
  45. 'height': 100
  46. });
  47. } else {
  48. CKEDITOR.replace(elements[i], {
  49. "toolbar": [
  50. {
  51. name: "styles",
  52. items: ["Format", 'Bold', 'Italic', 'Underline', 'Strike', "Link", "BulletedList"]
  53. },
  54. {
  55. items: ["TextColor"]
  56. },
  57. {name: 'paragraph', items: ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock']},
  58. {name: 'insert', items: ['Image', 'SpecialChar']},
  59. {name: "document", items: ["Source"]},
  60. ],
  61. "language": "fr"
  62. });
  63. }
  64. }
  65. }
  66. });