window.OneSignal = window.OneSignal || [];
OneSignal.push( function() {
OneSignal.SERVICE_WORKER_UPDATER_PATH = "OneSignalSDKUpdaterWorker.js.php";
OneSignal.SERVICE_WORKER_PATH = "OneSignalSDKWorker.js.php";
OneSignal.SERVICE_WORKER_PARAM = { scope: '/' };
OneSignal.setDefaultNotificationUrl("https://www.top6quotes.com");
var oneSignal_options = {};
window._oneSignalInitOptions = oneSignal_options;
oneSignal_options['wordpress'] = true;
oneSignal_options['appId'] = 'ae209f28-962a-40cd-8e38-adb75736256c';
oneSignal_options['welcomeNotification'] = { };
oneSignal_options['welcomeNotification']['title'] = "";
oneSignal_options['welcomeNotification']['message'] = "";
oneSignal_options['path'] = "https://www.top6quotes.com/wp-content/plugins/onesignal-free-web-push-notifications/sdk_files/";
oneSignal_options['promptOptions'] = { };
oneSignal_options['notifyButton'] = { };
oneSignal_options['notifyButton']['enable'] = true;
oneSignal_options['notifyButton']['position'] = 'bottom-left';
oneSignal_options['notifyButton']['theme'] = 'default';
oneSignal_options['notifyButton']['size'] = 'medium';
oneSignal_options['notifyButton']['showCredit'] = true;
oneSignal_options['notifyButton']['text'] = {};
OneSignal.init(window._oneSignalInitOptions);
OneSignal.showSlidedownPrompt(); });
function documentInitOneSignal() {
var oneSignal_elements = document.getElementsByClassName("OneSignal-prompt");
var oneSignalLinkClickHandler = function(event) { OneSignal.push(['registerForPushNotifications']); event.preventDefault(); }; for(var i = 0; i < oneSignal_elements.length; i++)
oneSignal_elements[i].addEventListener('click', oneSignalLinkClickHandler, false);
}
if (document.readyState === 'complete') {
documentInitOneSignal();
}
else {
window.addEventListener("load", function(event){
documentInitOneSignal();
});
}
jQuery(document).ready(function($){
var mysticky_welcomebar_height = jQuery( '.mysticky-welcomebar-fixed' ).outerHeight();
if( jQuery( '.mysticky-welcomebar-fixed' ).data('position') == 'top' ) {
jQuery( '.mysticky-welcomebar-fixed' ).css( 'top', '-' + mysticky_welcomebar_height + 'px' );
} else {
jQuery( '.mysticky-welcomebar-fixed' ).css( 'bottom', '-' + mysticky_welcomebar_height + 'px' );
}
var divi_topbar_height = $( '.et_fixed_nav #top-header' ).outerHeight();
var divi_total_height = mysticky_welcomebar_height + divi_topbar_height;
var welcombar_aftersubmission = $( '.mysticky-welcomebar-fixed' ).data('aftersubmission');
if( welcombar_aftersubmission == 'dont_show_welcomebar' ){
var welcomebar_storage = localStorage.getItem("welcomebar_close");
} else if( welcombar_aftersubmission == 'show_welcomebar_next_visit' ) {
var welcomebar_storage = sessionStorage.getItem("welcomebar_close");
} else {
sessionStorage.removeItem('welcomebar_close');
localStorage.removeItem('welcomebar_close');
var welcomebar_storage = null;
}
if ( welcomebar_storage === null ){
var after_trigger = jQuery( '.mysticky-welcomebar-fixed' ).data('after-triger');
jQuery( 'body' ).addClass( 'mysticky-welcomebar-apper' );
if ( after_trigger == 'after_a_few_seconds' ) {
if ( $( '.mysticky-welcomebar-fixed' ).hasClass( 'mysticky-welcomebar-display-desktop' ) ) {
if ( $( window ).width() > 767 ) {
var trigger_sec = jQuery( '.mysticky-welcomebar-fixed' ).data('triger-sec') * 1000;
var welcombar_position = $( '.mysticky-welcomebar-fixed' ).data('position');
var welcombar_height = $( '.mysticky-welcomebar-fixed' ).outerHeight();
setTimeout(function(){
jQuery( '.mysticky-welcomebar-fixed' ).addClass( 'mysticky-welcomebar-animation' );
if ( welcombar_position == 'top' ) {
jQuery( '.mysticky-welcomebar-fixed' ).addClass( 'mysticky-welcomebar-animation' );
jQuery( '.mysticky-welcomebar-fixed' ).css( 'top', '0' );
jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' );
$( 'html' ).css( 'margin-bottom', '' );
jQuery( '#mysticky_divi_style' ).remove();
jQuery( '.et_fixed_nav #top-header' ).css( 'top', welcombar_height + 'px' );
jQuery( 'head' ).append( '
' );
$( 'html' ).attr( 'style', 'margin-top: ' + mysticky_welcomebar_height + 'px !important' );
$( '#mysticky-nav' ).css( 'top', mysticky_welcomebar_height + 'px' );
} else {
jQuery( '.mysticky-welcomebar-fixed' ).css( 'bottom', '0' );
jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' );
$( 'html' ).css( 'margin-top', '' );
jQuery( '#mysticky_divi_style' ).remove();
jQuery( '.et_fixed_nav #top-header' ).css( 'top', '' );
$( 'html' ).attr( 'style', 'margin-bottom: ' + mysticky_welcomebar_height + 'px !important' );
}
}, trigger_sec );
}
}
}
if ( $( window ).width() < 767 ) {
if ( after_trigger == 'after_a_few_seconds' ) {
if ( $( '.mysticky-welcomebar-fixed' ).hasClass( 'mysticky-welcomebar-display-mobile' ) ) {
var trigger_sec = jQuery( '.mysticky-welcomebar-fixed' ).data('triger-sec') * 1000;
var welcombar_position = $( '.mysticky-welcomebar-fixed' ).data('position');
var welcombar_height = $( '.mysticky-welcomebar-fixed' ).outerHeight();
setTimeout(function(){
jQuery( '.mysticky-welcomebar-fixed' ).addClass( 'mysticky-welcomebar-animation' );
jQuery( '#mysticky_divi_style' ).remove();
jQuery( '.et_fixed_nav #top-header' ).css( 'top', '' );
if ( welcombar_position == 'top' ) {
jQuery( '.mysticky-welcomebar-fixed' ).css( 'top', '0' );
jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' );
$( 'html' ).css( 'margin-bottom', '' );
$( 'html' ).attr( 'style', 'margin-top: ' + mysticky_welcomebar_height + 'px !important' );
$( '#mysticky-nav' ).css( 'top', mysticky_welcomebar_height + 'px' );
} else {
jQuery( '.mysticky-welcomebar-fixed' ).css( 'bottom', '0' );
jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' );
$( 'html' ).css( 'margin-top', '' );
$( 'html' ).attr( 'style', 'margin-bottom: ' + mysticky_welcomebar_height + 'px !important' );
}
}, trigger_sec );
}
}
}
mystickyelements_present();
}
$( window ).resize( function(){
var mysticky_welcomebar_height = jQuery( '.mysticky-welcomebar-fixed' ).outerHeight();
if( welcombar_aftersubmission == 'dont_show_welcomebar' ){
var welcomebar_storage = localStorage.getItem("welcomebar_close");
} else if( welcombar_aftersubmission == 'show_welcomebar_next_visit' ) {
var welcomebar_storage = sessionStorage.getItem("welcomebar_close");
} else {
sessionStorage.removeItem('welcomebar_close');
localStorage.removeItem('welcomebar_close');
var welcomebar_storage = null;
}
if ( welcomebar_storage === null ){
var after_trigger = jQuery( '.mysticky-welcomebar-fixed' ).data('after-triger');
if ( ! $( '.mysticky-welcomebar-fixed' ).hasClass( 'mysticky-welcomebar-notapper' ) ) {
jQuery( 'body' ).addClass( 'mysticky-welcomebar-apper' );
} else {
jQuery( 'body' ).removeClass( 'mysticky-welcomebar-apper' );
}
if ( after_trigger == 'after_a_few_seconds' ) {
var trigger_sec = jQuery( '.mysticky-welcomebar-fixed' ).data('triger-sec') * 1000;
var welcombar_position = $( '.mysticky-welcomebar-fixed' ).data('position');
var welcombar_height = $( '.mysticky-welcomebar-fixed' ).outerHeight();
if ( $( window ).width() < 767 ) {
if ( $( '.mysticky-welcomebar-fixed' ).hasClass( 'mysticky-welcomebar-display-mobile' ) ) {
setTimeout(function(){
jQuery( '.mysticky-welcomebar-fixed' ).addClass( 'mysticky-welcomebar-animation' );
jQuery( '#mysticky_divi_style' ).remove();
jQuery( '.et_fixed_nav #top-header' ).css( 'top', '' );
if ( welcombar_position == 'top' ) {
jQuery( '.mysticky-welcomebar-fixed' ).css( 'top', '0' );
jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' );
$( 'html' ).css( 'margin-bottom', '' );
$( 'html' ).attr( 'style', 'margin-top: ' + mysticky_welcomebar_height + 'px !important' );
$( '.mysticky-welcomebar-apper #mysticky-nav' ).css( 'top', mysticky_welcomebar_height + 'px' );
} else {
jQuery( '.mysticky-welcomebar-fixed' ).css( 'bottom', '0' );
jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' );
$( 'html' ).css( 'margin-top', '' );
$( 'html' ).attr( 'style', 'margin-bottom: ' + mysticky_welcomebar_height + 'px !important' );
}
}, trigger_sec );
}
} else {
if ( $( '.mysticky-welcomebar-fixed' ).hasClass( 'mysticky-welcomebar-display-desktop' ) ) {
setTimeout(function(){
jQuery( '.mysticky-welcomebar-fixed' ).addClass( 'mysticky-welcomebar-animation' );
if ( welcombar_position == 'top' ) {
jQuery( '.mysticky-welcomebar-fixed' ).css( 'top', '0' );
jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' );
$( 'html' ).css( 'margin-bottom', '' );
jQuery( '#mysticky_divi_style' ).remove();
jQuery( '.mysticky-welcomebar-apper.et_fixed_nav #top-header' ).css( 'top', welcombar_height + 'px' );
jQuery( 'head' ).append( '
' );
$( 'html' ).attr( 'style', 'margin-top: ' + mysticky_welcomebar_height + 'px !important' );
$( '.mysticky-welcomebar-apper #mysticky-nav' ).css( 'top', mysticky_welcomebar_height + 'px' );
} else {
jQuery( '.mysticky-welcomebar-fixed' ).css( 'bottom', '0' );
jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' );
$( 'html' ).css( 'margin-top', '' );
jQuery( '#mysticky_divi_style' ).remove();
jQuery( '.et_fixed_nav #top-header' ).css( 'top', '' );
$( 'html' ).attr( 'style', 'margin-bottom: ' + mysticky_welcomebar_height + 'px !important' );
}
}, trigger_sec );
}
}
}
mystickyelements_present();
}
} );
jQuery(window).scroll(function(){
if( welcombar_aftersubmission == 'dont_show_welcomebar' ){
var welcomebar_storage = localStorage.getItem("welcomebar_close");
} else if( welcombar_aftersubmission == 'show_welcomebar_next_visit' ) {
var welcomebar_storage = sessionStorage.getItem("welcomebar_close");
} else {
sessionStorage.removeItem('welcomebar_close');
localStorage.removeItem('welcomebar_close');
var welcomebar_storage = null;
}
if ( welcomebar_storage === null ){
var welcombar_height = $( '.mysticky-welcomebar-fixed' ).outerHeight();
var welcombar_position = $( '.mysticky-welcomebar-fixed' ).data('position');
if ( welcombar_position == 'top' ) {
$( '#mysticky-nav' ).css( 'top', mysticky_welcomebar_height + 'px' );
}
if ( after_trigger === 'after_scroll' ) {
var scroll = 100 * $(window).scrollTop() / ($(document).height() - $(window).height());
var after_scroll_val = jQuery( '.mysticky-welcomebar-fixed' ).data('triger-sec');
var welcombar_position = $( '.mysticky-welcomebar-fixed' ).data('position');
var welcombar_height = $( '.mysticky-welcomebar-fixed' ).outerHeight();
if( scroll > after_scroll_val ) {
if ( $( '.mysticky-welcomebar-fixed' ).hasClass( 'mysticky-welcomebar-display-desktop' ) ) {
if ( $( window ).width() > 767 ) {
jQuery( '.mysticky-welcomebar-fixed' ).addClass( 'mysticky-welcomebar-animation' );
if ( welcombar_position == 'top' ) {
jQuery( '.mysticky-welcomebar-fixed' ).css( 'top', '0' );
jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' );
$( 'html' ).css( 'margin-bottom', '' );
$( 'html' ).attr( 'style', 'margin-top: ' + mysticky_welcomebar_height + 'px !important' );
$( '#mysticky-nav' ).css( 'top', mysticky_welcomebar_height + 'px' );
} else {
jQuery( '.mysticky-welcomebar-fixed' ).css( 'bottom', '0' );
jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' );
$( 'html' ).css( 'margin-top', '' );
$( 'html' ).attr( 'style', 'margin-bottom: ' + mysticky_welcomebar_height + 'px !important' );
}
}
}
if ( $( '.mysticky-welcomebar-fixed' ).hasClass( 'mysticky-welcomebar-display-mobile' ) ) {
if ( $( window ).width() < 767 ) {
jQuery( '.mysticky-welcomebar-fixed' ).addClass( 'mysticky-welcomebar-animation' );
if ( welcombar_position == 'top' ) {
jQuery( '.mysticky-welcomebar-fixed' ).css( 'top', '0' );
jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' );
$( 'html' ).css( 'margin-bottom', '' );
$( 'html' ).attr( 'style', 'margin-top: ' + mysticky_welcomebar_height + 'px !important' );
$( '#mysticky-nav' ).css( 'top', mysticky_welcomebar_height + 'px' );
} else {
jQuery( '.mysticky-welcomebar-fixed' ).css( 'bottom', '0' );
jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' );
$( 'html' ).css( 'margin-top', '' );
$( 'html' ).attr( 'style', 'margin-bottom: ' + mysticky_welcomebar_height + 'px !important' );
}
}
}
}
}
mystickyelements_present();
}
});
jQuery( '.mysticky-welcomebar-close, .mysticky-welcomebar-btn a' ).on( 'click', function(){
if( welcombar_aftersubmission != 'show_welcomebar_every_page' ){
if( welcombar_aftersubmission == 'dont_show_welcomebar' ){
sessionStorage.removeItem('welcomebar_close');
localStorage.setItem('welcomebar_close', 'close');
} else if( welcombar_aftersubmission == 'show_welcomebar_next_visit' ) {
localStorage.removeItem('welcomebar_close');
sessionStorage.setItem('welcomebar_close', 'close');
}
}
var welcombar_position = $( '.mysticky-welcomebar-fixed' ).data('position');
var welcombar_height = $( '.mysticky-welcomebar-fixed' ).outerHeight();
jQuery( '.mysticky-welcomebar-fixed' ).addClass( 'mysticky-welcomebar-notapper' );
jQuery( 'body' ).removeClass( 'mysticky-welcomebar-apper' );
jQuery( '.mysticky-welcomebar-fixed' ).slideUp( 'slow' );
if ( welcombar_position == 'top' ) {
jQuery( '.mysticky-welcomebar-fixed' ).css( 'top', '-' + mysticky_welcomebar_height + 'px' );
} else {
jQuery( '.mysticky-welcomebar-fixed' ).css( 'bottom', '-' + mysticky_welcomebar_height + 'px' );
}
jQuery( '#mysticky_divi_style' ).remove();
jQuery( '.et_fixed_nav #top-header' ).css( 'top', '' );
jQuery( 'html' ).css( 'margin-top', '' );
jQuery( 'html' ).css( 'margin-bottom', '' );
$( '#mysticky-nav' ).css( 'top', '0px' );
/*if mystickyelements show*/
var mystickyelements_show = $( '.mystickyelements-fixed' ).length;
if( mystickyelements_show && $( window ).width() <= 1024 && $( '.mystickyelements-fixed' ).hasClass( 'mystickyelements-position-mobile-top' ) && welcombar_position == 'top' ) {
var mystickyelements_height = $( '.mystickyelements-fixed' ).height();
$( '.mystickyelements-fixed' ).css( 'top', '' );
$( 'html' ).attr( 'style', 'margin-top: ' + mystickyelements_height + 'px !important' );
}
} );
});
function mystickyelements_present() {
var after_trigger = jQuery( '.mysticky-welcomebar-fixed' ).data('after-triger');
var mystickyelements_show = jQuery( '.mystickyelements-fixed' ).length;
if( mystickyelements_show ) {
var welcombar_position = jQuery( '.mysticky-welcomebar-fixed' ).data('position');
var welcombar_height = jQuery( '.mysticky-welcomebar-fixed' ).outerHeight();
var mystickyelements_height = jQuery( '.mystickyelements-fixed' ).height();
var mystickyelements_total_height = welcombar_height + mystickyelements_height;
if ( jQuery( window ).width() <= 1024 && jQuery( '.mystickyelements-fixed' ).hasClass( 'mystickyelements-position-mobile-top' ) ) {
if ( after_trigger == 'after_a_few_seconds' ) {
if ( jQuery( '.mysticky-welcomebar-fixed' ).hasClass( 'mysticky-welcomebar-display-mobile' ) ) {
var trigger_sec = jQuery( '.mysticky-welcomebar-fixed' ).data('triger-sec') * 1000;
setTimeout(function(){
if ( welcombar_position == 'top' ) {
jQuery( '.mystickyelements-fixed' ).css( 'top', welcombar_height );
jQuery( 'html' ).attr( 'style', 'margin-top: ' + mystickyelements_total_height + 'px !important' );
} else {
jQuery( '.mystickyelements-fixed' ).css( 'top', '' );
jQuery( 'html' ).attr( 'style', 'margin-bottom: ' + welcombar_height + 'px !important' );
}
}, trigger_sec );
}
} else if ( after_trigger === 'after_scroll' ) {
var scroll = 100 * $(window).scrollTop() / ($(document).height() - $(window).height());
var after_scroll_val = $( '.mysticky-welcomebar-fixed' ).data('triger-sec');
if( scroll > after_scroll_val ) {
if ( jQuery( '.mysticky-welcomebar-fixed' ).hasClass( 'mysticky-welcomebar-display-mobile' ) ) {
if ( welcombar_position == 'top' ) {
jQuery( '.mystickyelements-fixed' ).css( 'top', welcombar_height );
jQuery( 'html' ).attr( 'style', 'margin-top: ' + mystickyelements_total_height + 'px !important' );
} else {
jQuery( '.mystickyelements-fixed' ).css( 'top', '' );
jQuery( 'html' ).attr( 'style', 'margin-bottom: ' + welcombar_height + 'px !important' );
}
}
}
}
}
}
}
jQuery(".mysticky-welcomebar-fixed").on(
"animationend MSAnimationEnd webkitAnimationEnd oAnimationEnd",
function() {
jQuery(this).removeClass("animation-start");
}
);
jQuery(document).ready(function() {
var container = jQuery(".mysticky-welcomebar-fixed");
var refreshId = setInterval(function() {
container.addClass("animation-start");
}, 3500);
});