|
|
@ -3,52 +3,56 @@
|
|
|
|
$form = !empty($form) ? $form : '';
|
|
|
|
$form = !empty($form) ? $form : '';
|
|
|
|
@endphp
|
|
|
|
@endphp
|
|
|
|
|
|
|
|
|
|
|
|
<!-- reCaptcha -->
|
|
|
|
<!-- reCaptcha -->
|
|
|
|
<script src="//www.google.com/recaptcha/api.js?v={{$asset_version}}" async defer></script>
|
|
|
|
<script src="//www.google.com/recaptcha/api.js?v={{ $asset_version }}" async defer></script>
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
<script type="text/javascript">
|
|
|
|
if (typeof jQuery == 'undefined') {
|
|
|
|
if (typeof jQuery == 'undefined') {
|
|
|
|
document.write('<script src="//code.jquery.com/jquery-3.4.1.min.js?v={{$asset_version}}"></' + 'script>');
|
|
|
|
document.write('<script src="//code.jquery.com/jquery-3.4.1.min.js?v={{ $asset_version }}"></' + 'script>');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Bootstrap Js -->
|
|
|
|
<!-- Bootstrap Js -->
|
|
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js?v={{$asset_version}}"></script>
|
|
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js?v={{ $asset_version }}"></script>
|
|
|
|
|
|
|
|
|
|
|
|
<script src="//stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js?v={{$asset_version}}"></script>
|
|
|
|
<script src="//stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js?v={{ $asset_version }}"></script>
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript" src="//cdn.jsdelivr.net/npm/moment@2.24.0/moment.min.js?v={{$asset_version}}"></script>
|
|
|
|
<script type="text/javascript" src="//cdn.jsdelivr.net/npm/moment@2.24.0/moment.min.js?v={{ $asset_version }}"></script>
|
|
|
|
<script src="//cdn.jsdelivr.net/npm/toastr@2.1.4/build/toastr.min.js?v={{$asset_version}}"></script>
|
|
|
|
<script src="//cdn.jsdelivr.net/npm/toastr@2.1.4/build/toastr.min.js?v={{ $asset_version }}"></script>
|
|
|
|
<script src="//cdn.jsdelivr.net/npm/jquery-validation@1.17.0/dist/jquery.validate.min.js?v={{$asset_version}}"></script>
|
|
|
|
<script src="//cdn.jsdelivr.net/npm/jquery-validation@1.17.0/dist/jquery.validate.min.js?v={{ $asset_version }}">
|
|
|
|
|
|
|
|
</script>
|
|
|
|
<script type="text/javascript"
|
|
|
|
<script type="text/javascript"
|
|
|
|
src="//cdnjs.cloudflare.com/ajax/libs/rangeslider.js/2.3.2/rangeslider.min.js?v={{$asset_version}}"></script>
|
|
|
|
src="//cdnjs.cloudflare.com/ajax/libs/rangeslider.js/2.3.2/rangeslider.min.js?v={{ $asset_version }}"></script>
|
|
|
|
<script type="text/javascript"
|
|
|
|
<script type="text/javascript"
|
|
|
|
src="//cdnjs.cloudflare.com/ajax/libs/tempusdominus-bootstrap-4/5.1.2/js/tempusdominus-bootstrap-4.min.js?v={{$asset_version}}"></script>
|
|
|
|
src="//cdnjs.cloudflare.com/ajax/libs/tempusdominus-bootstrap-4/5.1.2/js/tempusdominus-bootstrap-4.min.js?v={{ $asset_version }}">
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript"
|
|
|
|
<script type="text/javascript"
|
|
|
|
src="//cdnjs.cloudflare.com/ajax/libs/dropzone/5.5.1/min/dropzone.min.js?v={{$asset_version}}"></script>
|
|
|
|
src="//cdnjs.cloudflare.com/ajax/libs/dropzone/5.5.1/min/dropzone.min.js?v={{ $asset_version }}"></script>
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript"
|
|
|
|
<script type="text/javascript"
|
|
|
|
src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.13.10/js/bootstrap-select.min.js?v={{$asset_version}}"></script>
|
|
|
|
src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.13.10/js/bootstrap-select.min.js?v={{ $asset_version }}">
|
|
|
|
|
|
|
|
</script>
|
|
|
|
<script type="text/javascript"
|
|
|
|
<script type="text/javascript"
|
|
|
|
src="//cdnjs.cloudflare.com/ajax/libs/summernote/0.8.12/summernote-bs4.min.js?v={{$asset_version}}"></script>
|
|
|
|
src="//cdnjs.cloudflare.com/ajax/libs/summernote/0.8.12/summernote-bs4.min.js?v={{ $asset_version }}"></script>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Boostrap star rating -->
|
|
|
|
<!-- Boostrap star rating -->
|
|
|
|
<script
|
|
|
|
<script
|
|
|
|
src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-star-rating/4.0.6/js/star-rating.min.js?v={{$asset_version}}"
|
|
|
|
src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-star-rating/4.0.6/js/star-rating.min.js?v={{ $asset_version }}"
|
|
|
|
type="text/javascript"></script>
|
|
|
|
type="text/javascript"></script>
|
|
|
|
<!-- if you need to use a theme, then include the theme Js file -->
|
|
|
|
<!-- if you need to use a theme, then include the theme Js file -->
|
|
|
|
<script
|
|
|
|
<script
|
|
|
|
src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-star-rating/4.0.6/themes/krajee-svg/theme.js?v={{$asset_version}}"></script>
|
|
|
|
src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-star-rating/4.0.6/themes/krajee-svg/theme.js?v={{ $asset_version }}">
|
|
|
|
|
|
|
|
</script>
|
|
|
|
<!-- optionally if you need translation for your language then include locale file as mentioned below -->
|
|
|
|
<!-- optionally if you need translation for your language then include locale file as mentioned below -->
|
|
|
|
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-star-rating/4.0.6/js/locales/<lang>.js"></script> -->
|
|
|
|
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-star-rating/4.0.6/js/locales/<lang>.js"></script> -->
|
|
|
|
<!-- signature pad (https://github.com/szimek/signature_pad)-->
|
|
|
|
<!-- signature pad (https://github.com/szimek/signature_pad)-->
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/signature_pad@2.3.2/dist/signature_pad.min.js?v={{$asset_version}}"></script>
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/signature_pad@2.3.2/dist/signature_pad.min.js?v={{ $asset_version }}">
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<script src="{{asset('/plugins/countdowntimer/countdowntimer.min.js').'?v='.$asset_version}}"></script>
|
|
|
|
<script src="{{ asset('/plugins/countdowntimer/countdowntimer.min.js') . '?v=' . $asset_version }}"></script>
|
|
|
|
|
|
|
|
|
|
|
|
@if(!$is_download)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@if (!$is_download)
|
|
|
|
<!-- app js values -->
|
|
|
|
<!-- app js values -->
|
|
|
|
<script type="application/javascript">
|
|
|
|
<script type="application/javascript">
|
|
|
|
var APP = {};
|
|
|
|
var APP = {};
|
|
|
@ -91,33 +95,35 @@
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<script
|
|
|
|
<script
|
|
|
|
src="//cdn.jsdelivr.net/npm/jquery-validation-unobtrusive@3.2.10/dist/jquery.validate.unobtrusive.min.js?v={{$asset_version}}"></script>
|
|
|
|
src="//cdn.jsdelivr.net/npm/jquery-validation-unobtrusive@3.2.10/dist/jquery.validate.unobtrusive.min.js?v={{ $asset_version }}">
|
|
|
|
<script src="//cdn.jsdelivr.net/npm/sweetalert2@11?v={{$asset_version}}"></script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<script src="//cdn.jsdelivr.net/npm/sweetalert2@11?v={{ $asset_version }}"></script>
|
|
|
|
|
|
|
|
{{-- <script src="/js/sweetalert2.all.js"></script> --}}
|
|
|
|
<script type="text/javascript"
|
|
|
|
<script type="text/javascript"
|
|
|
|
src="//cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/pdfmake.min.js?v={{$asset_version}}"></script>
|
|
|
|
src="//cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/pdfmake.min.js?v={{ $asset_version }}"></script>
|
|
|
|
<script type="text/javascript"
|
|
|
|
<script type="text/javascript"
|
|
|
|
src="//cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/vfs_fonts.js?v={{$asset_version}}"></script>
|
|
|
|
src="//cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/vfs_fonts.js?v={{ $asset_version }}"></script>
|
|
|
|
<script type="text/javascript"
|
|
|
|
<script type="text/javascript"
|
|
|
|
src="//cdn.datatables.net/v/bs4/jszip-2.5.0/dt-1.10.18/b-1.5.6/b-colvis-1.5.6/b-flash-1.5.6/b-html5-1.5.6/b-print-1.5.6/fc-3.3.1/fh-3.1.4/datatables.min.js?v={{$asset_version}}"></script>
|
|
|
|
src="//cdn.datatables.net/v/bs4/jszip-2.5.0/dt-1.10.18/b-1.5.6/b-colvis-1.5.6/b-flash-1.5.6/b-html5-1.5.6/b-print-1.5.6/fc-3.3.1/fh-3.1.4/datatables.min.js?v={{ $asset_version }}">
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ladda.js -->
|
|
|
|
<!-- ladda.js -->
|
|
|
|
<script type="text/javascript"
|
|
|
|
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/Ladda/1.0.6/spin.min.js?v={{ $asset_version }}">
|
|
|
|
src="//cdnjs.cloudflare.com/ajax/libs/Ladda/1.0.6/spin.min.js?v={{$asset_version}}"></script>
|
|
|
|
</script>
|
|
|
|
<script type="text/javascript"
|
|
|
|
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/Ladda/1.0.6/ladda.min.js?v={{ $asset_version }}">
|
|
|
|
src="//cdnjs.cloudflare.com/ajax/libs/Ladda/1.0.6/ladda.min.js?v={{$asset_version}}"></script>
|
|
|
|
</script>
|
|
|
|
<!-- localization -->
|
|
|
|
<!-- localization -->
|
|
|
|
<script src="{{ url('/js/lang.js') . '?v=' . $asset_version }}"></script>
|
|
|
|
<script src="{{ url('/js/lang.js') . '?v=' . $asset_version }}"></script>
|
|
|
|
<script src="{{ asset(mix('js/app.js')) }}" defer></script>
|
|
|
|
<script src="{{ asset(mix('js/app.js')) }}" defer></script>
|
|
|
|
<!-- intro.js -->
|
|
|
|
<!-- intro.js -->
|
|
|
|
<script type="text/javascript"
|
|
|
|
<script type="text/javascript"
|
|
|
|
src="https://cdnjs.cloudflare.com/ajax/libs/intro.js/2.9.3/intro.min.js?v={{$asset_version}}"></script>
|
|
|
|
src="https://cdnjs.cloudflare.com/ajax/libs/intro.js/2.9.3/intro.min.js?v={{ $asset_version }}"></script>
|
|
|
|
<script src="{{ asset('js/iframeResizercontentWindow.js') }}"></script>
|
|
|
|
<script src="{{ asset('js/iframeResizercontentWindow.js') }}"></script>
|
|
|
|
@endif
|
|
|
|
@endif
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
|
|
|
|
|
|
|
jQuery.validator.setDefaults({
|
|
|
|
jQuery.validator.setDefaults({
|
|
|
|
errorPlacement: function (error, element) {
|
|
|
|
errorPlacement: function(error, element) {
|
|
|
|
if (element.hasClass('select2') && element.parent().hasClass('input-group')) {
|
|
|
|
if (element.hasClass('select2') && element.parent().hasClass('input-group')) {
|
|
|
|
error.insertAfter(element.parent());
|
|
|
|
error.insertAfter(element.parent());
|
|
|
|
} else if (element.hasClass('select2')) {
|
|
|
|
} else if (element.hasClass('select2')) {
|
|
|
@ -140,57 +146,61 @@
|
|
|
|
error.insertAfter(element);
|
|
|
|
error.insertAfter(element);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
invalidHandler: function () {
|
|
|
|
invalidHandler: function() {
|
|
|
|
toastr.error("{{ __('messages.some_error_in_input_field') }}");
|
|
|
|
toastr.error("{{ __('messages.some_error_in_input_field') }}");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
$(document).ready(function () {
|
|
|
|
$(document).ready(function() {
|
|
|
|
@if(!$is_download)
|
|
|
|
@if (!$is_download)
|
|
|
|
jQuery.extend($.fn.dataTable.defaults, {
|
|
|
|
jQuery.extend($.fn.dataTable.defaults, {
|
|
|
|
fixedHeader: false,
|
|
|
|
fixedHeader: false,
|
|
|
|
aLengthMenu: [
|
|
|
|
aLengthMenu: [
|
|
|
|
[25, 50, 100, 200, 500, 1000, -1], [25, 50, 100, 200, 500, 1000, "{{__('messages.all')}}"]
|
|
|
|
[25, 50, 100, 200, 500, 1000, -1],
|
|
|
|
|
|
|
|
[25, 50, 100, 200, 500, 1000, "{{ __('messages.all') }}"]
|
|
|
|
],
|
|
|
|
],
|
|
|
|
iDisplayLength: 25,
|
|
|
|
iDisplayLength: 25,
|
|
|
|
dom: 'lfrtip',
|
|
|
|
dom: 'lfrtip',
|
|
|
|
"language": {
|
|
|
|
"language": {
|
|
|
|
"emptyTable": "{{__('messages.emptyTable')}}",
|
|
|
|
"emptyTable": "{{ __('messages.emptyTable') }}",
|
|
|
|
"info": "{{__('messages.dt_info')}}",
|
|
|
|
"info": "{{ __('messages.dt_info') }}",
|
|
|
|
"infoEmpty": "{{__('messages.infoEmpty')}}",
|
|
|
|
"infoEmpty": "{{ __('messages.infoEmpty') }}",
|
|
|
|
"infoFiltered": "{{__('messages.infoFiltered')}}",
|
|
|
|
"infoFiltered": "{{ __('messages.infoFiltered') }}",
|
|
|
|
"lengthMenu": "{{__('messages.lengthMenu')}}",
|
|
|
|
"lengthMenu": "{{ __('messages.lengthMenu') }}",
|
|
|
|
"loadingRecords": "{{__('messages.loadingRecords')}}",
|
|
|
|
"loadingRecords": "{{ __('messages.loadingRecords') }}",
|
|
|
|
"processing": "{{__('messages.processing')}}",
|
|
|
|
"processing": "{{ __('messages.processing') }}",
|
|
|
|
"search": "{{__('messages.search')}}",
|
|
|
|
"search": "{{ __('messages.search') }}",
|
|
|
|
"zeroRecords": "{{__('messages.zeroRecords')}}",
|
|
|
|
"zeroRecords": "{{ __('messages.zeroRecords') }}",
|
|
|
|
"paginate": {
|
|
|
|
"paginate": {
|
|
|
|
"first": "{{__('messages.first')}}",
|
|
|
|
"first": "{{ __('messages.first') }}",
|
|
|
|
"last": "{{__('messages.last')}}",
|
|
|
|
"last": "{{ __('messages.last') }}",
|
|
|
|
"next": "{{__('messages.next')}}",
|
|
|
|
"next": "{{ __('messages.next') }}",
|
|
|
|
"previous": "{{__('messages.previous')}}"
|
|
|
|
"previous": "{{ __('messages.previous') }}"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
buttons: {
|
|
|
|
buttons: {
|
|
|
|
copyTitle: "{{__('messages.copy_to_clipboard')}}",
|
|
|
|
copyTitle: "{{ __('messages.copy_to_clipboard') }}",
|
|
|
|
copySuccess: {
|
|
|
|
copySuccess: {
|
|
|
|
_: "{{__('messages.copied_n_rows_to_clipboard')}}"
|
|
|
|
_: "{{ __('messages.copied_n_rows_to_clipboard') }}"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
$.ajaxSetup({
|
|
|
|
$.ajaxSetup({
|
|
|
|
headers: {'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')}
|
|
|
|
headers: {
|
|
|
|
|
|
|
|
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
@endif
|
|
|
|
@endif
|
|
|
|
|
|
|
|
|
|
|
|
$('button[type=reset]').on('click', function () {
|
|
|
|
$('button[type=reset]').on('click', function() {
|
|
|
|
$(this).parents('form').find('input').val('');
|
|
|
|
$(this).parents('form').find('input').val('');
|
|
|
|
window.location.href = $(this).parents('form').attr('action');
|
|
|
|
window.location.href = $(this).parents('form').attr('action');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
function initialize_datetimepicker(element_name, element_date, start_date, end_date, date_format, time_format, disabled_days, enable_time_picker, time_picker_inline) {
|
|
|
|
function initialize_datetimepicker(element_name, element_date, start_date, end_date, date_format, time_format,
|
|
|
|
|
|
|
|
disabled_days, enable_time_picker, time_picker_inline) {
|
|
|
|
var start = null;
|
|
|
|
var start = null;
|
|
|
|
var end = null;
|
|
|
|
var end = null;
|
|
|
|
var format = '';
|
|
|
|
var format = '';
|
|
|
@ -254,10 +264,9 @@
|
|
|
|
$('#' + element_name).rangeslider({
|
|
|
|
$('#' + element_name).rangeslider({
|
|
|
|
polyfill: false,
|
|
|
|
polyfill: false,
|
|
|
|
//Callback function
|
|
|
|
//Callback function
|
|
|
|
onInit: function () {
|
|
|
|
onInit: function() {},
|
|
|
|
},
|
|
|
|
|
|
|
|
// Callback function
|
|
|
|
// Callback function
|
|
|
|
onSlide: function (position, value) {
|
|
|
|
onSlide: function(position, value) {
|
|
|
|
$('.' + element_name).text(value);
|
|
|
|
$('.' + element_name).text(value);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -265,12 +274,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
Dropzone.autoDiscover = false;
|
|
|
|
Dropzone.autoDiscover = false;
|
|
|
|
|
|
|
|
|
|
|
|
function initialize_dropzone(element_name, file_upload_msg, no_of_files_can_be_uploaded, max_file_size, allowed_file_type, url = null) {
|
|
|
|
function initialize_dropzone(element_name, file_upload_msg, no_of_files_can_be_uploaded, max_file_size,
|
|
|
|
|
|
|
|
allowed_file_type, url = null) {
|
|
|
|
|
|
|
|
|
|
|
|
var file_remove_url = "library/delete_file.php";
|
|
|
|
var file_remove_url = "library/delete_file.php";
|
|
|
|
if (url == null) {
|
|
|
|
if (url == null) {
|
|
|
|
url = "{{ url('/file-upload')}}";
|
|
|
|
url = "{{ url('/file-upload') }}";
|
|
|
|
file_remove_url = "{{ url('/file-delete')}}";
|
|
|
|
file_remove_url = "{{ url('/file-delete') }}";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var file_names = [];
|
|
|
|
var file_names = [];
|
|
|
@ -286,27 +296,37 @@
|
|
|
|
maxFilesize: max_file_size,
|
|
|
|
maxFilesize: max_file_size,
|
|
|
|
dictDefaultMessage: file_upload_msg,
|
|
|
|
dictDefaultMessage: file_upload_msg,
|
|
|
|
maxFiles: no_of_files_can_be_uploaded,
|
|
|
|
maxFiles: no_of_files_can_be_uploaded,
|
|
|
|
|
|
|
|
capture: allowed_file_type == 'image/*' ? 'image/*' : null,
|
|
|
|
headers: {
|
|
|
|
headers: {
|
|
|
|
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
|
|
|
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
|
|
|
},
|
|
|
|
},
|
|
|
|
acceptedFiles: allowed_file_type,
|
|
|
|
acceptedFiles: allowed_file_type,
|
|
|
|
init: function () {
|
|
|
|
init: function() {
|
|
|
|
//function to be use on editing a form, to display existing files
|
|
|
|
//function to be use on editing a form, to display existing files
|
|
|
|
if ($('input#' + element_name).val().length > 0) {
|
|
|
|
if ($('input#' + element_name).val().length > 0) {
|
|
|
|
window[`${element_name}_myDropzone`] = this;
|
|
|
|
window[`${element_name}_myDropzone`] = this;
|
|
|
|
var file_obj = {files: $('input#' + element_name).val()};
|
|
|
|
var file_obj = {
|
|
|
|
|
|
|
|
files: $('input#' + element_name).val()
|
|
|
|
|
|
|
|
};
|
|
|
|
$.ajax({
|
|
|
|
$.ajax({
|
|
|
|
method: "GET",
|
|
|
|
method: "GET",
|
|
|
|
url: '/existing-file-display',
|
|
|
|
url: '/existing-file-display',
|
|
|
|
dataType: "json",
|
|
|
|
dataType: "json",
|
|
|
|
data: file_obj,
|
|
|
|
data: file_obj,
|
|
|
|
success: function (result) {
|
|
|
|
success: function(result) {
|
|
|
|
if (result.success) {
|
|
|
|
if (result.success) {
|
|
|
|
$.each(result.files, function (key, file) {
|
|
|
|
$.each(result.files, function(key, file) {
|
|
|
|
var mockFile = {name: file.name, uploaded_as: file.uploaded_as, size: file.size};
|
|
|
|
var mockFile = {
|
|
|
|
window[`${element_name}_myDropzone`].emit("addedfile", mockFile);
|
|
|
|
name: file.name,
|
|
|
|
window[`${element_name}_myDropzone`].emit("thumbnail", mockFile, file.path);
|
|
|
|
uploaded_as: file.uploaded_as,
|
|
|
|
window[`${element_name}_myDropzone`].emit("complete", mockFile);
|
|
|
|
size: file.size
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
window[`${element_name}_myDropzone`].emit(
|
|
|
|
|
|
|
|
"addedfile", mockFile);
|
|
|
|
|
|
|
|
window[`${element_name}_myDropzone`].emit(
|
|
|
|
|
|
|
|
"thumbnail", mockFile, file.path);
|
|
|
|
|
|
|
|
window[`${element_name}_myDropzone`].emit(
|
|
|
|
|
|
|
|
"complete", mockFile);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -314,13 +334,15 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//function to be use on removeing a file
|
|
|
|
//function to be use on removeing a file
|
|
|
|
this.on("removedfile", function (file) {
|
|
|
|
this.on("removedfile", function(file) {
|
|
|
|
$.ajax({
|
|
|
|
$.ajax({
|
|
|
|
url: file_remove_url,
|
|
|
|
url: file_remove_url,
|
|
|
|
data: {"file_name": file.uploaded_as},
|
|
|
|
data: {
|
|
|
|
|
|
|
|
"file_name": file.uploaded_as
|
|
|
|
|
|
|
|
},
|
|
|
|
type: "POST",
|
|
|
|
type: "POST",
|
|
|
|
success: function (result) {
|
|
|
|
success: function(result) {
|
|
|
|
if (typeof (result) == 'string') {
|
|
|
|
if (typeof(result) == 'string') {
|
|
|
|
var result = JSON.parse(result);
|
|
|
|
var result = JSON.parse(result);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -350,8 +372,8 @@
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
success: function (file, response) {
|
|
|
|
success: function(file, response) {
|
|
|
|
if (typeof (response) == 'string') {
|
|
|
|
if (typeof(response) == 'string') {
|
|
|
|
var response = JSON.parse(response);
|
|
|
|
var response = JSON.parse(response);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (response.success == true) {
|
|
|
|
if (response.success == true) {
|
|
|
@ -409,7 +431,7 @@
|
|
|
|
var signaturePad = element;
|
|
|
|
var signaturePad = element;
|
|
|
|
var canvas = document.getElementById(element);
|
|
|
|
var canvas = document.getElementById(element);
|
|
|
|
signaturePad = new SignaturePad(canvas, {
|
|
|
|
signaturePad = new SignaturePad(canvas, {
|
|
|
|
onEnd: function (event) {
|
|
|
|
onEnd: function(event) {
|
|
|
|
var element = $(this)[0]._canvas.id
|
|
|
|
var element = $(this)[0]._canvas.id
|
|
|
|
var signature = $(this)[0].toDataURL();
|
|
|
|
var signature = $(this)[0].toDataURL();
|
|
|
|
$('#output_' + element).val(signature);
|
|
|
|
$('#output_' + element).val(signature);
|
|
|
@ -421,12 +443,12 @@
|
|
|
|
signaturePad.fromDataURL($('#output_' + element).val());
|
|
|
|
signaturePad.fromDataURL($('#output_' + element).val());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$(document).on('click', '#clear_' + element, function () {
|
|
|
|
$(document).on('click', '#clear_' + element, function() {
|
|
|
|
signaturePad.clear();
|
|
|
|
signaturePad.clear();
|
|
|
|
$('#output_' + $(this).data('name')).val('');
|
|
|
|
$('#output_' + $(this).data('name')).val('');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
$(document).on('click', '#undo_' + element, function () {
|
|
|
|
$(document).on('click', '#undo_' + element, function() {
|
|
|
|
var data = signaturePad.toData();
|
|
|
|
var data = signaturePad.toData();
|
|
|
|
if (data) {
|
|
|
|
if (data) {
|
|
|
|
data.pop(); // remove the last dot or line
|
|
|
|
data.pop(); // remove the last dot or line
|
|
|
@ -467,8 +489,8 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
<!-- Application additional js -->
|
|
|
|
<!-- Application additional js -->
|
|
|
|
@if(!$is_download && !isset($nav))
|
|
|
|
@if (!$is_download && !isset($nav))
|
|
|
|
@if(!empty($__additional_js))
|
|
|
|
@if (!empty($__additional_js))
|
|
|
|
{!!$__additional_js!!}
|
|
|
|
{!! $__additional_js !!}
|
|
|
|
@endif
|
|
|
|
@endif
|
|
|
|
@endif
|
|
|
|
@endif
|
|
|
|