(function($){
"use strict";
$=jQuery;
jQuery(document).ready(function(){
var blog_widget_id, blog_offset;
jQuery('.classic-blog-ajax').on('click','.ajax-load-btn.active',function(){
if(jQuery(this).hasClass('no-more')){
jQuery(this).find('.load-more-text').text(loadbuttonstring.nomoreString);
return;
}
var $this=jQuery(this);
var module_id=$this.parents('.gowp-classic-blog-wrapper').attr('id');
var entries=gowp_ajax[module_id]['entries'];
var excerpt_length=gowp_ajax[module_id]['excerpt_length'];
var args=gowp_ajax[module_id]['args'];
console.log(excerpt_length);
$('.ajax-load-btn').removeClass('active');
$this.css("display", "none");
$this.siblings('.loading-animation').css("display", "inline-block");
var $container=$this.parent('.classic-blog-ajax').siblings('.classic-blog-content-container');
var offset=parseInt($container.find('.classic-blog-style').length)+ parseInt(gowp_ajax[module_id]['offset']);
var data={
action:'classic_blog_load',
post_offset:offset,
entries:entries,
args:args,
excerpt_length:excerpt_length
};
jQuery.post(ajaxurl, data, function(respond){
var el=jQuery(respond);
var respond_length=el.find('.post-details').length;
$container.imagesLoaded(function(){
setTimeout(function(){
$container.append(el);
$('.ajax-load-btn').addClass('active');
$this.find('.ajax-load-btn').text(ajax_btn_str['loadmore']);
if(respond_length < entries){
$this.text(ajax_btn_str['nomore']);
$this.addClass('no-more');
$this.removeClass('active');
$this.append("<span></span>");
}
$this.css("display", "inline-block");
$this.siblings('.loading-animation').css("display", "none");
}, 500);
});
});
});
});
})(jQuery);
(function($){
"use strict";
$=jQuery;
jQuery(document).ready(function(){
var blog_widget_id, blog_offset;
jQuery('.large-blog-ajax').on('click','.ajax-load-btn.active',function(){
if(jQuery(this).hasClass('no-more')){
jQuery(this).find('.load-more-text').text(loadbuttonstring.nomoreString);
return;
}
var $this=jQuery(this);
var module_id=$this.parents('.gowp-large-blog-wrapper').attr('id');
var entries=gowp_ajax[module_id]['entries'];
var excerpt_length=gowp_ajax[module_id]['excerpt_length'];
var args=gowp_ajax[module_id]['args'];
console.log(excerpt_length);
$('.ajax-load-btn').removeClass('active');
$this.css("display", "none");
$this.siblings('.loading-animation').css("display", "inline-block");
var $container=$this.parent('.large-blog-ajax').siblings('.large-blog-content-container');
var offset=parseInt($container.find('.large-blog-style').length)+ parseInt(gowp_ajax[module_id]['offset']);
var data={
action:'large_blog_load',
post_offset:offset,
entries:entries,
args:args,
excerpt_length:excerpt_length
};
jQuery.post(ajaxurl, data, function(respond){
var el=jQuery(respond);
var respond_length=el.find('.post-details').length;
$container.imagesLoaded(function(){
setTimeout(function(){
$container.append(el);
$('.ajax-load-btn').addClass('active');
$this.find('.ajax-load-btn').text(ajax_btn_str['loadmore']);
if(respond_length < entries){
$this.text(ajax_btn_str['nomore']);
$this.addClass('no-more');
$this.removeClass('active');
$this.append("<span></span>");
}
$this.css("display", "inline-block");
$this.siblings('.loading-animation').css("display", "none");
}, 500);
});
});
});
});
})(jQuery);
(function($){"use strict";
$.fn.visible=function(partial){
var $t=$(this),
$w=$(window),
viewTop=$w.scrollTop(),
viewBottom=viewTop + $w.height(),
_top=$t.offset().top,
_bottom=_top + $t.height(),
compareTop=partial===true ? _bottom:_top,
compareBottom=partial===true ? _top:_bottom;
return ((compareBottom <=viewBottom)&&(compareTop >=viewTop));
};})(jQuery);
jQuery(document).ready(function($){
var gowpWindow=$(window),
gowpRatingBars=$('.gowp-overlay').find('.gowp-zero-trigger');
jQuery.each(gowpRatingBars, function(i, value){
var gowpValue=$(value);
if(gowpValue.visible(true)){
gowpValue.removeClass('gowp-zero-trigger');
gowpValue.addClass('gowp-bar-ani');
}});
gowpWindow.scroll(function(event){
jQuery.each(gowpRatingBars, function(i, value){
var gowpValue=$(value);
if(( gowpValue.visible(true))&&(gowpValue.hasClass('gowp-zero-trigger'))){
gowpValue.removeClass('gowp-zero-trigger');
gowpValue.addClass('gowp-bar-ani');
}});
});
});