material-kit.min.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. var big_image;
  2. $(document).ready(function() {
  3. BrowserDetect.init(), $('body').bootstrapMaterialDesign(), window_width = $(window).width(), $navbar = $('.navbar[color-on-scroll]'), scroll_distance = $navbar.attr('color-on-scroll') || 500, $navbar_collapse = $('.navbar').find('.navbar-collapse'), $('[data-toggle="tooltip"], [rel="tooltip"]').tooltip(), $('.form-file-simple .inputFileVisible').click(function() {
  4. $(this).siblings('.inputFileHidden').trigger('click')
  5. }), $('.form-file-simple .inputFileHidden').change(function() {
  6. var a = $(this).val().replace(/C:\\fakepath\\/i, '');
  7. $(this).siblings('.inputFileVisible').val(a)
  8. }), $('.form-file-multiple .inputFileVisible, .form-file-multiple .input-group-btn').click(function() {
  9. $(this).parent().parent().find('.inputFileHidden').trigger('click'), $(this).parent().parent().addClass('is-focused')
  10. }), $('.form-file-multiple .inputFileHidden').change(function() {
  11. for (var a = '', b = 0; b < $(this).get(0).files.length; ++b) a += b < $(this).get(0).files.length - 1 ? $(this).get(0).files.item(b).name + ',' : $(this).get(0).files.item(b).name;
  12. $(this).siblings('.input-group').find('.inputFileVisible').val(a)
  13. }), $('.form-file-multiple .btn').on('focus', function() {
  14. $(this).parent().siblings().trigger('focus')
  15. }), $('.form-file-multiple .btn').on('focusout', function() {
  16. $(this).parent().siblings().trigger('focusout')
  17. }), 0 != $('.selectpicker').length && $('.selectpicker').selectpicker(), $('[data-toggle="popover"]').popover(), $('.carousel').carousel({
  18. interval: 3e3
  19. });
  20. var a = $('.tagsinput').data('color');
  21. 0 != $('.tagsinput').length && $('.tagsinput').tagsinput(), $('.bootstrap-tagsinput').addClass('' + a + '-badge'), 0 != $('.navbar-color-on-scroll').length && $(window).on('scroll', materialKit.checkScrollForTransparentNavbar), materialKit.checkScrollForTransparentNavbar(), 768 <= window_width && (big_image = $('.page-header[data-parallax="true"]'), 0 != big_image.length && $(window).on('scroll', materialKit.checkScrollForParallax))
  22. }), $(window).on('load', function() {
  23. materialKit.initRotateCard(), materialKit.initColoredShadows()
  24. }), $(document).on('click', '.card-rotate .btn-rotate', function() {
  25. var a = $(this).closest('.rotating-card-container');
  26. a.hasClass('hover') ? a.removeClass('hover') : a.addClass('hover')
  27. }), $(document).on('click', '.navbar-toggler', function() {
  28. $toggle = $(this), 1 == materialKit.misc.navbar_menu_visible ? ($('html').removeClass('nav-open'), materialKit.misc.navbar_menu_visible = 0, $('#bodyClick').remove(), setTimeout(function() {
  29. $toggle.removeClass('toggled')
  30. }, 550), $('html').removeClass('nav-open-absolute')) : (setTimeout(function() {
  31. $toggle.addClass('toggled')
  32. }, 580), div = '<div id="bodyClick"></div>', $(div).appendTo('body').click(function() {
  33. $('html').removeClass('nav-open'), $('nav').hasClass('navbar-absolute') && $('html').removeClass('nav-open-absolute'), materialKit.misc.navbar_menu_visible = 0, $('#bodyClick').remove(), setTimeout(function() {
  34. $toggle.removeClass('toggled')
  35. }, 550)
  36. }), $('nav').hasClass('navbar-absolute') && $('html').addClass('nav-open-absolute'), $('html').addClass('nav-open'), materialKit.misc.navbar_menu_visible = 1)
  37. }), $(window).on('resize', function() {
  38. materialKit.initRotateCard()
  39. }), materialKit = {
  40. misc: {
  41. navbar_menu_visible: 0,
  42. window_width: 0,
  43. transparent: !0,
  44. colored_shadows: !0,
  45. fixedTop: !1,
  46. navbar_initialized: !1,
  47. isWindow: document.documentMode || /Edge/.test(navigator.userAgent)
  48. },
  49. checkScrollForParallax: function() {
  50. oVal = $(window).scrollTop() / 3, big_image.css({
  51. transform: 'translate3d(0,' + oVal + 'px,0)',
  52. "-webkit-transform": 'translate3d(0,' + oVal + 'px,0)',
  53. "-ms-transform": 'translate3d(0,' + oVal + 'px,0)',
  54. "-o-transform": 'translate3d(0,' + oVal + 'px,0)'
  55. })
  56. },
  57. initFormExtendedDatetimepickers: function() {
  58. $('.datetimepicker').datetimepicker({
  59. icons: {
  60. time: 'fa fa-clock-o',
  61. date: 'fa fa-calendar',
  62. up: 'fa fa-chevron-up',
  63. down: 'fa fa-chevron-down',
  64. previous: 'fa fa-chevron-left',
  65. next: 'fa fa-chevron-right',
  66. today: 'fa fa-screenshot',
  67. clear: 'fa fa-trash',
  68. close: 'fa fa-remove'
  69. }
  70. }), $('.datepicker').datetimepicker({
  71. format: 'MM/DD/YYYY',
  72. icons: {
  73. time: 'fa fa-clock-o',
  74. date: 'fa fa-calendar',
  75. up: 'fa fa-chevron-up',
  76. down: 'fa fa-chevron-down',
  77. previous: 'fa fa-chevron-left',
  78. next: 'fa fa-chevron-right',
  79. today: 'fa fa-screenshot',
  80. clear: 'fa fa-trash',
  81. close: 'fa fa-remove'
  82. }
  83. }), $('.timepicker').datetimepicker({
  84. format: 'h:mm A',
  85. icons: {
  86. time: 'fa fa-clock-o',
  87. date: 'fa fa-calendar',
  88. up: 'fa fa-chevron-up',
  89. down: 'fa fa-chevron-down',
  90. previous: 'fa fa-chevron-left',
  91. next: 'fa fa-chevron-right',
  92. today: 'fa fa-screenshot',
  93. clear: 'fa fa-trash',
  94. close: 'fa fa-remove'
  95. }
  96. })
  97. },
  98. initSliders: function() {
  99. var a = document.getElementById('sliderRegular');
  100. noUiSlider.create(a, {
  101. start: 40,
  102. connect: [!0, !1],
  103. range: {
  104. min: 0,
  105. max: 100
  106. }
  107. });
  108. var b = document.getElementById('sliderDouble');
  109. noUiSlider.create(b, {
  110. start: [20, 60],
  111. connect: !0,
  112. range: {
  113. min: 0,
  114. max: 100
  115. }
  116. })
  117. },
  118. initColoredShadows: function() {
  119. !0 != materialKit.misc.colored_shadows || 'Explorer' == BrowserDetect.browser && 12 >= BrowserDetect.version || $('.card:not([data-colored-shadow="false"]) .card-header-image').each(function() {
  120. if ($card_img = $(this), is_on_dark_screen = $(this).closest('.section-dark, .section-image').length, 0 == is_on_dark_screen) {
  121. var a = $card_img.find('img').attr('src'),
  122. b = 1 == $card_img.closest('.card-rotate').length,
  123. c = $card_img,
  124. d = $('<div class="colored-shadow"/>');
  125. if (b) {
  126. var e = $card_img.height(),
  127. f = $card_img.width();
  128. $(this).find('.back').css({
  129. height: e + 'px',
  130. width: f + 'px'
  131. }), c = $card_img.find('.front')
  132. }
  133. d.css({
  134. "background-image": 'url(' + a + ')'
  135. }).appendTo(c), 700 < $card_img.width() && d.addClass('colored-shadow-big'), setTimeout(function() {
  136. d.css('opacity', 1)
  137. }, 200)
  138. }
  139. })
  140. },
  141. initRotateCard: debounce(function() {
  142. $('.rotating-card-container .card-rotate').each(function() {
  143. var a = $(this),
  144. b = $(this).parent().width(),
  145. c = $(this).find('.front .card-body').outerHeight();
  146. a.parent().css({
  147. height: c + 'px',
  148. "margin-bottom": '30px'
  149. }), a.find('.front').css({
  150. height: c + 35 + 'px',
  151. width: b + 'px'
  152. }), a.find('.back').css({
  153. height: c + 35 + 'px',
  154. width: b + 'px'
  155. })
  156. })
  157. }, 50),
  158. checkScrollForTransparentNavbar: debounce(function() {
  159. $(document).scrollTop() > scroll_distance ? materialKit.misc.transparent && (materialKit.misc.transparent = !1, $('.navbar-color-on-scroll').removeClass('navbar-transparent')) : !materialKit.misc.transparent && (materialKit.misc.transparent = !0, $('.navbar-color-on-scroll').addClass('navbar-transparent'))
  160. }, 17)
  161. };
  162. function debounce(a, b, c) {
  163. var d;
  164. return function() {
  165. var e = this,
  166. f = arguments;
  167. clearTimeout(d), d = setTimeout(function() {
  168. d = null, c || a.apply(e, f)
  169. }, b), c && !d && a.apply(e, f)
  170. }
  171. }
  172. var BrowserDetect = {
  173. init: function() {
  174. this.browser = this.searchString(this.dataBrowser) || 'Other', this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion) || 'Unknown'
  175. },
  176. searchString: function(a) {
  177. for (var b, c = 0; c < a.length; c++)
  178. if (b = a[c].string, this.versionSearchString = a[c].subString, -1 !== b.indexOf(a[c].subString)) return a[c].identity
  179. },
  180. searchVersion: function(a) {
  181. var b = a.indexOf(this.versionSearchString);
  182. if (-1 !== b) {
  183. var c = a.indexOf('rv:');
  184. return 'Trident' === this.versionSearchString && -1 !== c ? parseFloat(a.substring(c + 3)) : parseFloat(a.substring(b + this.versionSearchString.length + 1))
  185. }
  186. },
  187. dataBrowser: [{
  188. string: navigator.userAgent,
  189. subString: 'Chrome',
  190. identity: 'Chrome'
  191. }, {
  192. string: navigator.userAgent,
  193. subString: 'MSIE',
  194. identity: 'Explorer'
  195. }, {
  196. string: navigator.userAgent,
  197. subString: 'Trident',
  198. identity: 'Explorer'
  199. }, {
  200. string: navigator.userAgent,
  201. subString: 'Firefox',
  202. identity: 'Firefox'
  203. }, {
  204. string: navigator.userAgent,
  205. subString: 'Safari',
  206. identity: 'Safari'
  207. }, {
  208. string: navigator.userAgent,
  209. subString: 'Opera',
  210. identity: 'Opera'
  211. }]
  212. },
  213. better_browser = '<div class="container"><div class="better-browser row"><div class="col-md-2"></div><div class="col-md-8"><h3>We are sorry but it looks like your Browser doesn\'t support our website Features. In order to get the full experience please download a new version of your favourite browser.</h3></div><div class="col-md-2"></div><br><div class="col-md-4"><a href="https://www.mozilla.org/ro/firefox/new/" class="btn btn-warning">Mozilla</a><br></div><div class="col-md-4"><a href="https://www.google.com/chrome/browser/desktop/index.html" class="btn ">Chrome</a><br></div><div class="col-md-4"><a href="http://windows.microsoft.com/en-us/internet-explorer/ie-11-worldwide-languages" class="btn">Internet Explorer</a><br></div><br><br><h4>Thank you!</h4></div></div>';