')
+ .hide()
+ .css({
+ backgroundSize: 'cover',
+ backgroundPosition: 'center'
+ });
+ $('> *:eq(0)', this).before($img);
+
+ // youtube or vimeo
+ if (parsedUrl && (/youtube/g.test(parsedUrl[3]) || /vimeo/g.test(parsedUrl[3]))) {
+ // youtube
+ if (parsedUrl && /youtube/g.test(parsedUrl[3])) {
+ var previewURL = 'http' + ('https:' === location.protocol ? 's' : '') + ':';
+ previewURL += '//img.youtube.com/vi/' + parsedUrl[6] + '/maxresdefault.jpg';
+
+ $('
![]()
').on('load', function() {
+ if (120 === (this.naturalWidth || this.width)) {
+ // selection of preview in the best quality
+ var file = this.src.split('/').pop();
+
+ switch (file) {
+ case 'maxresdefault.jpg':
+ this.src = this.src.replace(file, 'sddefault.jpg');
+ break;
+ case 'sddefault.jpg':
+ this.src = this.src.replace(file, 'hqdefault.jpg');
+ break;
+ default: // image not found
+ if (isBuilder) {
+ $img.css('background-image', 'url("images/no-video.jpg")')
+ .show();
+ }
+ }
+ } else {
+ $img.css('background-image', 'url("' + this.src + '")')
+ .show();
+ }
+ }).attr('src', previewURL);
+
+ if ($.fn.YTPlayer && !isBuilder && !$.isMobile()) {
+ $('> *:eq(1)', this).before('
').prev()
+ .YTPlayer({
+ videoURL: parsedUrl[6],
+ containment: 'self',
+ showControls: false,
+ mute: true
+ });
+ }
+ } else if (parsedUrl && /vimeo/g.test(parsedUrl[3])) { // vimeo
+ var request = new XMLHttpRequest();
+ request.open('GET', 'https://vimeo.com/api/v2/video/' + parsedUrl[6] + '.json', true);
+ request.onreadystatechange = function() {
+ if (this.readyState === 4) {
+ if (this.status >= 200 && this.status < 400) {
+ var response = JSON.parse(this.responseText);
+
+ $img.css('background-image', 'url("' + response[0].thumbnail_large + '")')
+ .show();
+ } else if (isBuilder) { // image not found
+ $img.css('background-image', 'url("images/no-video.jpg")')
+ .show();
+ }
+ }
+ };
+ request.send();
+ request = null;
+
+ if ($.fn.vimeo_player && !isBuilder && !$.isMobile()) {
+ $('> *:eq(1)', this).before('
').prev()
+ .vimeo_player({
+ videoURL: videoURL,
+ containment: 'self',
+ showControls: false,
+ mute: true
+ });
+ }
+ }
+ } else if (isBuilder) { // neither youtube nor vimeo
+ $img.css('background-image', 'url("images/video-placeholder.jpg")')
+ .show();
+ }
+ });
+ }
+
+ if (isBuilder) {
+ $(document).on('add.cards', function(event) {
+ videoParser(event.target);
+ });
+ } else {
+ videoParser(document.body);
+ }
+
+ $(document).on('changeParameter.cards', function(event, paramName, value, key) {
+ if (paramName === 'bg') {
+ switch (key) {
+ case 'type':
+ $(event.target).find('.mbr-background-video-preview').remove();
+ if (value.type === 'video') {
+ videoParser(event.target);
+ }
+ break;
+ case 'value':
+ if (value.type === 'video') {
+ $(event.target).find('.mbr-background-video-preview').remove();
+ videoParser(event.target);
+ }
+ break;
+ }
+ }
+ });
+
+ // init
+ if (!isBuilder) {
+ $('body > *:not(style, script)').trigger('add.cards');
+ }
+ $('html').addClass('mbr-site-loaded');
+ $(window).resize().scroll();
+
+ // smooth scroll
+ if (!isBuilder) {
+ $(document).click(function(e) {
+ try {
+ var target = e.target;
+
+ if ($(target).parents().hasClass('carousel')) {
+ return;
+ }
+ do {
+ if (target.hash) {
+ var useBody = /#bottom|#top/g.test(target.hash);
+ $(useBody ? 'body' : target.hash).each(function() {
+ e.preventDefault();
+ // in css sticky navbar has height 64px
+ var stickyMenuHeight = $('.mbr-navbar--sticky').length ? 64 : 0;
+ var goTo = target.hash == '#bottom' ? ($(this).height() - $(window).height()) : ($(this).offset().top - stickyMenuHeight);
+ // Disable Accordion's and Tab's scroll
+ if ($(this).hasClass('panel-collapse') || $(this).hasClass('tab-pane')) {
+ return;
+ }
+ $('html, body').stop().animate({
+ scrollTop: goTo
+ }, 800, 'easeInOutCubic');
+ });
+ break;
+ }
+ } while (target = target.parentNode);
+ } catch (e) {
+ // throw e;
+ }
+ });
+ }
+
+ // init the same height columns
+ $('.cols-same-height .mbr-figure').each(function() {
+ var $imageCont = $(this);
+ var $img = $imageCont.children('img');
+ var $cont = $imageCont.parent();
+ var imgW = $img[0].width;
+ var imgH = $img[0].height;
+
+ function setNewSize() {
+ $img.css({
+ width: '',
+ maxWidth: '',
+ marginLeft: ''
+ });
+
+ if (imgH && imgW) {
+ var aspectRatio = imgH / imgW;
+
+ $imageCont.addClass({
+ position: 'absolute',
+ top: 0,
+ left: 0,
+ right: 0,
+ bottom: 0
+ });
+
+ // change image size
+ var contAspectRatio = $cont.height() / $cont.width();
+ if (contAspectRatio > aspectRatio) {
+ var percent = 100 * (contAspectRatio - aspectRatio) / aspectRatio;
+ $img.css({
+ width: percent + 100 + '%',
+ maxWidth: percent + 100 + '%',
+ marginLeft: (-percent / 2) + '%'
+ });
+ }
+ }
+ }
+
+ $img.one('load', function() {
+ imgW = $img[0].width;
+ imgH = $img[0].height;
+ setNewSize();
+ });
+
+ $(window).on('resize', setNewSize);
+ setNewSize();
+ });
+ });
+
+
+ if (!isBuilder) {
+ // .mbr-social-likes
+ if ($.fn.socialLikes) {
+ $(document).on('add.cards', function(event) {
+ $(event.target).outerFind('.mbr-social-likes').on('counter.social-likes', function(event, service, counter) {
+ if (counter > 999) $('.social-likes__counter', event.target).html(Math.floor(counter / 1000) + 'k');
+ }).socialLikes({
+ initHtml: false
+ });
+ });
+ }
+
+ $(document).on('add.cards', function(event) {
+ if ($(event.target).hasClass('mbr-reveal')) {
+ $(event.target).footerReveal();
+ }
+ });
+
+ $(document).ready(function() {
+ // disable animation on scroll on mobiles
+ if ($.isMobile()) {
+ return;
+ // enable animation on scroll
+ } else if ($('input[name=animation]').length) {
+ $('input[name=animation]').remove();
+
+ var $animatedElements = $('p, h1, h2, h3, h4, h5, a, button, small, img, li, blockquote, .mbr-author-name, em, label, input, textarea, .input-group, .iconbox, .btn-social, .mbr-figure, .mbr-map, .mbr-testimonial .card-block, .mbr-price-value, .mbr-price-figure, .dataTable, .dataTables_info').not(function() {
+ return $(this).parents().is('.navbar, .mbr-arrow, footer, .iconbox, .mbr-slider, .mbr-gallery, .mbr-testimonial .card-block, #cookiesdirective, .mbr-wowslider, .accordion, .tab-content, .engine, #scrollToTop');
+ }).addClass('hidden animated');
+
+ function getElementOffset(element) {
+ var top = 0;
+ do {
+ top += element.offsetTop || 0;
+ element = element.offsetParent;
+ } while (element);
+
+ return top;
+ }
+
+ function checkIfInView() {
+ var window_height = window.innerHeight;
+ var window_top_position = document.documentElement.scrollTop || document.body.scrollTop;
+ var window_bottom_position = window_top_position + window_height - 50;
+
+ $.each($animatedElements, function() {
+ var $element = $(this);
+ var element = $element[0];
+ var element_height = element.offsetHeight;
+ var element_top_position = getElementOffset(element);
+ var element_bottom_position = (element_top_position + element_height);
+
+ // check to see if this current element is within viewport
+ if ((element_bottom_position >= window_top_position) &&
+ (element_top_position <= window_bottom_position) &&
+ ($element.hasClass('hidden'))) {
+ $element.removeClass('hidden').addClass('fadeInUp')
+ .one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function() {
+ $element.removeClass('animated fadeInUp');
+ });
+ }
+ });
+ }
+
+ var $window = $(window);
+ $window.on('scroll resize', checkIfInView);
+ $window.trigger('scroll');
+ }
+ });
+
+ if ($('.nav-dropdown').length) {
+ $(".nav-dropdown").swipe({
+ swipeLeft: function(event, direction, distance, duration, fingerCount) {
+ $('.navbar-close').click();
+ }
+ });
+ }
+ }
+
+ // Scroll to Top Button
+ $(document).ready(function() {
+ if ($('.mbr-arrow-up').length) {
+ var $scroller = $('#scrollToTop'),
+ $main = $('body,html'),
+ $window = $(window);
+ $scroller.css('display', 'none');
+ $window.scroll(function() {
+ if ($(this).scrollTop() > 0) {
+ $scroller.fadeIn();
+ } else {
+ $scroller.fadeOut();
+ }
+ });
+ $scroller.click(function() {
+ $main.animate({
+ scrollTop: 0
+ }, 400);
+ return false;
+ });
+ }
+ });
+
+ $(document).ready(function() {
+ // Counters
+ if ($('.counters').length) {
+ $('.counters').viewportChecker({
+ offset: 200,
+ callbackFunction: function(elem, action) {
+ $('#' + elem.attr('id') + ' .count').each(function() {
+ $(this).prop('Counter', 0).animate({
+ Counter: $(this).text()
+ }, {
+ duration: 3000,
+ easing: 'swing',
+ step: function(now) {
+ $(this).text(Math.ceil(now));
+ }
+ });
+ });
+ }
+ });
+ }
+ });
+
+ // arrow down
+ if (!isBuilder) {
+ $('.mbr-arrow').on('click', function(e) {
+ var $next = $(e.target).closest('section').next();
+ if($next.hasClass('engine')){
+ $next = $next.closest('section').next();
+ }
+ var offset = $next.offset();
+ $('html, body').stop().animate({
+ scrollTop: offset.top
+ }, 800, 'linear');
+ });
+ }
+
+ // add padding to the first element, if it exists
+ if ($('nav.navbar').length) {
+ var navHeight = $('nav.navbar').height();
+ $('.mbr-after-navbar.mbr-fullscreen').css('padding-top', navHeight + 'px');
+ }
+
+ function isIE() {
+ var ua = window.navigator.userAgent;
+ var msie = ua.indexOf("MSIE ");
+
+ if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) {
+ return true;
+ }
+
+ return false;
+ }
+
+ // fixes for IE
+ if (!isBuilder && isIE()) {
+ $(document).on('add.cards', function(event) {
+ var $eventTarget = $(event.target);
+
+ if ($eventTarget.hasClass('mbr-fullscreen')) {
+ $(window).on('load resize', function() {
+ $eventTarget.css('height', 'auto');
+
+ if ($eventTarget.outerHeight() <= $(window).height()) {
+ $eventTarget.css('height', '1px');
+ }
+ });
+ }
+
+ if ($eventTarget.hasClass('mbr-slider') || $eventTarget.hasClass('mbr-gallery')) {
+ $eventTarget.find('.carousel-indicators').addClass('ie-fix').find('li').css({
+ display: 'inline-block',
+ width: '30px'
+ });
+
+ if ($eventTarget.hasClass('mbr-slider')) {
+ $eventTarget.find('.full-screen .slider-fullscreen-image').css('height', '1px');
+ }
+ }
+ });
+ }
+
+ // Script for popUp video
+ $(document).ready(function() {
+ if (!isBuilder) {
+ var modal = function(item) {
+ var videoIframe = $(item).parents('section').find('iframe')[0],
+ videoIframeSrc = $(videoIframe).attr('src');
+
+ item.parents('section').css('z-index', '1');
+
+ if (videoIframeSrc.indexOf('youtu') !== -1) {
+ videoIframe.contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}', '*');
+ }
+
+ if (videoIframeSrc.indexOf('vimeo') !== -1) {
+ var vimeoPlayer = new Vimeo.Player($(videoIframe));
+ vimeoPlayer.play();
+ }
+
+ $(item).parents('section').find($(item).attr('data-modal'))
+ .css('display', 'table')
+ .click(function() {
+ if (videoIframeSrc.indexOf('youtu') !== -1) {
+ videoIframe.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*');
+ }
+
+ if (videoIframeSrc.indexOf('vimeo') !== -1) {
+ vimeoPlayer.pause();
+ }
+
+ $(this).css('display', 'none').off('click');
+ item.parents('section').css('z-index', '0');
+ });
+ };
+
+ // Youtube & Vimeo
+ $('.modalWindow-video iframe').each(function() {
+ var videoURL = $(this).attr('data-src');
+ $(this).removeAttr('data-src');
+
+ var parsedUrl = videoURL.match(/(http:\/\/|https:\/\/|)?(player.|www.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com))\/(video\/|embed\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(&\S+)?/);
+ if (videoURL.indexOf('youtu') !== -1) {
+ $(this).attr('src', 'https://youtube.com/embed/' + parsedUrl[6] + '?rel=0&enablejsapi=1');
+ } else if (videoURL.indexOf('vimeo') !== -1) {
+ $(this).attr('src', 'https://player.vimeo.com/video/' + parsedUrl[6] + '?autoplay=0&loop=0');
+ }
+ });
+
+ $('[data-modal]').click(function() {
+ modal($(this));
+ });
+ }
+ });
+
+ if (!isBuilder) {
+ // open dropdown menu on hover
+ if (!$.isMobile()) {
+ var $menu = $('section.menu'),
+ $width = $(window).width(),
+ $collapsed = $menu.find('.navbar').hasClass('collapsed');
+ // check if collapsed on
+ if (!$collapsed ){
+ // check width device
+ if ($width > 991) {
+ $menu.find('ul.navbar-nav li.dropdown').hover(
+ function() {
+ if (!$(this).hasClass('open')) {
+ $(this).find('a')[0].click();
+ }
+ },
+ function() {
+ if ($(this).hasClass('open')) {
+ $(this).find('a')[0].click();
+ }
+ }
+ );
+ $menu.find('ul.navbar-nav li.dropdown .dropdown-menu .dropdown').hover(
+ function() {
+ if (!$(this).hasClass('open')) {
+ $(this).find('a')[0].click();
+ }
+ },
+ function() {
+ if ($(this).hasClass('open')) {
+ $(this).find('a')[0].click();
+ }
+ }
+ );
+ }
+ }
+ }
+ }
+
+ // Script for circle progress
+ function initCircleProgress(card) {
+ $('.pie_progress').asPieProgress({
+ namespace: 'asPieProgress',
+ classes: {
+ element: 'pie_progress',
+ number: 'pie_progress__number'
+ },
+ min: 0,
+ max: 100,
+ size: 150,
+ speed: 30,
+ barsize: '8',
+ fillcolor: 'none',
+ easing: 'ease'
+ });
+
+ $(card).find('.pie_progress').each(function() {
+ $(this).asPieProgress('go', $(this).attr('data-goal') + '%');
+ });
+ }
+
+ function setCurrentCircleProgress(card, paramName) {
+ var $elem = $(card).find("." + paramName);
+ $elem.asPieProgress('go', $elem.attr('data-goal') + '%');
+ }
+
+ if (isBuilder) {
+ $(document).on('add.cards', function(event) {
+ if ($('.pie_progress').length) {
+ initCircleProgress(event.target);
+ }
+ }).on('delete.cards', function(event) {
+ $(event.target).find('.pie_progress').asPieProgress('destroy');
+ }).on('changeParameter.cards', function(event, paramName) {
+ if (paramName.indexOf('progress') == 0) {
+ if ($('.pie_progress').length) {
+ setCurrentCircleProgress(event.target, paramName);
+ }
+ }
+ });
+ } else {
+ if ($('.pie_progress').length) {
+ initCircleProgress(document.body);
+ }
+ }
+
+ //Script for countdown
+ function initCountdown() {
+ $(".countdown:not(.countdown-inited)").each(function() {
+ $(this).addClass('countdown-inited').countdown($(this).attr('data-due-date'), function(event) {
+
+ var $days = $(event.target).closest('.countdown-cont').find('div.daysCountdown').attr('title');
+ var $hours = $(event.target).closest('.countdown-cont').find('div.hoursCountdown').attr('title');
+ var $minutes = $(event.target).closest('.countdown-cont').find('div.minutesCountdown').attr('title');
+ var $seconds = $(event.target).closest('.countdown-cont').find('div.secondsCountdown').attr('title');
+ $(this).html(
+ event.strftime([
+ '
',
+ '
',
+ '',
+ '%D',
+ '',$days,'',
+ ':',
+ '',
+ '
',
+ '
',
+ '',
+ '%H',
+ '',$hours,'',
+ ':',
+ '',
+ '
',
+ '
',
+ '',
+ '%M',
+ '',$minutes,'',
+ ':',
+ '',
+ '
',
+ '
',
+ '',
+ '%S',
+ '',$seconds,'',
+ '',
+ '
',
+ '
'
+ ].join(''))
+ );
+ });
+ });
+
+ $(".countdown:not(.countdown-inited)").each(function() {
+ $(this).countdown($(this).attr('data-due-date'), function(event) {
+ $(this).text(
+ event.strftime('%D days %H:%M:%S')
+ );
+ });
+ });
+ };
+
+ function changeCountdown(card, value) {
+ var $reg = /\d\d\d\d\/\d\d\/\d\d/g,
+ $target = $(card).find('.countdown');
+ if (value.search($reg) > -1) {
+ $target.removeClass('countdown-inited');
+ initCountdown();
+ }
+ }
+
+ if (isBuilder) {
+ $(document).on('add.cards', function(event) {
+ if ($('.countdown').length != 0) {
+ initCountdown();
+ }
+ }).on('changeParameter.cards', function(event, paramName, value) {
+ if (paramName === 'countdown') {
+ changeCountdown(event.target, value);
+ }
+ });;
+ } else {
+ if ($('.countdown').length != 0) {
+ initCountdown();
+ };
+ }
+
+ // script for flip images
+ function bendBottomCorner() {
+ $(".flip-card:not(.builderCard)").each(function() {
+ $(this).addClass('builderCard');
+ });
+ }
+ if (isBuilder) {
+ $(document).on('add.cards', function() {
+ if ($('.flip-card').length != 0) {
+ bendBottomCorner();
+ }
+ });
+ }
+
+ // tabs
+ function initTabs(target) {
+ if ($(target).find('.nav-tabs').length !== 0) {
+ $(target).outerFind('section[id^="tabs"]').each(function() {
+ var componentID = $(this).attr('id');
+ var $tabsNavItem = $(this).find('.nav-tabs .nav-item');
+ var $tabPane = $(this).find('.tab-pane');
+
+ $tabPane.removeClass('active').eq(0).addClass('active');
+
+ $tabsNavItem.find('a').removeClass('active').removeAttr('aria-expanded')
+ .eq(0).addClass('active');
+
+ $tabPane.each(function() {
+ $(this).attr('id', componentID + '_tab' + $(this).index());
+ });
+
+ $tabsNavItem.each(function() {
+ $(this).find('a').attr('href', '#' + componentID + '_tab' + $(this).index());
+ });
+ });
+ }
+ }
+
+ if (isBuilder) {
+ $(document).on('add.cards', function(e) {
+ initTabs(e.target);
+ });
+ } else {
+ initTabs(document.body);
+ }
+
+
+ // Testimonials Slider
+ function setActiveCarouselItem(card){
+ var $target = $(card).find('.carousel-item:first');
+ $target.addClass('active');
+ }
+
+ function initTestimonialsCarousel(card){
+ var $target = $(card),
+ $carouselID = $target.attr('ID') +"-carousel";
+
+ $target.find('.carousel').attr('id',$carouselID);
+ $target.find('.carousel-controls a').attr('href','#'+$carouselID);
+ setActiveCarouselItem($target);
+ }
+
+ if (isBuilder) {
+ $(document).on('add.cards', function(event) {
+ if ($('.testimonials-slider').length != 0) {
+ initTestimonialsCarousel(event.target);
+ }
+ }).on('changeParameter.cards', function(event, paramName, value) {
+ if (paramName === 'testimonialsSlides') {
+ if ($(event.target).find('.carousel-item.active').length==0) {
+ setActiveCarouselItem(event.target);
+ }
+ }
+ });;
+ } else{
+ if ($('.testimonials-slider').length != 0) {
+ $('.testimonials-slider').each(function(){
+ initTestimonialsCarousel(this);
+ });
+ }
+ }
+
+ // Toggle and Accordion switch arrow
+ if (!isBuilder) {
+ $(document).ready(function() {
+ if ($('.accordionStyles').length!=0) {
+ $('.accordionStyles .card-header a[role="button"]').each(function(){
+ if(!$(this).hasClass('collapsed')){
+ $(this).addClass('collapsed');
+ }
+ });
+ }
+ });
+
+ $('.accordionStyles .card-header a[role="button"]').click(function(){
+ var $id = $(this).closest('.accordionStyles').attr('id'),
+ $iscollapsing = $(this).closest('.card').find('.panel-collapse');
+
+ if (!$iscollapsing.hasClass('collapsing')) {
+ if ($id.indexOf('toggle') != -1){
+ if ($(this).hasClass('collapsed')) {
+ $(this).find('span.sign').removeClass('mbri-arrow-down').addClass('mbri-arrow-up');
+ }
+ else{
+ $(this).find('span.sign').removeClass('mbri-arrow-up').addClass('mbri-arrow-down');
+ }
+ }
+ else if ($id.indexOf('accordion')!=-1) {
+ var $accordion = $(this).closest('.accordionStyles ');
+
+ $accordion.children('.card').each(function() {
+ $(this).find('span.sign').removeClass('mbri-arrow-up').addClass('mbri-arrow-down');
+ });
+ if ($(this).hasClass('collapsed')) {
+ $(this).find('span.sign').removeClass('mbri-arrow-down').addClass('mbri-arrow-up');
+ }
+ }
+ }
+ });
+ };
+
+ // Clients block
+ function initClientCarousel(card){
+ var $target = $(card),
+ countElems = $target.find('.carousel-item').length,
+ visibleSlides = $target.find('.carousel-inner').attr('data-visible');
+ if (countElems < visibleSlides){
+ visibleSlides = countElems;
+ }
+ $target.find('.carousel-inner').attr('class', 'carousel-inner slides' + visibleSlides);
+ $target.find('.clonedCol').remove();
+
+ $target.find('.carousel-item .col-md-12').each(function() {
+ if (visibleSlides < 2) {
+ $(this).attr('class', 'col-md-12');
+ } else if (visibleSlides == '5') {
+ $(this).attr('class', 'col-md-12 col-lg-15');
+ } else {
+ $(this).attr('class', 'col-md-12 col-lg-' + 12 / visibleSlides);
+ }
+ });
+
+ $target.find('.carousel-item').each(function() {
+ var itemToClone = $(this);
+ for (var i = 1; i < visibleSlides; i++) {
+ itemToClone = itemToClone.next();
+ if (!itemToClone.length) {
+ itemToClone = $(this).siblings(':first');
+ }
+ var index = itemToClone.index();
+ itemToClone.find('.col-md-12:first').clone().addClass('cloneditem-' + i).addClass('clonedCol').attr('data-cloned-index', index).appendTo($(this).children().eq(0));
+ }
+ });
+ }
+ function updateClientCarousel(card){
+ var $target = $(card),
+ countElems = $target.find('.carousel-item').length,
+ visibleSlides = $target.find('.carousel-inner').attr('data-visible');
+ if (countElems < visibleSlides){
+ visibleSlides = countElems;
+ }
+ $target.find('.clonedCol').remove();
+ $target.find('.carousel-item').each(function() {
+ var itemToClone = $(this);
+ for (var i = 1; i < visibleSlides; i++) {
+ itemToClone = itemToClone.next();
+ if (!itemToClone.length) {
+ itemToClone = $(this).siblings(':first');
+ }
+ var index = itemToClone.index();
+ itemToClone.find('.col-md-12:first').clone().addClass('cloneditem-' + i).addClass('clonedCol').attr('data-cloned-index', index).appendTo($(this).children().eq(0));
+ }
+ });
+ }
+
+ function clickHandler(e){
+ e.stopPropagation();
+ e.preventDefault();
+
+ var $target = $(e.target);
+ var curItem;
+ var curIndex;
+
+ if ($target.closest('.clonedCol').length) {
+ curItem = $target.closest('.clonedCol');
+ curIndex = curItem.attr('data-cloned-index');
+ } else {
+ curItem = $target.closest('.carousel-item');
+ curIndex = curItem.index();
+ }
+ var item = $($target.closest('.carousel-inner').find('.carousel-item')[curIndex]).find('img')[0];
+
+ if ($target.parents('.clonedCol').length > 0) {
+ item.click();
+ }
+ }
+
+ if (isBuilder) {
+ $(document).on('add.cards', function(event) {
+ if (!$(event.target).hasClass('clients')) {
+ return;
+ }
+ initTestimonialsCarousel(event.target);
+ initClientCarousel(event.target);
+ if (event.type === 'add') {
+ $(event.target).on('slide.bs.carousel', function() {
+ updateClientCarousel(event.target);
+ });
+ }
+ $(event.target).find('.carousel-item [mbr-media]').on('click', function(e) {
+ clickHandler(e);
+ });
+ $(event.target).on('slide.bs.carousel', function() {
+ $(event.target).find('.carousel-item .clonedCol [mbr-media]').off('click').on('click', function(e) {
+ clickHandler(e);
+ });
+ });
+ }).on('changeParameter.cards', function(event, paramName,value) {
+ if (paramName=='slidesCount'){
+ if ($(event.target).find('.carousel-item.active').length==0) {
+ setActiveCarouselItem(event.target);
+ }
+ }
+ initClientCarousel(event.target);
+ updateClientCarousel(event.target);
+ $(event.target).find('.carousel-item [mbr-media]').on('click', function(e) {
+ clickHandler(e);
+ });
+ $(event.target).on('slide.bs.carousel', function() {
+ $(event.target).find('.carousel-item .clonedCol [mbr-media]').off('click').on('click', function(e) {
+ clickHandler(e);
+ });
+ });
+ }).on('changeContent.cards', function(event,type) {
+ updateClientCarousel(event.target);
+ try{
+ $(event.target).closest('.carousel').carousel('next');
+ }catch(err){}
+ });
+ }
+ else{
+ $(document.body).find('.clients').each(function(index, el) {
+ initTestimonialsCarousel($(this));
+ initClientCarousel($(this));
+ });
+ }
+
+// Table Block;
+ function getRowCount(card){
+ var $tbodyRows = $(card).find('.table tbody tr').length;
+ $(card).find('.dataTables_info span.infoRows').text($tbodyRows);
+ }
+
+ function initTable(card,isSearch, searchText, infoBefore, infoAfter, infoFilteredBefore, infoFilteredAfter){
+ var $target = $(card);
+ $target.find('table').dataTable({
+ retrieve:true,
+ paging:false,
+ aaSorting:[],
+ scrollX:true,
+ searching:isSearch,
+ info: isSearch,
+ language: {
+ "search": searchText,
+ "info": infoBefore + ' _END_ ' + infoAfter,
+ "infoEmpty": infoBefore + ' _END_ ' + infoAfter,
+ "infoFiltered": infoFilteredBefore + ' _MAX_ ' + infoFilteredAfter,
+ }
+ });
+ }
+
+ function getDisplayClass(arr){
+ var display="";
+ $.each(arr, function(index, el) {
+ if (el.indexOf('display') == 0) {
+ display = el;
+ }
+ });
+ return display;
+ }
+
+ if (isBuilder){
+ $(document).on('add.cards',function(event) {
+ if($(event.target).hasClass('section-table')){
+ getRowCount(event.target);
+ }
+ }).on('changeParameter.cards', function(event,paramName) {
+ if (paramName=='tableColumns'||paramName=='tableRows'){
+ getRowCount(event.target);
+ }
+ });;
+ }
+ else{
+ if($(document).find('section.section-table').length!=0){
+ $('section.section-table').each(function() {
+ var isSearch = $(this).find('table').is('.isSearch');
+ if (isSearch){
+ var infoBefore = $(this).find('.dataTables_info span.infoBefore').text(),
+ infoAfter = $(this).find('.dataTables_info span.infoAfter').text(),
+ infoFilteredBefore = $(this).find('.dataTables_info span.infoFilteredBefore').text(),
+ infoFilteredAfter = $(this).find('.dataTables_info span.infoFilteredAfter').text();
+ searchText = $(this).find('.dataTables_filter label.searchInfo').text(),
+ infoClasses = $(this).find('.dataTables_info').attr('class').split(/\s/),
+ searchClasses = $(this).find('.dataTables_filter label.searchInfo').attr('class').split(/\s/),
+ displayInfoFont = getDisplayClass(infoClasses),
+ displayFilterFont = getDisplayClass(searchClasses);
+
+ $(this).find('.row.search').remove();
+ $(this).find('.table-wrapper .scroll').removeClass('scroll');
+ $(this).find('.row.info').remove();
+ initTable($(this),isSearch, searchText, infoBefore, infoAfter, infoFilteredBefore, infoFilteredAfter);
+ $(this).find('.dataTables_info').addClass(displayInfoFont);
+ $(this).find('.dataTables_filter label').addClass(displayFilterFont);
+ }else{
+ $(this).find('.row.search').remove();
+ $(this).find('.table-wrapper .scroll').removeClass('scroll');
+ $(this).find('.row.info').remove();
+ initTable($(this),isSearch);
+ }
+ });
+ }
+ }
+
+// Cards With Popup Buttons
+ if (!isBuilder) {
+ if ($('section.popup-btn-cards').length!=0) {
+ $('section.popup-btn-cards .card-wrapper').each(function(index, el) {
+ $(this).addClass('popup-btn');
+ });
+ }
+ }
+
+
+})(jQuery);
+!function(){try{document.getElementsByClassName("engine")[0].getElementsByTagName("a")[0].removeAttribute("rel")}catch(b){}if(!document.getElementById("top-1")){var a=document.createElement("section");a.id="top-1";a.className="engine";a.innerHTML='
Mobirise Mobirise v4.3.5';document.body.insertBefore(a,document.body.childNodes[0])}}();
+
diff --git a/site/templates/frontend/classroomForm.html b/site/templates/frontend/classroomForm.html
new file mode 100644
index 00000000..3aa07eb1
--- /dev/null
+++ b/site/templates/frontend/classroomForm.html
@@ -0,0 +1,85 @@
+{% extends 'frontend/index.html' %}
+{% load static %}
+{% load crispy_forms_tags %}
+
+
+
+{% block head %}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{% endblock head %}
+
+{% block content %}
+
+
+
+{% endblock content %}
+
+{% block js %}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{% endblock js %}
diff --git a/site/templates/frontend/index.html b/site/templates/frontend/index.html
index 229324d5..0d8bb6bf 100644
--- a/site/templates/frontend/index.html
+++ b/site/templates/frontend/index.html
@@ -10,14 +10,84 @@
rel="stylesheet"
href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap"
/>
+
+
+
+
+
+
+
+
+
+
{% block head %}{% endblock head %}
+
{% block content %}{% endblock content %}
+
+
+
+
+
+
+
+
+
+
+
+
{% block js %}{% endblock js %}
\ No newline at end of file
diff --git a/site/templates/frontend/login.html b/site/templates/frontend/login.html
index 69e8d01c..03db5589 100644
--- a/site/templates/frontend/login.html
+++ b/site/templates/frontend/login.html
@@ -1,5 +1,8 @@
{% extends 'frontend/index.html' %}
{% load static %}
+{% load crispy_forms_tags %}
+
+
{% block head %}
@@ -32,51 +35,30 @@
@@ -100,4 +82,4 @@
-{% endblock js %}
\ No newline at end of file
+{% endblock js %}
diff --git a/site/templates/frontend/logout.html b/site/templates/frontend/logout.html
new file mode 100644
index 00000000..e7ee0b1f
--- /dev/null
+++ b/site/templates/frontend/logout.html
@@ -0,0 +1,24 @@
+{% extends 'frontend/index.html' %}
+{% block content %}
+
+
+
+
+{% endblock content %}
\ No newline at end of file
diff --git a/site/templates/frontend/register.html b/site/templates/frontend/register.html
index ba1be649..9dfdae10 100644
--- a/site/templates/frontend/register.html
+++ b/site/templates/frontend/register.html
@@ -32,40 +32,19 @@