advanced-form-elements.js 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. $(function () {
  2. $('.colorpicker').colorpicker();
  3. //Dropzone
  4. Dropzone.options.frmFileUpload = {
  5. paramName: "file",
  6. maxFilesize: 2
  7. };
  8. //Masked Input ============================================================================================================================
  9. var $demoMaskedInput = $('.demo-masked-input');
  10. //Date
  11. $demoMaskedInput.find('.date').inputmask('dd/mm/yyyy', { placeholder: '__/__/____' });
  12. //Time
  13. $demoMaskedInput.find('.time12').inputmask('hh:mm t', { placeholder: '__:__ _m', alias: 'time12', hourFormat: '12' });
  14. $demoMaskedInput.find('.time24').inputmask('hh:mm', { placeholder: '__:__ _m', alias: 'time24', hourFormat: '24' });
  15. //Date Time
  16. $demoMaskedInput.find('.datetime').inputmask('d/m/y h:s', { placeholder: '__/__/____ __:__', alias: "datetime", hourFormat: '24' });
  17. //Mobile Phone Number
  18. $demoMaskedInput.find('.mobile-phone-number').inputmask('+99 (999) 999-99-99', { placeholder: '+__ (___) ___-__-__' });
  19. //Phone Number
  20. $demoMaskedInput.find('.phone-number').inputmask('+99 (999) 999-99-99', { placeholder: '+__ (___) ___-__-__' });
  21. //Dollar Money
  22. $demoMaskedInput.find('.money-dollar').inputmask('99,99 $', { placeholder: '__,__ $' });
  23. //Euro Money
  24. $demoMaskedInput.find('.money-euro').inputmask('99,99 €', { placeholder: '__,__ €' });
  25. //IP Address
  26. $demoMaskedInput.find('.ip').inputmask('999.999.999.999', { placeholder: '___.___.___.___' });
  27. //Credit Card
  28. $demoMaskedInput.find('.credit-card').inputmask('9999 9999 9999 9999', { placeholder: '____ ____ ____ ____' });
  29. //Email
  30. $demoMaskedInput.find('.email').inputmask({ alias: "email" });
  31. //Serial Key
  32. $demoMaskedInput.find('.key').inputmask('****-****-****-****', { placeholder: '____-____-____-____' });
  33. //===========================================================================================================================================
  34. //Multi-select
  35. $('#optgroup').multiSelect({ selectableOptgroup: true });
  36. //noUISlider
  37. var sliderBasic = document.getElementById('nouislider_basic_example');
  38. noUiSlider.create(sliderBasic, {
  39. start: [30],
  40. connect: 'lower',
  41. step: 1,
  42. range: {
  43. 'min': [0],
  44. 'max': [100]
  45. }
  46. });
  47. getNoUISliderValue(sliderBasic, true);
  48. //Range Example
  49. var rangeSlider = document.getElementById('nouislider_range_example');
  50. noUiSlider.create(rangeSlider, {
  51. start: [32500, 62500],
  52. connect: true,
  53. range: {
  54. 'min': 25000,
  55. 'max': 100000
  56. }
  57. });
  58. getNoUISliderValue(rangeSlider, false);
  59. });
  60. //Get noUISlider Value and write on
  61. function getNoUISliderValue(slider, percentage) {
  62. slider.noUiSlider.on('update', function () {
  63. var val = slider.noUiSlider.get();
  64. if (percentage) {
  65. val = parseInt(val);
  66. val += '%';
  67. }
  68. $(slider).parent().find('span.js-nouislider-value').text(val);
  69. });
  70. }