Enfold
Anonymous
354 x views • 6 years ago
"use strict";
$(function(){function t(t,a){for(var e=0;e<t[a].link.length;e++)if("alternate"==t[a].link[e].rel){var s=t[a].link[e].href;break}return s}function a(t,a,e){var s=t[a].title.$t,i='<a href="'+e+'">'+s+"</a>";return i}function e(t,a){var e=t[a].author[0].name.$t,s='<span class="post-author">'+e+" </span>";return s}function s(t,a){var e=t[a].published.$t,s=e.substring(0,4),i=e.substring(5,7),l=e.substring(8,10),n=monthFormat[parseInt(i,10)-1]+" "+l+", "+s,o='<span class="post-date">'+n+"</span>";return o}function i(t,a){var e=t[a].title.$t,s=t[a].content.$t;if("media$thumbnail"in t[a]){var i=t[a].media$thumbnail.url,l=i.replace("/s72-c","/w640"),n=i.replace("/s72-c","/w280"),o=i.replace("/s72-c","/w100");s.indexOf("youtube.com/embed")>-1&&(l=i.replace("/default.","/hqdefault."),n=i.replace("/default.","/mqdefault."),o=i)}else l=noThumbnail,n=noThumbnail.replace("/s680","/w280"),o=noThumbnail.replace("/s680","/w100");var r='<img class="post-thumb" alt="'+e+'" src="'+l+'"/>',c='<img class="post-thumb" alt="'+e+'" src="'+n+'"/>',m='<img class="post-thumb" alt="'+e+'" src="'+o+'"/>',h=[r,c,m];return h}function l(t,a){if(void 0!=t[a].category)var e=t[a].category[0].term,s='<span class="post-tag">'+e+"</span>";else s="";return s}function n(t,a){var e=t[a].content.$t,s=$("<div>").html(e),i=s.text().trim().substr(0,86),l='<p class="post-snippet">'+i+"…</p>";return l}function o(t,a){var e=t[a].content.$t,s=$("<div>").html(e),i=s.text().trim().substr(0,200),l='<p class="post-snippet">'+i+"…</p>";return l}function r(r,c,m,h){if(c.match("mega-menu")||c.match("hot-posts")||c.match("feat-big")||c.match("col-left")||c.match("col-right")||c.match("grid-small")||c.match("grid-big")||c.match("feat-list")||c.match("post-list")||c.match("related")){var d="";if("recent"==h)d="/feeds/posts/default?alt=json-in-script&max-results="+m;else if("random"==h){var p=Math.floor(Math.random()*m)+1;d="/feeds/posts/default?max-results="+m+"&start-index="+p+"&alt=json-in-script"}else d="/feeds/posts/default/-/"+h+"?alt=json-in-script&max-results="+m;$.ajax({url:d,type:"get",dataType:"jsonp",beforeSend:function(){c.match("hot-posts")&&r.html('<div class="hot-loader"/>').parent().addClass("show-hot")},success:function(m){if(c.match("mega-menu"))var d='<ul class="mega-menu-inner">';else c.match("hot-posts")?d='<ul class="hot-posts">':c.match("feat-big")?d='<ul class="feat-big">':c.match("col-right")||c.match("col-left")?d='<ul class="feat-col">':c.match("grid-small")?d='<ul class="grid-small">':c.match("grid-big")?d='<ul class="grid-big">':c.match("feat-list")?d='<ul class="feat-list">':c.match("post-list")?d='<ul class="custom-widget">':c.match("related")&&(d='<ul class="related-posts">');var p=m.feed.entry;if(void 0!=p){for(var u=0,f=p;u<f.length;u++){var g=t(f,u),v=a(f,u,g),b=i(f,u),$=l(f,u),w=e(f,u),x=s(f,u),k=n(f,u),y=o(f,u),C="";c.match("mega-menu")?C+='<div class="mega-item item-'+u+'"><div class="mega-content"><div class="post-image-wrap"><a class="post-image-link" href="'+g+'">'+b[1]+"</a>"+$+'</div><h2 class="post-title">'+v+'</h2><div class="post-meta">'+x+"</div></div></div>":c.match("hot-posts")?C+=0==u?'<li class="hot-item item-'+u+'"><div class="hot-item-inner"><a class="post-image-link" href="'+g+'">'+b[0]+'</a><div class="post-info">'+$+'<h2 class="post-title">'+v+'</h2><div class="post-meta">'+w+x+"</div></div></div></li>":'<li class="hot-item item-'+u+'"><div class="hot-item-inner"><a class="post-image-link" href="'+g+'">'+b[0]+'</a><div class="post-info">'+$+'<h2 class="post-title">'+v+'</h2><div class="post-meta">'+x+"</div></div></div></li>":c.match("feat-big")?C+=0==u?'<li class="feat-item item-big item-'+u+'"><div class="feat-inner"><a class="post-image-link" href="'+g+'">'+b[0]+"</a>"+$+'<div class="post-info"><h2 class="post-title">'+v+'</h2><div class="post-meta">'+w+x+"</div>"+k+"</div></div></li>":'<li class="feat-item item-small item-'+u+'"><a class="post-image-link" href="'+g+'">'+b[1]+'</a><div class="post-info"><h2 class="post-title">'+v+'</h2><div class="post-meta">'+x+"</div></div></li>":c.match("col-left")||c.match("col-right")?C+=0==u?'<li class="feat-item item-big item-'+u+'"><div class="feat-inner"><a class="post-image-link" href="'+g+'">'+b[0]+"</a>"+$+'<div class="post-info"><h2 class="post-title">'+v+'</h2><div class="post-meta">'+w+x+"</div>"+k+"</div></div></li>":'<li class="feat-item item-small item-'+u+'"><a class="post-image-link" href="'+g+'">'+b[2]+'</a><div class="post-info"><h2 class="post-title">'+v+'</h2><div class="post-meta">'+x+"</div></div></li>":c.match("grid-small")?C+='<li class="feat-item item-small item-'+u+'"><div class="post-image-wrap"><a class="post-image-link" href="'+g+'">'+b[1]+"</a>"+$+'</div><div class="post-info"><h2 class="post-title">'+v+'</h2><div class="post-meta">'+x+"</div></div></li>":c.match("grid-big")?C+='<li class="feat-item item-big item-'+u+'"><div class="feat-inner"><a class="post-image-link" href="'+g+'">'+b[0]+"</a>"+$+'<div class="post-info"><h2 class="post-title">'+v+'</h2><div class="post-meta">'+w+x+"</div>"+k+"</div></div></li>":c.match("feat-list")?C+='<li class="feat-item item-'+u+'"><div class="feat-inner"><a class="post-image-link" href="'+g+'">'+b[0]+"</a>"+$+'<div class="post-info"><h2 class="post-title">'+v+'</h2><div class="post-meta">'+w+x+"</div>"+y+"</div></div></li>":c.match("post-list")?C+='<li class="item-'+u+'"><a class="post-image-link" href="'+g+'">'+b[2]+'</a><h2 class="post-title">'+v+'</h2><div class="post-meta">'+x+"</div></div></li>":c.match("related")&&(C+='<li class="related-item item-'+u+'"><div class="post-image-wrap"><a class="post-image-link" href="'+g+'">'+b[1]+"</a>"+$+'</div><h2 class="post-title">'+v+'</h2><div class="post-meta">'+x+"</div></li>"),d+=C}d+="</ul>"}else d='<ul class="no-posts">Error: No Posts Found <i class="fa fa-frown-o"/></ul>';c.match("mega-menu")?(r.addClass("has-sub mega-menu").append(d),r.find("a:first").attr("href",function(t,a){return a="recent"==h||"random"==h?a.replace(a,"/search/?&max-results="+postPerPage):a.replace(a,"/search/label/"+h+"?&max-results="+postPerPage)})):c.match("hot-posts")?r.html(d).parent().addClass("show-hot"):c.match("feat-big")||c.match("feat-list")||c.match("col-left")||c.match("col-right")||c.match("grid-small")||c.match("grid-big")?(r.parent().find(".widget-title").append('<a class="view-all" href="/search/label/'+h+"?&max-results="+postPerPage+'">'+messages.viewAll+"</a>"),(c.match("col-left")||c.match("col-right"))&&(c.match("col-right")&&r.parent().addClass("col-right"),r.parent().addClass("col-width")),r.html(d).parent().addClass("show-widget")):r.html(d)}})}}$("#main-menu").each(function(){for(var t=$(this).find(".LinkList ul > li").children("a"),a=t.length,e=0;a>e;e++){var s=t.eq(e),i=s.text();if("_"!==i.charAt(0)){var l=t.eq(e+1),n=l.text();if("_"===n.charAt(0)){var o=s.parent();o.append('<ul class="sub-menu m-sub"/>')}}"_"===i.charAt(0)&&(s.text(i.replace("_","")),s.parent().appendTo(o.children(".sub-menu")))}for(e=0;a>e;e++)s=t.eq(e),i=s.text(),"_"!==i.charAt(0)&&(l=t.eq(e+1),n=l.text(),"_"===n.charAt(0)&&(o=s.parent(),o.append('<ul class="sub-menu2 m-sub"/>'))),"_"===i.charAt(0)&&(s.text(i.replace("_","")),s.parent().appendTo(o.children(".sub-menu2")));$("#main-menu ul li ul").parent("li").addClass("has-sub"),$("#main-menu-nav > li > a").each(function(){var t=$(this),a=t.attr("href").trim().toLowerCase();"homepage"==a&&t.attr("href","/").parent("li").addClass("li-home")}),$("#main-menu .widget").addClass("show-menu")}),$("#main-menu-nav").clone().appendTo(".mobile-menu"),$(".mobile-menu .has-sub").append('<div class="submenu-toggle"/>'),$(".mobile-menu ul > li a").each(function(){var t=$(this),a=t.attr("href").trim(),e=a.toLowerCase(),s=a.split("/"),i=s[0];e.match("mega-menu")&&t.attr("href","/search/label/"+i+"?&max-results="+postPerPage)}),$(".slide-menu-toggle").on("click",function(){$("body").toggleClass("nav-active"),$(".overlay").fadeToggle(170)}),$(".mobile-menu ul li .submenu-toggle").on("click",function(t){$(this).parent().hasClass("has-sub")&&(t.preventDefault(),$(this).parent().hasClass("show")?$(this).parent().removeClass("show").find("> .m-sub").slideToggle(170):$(this).parent().addClass("show").children(".m-sub").slideToggle(170))}),$(".show-search, .show-mobile-search").on("click",function(){$("#nav-search, .mobile-search-form").fadeIn(250).find("input").focus()}),$(".hide-search, .hide-mobile-search").on("click",function(){$("#nav-search, .mobile-search-form").fadeOut(250).find("input").blur()}),$(".Label a, a.b-label").attr("href",function(t,a){return a.replace(a,a+"?&max-results="+postPerPage)}),$(".avatar-image-container img").attr("src",function(t,a){return a=a.replace("/s35-c/","/s45-c/"),a=a.replace("//img1.blogblog.com/img/blank.gif","//4.bp.blogspot.com/-uCjYgVFIh70/VuOLn-mL7PI/AAAAAAAADUs/Kcu9wJbv790hIo83rI_s7lLW3zkLY01EA/s55-r/avatar.png")}),$(".index-post .post-image-link img").attr("src",function(t,a){return a=a.replace("https://4.bp.blogspot.com/-O3EpVMWcoKw/WxY6-6I4--I/AAAAAAAAB2s/KzC0FqUQtkMdw7VzT6oOR_8vbZO6EJc-ACK4BGAYYCw/w680/nth.png",noThumbnail)}),$(".author-description a").each(function(){$(this).attr("target","_blank")}),$(".post-nav").each(function(){var t=$("a.prev-post-link").attr("href"),a=$("a.next-post-link").attr("href");$.ajax({url:t,type:"get",success:function(t){var a=$(t).find(".blog-post h1.post-title").text();$(".post-prev a .post-nav-inner p").text(a)}}),$.ajax({url:a,type:"get",success:function(t){var a=$(t).find(".blog-post h1.post-title").text();$(".post-next a .post-nav-inner p").text(a)}})}),$(".post-body strike").each(function(){var t=$(this),a=t.text();a.match("left-sidebar")&&t.replaceWith("<style>.item #main-wrapper{float:right;padding:0 0 0 25px}.item #sidebar-wrapper{float:left}.item #content-wrapper > .container{margin:0}</style>"),a.match("right-sidebar")&&t.replaceWith("<style>.item #main-wrapper{float:left;padding:0 25px 0 0}.item #sidebar-wrapper{float:right}</style>"),a.match("full-width")&&t.replaceWith("<style>.item #main-wrapper{width:100%;padding:0}.item #sidebar-wrapper{display:none}.item #content-wrapper > .container{margin:0}</style>")}),$("#main-wrapper, #sidebar-wrapper").each(function(){1==fixedSidebar&&$(this).theiaStickySidebar({additionalMarginTop:25,additionalMarginBottom:25})}),$(".back-top").each(function(){var t=$(this);$(window).on("scroll",function(){$(this).scrollTop()>=100?t.fadeIn(250):t.fadeOut(250)}),t.click(function(){$("html, body").animate({scrollTop:0},500)})}),$("#main-menu #main-menu-nav li").each(function(){var t=$(this),a=t.find("a").attr("href").trim(),e=t,s=a.toLowerCase(),i=a.split("/"),l=i[0];r(e,s,5,l)}),$("#hot-section .widget-content").each(function(){var t=$(this),a=t.text().trim(),e=a.toLowerCase(),s=a.split("/"),i=s[0];r(t,e,3,i)}),$(".featured-posts .widget-content").each(function(){var t=$(this),a=t.text().trim(),e=a.toLowerCase(),s=a.split("/");if(e.match("feat-big"))var i=5,l=s[0];else i=s[0],l=s[1];r(t,e,i,l)}),$(".common-widget .widget-content").each(function(){var t=$(this),a=t.text().trim(),e=a.toLowerCase(),s=a.split("/"),i=s[0],l=s[1];r(t,e,i,l)}),$(".related-ready").each(function(){var t=$(this),a=t.find(".related-tag").data("label");r(t,"related",3,a)}),$(".blog-post-comments").each(function(){var t=commentsSystem,a=(disqus_blogger_current_url,'<div id="disqus_thread"/>'),e=$(location).attr("href"),s='<div class="fb-comments" data-width="100%" data-href="'+e+'" data-numposts="5"></div>',i="comments-system-"+t;"blogger"==t?$(this).addClass(i).show():"disqus"==t?(!function(){var t=document.createElement("script");t.type="text/javascript",t.async=!0,t.src="//"+disqusShortname+".disqus.com/embed.js",(document.getElementsByTagName("head")[0]||document.getElementsByTagName("body")[0]).appendChild(t)}(),$("#comments, #gpluscomments").remove(),$(this).append(a).addClass(i).show()):"facebook"==t?($("#comments, #gpluscomments").remove(),$(this).append(s).addClass(i).show()):"hide"==t?$(this).hide():$(this).addClass("comments-system-default").show()})}),$(document).ready(function(){1==fixedMenu&&$(window).on("scroll",function(){var t=0,a=$(this).scrollTop();console.log(a),200>a?(t=$(".header-menu, .mobile-header").height(),$(".header-menu, .mobile-header").removeClass("scrolled-header")):($(".header-menu, .mobile-header").addClass("scrolled-header"),$("body").css({marginTop:t}))})});