DesignX
Anonymous
182 x views • 4 years ago
"use strict";
$(function(){function t(t,a){for(var s=0;s<t[a].link.length;s++)if("alternate"==t[a].link[s].rel){var e=t[a].link[s].href;break}return e}function a(t,a,s){var e=t[a].title.$t,i='<a href="'+s+'">'+e+"</a>";return i}function s(t,a){var s=t[a].author[0].name.$t,e='<span class="post-author">'+s+" </span>";return e}function e(t,a){var s=t[a].published.$t,e=s.substring(0,4),i=s.substring(5,7),l=s.substring(8,10),n=monthFormat[parseInt(i,10)-1]+" "+l+", "+e,o='<span class="post-date">'+n+"</span>";return o}function i(t,a){var s=t[a].title.$t,e=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");e.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 c='<img class="post-thumb" alt="'+s+'" src="'+l+'"/>',r='<img class="post-thumb" alt="'+s+'" src="'+n+'"/>',m='<img class="post-thumb" alt="'+s+'" src="'+o+'"/>',h=[c,r,m];return h}function l(t,a){if(void 0!=t[a].category)var s=t[a].category[0].term,e='<span class="post-tag">'+s+"</span>";else e="";return e}function n(t,a){var s=t[a].content.$t,e=$("<div>").html(s),i=e.text().trim().substr(0,86),l='<p class="post-snippet">'+i+"…</p>";return l}function o(o,c,r,m){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 h="";if("recent"==m)h="/feeds/posts/default?alt=json-in-script&max-results="+r;else if("random"==m){var d=Math.floor(Math.random()*r)+1;h="/feeds/posts/default?max-results="+r+"&start-index="+d+"&alt=json-in-script"}else h="/feeds/posts/default/-/"+m+"?alt=json-in-script&max-results="+r;$.ajax({url:h,type:"get",dataType:"jsonp",beforeSend:function(){c.match("hot-posts")&&o.html('<div class="hot-loader"/>').parent().addClass("show-hot")},success:function(r){if(c.match("mega-menu"))var m='<ul class="mega-menu-inner">';else c.match("hot-posts")?m='<ul class="hot-posts">':c.match("feat-big")?m='<ul class="feat-big">':c.match("col-right")||c.match("col-left")?m='<ul class="feat-col">':c.match("grid-small")?m='<ul class="grid-small">':c.match("grid-big")?m='<ul class="grid-big">':c.match("feat-list")?m='<ul class="feat-list">':c.match("post-list")?m='<ul class="custom-widget">':c.match("related")&&(m='<ul class="related-posts">');var h=r.feed.entry;if(void 0!=h){for(var d=0,p=h;d<p.length;d++){var u=t(p,d),f=a(p,d,u),v=i(p,d),g=l(p,d),b=s(p,d),$=e(p,d),w=n(p,d),x="";c.match("mega-menu")?x+='<div class="mega-item item-'+d+'"><div class="mega-content"><div class="post-image-wrap"><a class="post-image-link" href="'+u+'">'+v[1]+"</a>"+g+'</div><h2 class="post-title">'+f+'</h2><div class="post-meta">'+$+"</div></div></div>":c.match("hot-posts")?x+=0==d?'<li class="hot-item item-'+d+'"><div class="hot-item-inner"><a class="post-image-link" href="'+u+'">'+v[0]+'</a><div class="post-info">'+g+'<h2 class="post-title">'+f+'</h2><div class="post-meta">'+b+$+"</div></div></div></li>":1==d?'<li class="hot-item item-'+d+'"><div class="hot-item-inner"><a class="post-image-link" href="'+u+'">'+v[0]+'</a><div class="post-info">'+g+'<h2 class="post-title">'+f+'</h2><div class="post-meta">'+b+$+"</div></div></div></li>":2==d?'<li class="hot-item item-'+d+'"><div class="hot-item-inner"><a class="post-image-link" href="'+u+'">'+v[0]+'</a><div class="post-info">'+g+'<h2 class="post-title">'+f+'</h2><div class="post-meta">'+b+$+"</div></div></div></li>":'<li class="hot-item item-'+d+'"><div class="hot-item-inner"><a class="post-image-link" href="'+u+'">'+v[0]+'</a><div class="post-info">'+g+'<h2 class="post-title">'+f+'</h2><div class="post-meta">'+$+"</div></div></div></li>":c.match("feat-big")?x+=0==d?'<li class="feat-item item-big item-'+d+'"><div class="feat-inner"><a class="post-image-link" href="'+u+'">'+v[0]+"</a>"+g+'<div class="post-info"><h2 class="post-title">'+f+'</h2><div class="post-meta">'+b+$+"</div>"+w+"</div></div></li>":'<li class="feat-item item-small item-'+d+'"><a class="post-image-link" href="'+u+'">'+v[1]+'</a><div class="post-info"><h2 class="post-title">'+f+'</h2><div class="post-meta">'+$+"</div></div></li>":c.match("col-left")||c.match("col-right")?x+=0==d?'<li class="feat-item item-big item-'+d+'"><div class="feat-inner"><a class="post-image-link" href="'+u+'">'+v[0]+"</a>"+g+'<div class="post-info"><h2 class="post-title">'+f+'</h2><div class="post-meta">'+b+$+"</div>"+w+"</div></div></li>":'<li class="feat-item item-small item-'+d+'"><a class="post-image-link" href="'+u+'">'+v[2]+'</a><div class="post-info"><h2 class="post-title">'+f+'</h2><div class="post-meta">'+$+"</div></div></li>":c.match("grid-small")?x+='<li class="feat-item item-small item-'+d+'"><div class="post-image-wrap"><a class="post-image-link" href="'+u+'">'+v[1]+"</a>"+g+'</div><div class="post-info"><h2 class="post-title">'+f+'</h2><div class="post-meta">'+$+"</div></div></li>":c.match("grid-big")?x+='<li class="feat-item item-big item-'+d+'"><div class="feat-inner"><a class="post-image-link" href="'+u+'">'+v[0]+"</a>"+g+'<div class="post-info"><h2 class="post-title">'+f+'</h2><div class="post-meta">'+b+$+"</div>"+w+"</div></div></li>":c.match("feat-list")?x+='<li class="feat-item item-'+d+'"><div class="feat-inner"><a class="post-image-link" href="'+u+'">'+v[0]+"</a>"+g+'<div class="post-info"><h2 class="post-title">'+f+'</h2><div class="post-meta">'+b+$+"</div>"+w+"</div></div></li>":c.match("post-list")?x+='<li class="item-'+d+'"><a class="post-image-link" href="'+u+'">'+v[2]+'</a><h2 class="post-title">'+f+'</h2><div class="post-meta">'+$+"</div></div></li>":c.match("related")&&(x+='<li class="related-item item-'+d+'"><div class="post-image-wrap"><a class="post-image-link" href="'+u+'">'+v[1]+"</a>"+g+'</div><h2 class="post-title">'+f+'</h2><div class="post-meta">'+$+"</div></li>"),m+=x}m+="</ul>"}else m='<ul class="no-posts">Error: No Posts Found <i class="fa fa-frown-o"/></ul>';c.match("mega-menu")?(o.addClass("has-sub mega-menu").append(m),o.find("a:first").attr("href",function(t,a){return a="recent"==p||"random"==p?a.replace(a,"/search/?&max-results="+postPerPage):a.replace(a,"/search/label/"+p+"?&max-results="+postPerPage)})):c.match("hot-posts")?o.html(m).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")?(o.parent().find(".widget-title").append('<a class="view-all" href="/search/label/'+p+"?&max-results="+postPerPage+'">'+messages.viewAll+"</a>"),(c.match("col-left")||c.match("col-right"))&&(c.match("col-right")&&o.parent().addClass("col-right"),o.parent().addClass("col-width")),o.html(m).parent().addClass("show-widget")):o.html(m)}})}}$("#main-menu").each(function(){for(var t=$(this).find(".LinkList ul > li").children("a"),a=t.length,s=0;a>s;s++){var e=t.eq(s),i=e.text();if("_"!==i.charAt(0)){var l=t.eq(s+1),n=l.text();if("_"===n.charAt(0)){var o=e.parent();o.append('<ul class="sub-menu m-sub"/>')}}"_"===i.charAt(0)&&(e.text(i.replace("_","")),e.parent().appendTo(o.children(".sub-menu")))}for(s=0;a>s;s++){var e=t.eq(s),i=e.text();if("_"!==i.charAt(0)){var l=t.eq(s+1),n=l.text();if("_"===n.charAt(0)){var o=e.parent();o.append('<ul class="sub-menu2 m-sub"/>')}}"_"===i.charAt(0)&&(e.text(i.replace("_","")),e.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(),s=a.toLowerCase(),e=a.split("/"),i=e[0];s.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}</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}</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(),s=t,e=a.toLowerCase(),i=a.split("/"),l=i[0];o(s,e,5,l)}),$("#hot-section .widget-content").each(function(){var t=$(this),a=t.text().trim(),s=a.toLowerCase(),e=a.split("/"),i=e[0];o(t,s,5,i)}),$(".featured-posts .widget-content").each(function(){var t=$(this),a=t.text().trim(),s=a.toLowerCase(),e=a.split("/");if(s.match("feat-big"))var i=5,l=e[0];else i=e[0],l=e[1];o(t,s,i,l)}),$(".common-widget .widget-content").each(function(){var t=$(this),a=t.text().trim(),s=a.toLowerCase(),e=a.split("/"),i=e[0],l=e[1];o(t,s,i,l)}),$(".related-ready").each(function(){var t=$(this),a=t.find(".related-tag").data("label");o(t,"related",3,a)}),$(".blog-post-comments").each(function(){var t=commentsSystem,a=(disqus_blogger_current_url,'<div id="disqus_thread"/>'),s=$(location).attr("href"),e='<div class="fb-comments" data-width="100%" data-href="'+s+'" 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(e).addClass(i).show()):"hide"==t?$(this).hide():$(this).addClass("comments-system-default").show()})});