Custom log function => log current time

This commit is contained in:
ostertun
2020-10-05 11:53:54 +02:00
parent 3f676141d7
commit eaa08ba301
8 changed files with 313 additions and 271 deletions

View File

@@ -1,9 +1,9 @@
<?php
header('Content-Type: text/javascript');
require_once(__DIR__ . '/../../server/config.php');
?>
var loaderCount = 2;
@@ -29,17 +29,17 @@ $(window).on('load',function(){
$(document).ready(function(){
'use strict'
var isAJAX = false; //Enables or disable AJAX page transitions and loading.
var isDevelopment = false; // Enables development mode. Clean cache & Stops BG & Highlights from changing defaults.
function init_template(){
//ADD YOUR CUSTOM JAVASCRIPT CODES HERE!
//Do not put inside HTML files.
//The init_template() function will be triggered when pages open.
//Generating Dynamic Styles to decrease CSS size and execute faster loading times.
var colorsArray = [
//colors must be in HEX format.
@@ -93,24 +93,24 @@ $(document).ready(function(){
["skype","#12A5F4"],
["instagram","#e1306c"]
];
//Back Button Scroll Stop
//if ('scrollRestoration' in history) {history.scrollRestoration = 'manual';}
//Disable Page Jump on Empty Links.
$('a').on('click', function(){var attrs = $(this).attr('href'); if(attrs === '#'){return false;}});
//Adding Background for Gradient
if(!$('.menu-hider').length){$('#page').append('<div class="menu-hider"><div>');}
/*Menu Extender Function*/
$.fn.showMenu = function() {$(this).addClass('menu-active'); $('#footer-bar').addClass('footer-menu-hidden');setTimeout(function(){$('.menu-hider').addClass('menu-active');},250);$('body').addClass('modal-open')};
$.fn.hideMenu = function() {$(this).removeClass('menu-active'); $('#footer-bar').removeClass('footer-menu-hidden');$('.menu-hider').removeClass('menu-active menu-active-clear');$('body').removeClass('modal-open')};
//Add your programatically triggered menus here
//Menu Required Variables
var menu = $('.menu'),
body = $('body'),
@@ -123,21 +123,21 @@ $(document).ready(function(){
pageContent = $('.page-content'),
headerAndContent = $('.header, .page-content, #footer-bar'),
menuDeployer = $('a[data-menu]');
//Menu System
menu.each(function(){
var menuHeight = $(this).data('menu-height');
var menuWidth = $(this).data('menu-width');
var menuActive = $(this).data('menu-active');
if($(this).hasClass('menu-box-right')){$(this).css("width",menuWidth);}
if($(this).hasClass('menu-box-left')){$(this).css("width",menuWidth);}
if($(this).hasClass('menu-box-bottom')){$(this).css("height",menuHeight);}
if($(this).hasClass('menu-box-top')){$(this).css("height",menuHeight);}
if($(this).hasClass('menu-box-right')){$(this).css("width",menuWidth);}
if($(this).hasClass('menu-box-left')){$(this).css("width",menuWidth);}
if($(this).hasClass('menu-box-bottom')){$(this).css("height",menuHeight);}
if($(this).hasClass('menu-box-top')){$(this).css("height",menuHeight);}
if($(this).hasClass('menu-box-modal')){$(this).css({"height":menuHeight, "width":menuWidth});}
});
});
//Menu Deploy Click
menuDeployer.on('click',function(){
menuDeployer.on('click',function(){
menu.removeClass('menu-active');
menuHider.addClass('menu-active');
@@ -147,23 +147,23 @@ $(document).ready(function(){
var menuWidth = menuID.data('menu-width');
var menuHeight = menuID.data('menu-height');
$('body').addClass('modal-open');
if(menuID.hasClass('menu-header-clear')){menuHider.addClass('menu-active-clear');}
function menuActivate(){menuID = 'menu-active' ? menuID.addClass('menu-active') : menuID.removeClass('menu-active');}
if(menuID.hasClass('menu-header-clear')){menuHider.addClass('menu-active-clear');}
function menuActivate(){menuID = 'menu-active' ? menuID.addClass('menu-active') : menuID.removeClass('menu-active');}
if(menuID.hasClass('menu-box-bottom')){$('#footer-bar').addClass('footer-menu-hidden');}
if(menuEffect === "menu-parallax"){
if(menuID.hasClass('menu-box-bottom')){headerAndContent.css("transform", "translateY("+(menuHeight/5)*(-1)+"px)");}
if(menuID.hasClass('menu-box-top')){headerAndContent.css("transform", "translateY("+(menuHeight/5)+"px)");}
if(menuID.hasClass('menu-box-left')){headerAndContent.css("transform", "translateX("+(menuWidth/5)+"px)");}
if(menuID.hasClass('menu-box-bottom')){headerAndContent.css("transform", "translateY("+(menuHeight/5)*(-1)+"px)");}
if(menuID.hasClass('menu-box-top')){headerAndContent.css("transform", "translateY("+(menuHeight/5)+"px)");}
if(menuID.hasClass('menu-box-left')){headerAndContent.css("transform", "translateX("+(menuWidth/5)+"px)");}
if(menuID.hasClass('menu-box-right')){headerAndContent.css("transform", "translateX("+(menuWidth/5)*(-1)+"px)");}
}
}
if(menuEffect === "menu-push"){
if(menuID.hasClass('menu-box-bottom')){headerAndContent.css("transform", "translateY("+(menuHeight)*(-1)+"px)");}
if(menuID.hasClass('menu-box-top')){headerAndContent.css("transform", "translateY("+(menuHeight)+"px)");}
if(menuID.hasClass('menu-box-left')){headerAndContent.css("transform", "translateX("+(menuWidth)+"px)");}
if(menuID.hasClass('menu-box-bottom')){headerAndContent.css("transform", "translateY("+(menuHeight)*(-1)+"px)");}
if(menuID.hasClass('menu-box-top')){headerAndContent.css("transform", "translateY("+(menuHeight)+"px)");}
if(menuID.hasClass('menu-box-left')){headerAndContent.css("transform", "translateX("+(menuWidth)+"px)");}
if(menuID.hasClass('menu-box-right')){headerAndContent.css("transform", "translateX("+(menuWidth)*(-1)+"px)");}
}
}
if(menuEffect === "menu-push-full"){
if(menuID.hasClass('menu-box-left')){headerAndContent.css("transform", "translateX(100%)");}
if(menuID.hasClass('menu-box-left')){headerAndContent.css("transform", "translateX(100%)");}
if(menuID.hasClass('menu-box-right')){headerAndContent.css("transform", "translateX(-100%)");}
}
menuActivate();
@@ -204,13 +204,13 @@ $(document).ready(function(){
setTimeout(function(){
if($('body').hasClass('detect-theme')){$('body').removeClass('detect-theme');}
if($('body').hasClass('theme-light')){
eraseCookie('sticky_dark_mode');
darkSwitch.prop('checked', false);
eraseCookie('sticky_dark_mode');
darkSwitch.prop('checked', false);
createCookie('sticky_light_mode', true, 1);
}
if($('body').hasClass('theme-dark')){
eraseCookie('sticky_light_mode');
darkSwitch.prop('checked', true);
eraseCookie('sticky_light_mode');
darkSwitch.prop('checked', true);
createCookie('sticky_dark_mode', true, 1);
}
},150);
@@ -222,7 +222,7 @@ $(document).ready(function(){
//Auto Dark Mode
function activateDarkMode(){$('body').removeClass('theme-light').addClass('theme-dark'); $('#dark-mode-detected').removeClass('disabled'); eraseCookie('sticky_light_mode'); createCookie('sticky_dark_mode', true, 1);}
function activateLightMode(){$('body').removeClass('theme-dark').addClass('theme-light'); $('#dark-mode-detected').removeClass('disabled'); eraseCookie('sticky_dark_mode'); createCookie('sticky_light_mode', true, 1);}
function activateNoPreference(){$('#manual-mode-detected').removeClass('disabled');}
function activateNoPreference(){$('#manual-mode-detected').removeClass('disabled');}
function setColorScheme() {
const isDarkMode = window.matchMedia("(prefers-color-scheme: dark)").matches
@@ -244,19 +244,19 @@ $(document).ready(function(){
$('.footer-bar-2 .active-nav, .footer-bar-4 .active-nav, .footer-bar-5 .active-nav').append('<strong></strong>')
}
}
//Back Button in Header
var backButton = $('.back-button, [data-back-button]');
backButton.on('click', function() {
window.history.go(-1);
//return false;
});
//Copyright Year
//Copyright Year
var copyrightYear = $('.copyright-year, #copyright-year');
var dteNow = new Date(); var intYear = dteNow.getFullYear();
copyrightYear.html(intYear);
//Back to top Badge
var backToTop = $('.back-to-top, [data-back-to-top], .back-to-top-badge, .back-to-top-icon'),
backToTopBadge = $('.back-to-top-badge, .back-to-top-icon');
@@ -293,7 +293,7 @@ $(document).ready(function(){
show_back_to_top_badge();
show_scroll_ad();
$('.header-auto-show').addClass('header-active');
}
}
if (footer_reached == true){
hide_back_to_top_badge();
hide_scroll_ad();
@@ -333,10 +333,10 @@ $(document).ready(function(){
if(tab.length){activate_tabs()}
//Text Resizer
$(".text-size-increase").click(function() {$(".text-size-changer *").css("font-size","+=1");});
$(".text-size-increase").click(function() {$(".text-size-changer *").css("font-size","+=1");});
$(".text-size-decrease").click(function() {$(".text-size-changer *").css("font-size","-=1");});
$(".text-size-default").click(function() {$(".text-size-changer *").css("font-size", "");});
//Search Menu Functions
function search_menu(){
$('[data-search]').on('keyup', function() {
@@ -387,15 +387,15 @@ $(document).ready(function(){
//Owl Carousel Sliders
setTimeout(function(){
$('.user-slider').owlCarousel({loop:false, margin:20, nav:false, lazyLoad:true, items:1, autoplay: false, dots:false, autoplayTimeout:4000});
$('.single-slider').owlCarousel({loop:true, margin:20, nav:false, lazyLoad:true, items:1, autoplay: true, autoplayTimeout:4000});
$('.cover-slider').owlCarousel({loop:true, margin:0, nav:false, lazyLoad:true, items:1, autoplay: true, autoplayTimeout:6000});
$('.double-slider').owlCarousel({loop:true, margin:20, nav:false, lazyLoad:false, items:2, autoplay: true, autoplayTimeout:4000});
$('.task-slider').owlCarousel({loop:true, margin:20, nav:false, stagePadding:50, lazyLoad:true, items:2, autoplay: false, autoplayTimeout:4000});
$('.next-slide, .next-slide-arrow, .next-slide-text, .cover-next').on('click',function(){$(this).parent().find('.owl-carousel').trigger('next.owl.carousel');});
$('.prev-slide, .prev-slide-arrow, .prev-slide-text, .cover-prev').on('click',function(){$(this).parent().find('.owl-carousel').trigger('prev.owl.carousel');});
$('.next-slide-user').on('click',function(){$(this).closest('.owl-carousel').trigger('next.owl.carousel');});
$('.prev-slide-user').on('click',function(){$(this).closest('.owl-carousel').trigger('prev.owl.carousel');});
$('.user-slider').owlCarousel({loop:false, margin:20, nav:false, lazyLoad:true, items:1, autoplay: false, dots:false, autoplayTimeout:4000});
$('.single-slider').owlCarousel({loop:true, margin:20, nav:false, lazyLoad:true, items:1, autoplay: true, autoplayTimeout:4000});
$('.cover-slider').owlCarousel({loop:true, margin:0, nav:false, lazyLoad:true, items:1, autoplay: true, autoplayTimeout:6000});
$('.double-slider').owlCarousel({loop:true, margin:20, nav:false, lazyLoad:false, items:2, autoplay: true, autoplayTimeout:4000});
$('.task-slider').owlCarousel({loop:true, margin:20, nav:false, stagePadding:50, lazyLoad:true, items:2, autoplay: false, autoplayTimeout:4000});
$('.next-slide, .next-slide-arrow, .next-slide-text, .cover-next').on('click',function(){$(this).parent().find('.owl-carousel').trigger('next.owl.carousel');});
$('.prev-slide, .prev-slide-arrow, .prev-slide-text, .cover-prev').on('click',function(){$(this).parent().find('.owl-carousel').trigger('prev.owl.carousel');});
$('.next-slide-user').on('click',function(){$(this).closest('.owl-carousel').trigger('next.owl.carousel');});
$('.prev-slide-user').on('click',function(){$(this).closest('.owl-carousel').trigger('prev.owl.carousel');});
},10);
setTimeout(function(){
$('.owl-prev, .owl-next').addClass('bg-highlight');
@@ -428,20 +428,20 @@ $(document).ready(function(){
//Toast, Snackbars and Notifications
$('[data-toast]').on('click',function(){
$('.toast, .snackbar-toast, .notification').toast('hide');
$('#'+$(this).data('toast')).toast('show');
$('.toast, .snackbar-toast, .notification').toast('hide');
$('#'+$(this).data('toast')).toast('show');
return false;
});
$('[data-dismiss]').on('click',function(){
var thisData = $(this).data('dismiss');
$('#'+thisData).toast('hide');
});
//Tooltips
$(function () {
$('[data-toggle="tooltip"]').tooltip()
})
//Cancel Collapse Jump on Click
if($('[data-toggle="collapse"]').length){
$('[data-toggle="collapse"]').on('click',function(e){
@@ -467,10 +467,10 @@ $(document).ready(function(){
$('#'+thisID).prop('checked', false);
} else {
$('#'+thisID).prop('checked', true);
}
}
})
//Working Hours
//Working Hours
var businessHours = $('.business-hours');
function activate_business_hours(){
if(businessHours.length){
@@ -501,7 +501,7 @@ $(document).ready(function(){
},
openClass:"bg-green1-dark is-business-opened",
closedClass:"bg-red2-dark is-business-closed"
});
});
if(businessHours.hasClass('is-business-opened')){
$('.show-business-opened').removeClass('disabled');
$('.show-business-closed').addClass('disabled');
@@ -540,7 +540,7 @@ $(document).ready(function(){
})(document, window.navigator, "standalone")
}
ath();
//Add to Home Banners
$('.simulate-android-badge').on('click',function(){$('.add-to-home').removeClass('add-to-home-ios').addClass('add-to-home-visible add-to-home-android');});
$('.simulate-iphone-badge').on('click',function(){$('.add-to-home').removeClass('add-to-home-android').addClass('add-to-home-visible add-to-home-ios');});
@@ -549,16 +549,16 @@ $(document).ready(function(){
$('.simulate-ios-banner').on('click',function(){$('#menu-install-pwa-ios, .menu-hider').addClass('menu-active')})
//Extending Card Features
function card_extender(){
function card_extender(){
/*Set Page Content to Min 100vh*/
if($('.is-on-homescreen').length){
var windowHeight = screen.height;
$('.page-content, #page').css('min-height', windowHeight);
}
}
if(!$('.is-on-homescreen').length){
var windowHeight = window.innerHeight
$('.page-content, #page').css('min-height', windowHeight);
}
}
$('[data-card-height]').each(function(){
var cardHeight = $(this).data('card-height');
@@ -567,8 +567,8 @@ $(document).ready(function(){
$(this).css('height', cardHeight);
if(cardHeight == "cover"){
if(header.length && menuFooter.length){
$(this).css('height', windowHeight -headerHeight - footerHeight)
$('.map-full, .map-full iframe').css('height', windowHeight - headerHeight - footerHeight +14)
$(this).css('height', windowHeight -headerHeight - footerHeight)
$('.map-full, .map-full iframe').css('height', windowHeight - headerHeight - footerHeight +14)
} else {
$(this).css('height', windowHeight)
$('.map-full, .map-full iframe').css('height', windowHeight)
@@ -581,20 +581,20 @@ $(document).ready(function(){
$(window).resize(function(){
card_extender();
});
//Show Map
$('.show-map, .hide-map').on('click',function(){
$('.map-full .caption').toggleClass('deactivate-map');
$('.map-but-1, .map-but-2').toggleClass('deactivate-map');
$('.map-full .hide-map').toggleClass('activate-map');
});
});
//Card Hovers
$('.card-scale').unbind().bind('mouseenter mouseleave touchstart touchend',function(){$(this).find('img').toggleClass('card-scale-image');});
$('.card-grayscale').unbind().bind('mouseenter mouseleave touchstart touchend',function(){$(this).find('img').toggleClass('card-grayscale-image');});
$('.card-rotate').unbind().bind('mouseenter mouseleave touchstart touchend',function(){$(this).find('img').toggleClass('card-rotate-image');});
$('.card-blur').unbind().bind('mouseenter mouseleave touchstart touchend',function(){$(this).find('img').toggleClass('card-blur-image');});
$('.card-scale').unbind().bind('mouseenter mouseleave touchstart touchend',function(){$(this).find('img').toggleClass('card-scale-image');});
$('.card-grayscale').unbind().bind('mouseenter mouseleave touchstart touchend',function(){$(this).find('img').toggleClass('card-grayscale-image');});
$('.card-rotate').unbind().bind('mouseenter mouseleave touchstart touchend',function(){$(this).find('img').toggleClass('card-rotate-image');});
$('.card-blur').unbind().bind('mouseenter mouseleave touchstart touchend',function(){$(this).find('img').toggleClass('card-blur-image');});
$('.card-hide').unbind().bind('mouseenter mouseleave touchstart touchend',function(){$(this).find('.card-center, .card-bottom, .card-top, .card-overlay').toggleClass('card-hide-image');});
@@ -605,7 +605,7 @@ $(document).ready(function(){
var readingSeconds = readingWords % 60
$('.reading-progress-words').append(readingWords);
$('.reading-progress-time').append(readingMinutes + ':' + readingSeconds);
});
});
//Timed Ads
if($('[data-auto-show-ad]').length){
@@ -614,7 +614,7 @@ $(document).ready(function(){
$('[data-auto-show-ad]').trigger('click');
},time*1000);
}
$('[data-timed-ad]').on('click', function(){
$('[data-timed-ad]').on('click', function(){
var counter = $(this).data('timed-ad');
var adwin = $('#'+$(this).data('menu'));
menuHider.addClass('no-click');
@@ -686,10 +686,10 @@ $(document).ready(function(){
})
//Caption Hovers
$('.caption-scale').unbind().bind('mouseenter mouseleave touchstart touchend',function(){$(this).find('img').toggleClass('caption-scale-image');});
$('.caption-grayscale').unbind().bind('mouseenter mouseleave touchstart touchend',function(){$(this).find('img').toggleClass('caption-grayscale-image');});
$('.caption-rotate').unbind().bind('mouseenter mouseleave touchstart touchend',function(){$(this).find('img').toggleClass('caption-rotate-image');});
$('.caption-blur').unbind().bind('mouseenter mouseleave touchstart touchend',function(){$(this).find('img').toggleClass('caption-blur-image');});
$('.caption-scale').unbind().bind('mouseenter mouseleave touchstart touchend',function(){$(this).find('img').toggleClass('caption-scale-image');});
$('.caption-grayscale').unbind().bind('mouseenter mouseleave touchstart touchend',function(){$(this).find('img').toggleClass('caption-grayscale-image');});
$('.caption-rotate').unbind().bind('mouseenter mouseleave touchstart touchend',function(){$(this).find('img').toggleClass('caption-rotate-image');});
$('.caption-blur').unbind().bind('mouseenter mouseleave touchstart touchend',function(){$(this).find('img').toggleClass('caption-blur-image');});
$('.caption-hide').unbind().bind('mouseenter mouseleave touchstart touchend',function(){$(this).find('.caption-center, .caption-bottom, .caption-top, .caption-overlay').toggleClass('caption-hide-image');});
//File Upload
@@ -733,8 +733,8 @@ $(document).ready(function(){
//Age Verification
var checkAge = $('.check-age');
function activate_age_checker(){
console.log('active');
$(".check-age").on('click',function(){
log('active');
$(".check-age").on('click',function(){
var dateBirghtDay = $("#date-birth-day").val();
var dateBirthMonth = $("#date-birth-month").val();
var dateBirthYear = $("#date-birth-year").val();
@@ -747,7 +747,7 @@ $(document).ready(function(){
setDate.setFullYear(mydate.getFullYear() + age, dateBirthMonth-1, dateBirghtDay);
if ((currdate - setDate) > 0){
console.log("above 18");
log("above 18");
$('#menu-age').removeClass('menu-active')
$('#menu-age-okay').addClass('menu-active');
}else{
@@ -756,7 +756,7 @@ $(document).ready(function(){
}
return true;
});
}
}
if(checkAge.length){activate_age_checker();}
@@ -816,11 +816,11 @@ $(document).ready(function(){
var spanValue = $(this).parent().find('span').text();
if($(this).val() != spanValue && $(this).val() != ""){
$(this).parent().find('span').addClass('input-style-1-active').removeClass('input-style-1-inactive');
}
}
if($(this).val() === ""){
$(this).parent().find('span').removeClass('input-style-1-inactive input-style-1-active');
}
});
});
$('.input-required input, .input-required select, .input-required textarea').on('focusout',function(){
var spanValue = $(this).parent().find('span').text();
if($(this).val() === ""){
@@ -833,17 +833,17 @@ $(document).ready(function(){
if(getValue === "default"){
$(this).parent().find('em').html(invalidIcon)
$(this).parent().find('span').removeClass('input-style-1-inactive input-style-1-active');
}
}
if(getValue != "default"){
$(this).parent().find('em').html(validIcon)
}
}
});
$('.input-required input[type="email"]').on('focusout',function(){if (emailValidator.test($(this).val())){$(this).parent().find('em').html(validIcon);}else{if($(this).val() === ""){$(this).parent().find('em').html("(required)");}else{$(this).parent().find('em').html(invalidIcon);}}});
$('.input-required input[type="email"]').on('focusout',function(){if (emailValidator.test($(this).val())){$(this).parent().find('em').html(validIcon);}else{if($(this).val() === ""){$(this).parent().find('em').html("(required)");}else{$(this).parent().find('em').html(invalidIcon);}}});
$('.input-required input[type="tel"]').on('focusout',function(){if (phoneValidator.test($(this).val())){$(this).parent().find('em').html(validIcon);}else{if($(this).val() === ""){$(this).parent().find('em').html("(required)");}else{$(this).parent().find('em').html(invalidIcon);}}});
$('.input-required input[type="password"]').on('focusout',function(){if (passwordValidator.test($(this).val())){$(this).parent().find('em').html(validIcon);}else{if($(this).val() === ""){$(this).parent().find('em').html("(required)");}else{$(this).parent().find('em').html(invalidIcon);}}});
$('.input-required input[type="url"]').on('focusout',function(){if (urlValidator.test($(this).val())){$(this).parent().find('em').html(validIcon);}else{if($(this).val() === ""){$(this).parent().find('em').html("(required)");}else{$(this).parent().find('em').html(invalidIcon);}}});
$('.input-required input[type="name"]').on('focusout',function(){if (nameValidator.test($(this).val())){$(this).parent().find('em').html(validIcon);}else{if($(this).val() === ""){$(this).parent().find('em').html("(required)");}else{$(this).parent().find('em').html(invalidIcon);}}});
$('.input-required textarea').on('focusout',function(){if (textareaValidator.test($(this).val())){$(this).parent().find('em').html(validIcon);}else{if($(this).val() === ""){$(this).parent().find('em').html("(required)");}else{$(this).parent().find('em').html(invalidIcon);}}});
$('.input-required input[type="password"]').on('focusout',function(){if (passwordValidator.test($(this).val())){$(this).parent().find('em').html(validIcon);}else{if($(this).val() === ""){$(this).parent().find('em').html("(required)");}else{$(this).parent().find('em').html(invalidIcon);}}});
$('.input-required input[type="url"]').on('focusout',function(){if (urlValidator.test($(this).val())){$(this).parent().find('em').html(validIcon);}else{if($(this).val() === ""){$(this).parent().find('em').html("(required)");}else{$(this).parent().find('em').html(invalidIcon);}}});
$('.input-required input[type="name"]').on('focusout',function(){if (nameValidator.test($(this).val())){$(this).parent().find('em').html(validIcon);}else{if($(this).val() === ""){$(this).parent().find('em').html("(required)");}else{$(this).parent().find('em').html(invalidIcon);}}});
$('.input-required textarea').on('focusout',function(){if (textareaValidator.test($(this).val())){$(this).parent().find('em').html(validIcon);}else{if($(this).val() === ""){$(this).parent().find('em').html("(required)");}else{$(this).parent().find('em').html(invalidIcon);}}});
//Set Today Date to Date Inputs
Date.prototype.toDateInputValue = (function() {
@@ -880,7 +880,7 @@ $(document).ready(function(){
$('.online-message').addClass('online-message-active');
$('.offline-message').removeClass('offline-message-active');
setTimeout(function(){$('.online-message').removeClass('online-message-active');},2000);
}
}
$('.simulate-offline').on('click',function(){isOffline();})
$('.simulate-online').on('click',function(){isOnline();})
@@ -889,11 +889,11 @@ $(document).ready(function(){
function updateOnlineStatus(event) {
var condition = navigator.onLine ? "online" : "offline";
isOnline();
console.log( 'Connection: Online');
log( 'Connection: Online');
}
function updateOfflineStatus(event) {
isOffline();
console.log( 'Connection: Offline');
log( 'Connection: Offline');
}
window.addEventListener('online', updateOnlineStatus);
window.addEventListener('offline', updateOfflineStatus);
@@ -901,14 +901,14 @@ $(document).ready(function(){
//QR Generator
var generateQR = $('.generate-qr-result, .generate-qr-auto');
function activate_qr_generator(){
//QR Code Generator
//QR Code Generator
var qr_auto_link = window.location.href;
var qr_api_address = 'https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=';
$('.generate-qr-auto').attr('src', qr_api_address+qr_auto_link)
$('.generate-qr-button').on('click',function(){
if($(this).parent().find('.fa').hasClass('fa-exclamation-triangle')){
console.log('Invalid URL');
log('Invalid URL');
} else {
var get_qr_url = $('.generate-qr-input').val();
if(!get_qr_url == ''){
@@ -960,10 +960,10 @@ $(document).ready(function(){
});
//Filterable
if($('.gallery-filter').length > 0){$('.gallery-filter').filterizr(); $('.gallery-filter-active').addClass('color-highlight');}
if($('.gallery-filter').length > 0){$('.gallery-filter').filterizr(); $('.gallery-filter-active').addClass('color-highlight');}
$('.gallery-filter-controls li').on('click',function(){
$('.gallery-filter-controls li').removeClass('gallery-filter-active color-highlight');
$(this).addClass('gallery-filter-active color-highlight');
$('.gallery-filter-controls li').removeClass('gallery-filter-active color-highlight');
$(this).addClass('gallery-filter-active color-highlight');
});
//Gallery Views // Added in 2.0
@@ -982,7 +982,7 @@ $(document).ready(function(){
galleryViewControls.removeClass('color-highlight');
$(this).addClass('color-highlight');
galleryViews.removeClass().addClass('gallery-views gallery-view-2');
});
});
galleryView3.on('click',function(){
galleryViewControls.removeClass('color-highlight');
$(this).addClass('color-highlight');
@@ -1064,7 +1064,7 @@ $(document).ready(function(){
})
});
//Charts
if($('.chart').length > 0){
var loadJS = function(url, implementationCode, location){
@@ -1075,7 +1075,7 @@ $(document).ready(function(){
location.appendChild(scriptTag);
};
var call_charts_to_page = function(){
var walletChart = $('#wallet-chart');
var pieChart = $('#pie-chart');
var doughnutChart = $('#doughnut-chart');
@@ -1100,9 +1100,9 @@ $(document).ready(function(){
legend: {display: true, position:'bottom', labels:{fontSize:13, padding:15,boxWidth:12},},
tooltips:{enabled:true}, animation:{duration:1500}
}
});
});
}
if(pieChart.length){
var pieDemoChart = new Chart(pieChart, {
type: 'pie',
@@ -1119,7 +1119,7 @@ $(document).ready(function(){
legend: {display: true, position:'bottom', labels:{fontSize:13, padding:15,boxWidth:12},},
tooltips:{enabled:true}, animation:{duration:1500}
}
});
});
}
if(doughnutChart.length){
@@ -1138,7 +1138,7 @@ $(document).ready(function(){
legend: {display: true, position:'bottom', labels:{fontSize:13, padding:15,boxWidth:12},},
tooltips:{enabled:true}, animation:{duration:1500}, layout:{ padding: {bottom: 30}}
}
});
});
}
if(polarChart.length){
@@ -1157,7 +1157,7 @@ $(document).ready(function(){
legend: {display: true, position:'bottom', labels:{fontSize:13, padding:15,boxWidth:12},},
tooltips:{enabled:true}, animation:{duration:1500}, layout:{ padding: {bottom: 30}}
}
});
});
}
if (verticalChart.length){
@@ -1182,7 +1182,7 @@ $(document).ready(function(){
legend: {display: true, position:'bottom', labels:{fontSize:13, padding:15,boxWidth:12},},
title: {display: false}
}
});
});
}
if(horizontalChart.length){
@@ -1206,7 +1206,7 @@ $(document).ready(function(){
legend: {display: true, position:'bottom', labels:{fontSize:13, padding:15,boxWidth:12},},
title: {display: false}
}
});
});
}
if(lineChart.length){
@@ -1214,11 +1214,11 @@ $(document).ready(function(){
type: 'line',
data: {
labels: [2000,2005,2010,2015,2010],
datasets: [{
datasets: [{
data: [500,400,300,200,300],
label: "Desktop Web",
borderColor: "#D8334A"
}, {
}, {
data: [0,100,300,400,500],
label: "Mobile Web",
borderColor: "#4A89DC"
@@ -1234,11 +1234,11 @@ $(document).ready(function(){
}
}
loadJS('<?php echo SERVER_ADDR; ?>/client/scripts/charts.js', call_charts_to_page, document.body);
}
}
//Local Error Message
if (window.location.protocol === "file:"){$('a').on('mouseover',function(){console.log("You are seeing these errors because your file is on your local computer. For real life simulations please use a Live Server or a Local Server such as AMPPS or WAMPP or simulate a Live Preview using a Code Editor like http://brackets.io (it's 100% free) - PWA functions and AJAX Page Transitions will only work in these scenarios.");});}
if (window.location.protocol === "file:"){$('a').on('mouseover',function(){log("You are seeing these errors because your file is on your local computer. For real life simulations please use a Live Server or a Local Server such as AMPPS or WAMPP or simulate a Live Preview using a Code Editor like http://brackets.io (it's 100% free) - PWA functions and AJAX Page Transitions will only work in these scenarios.");});}
//Style Generator
@@ -1248,21 +1248,21 @@ $(document).ready(function(){
//HEX to RGBA Converter
function HEXtoRGBA(hex){
var c;
if(/^#([A-Fa-f0-9]{3}){1,2}$/.test(hex)){
if(/^#([A-Fa-f0-9]{3}){1,2}$/.test(hex)){
c= hex.substring(1).split('');
if(c.length== 3){c= [c[0], c[0], c[1], c[1], c[2], c[2]];}
c= '0x'+c.join('');
return 'rgba('+[(c>>16)&255, (c>>8)&255, c&255].join(',')+',0.3)';
}
}
function highlight_colors(){
var bodyColor = readCookie('sticky-color-scheme')
if(bodyColor == undefined){var bodyColor = $('body').data('highlight');}
var bodyBackground = readCookie('sticky-bg-scheme')
if(bodyBackground == undefined){var bodyBackground = $('body').data('background');}
var data = colorsArray.map(colorsArray => colorsArray[0]);
if (data.indexOf(bodyColor) > -1) {
var highlightLocated = data.indexOf(bodyColor)
@@ -1282,7 +1282,7 @@ $(document).ready(function(){
$('.generated-background').append(bodyBG);
}
}
}
}
highlight_colors();
//Change Highlight
@@ -1306,7 +1306,7 @@ $(document).ready(function(){
$('body').append('<style class="generated-highlight"></style>')
$('.generated-highlight').append(highlightColor, highlightBg, highlightNav, highlightBorder);
}
});
});
//Change Background
$('[data-change-background]').on('click',function(changeColor){
@@ -1322,15 +1322,15 @@ $(document).ready(function(){
});
if (!generatedStyles.length){
$('body').append('<style class="generated-styles"></style>');
$('body').append('<style class="generated-styles"></style>');
$('.generated-styles').append('/*Generated using JS for lower CSS file Size, Easier Editing & Faster Loading*/');
colorsArray.forEach(function (colorValue) {$('.generated-styles').append('.bg-'+colorValue[0]+'-light{ background-color: '+colorValue[1]+'!important; color:#FFFFFF!important;} .bg-'+colorValue[0]+'-light i, .bg-'+colorValue[0]+'-dark i{color:#FFFFFF;} .bg-'+colorValue[0]+'-dark{ background-color: '+colorValue[2]+'!important; color:#FFFFFF!important;} .border-'+colorValue[0]+'-light{ border-color:'+colorValue[1]+'!important;} .border-'+colorValue[0]+'-dark{ border-color:'+colorValue[2]+'!important;} .color-'+colorValue[0]+'-light{ color: '+colorValue[1]+'!important;} .color-'+colorValue[0]+'-dark{ color: '+colorValue[2]+'!important;}');});
colorsArray.forEach(function (colorFadeValue) {$('.generated-styles').append('.bg-fade-'+colorFadeValue[0]+'-light{ background-color: '+ HEXtoRGBA(colorFadeValue[1]) + '!important; color:#FFFFFF;} .bg-fade-'+colorFadeValue[0]+'-light i, .bg-'+colorFadeValue[0]+'-dark i{color:#FFFFFF;} .bg-fade-'+colorFadeValue[0]+'-dark{ background-color: '+HEXtoRGBA(colorFadeValue[2])+'!important; color:#FFFFFF;} .border-fade-'+colorFadeValue[0]+'-light{ border-color:'+HEXtoRGBA(colorFadeValue[1])+'!important;} .border-fade-'+colorFadeValue[0]+'-dark{ border-color:'+HEXtoRGBA(colorFadeValue[2])+'!important;} .color-fade-'+colorFadeValue[0]+'-light{ color: '+HEXtoRGBA(colorFadeValue[1])+'!important;} .color-fade-'+colorFadeValue[0]+'-dark{ color: '+HEXtoRGBA(colorFadeValue[2])+'!important;}');});
colorsArray.forEach(function (gradientValue) {$('.generated-styles').append('.bg-gradient-'+gradientValue[0]+'{background-image: linear-gradient(to bottom, '+gradientValue[1]+' 0, '+gradientValue[2]+' 100%)}')});
colorsArray.forEach(function (colorValue) {$('.generated-styles').append('.bg-'+colorValue[0]+'-light{ background-color: '+colorValue[1]+'!important; color:#FFFFFF!important;} .bg-'+colorValue[0]+'-light i, .bg-'+colorValue[0]+'-dark i{color:#FFFFFF;} .bg-'+colorValue[0]+'-dark{ background-color: '+colorValue[2]+'!important; color:#FFFFFF!important;} .border-'+colorValue[0]+'-light{ border-color:'+colorValue[1]+'!important;} .border-'+colorValue[0]+'-dark{ border-color:'+colorValue[2]+'!important;} .color-'+colorValue[0]+'-light{ color: '+colorValue[1]+'!important;} .color-'+colorValue[0]+'-dark{ color: '+colorValue[2]+'!important;}');});
colorsArray.forEach(function (colorFadeValue) {$('.generated-styles').append('.bg-fade-'+colorFadeValue[0]+'-light{ background-color: '+ HEXtoRGBA(colorFadeValue[1]) + '!important; color:#FFFFFF;} .bg-fade-'+colorFadeValue[0]+'-light i, .bg-'+colorFadeValue[0]+'-dark i{color:#FFFFFF;} .bg-fade-'+colorFadeValue[0]+'-dark{ background-color: '+HEXtoRGBA(colorFadeValue[2])+'!important; color:#FFFFFF;} .border-fade-'+colorFadeValue[0]+'-light{ border-color:'+HEXtoRGBA(colorFadeValue[1])+'!important;} .border-fade-'+colorFadeValue[0]+'-dark{ border-color:'+HEXtoRGBA(colorFadeValue[2])+'!important;} .color-fade-'+colorFadeValue[0]+'-light{ color: '+HEXtoRGBA(colorFadeValue[1])+'!important;} .color-fade-'+colorFadeValue[0]+'-dark{ color: '+HEXtoRGBA(colorFadeValue[2])+'!important;}');});
colorsArray.forEach(function (gradientValue) {$('.generated-styles').append('.bg-gradient-'+gradientValue[0]+'{background-image: linear-gradient(to bottom, '+gradientValue[1]+' 0, '+gradientValue[2]+' 100%)}')});
socialColorArray.forEach(function (socialColorValue) {$('.generated-styles').append('.bg-'+socialColorValue[0]+'{background-color:'+socialColorValue[1]+'!important; color:#FFFFFF;} .color-'+socialColorValue[0]+'{color:'+socialColorValue[1]+'!important;}')});
colorsArray.forEach(function (gradientBodyValue) {$('.generated-styles').append('.body-'+gradientBodyValue[0]+'{background-image: linear-gradient(to bottom, '+gradientBodyValue[1]+' 0, '+gradientBodyValue[3]+' 100%)}')});
colorsArray.forEach(function (gradientBodyValue) {$('.generated-styles').append('.body-'+gradientBodyValue[0]+'{background-image: linear-gradient(to bottom, '+gradientBodyValue[1]+' 0, '+gradientBodyValue[3]+' 100%)}')});
}
function welcomeOk() {
createCookie('sticky_welcome_banner', true, 1);
$('#menu-welcome').hideMenu();
@@ -1344,16 +1344,16 @@ $(document).ready(function(){
}
$('#menu-welcome-a-okay').click(welcomeOk);
showWelcome();
initRegatten();
hideLoader();
}
//Activating all the plugins
setTimeout(init_template, 0);
//Activate AJAX Transitions
//Activate AJAX Transitions
if(isAJAX === true){
$(function(){
'use strict';
@@ -1361,7 +1361,7 @@ $(document).ready(function(){
prefetch: true,
prefetchOn: 'mouseover',
cacheLength: 100,
scroll: true,
scroll: true,
blacklist: '.default-link',
forms: 'contactForm',
onStart: {
@@ -1378,7 +1378,7 @@ $(document).ready(function(){
render: function ($container, $newContent) {
$container.removeClass('is-exiting');// Remove your CSS animation reversing class
$container.html($newContent);// Inject the new content
setTimeout(init_template, 0)//Timeout required to properly initiate all JS Functions.
setTimeout(init_template, 0)//Timeout required to properly initiate all JS Functions.
$('#preloader').removeClass('preloader-hide');
}
},
@@ -1406,5 +1406,5 @@ $(document).ready(function(){
caches.delete(cacheName);
});
});
}
});
}
});