|
| 1 | +/*! |
| 2 | +
|
| 3 | + ========================================================= |
| 4 | + * Material Kit - v2.0.4 |
| 5 | + ========================================================= |
| 6 | +
|
| 7 | + * Product Page: https://www.creative-tim.com/product/material-kit |
| 8 | + * Copyright 2018 Creative Tim (http://www.creative-tim.com) |
| 9 | +
|
| 10 | + * Designed by www.invisionapp.com Coded by www.creative-tim.com |
| 11 | +
|
| 12 | + ========================================================= |
| 13 | +
|
| 14 | + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
| 15 | +
|
| 16 | + */ |
| 17 | + |
| 18 | +var big_image; |
| 19 | + |
| 20 | +$(document).ready(function() { |
| 21 | + BrowserDetect.init(); |
| 22 | + |
| 23 | + // Init Material scripts for buttons ripples, inputs animations etc, more info on the next link https://github.com/FezVrasta/bootstrap-material-design#materialjs |
| 24 | + //$('body').bootstrapMaterialDesign(); |
| 25 | + |
| 26 | + window_width = $(window).width(); |
| 27 | + |
| 28 | + $navbar = $('.navbar[color-on-scroll]'); |
| 29 | + scroll_distance = $navbar.attr('color-on-scroll') || 500; |
| 30 | + |
| 31 | + $navbar_collapse = $('.navbar').find('.navbar-collapse'); |
| 32 | + |
| 33 | + // Activate the Tooltips |
| 34 | + $('[data-toggle="tooltip"], [rel="tooltip"]').tooltip(); |
| 35 | + |
| 36 | + // Activate Popovers |
| 37 | + $('[data-toggle="popover"]').popover(); |
| 38 | + |
| 39 | + if ($('.navbar-color-on-scroll').length != 0) { |
| 40 | + $(window).on('scroll', materialKit.checkScrollForTransparentNavbar); |
| 41 | + } |
| 42 | + |
| 43 | + materialKit.checkScrollForTransparentNavbar(); |
| 44 | + |
| 45 | + if (window_width >= 768) { |
| 46 | + big_image = $('.page-header[data-parallax="true"]'); |
| 47 | + if (big_image.length != 0) { |
| 48 | + $(window).on('scroll', materialKit.checkScrollForParallax); |
| 49 | + } |
| 50 | + |
| 51 | + } |
| 52 | + |
| 53 | + |
| 54 | +}); |
| 55 | + |
| 56 | +$(document).on('click', '.navbar-toggler', function() { |
| 57 | + $toggle = $(this); |
| 58 | + |
| 59 | + if (materialKit.misc.navbar_menu_visible == 1) { |
| 60 | + $('html').removeClass('nav-open'); |
| 61 | + materialKit.misc.navbar_menu_visible = 0; |
| 62 | + $('#bodyClick').remove(); |
| 63 | + setTimeout(function() { |
| 64 | + $toggle.removeClass('toggled'); |
| 65 | + }, 550); |
| 66 | + |
| 67 | + $('html').removeClass('nav-open-absolute'); |
| 68 | + } else { |
| 69 | + setTimeout(function() { |
| 70 | + $toggle.addClass('toggled'); |
| 71 | + }, 580); |
| 72 | + |
| 73 | + |
| 74 | + div = '<div id="bodyClick"></div>'; |
| 75 | + $(div).appendTo("body").click(function() { |
| 76 | + $('html').removeClass('nav-open'); |
| 77 | + |
| 78 | + if ($('nav').hasClass('navbar-absolute')) { |
| 79 | + $('html').removeClass('nav-open-absolute'); |
| 80 | + } |
| 81 | + materialKit.misc.navbar_menu_visible = 0; |
| 82 | + $('#bodyClick').remove(); |
| 83 | + setTimeout(function() { |
| 84 | + $toggle.removeClass('toggled'); |
| 85 | + }, 550); |
| 86 | + }); |
| 87 | + |
| 88 | + if ($('nav').hasClass('navbar-absolute')) { |
| 89 | + $('html').addClass('nav-open-absolute'); |
| 90 | + } |
| 91 | + |
| 92 | + $('html').addClass('nav-open'); |
| 93 | + materialKit.misc.navbar_menu_visible = 1; |
| 94 | + } |
| 95 | +}); |
| 96 | + |
| 97 | +materialKit = { |
| 98 | + misc: { |
| 99 | + navbar_menu_visible: 0, |
| 100 | + window_width: 0, |
| 101 | + transparent: true, |
| 102 | + fixedTop: false, |
| 103 | + navbar_initialized: false, |
| 104 | + isWindow: document.documentMode || /Edge/.test(navigator.userAgent) |
| 105 | + }, |
| 106 | + |
| 107 | + initFormExtendedDatetimepickers: function() { |
| 108 | + $('.datetimepicker').datetimepicker({ |
| 109 | + icons: { |
| 110 | + time: "fa fa-clock-o", |
| 111 | + date: "fa fa-calendar", |
| 112 | + up: "fa fa-chevron-up", |
| 113 | + down: "fa fa-chevron-down", |
| 114 | + previous: 'fa fa-chevron-left', |
| 115 | + next: 'fa fa-chevron-right', |
| 116 | + today: 'fa fa-screenshot', |
| 117 | + clear: 'fa fa-trash', |
| 118 | + close: 'fa fa-remove' |
| 119 | + } |
| 120 | + }); |
| 121 | + }, |
| 122 | + |
| 123 | + initSliders: function() { |
| 124 | + // Sliders for demo purpose |
| 125 | + var slider = document.getElementById('sliderRegular'); |
| 126 | + |
| 127 | + noUiSlider.create(slider, { |
| 128 | + start: 40, |
| 129 | + connect: [true, false], |
| 130 | + range: { |
| 131 | + min: 0, |
| 132 | + max: 100 |
| 133 | + } |
| 134 | + }); |
| 135 | + |
| 136 | + var slider2 = document.getElementById('sliderDouble'); |
| 137 | + |
| 138 | + noUiSlider.create(slider2, { |
| 139 | + start: [20, 60], |
| 140 | + connect: true, |
| 141 | + range: { |
| 142 | + min: 0, |
| 143 | + max: 100 |
| 144 | + } |
| 145 | + }); |
| 146 | + }, |
| 147 | + |
| 148 | + checkScrollForParallax: function() { |
| 149 | + oVal = ($(window).scrollTop() / 3); |
| 150 | + big_image.css({ |
| 151 | + 'transform': 'translate3d(0,' + oVal + 'px,0)', |
| 152 | + '-webkit-transform': 'translate3d(0,' + oVal + 'px,0)', |
| 153 | + '-ms-transform': 'translate3d(0,' + oVal + 'px,0)', |
| 154 | + '-o-transform': 'translate3d(0,' + oVal + 'px,0)' |
| 155 | + }); |
| 156 | + }, |
| 157 | + |
| 158 | + checkScrollForTransparentNavbar: debounce(function() { |
| 159 | + if ($(document).scrollTop() > scroll_distance) { |
| 160 | + if (materialKit.misc.transparent) { |
| 161 | + materialKit.misc.transparent = false; |
| 162 | + $('.navbar-color-on-scroll').removeClass('navbar-transparent'); |
| 163 | + } |
| 164 | + } else { |
| 165 | + if (!materialKit.misc.transparent) { |
| 166 | + materialKit.misc.transparent = true; |
| 167 | + $('.navbar-color-on-scroll').addClass('navbar-transparent'); |
| 168 | + } |
| 169 | + } |
| 170 | + }, 17) |
| 171 | +}; |
| 172 | + |
| 173 | +// Returns a function, that, as long as it continues to be invoked, will not |
| 174 | +// be triggered. The function will be called after it stops being called for |
| 175 | +// N milliseconds. If `immediate` is passed, trigger the function on the |
| 176 | +// leading edge, instead of the trailing. |
| 177 | + |
| 178 | +function debounce(func, wait, immediate) { |
| 179 | + var timeout; |
| 180 | + return function() { |
| 181 | + var context = this, |
| 182 | + args = arguments; |
| 183 | + clearTimeout(timeout); |
| 184 | + timeout = setTimeout(function() { |
| 185 | + timeout = null; |
| 186 | + if (!immediate) func.apply(context, args); |
| 187 | + }, wait); |
| 188 | + if (immediate && !timeout) func.apply(context, args); |
| 189 | + }; |
| 190 | +}; |
| 191 | + |
| 192 | +var BrowserDetect = { |
| 193 | + init: function() { |
| 194 | + this.browser = this.searchString(this.dataBrowser) || "Other"; |
| 195 | + this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion) || "Unknown"; |
| 196 | + }, |
| 197 | + searchString: function(data) { |
| 198 | + for (var i = 0; i < data.length; i++) { |
| 199 | + var dataString = data[i].string; |
| 200 | + this.versionSearchString = data[i].subString; |
| 201 | + |
| 202 | + if (dataString.indexOf(data[i].subString) !== -1) { |
| 203 | + return data[i].identity; |
| 204 | + } |
| 205 | + } |
| 206 | + }, |
| 207 | + searchVersion: function(dataString) { |
| 208 | + var index = dataString.indexOf(this.versionSearchString); |
| 209 | + if (index === -1) { |
| 210 | + return; |
| 211 | + } |
| 212 | + |
| 213 | + var rv = dataString.indexOf("rv:"); |
| 214 | + if (this.versionSearchString === "Trident" && rv !== -1) { |
| 215 | + return parseFloat(dataString.substring(rv + 3)); |
| 216 | + } else { |
| 217 | + return parseFloat(dataString.substring(index + this.versionSearchString.length + 1)); |
| 218 | + } |
| 219 | + }, |
| 220 | + |
| 221 | + dataBrowser: [{ |
| 222 | + string: navigator.userAgent, |
| 223 | + subString: "Chrome", |
| 224 | + identity: "Chrome" |
| 225 | + }, |
| 226 | + { |
| 227 | + string: navigator.userAgent, |
| 228 | + subString: "MSIE", |
| 229 | + identity: "Explorer" |
| 230 | + }, |
| 231 | + { |
| 232 | + string: navigator.userAgent, |
| 233 | + subString: "Trident", |
| 234 | + identity: "Explorer" |
| 235 | + }, |
| 236 | + { |
| 237 | + string: navigator.userAgent, |
| 238 | + subString: "Firefox", |
| 239 | + identity: "Firefox" |
| 240 | + }, |
| 241 | + { |
| 242 | + string: navigator.userAgent, |
| 243 | + subString: "Safari", |
| 244 | + identity: "Safari" |
| 245 | + }, |
| 246 | + { |
| 247 | + string: navigator.userAgent, |
| 248 | + subString: "Opera", |
| 249 | + identity: "Opera" |
| 250 | + } |
| 251 | + ] |
| 252 | + |
| 253 | +}; |
| 254 | + |
| 255 | +var 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>'; |
0 commit comments