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.

62 lines
2.1 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. (function($) {
  2. 'use strict';
  3. $(function() {
  4. $('.file-upload-browse').on('click', function() {
  5. var file = $(this).parent().parent().parent().find('.file-upload-default');
  6. file.trigger('click');
  7. });
  8. $('.file-upload-default').on('change', function() {
  9. $(this).parent().find('.form-control').val($(this).val().replace(/C:\\fakepath\\/i, ''));
  10. });
  11. });
  12. $(document).ready(function() {
  13. $(".select2").select2();
  14. $('#inlinedatetimepicker').datetimepicker({
  15. inline: true,
  16. sideBySide: true
  17. });
  18. $('#datepicker').datetimepicker({
  19. format: 'L'
  20. });
  21. $('#timepicker').datetimepicker({
  22. format: 'LT'
  23. });
  24. $('#tags').tagsinput('items');
  25. $('.repeater').repeater({
  26. // (Optional)
  27. // "defaultValues" sets the values of added items. The keys of
  28. // defaultValues refer to the value of the input's name attribute.
  29. // If a default value is not specified for an input, then it will
  30. // have its value cleared.
  31. defaultValues: {
  32. 'text-input': 'foo'
  33. },
  34. // (Optional)
  35. // "show" is called just after an item is added. The item is hidden
  36. // at this point. If a show callback is not given the item will
  37. // have $(this).show() called on it.
  38. show: function() {
  39. $(this).slideDown();
  40. },
  41. // (Optional)
  42. // "hide" is called when a user clicks on a data-repeater-delete
  43. // element. The item is still visible. "hide" is passed a function
  44. // as its first argument which will properly remove the item.
  45. // "hide" allows for a confirmation step, to send a delete request
  46. // to the server, etc. If a hide callback is not given the item
  47. // will be deleted.
  48. hide: function(deleteElement) {
  49. if (confirm('Are you sure you want to delete this element?')) {
  50. $(this).slideUp(deleteElement);
  51. }
  52. },
  53. // (Optional)
  54. // Removes the delete button from the first list item,
  55. // defaults to false.
  56. isFirstItemUndeletable: true
  57. });
  58. $('.html-editor').summernote({
  59. height: 300,
  60. tabsize: 2
  61. });
  62. })
  63. })(jQuery);