Guest User

Untitled

a guest
Apr 19th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.98 KB | None | 0 0
  1. <script src="{{ asset('themes/js/jquery.min.js') }}"></script>
  2. <script src="https://cdnjs.cloudflare.com/ajax/libs/1000hz-bootstrap-validator/0.11.5/validator.min.js"></script>
  3. <script src="{{ asset('themes/js/bootstrap.min.js') }}"></script>
  4. <script src="{{ asset('themes/js/bootstrap-toggle.min.js') }}"></script>
  5. <script src="{{ asset('themes/ckeditor/ckeditor.js') }}"></script>
  6. <script>
  7. CKEDITOR.replace('body' ,{
  8. filebrowserUploadUrl : '/admin/panel/upload-image',
  9. filebrowserImageUploadUrl : '/admin/panel/upload-image'
  10. });
  11. </script>
  12. <script type="text/javascript" src="{{ asset('themes/js/jquery.smartWizard.min.js') }}"></script>
  13. <script type="text/javascript">
  14. $(document).ready(function(){
  15.  
  16. // Toolbar extra buttons
  17. var btnFinish = $('<button ></button>').text('Final')
  18. .addClass('btn btn-info')
  19. .on('click', function(){
  20. if (!$(this).hasClass('disabled')){
  21. var elmForm = $("#schools");
  22. if(elmForm){
  23. elmForm.validator('validate');
  24. var elmErr = elmForm.find('.has-error');
  25. if(elmErr && elmErr.length > 0){
  26. alert('Oops we still have error in the form');
  27. return false;
  28. }else{
  29. alert('Great! we are ready to submit form');
  30. elmForm.submit();
  31. return false;
  32. }
  33. }
  34. }
  35. });
  36. var btnCancel = $('<button></button>').text('Cancel')
  37. .addClass('btn btn-danger')
  38. .on('click', function(){
  39. $('#smartwizard').smartWizard("reset");
  40. $('#schools').find("input, textarea").val("");
  41. });
  42.  
  43.  
  44.  
  45. // Smart Wizard
  46. $('#smartwizard').smartWizard({
  47. selected: 0,
  48. theme: 'dots',
  49. transitionEffect:'fade',
  50. toolbarSettings: {toolbarPosition: 'bottom',
  51. toolbarExtraButtons: [btnFinish, btnCancel]
  52. },
  53. anchorSettings: {
  54. markDoneStep: true, // add done css
  55. markAllPreviousStepsAsDone: true, // When a step selected by url hash, all previous steps are marked done
  56. removeDoneStepOnNavigateBack: true, // While navigate back done step after active step will be cleared
  57. enableAnchorOnDoneStep: true // Enable/Disable the done steps navigation
  58. }
  59. });
  60.  
  61. $("#smartwizard").on("leaveStep", function(e, anchorObject, stepNumber, stepDirection) {
  62. var elmForm = $("#form-step-" + stepNumber);
  63. // stepDirection === 'forward' :- this condition allows to do the form validation
  64. // only on forward navigation, that makes easy navigation on backwards still do the validation when going next
  65. if(stepDirection === 'forward' && elmForm){
  66. //elmForm.validator('validate');
  67. var elmErr = elmForm.children('.has-error');
  68. if(elmErr && elmErr.length > 0){
  69. // Form validation failed
  70. return false;
  71. }
  72. }
  73. return true;
  74. });
  75.  
  76. $("#smartwizard").on("showStep", function(e, anchorObject, stepNumber, stepDirection) {
  77. // Enable finish button only on last step
  78. if(stepNumber == 3){
  79. $('.btn-finish').removeClass('disabled');
  80. }else{
  81. $('.btn-finish').addClass('disabled');
  82. }
  83. });
  84.  
  85. });
  86. </script>
  87. <script src="{{ asset('themes/js/bootstrap-datepicker.min.js') }}"></script>
  88. <script src="{{ asset('themes/js/bootstrap-datepicker.fa.min.js') }}"></script>
  89. <script>
  90. $(document).ready(function() {
  91. $("#birthdate").datepicker();
  92. $("#datepicker1btn").click(function(event) {
  93. event.preventDefault();
  94. $("#datepicker1").focus();
  95. });
  96. });
  97. </script>
Add Comment
Please, Sign In to add comment