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.

90 líneas
2.8KB

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