// source --> https://www.annamonteverdi.it/digital/wp-content/plugins/wp-advanced-pdf/asset/js/ajaxsave.js?ver=1.1.5
jQuery( document ).on( 'click', '#guest_email', function(e) {
e.preventDefault();
var ced_email_to = jQuery('#ced-email-to').val();
var postid = jQuery('#emailpostID').val();
$this = jQuery(this).parent().parent();
jQuery(this).parent().remove();
jQuery($this).append('');
jQuery.ajax({
url: postajaxsave.ajax_url,
type: 'post',
data: {
action: 'postajax_exportandmail',
ced_email_to: ced_email_to,
postid: postid,
},
success: function (response) {
if(response.NOTSENT){
jQuery($this).find('img').remove();
jQuery($this).append('
');
} else if(response.INVALIDEMAIL) {
jQuery($this).find('img').remove();
var htmlq="";
jQuery($this).append(htmlq);
} else if(response.SENT) {
jQuery($this).html('PDF is sent To Your Email Address
');
}
}
});
});
jQuery(function ($) {
jQuery('.export-pdf').click(function(e) {
e.preventDefault();
var postID = jQuery(this).attr('id');
var htmlq="";
htmlq+='';
htmlq+="";
htmlq+="
";
jQuery('#examplePopup1').html(htmlq);
jQuery('#emailpostID').val(postID);
});
jQuery( document ).on( 'click', '#send_again', function(e) {
$this = jQuery(this).parent().parent();
jQuery(this).parent().remove();
var htmlq="";
htmlq+='';
htmlq+="";
htmlq+="
";
jQuery($this).append(htmlq);
});
});
// source --> https://www.annamonteverdi.it/digital/wp-content/themes/sg-window/inc/js/one-page-nav.js?ver=6.4.5
jQuery( document ).ready(function( $ ) {
var scroll = false;
var timer = null;
$( '#sidebar-1 > .widget-area > .widget' ).each( function( index ) {
var nav = $( '.one-page-nav li' ).eq( $( this ).index() );
if ( 'undefined' == nav )
return;
var title = $( this ).find( '> .widget-title' ).text();
if ( '' == title) {
title = $( this ).find( '.entry-header' ).eq( 0 ).text();
}
if ( '' == title) {
title = $( this ).find( 'h1' ).eq( 0 ).text();
}
if ( '' == title) {
title = $( this ).find( 'h2' ).eq( 0 ).text();
}
if ( '' == title) {
title = $( this ).find( 'h3' ).eq( 0 ).text();
}
if ( '' != title) {
nav.text( title );
} else {
nav.addClass( 'invisible' );
}
});
$('body').on( 'click', '.one-page-nav li', function( event ) {
var adm = 0;
scroll = true;
if( parseInt( $( '#wpadminbar') ) != 'undefined' )
adm = parseInt( $( '#wpadminbar' ).css( 'height' ) );
if ( isNaN( adm ) )
adm = 0;
$('.one-page-nav li').removeClass('current');
var id = $( this ).attr( 'class' );
$( '.cloned-nav li' ).eq( $( this ).index() ).addClass( 'current' );
$( '.original-nav li' ).eq( $( this ).index() ).addClass( 'current' );
var offset = $( '#sidebar-1 > .widget-area > .widget' ).eq( id ).offset();
if( 'undefined' == typeof offset )
return;
offset = offset.top - adm - $( '.one-page-nav' ).height();
$( 'html, body' ).animate( {scrollTop : offset}, 1000 );
scroll = true;
setTimeout(function() {
scroll = false;
}, 1400 );
});
$(window).scroll(function () {
stickIt();
if (timer) {
clearTimeout(timer);
timer = null;
}
timer = setTimeout(function() {
if ( scroll == false ) {
greenIt();
}
}, 100 );
});
$(window).resize( function(){
resizeIt();
greenIt();
});
var adm = 0;
if(parseInt($('#wpadminbar')) != 'undefined')
adm = parseInt($('#wpadminbar').css('height'));
if ( isNaN( adm ) )
adm = 0;
$('.nav-one-page')
.addClass('original-nav')
.clone()
.insertAfter('.nav-one-page')
.addClass('cloned-nav')
.css('position','fixed')
.css('top','0')
.css('margin-top',adm)
.css('margin-left','0')
.css('z-index','500')
.removeClass('original-nav')
.hide();
function greenIt() {
var orgElement = $('.original-nav');
if( orgElement.size() <= 0)
return;
var orgElementPos = $('.original-nav').offset();
var orgElementTop = orgElementPos.top;
var height = $('.original-nav').height();
var top_sidebar_offset = $( '#sidebar-1' ).offset().top + $( '#sidebar-1' ).height();
if ( $(window).scrollTop() + adm > ( orgElementTop ) && parseInt($(window).width()) > 450 && $(window).scrollTop() + height <= top_sidebar_offset ) {
$( '#sidebar-1 > .widget-area > .widget' ).each( function( index ) {
var offsettop = $( this ).offset().top;
var height_widget = $( this ).height();
//current element
if ( $( window ).scrollTop()> offsettop && $( window ).scrollTop() < offsettop + height_widget ) {
if ( $( window ).scrollTop() + height > offsettop && $( window ).scrollTop() + height < offsettop + height_widget ) {
$( '.one-page-nav li' ).removeClass( 'current' );
$( '.original-nav li' ).eq( $( this ).index() ).addClass( 'current' );
$( '.cloned-nav li' ).eq( $( this ).index() ).addClass( 'current' );
} else {
$( '.one-page-nav li' ).removeClass( 'current' );
$( '.original-nav li' ).eq( $( this ).index() + 1 ).addClass( 'current' );
$( '.cloned-nav li' ).eq( $( this ).index() + 1 ).addClass( 'current' );
}
}
});
}
else {
$( '.one-page-nav li' ).removeClass( 'current' );
}
}
function stickIt() {
var orgElement = $('.original-nav');
if( orgElement.size() <= 0)
return;
var orgElementPos = $('.original-nav').offset();
var orgElementTop = orgElementPos.top;
var height = $('.original-nav').height();
var top_sidebar_offset = $( '.sidebar-top-full' ).offset().top + $( '.sidebar-top-full' ).height();
if ($(window).scrollTop() + adm > (orgElementTop) && parseInt($(window).width()) > 450 && $(window).scrollTop() + height < top_sidebar_offset + 9999 ) {
if ( $('.cloned-nav').hasClass( 'on-sceen' ) )
return;
var coordsOrgElement = orgElement.offset();
var leftOrgElement = coordsOrgElement.left;
var widthOrgElement = parseInt(orgElement.css('width'));
$('.cloned-nav')
.css('left',leftOrgElement+'px')
.css('top',0)
.css('width',widthOrgElement)
.show()
.addClass( 'on-sceen' );
$('.original-nav')
.css('height', $('.original-nav').css('height'))
.css('visibility','hidden');
$('.original-nav .one-page-nav')
.css('display', 'none');
} else {
$('.original-nav')
.css('visibility','visible')
.css('height', 'auto')
$('.cloned-nav')
.hide()
.removeClass( 'on-sceen' );
$('.original-nav .one-page-nav')
.css('display', 'block');
}
}
function resizeIt() {
var orgElement = $('.original-nav');
if( orgElement.size() <= 0)
return;
var orgElementPos = $('.original-nav').offset();
var orgElementTop = orgElementPos.top;
if ( $(window).scrollTop() + adm > (orgElementTop) && parseInt( $(window).width() ) > 450 ) {
var coordsOrgElement = orgElement.offset();
var leftOrgElement = coordsOrgElement.left;
var widthOrgElement = parseInt(orgElement.css('width'));
$('.cloned-nav')
.css('left',leftOrgElement+'px')
.css('top',0)
.css('width',widthOrgElement)
.show()
.addClass( 'on-sceen' );
$('.original-nav')
.css('height', $('.original-nav').css('height'))
.css('visibility','hidden');
$('.original-nav .one-page-nav')
.css('display', 'none');
} else {
$('.original-nav')
.css('height', 'auto')
.css('visibility','visible');
$('.cloned-nav')
.hide()
.removeClass( 'on-sceen' );
$('.original-nav .one-page-nav')
.css('display', 'block');
}
}
});
// source --> https://www.annamonteverdi.it/digital/wp-content/themes/sg-window/inc/js/slider.js?ver=6.4.5
//load main functions
jQuery( document ).ready(function( $ ) {
slider();
function slider() {
$( '.sgwindow-slider-content' ).each( function( index ) {
var arrName = $(this).attr('class').split( ' ' );
var is_autoplay = arrName[0];
var slidespeed = parseInt( arrName[1] );
var delayspeed = parseInt( arrName[2] );
var timerId;
var animtype = 4;
var disabled = false;
var slider = $( this );
var slide = $(this).find( '.sgwindow-slide' );
var size = slide.size();
var currindex = 0;
var newindex = 0;
var previndex = size - 1;
if ( 0 == size ) {
slider.css( 'display', 'none' );
return;
}
if ( size < 4 ) {
for( i = size; i < 4; i++) {
$(this).find( '.sgwindow-slide:first-child' )
.clone()
.insertBefore( $(this).find( '.sgwindow-slide:first-child' ) )
}
slide = $(this).find( '.sgwindow-slide' );
size = slide.size();
}
var menuitem = $( this ).parent().find( '.sgwindow-slider-buttons li' );
var next = $( this ).parent().find( '.sgwindow-next-button' );
var prev = $( this ).parent().find( '.sgwindow-prev-button' );
if ( '1' == is_autoplay ) {
autoplay();
}
next.click(function( event ) {
if ( disabled )
return false;
disabled = true;
newindex = ( newindex + 1 >= size ? 0 : newindex + 1 );
slide.eq(currindex - 1).stop(true, true);
slide.eq(currindex + 1).stop(true, true);
slide.eq(currindex).stop(true, true);
slide.eq(previndex).stop(true, true);
animtype = 4;
previndex = currindex - 1;
if ( previndex < 0 )
previndex = size - 1;
switchSlide();
slider.parent().find( '.sgwindow-slider-buttons li' ).removeClass( 'current' );
slider.parent().find( '.sgwindow-slider-buttons li' ).eq( newindex ).addClass( 'current' );
return false;
});
prev.click(function( event ) {
if ( disabled )
return false;
disabled = true;
newindex = ( newindex - 1 >= 0 ? newindex - 1 : size - 1 );
slide.eq(currindex - 1 ).stop(true, true);
slide.eq(currindex + 1).stop(true, true);
slide.eq(currindex).stop(true, true);
slide.eq(previndex).stop(true, true);
animtype = 3;
previndex = newindex - 1;
switchSlide();
slider.parent().find( '.sgwindow-slider-buttons li' ).removeClass( 'current' );
slider.parent().find( '.sgwindow-slider-buttons li' ).eq( newindex ).addClass( 'current' );
return false;
});
menuitem.click(function( event ) {
var next_b = menuitem.index( this );
if ( next_b == currindex )
return;
slider.parent().find( '.sgwindow-slider-buttons li' ).removeClass( 'current' );
$( this ).addClass( 'current' );
slider.eq( currindex ).stop(true, true);
slider.eq( previndex ).stop(true, true);
var prevspeed = slidespeed;
var slidetomove = ( next_b - currindex > 0 ? next_b - currindex : currindex - next_b );
slidespeed = slidespeed / slidetomove;
var timeout = slidespeed;
var button = ( next_b > currindex ? next : prev );
moveit( false, 400, button, slidetomove - 1, prevspeed );
});
function moveit( flag, timeout, button, index, prevspeed ) {
if ( false === flag ) {
setTimeout( function() {
moveit( true, timeout, button, index, prevspeed );
}, timeout );
} else {
button.click();
if ( index > 0 ) {
index--;
moveit( false, timeout, button, index, prevspeed );
} else {
slidespeed = prevspeed;
}
}
}
slider.mouseover(function( event ) {
if ( is_autoplay ) {
clearInterval( timerId );
}
});
slider.mouseleave(function( event ) {
if ( is_autoplay ){
clearInterval( timerId );
autoplay();
}
});
function autoplay() {
timerId = setInterval( function (){
next.click();
}, delayspeed );
}
function switchSlide() {
animslide(currindex, newindex);
previndex = currindex;
currindex = newindex;
}
function animslide(currindex, newindex) {
switch ( animtype ) {
case 3: //move right
slide.eq( previndex )
.css( 'display', 'block' )
.css( 'left', '-200%' )
.css( 'right', '200%' )
.animate({
'left':'-100%', 'right':'100%'}, {
duration: slidespeed,
queue: false,
always: function() {
}
});
slide.eq( currindex )
.css( 'display', 'block' )
.css( 'left', '0' )
.css( 'right', '0' )
.animate({
'left':'100%', 'right':'-100%'}, {
duration: slidespeed,
queue: false,
always: function() {
enabled();
}
});
slide.eq( newindex )
.css( 'display', 'block' )
.css( 'left', '-100%' )
.css( 'right', '100%' )
.animate({
'left':'0', 'right':'0'}, {
duration: slidespeed,
queue: false,
always: function() {
}
});
if ( size == currindex + 1 ) {
slide.eq( 0 )
.css( 'display', 'block' )
.css( 'left', '100%' )
.css( 'right', '-100%' )
.animate({
'left':'200%', 'right':'-200%'}, {
duration: slidespeed,
queue: false,
always: function() {
}
});
} else {
slide.eq( currindex + 1 )
.css( 'display', 'block' )
.css( 'left', '100%' )
.css( 'right', '-100%' )
.animate({
'left':'200%', 'right':'-200%'}, {
duration: slidespeed,
queue: false,
always: function() {
}
});
}
break;
case 4: //move left
slide.eq( previndex )
.css( 'display', 'block' )
.css( 'left', '-100%' )
.css( 'right', '100%' )
.animate({
'left':'-200%', 'right':'200%'}, {
duration: slidespeed,
queue: false,
always: function() {
}
});
slide.eq( currindex )
.css( 'display', 'block' )
.css( 'left', '0' )
.css( 'right', '0' )
.animate({
'left':'-100%', 'right':'100%'}, {
duration: slidespeed,
queue: false,
always: function() {
enabled();
}
});
slide.eq( newindex )
.css( 'display', 'block' )
.css( 'left', '100%' )
.css( 'right', '-100%' )
.animate({
'left':'0', 'right':'0'}, {
duration: slidespeed,
queue: false
});
if( size == newindex + 1 ) {
slide.eq( 0 )
.css( 'display', 'block' )
.css( 'left', '200%' )
.css( 'right', '-200%' )
.animate({
'left':'100%', 'right':'-100%'}, {
duration: slidespeed,
queue: false
});
} else {
slide.eq( newindex + 1 )
.css( 'display', 'block' )
.css( 'left', '200%' )
.css( 'right', '-200%' )
.animate({
'left':'100%', 'right':'-100%'}, {
duration: slidespeed,
queue: false
});
}
break;
};
}
function hideslide( obj ) {
obj.css( 'display', 'none' );
}
function enabled() {
disabled = false;
}
});
}
});