No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

87 líneas
2.7KB

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