MZine
Anonymous
366 x views • 6 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,r='<span class="post-date">'+n+"</span>";return r}function i(t,a){var s=t[a].title.$t;t[a].content.$t;if("media$thumbnail"in t[a]){var e=t[a].media$thumbnail.url,i=e.replace("/s72-c","/w640"),l=e.replace("/s72-c","/w280"),n=e.replace("/s72-c","/w100");e.match("img.youtube.com")&&(i=e.replace("/default.","/hqdefault."),l=e.replace("/default.","/mqdefault."),n=e)}else i=noThumbnail,l=noThumbnail.replace("/s680","/w280"),n=noThumbnail.replace("/s680","/w100");var r='<img class="post-thumb" alt="'+s+'" src="'+i+'"/>',o='<img class="post-thumb" alt="'+s+'" src="'+l+'"/>',c='<img class="post-thumb" alt="'+s+'" src="'+n+'"/>',m=[r,o,c];return m}function l(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 n(n,r,o,c){if(r.match("mega-menu")||r.match("hot-posts")||r.match("feat-big")||r.match("col-left")||r.match("col-right")||r.match("grid-small")||r.match("grid-big")||r.match("post-list")||r.match("related")){var m="";if("recent"==c)m="/feeds/posts/default?alt=json-in-script&max-results="+o;else if("random"==c){var h=Math.floor(Math.random()*o)+1;m="/feeds/posts/default?max-results="+o+"&start-index="+h+"&alt=json-in-script"}else m="/feeds/posts/default/-/"+c+"?alt=json-in-script&max-results="+o;$.ajax({url:m,type:"get",dataType:"jsonp",beforeSend:function(){r.match("hot-posts")&&n.html('<div class="hot-loader"/>').parent().addClass("show-hot")},success:function(o){if(r.match("mega-menu"))var c='<ul class="mega-menu-inner">';else r.match("hot-posts")?c='<ul class="hot-posts">':r.match("feat-big")?c='<ul class="feat-big">':r.match("col-right")||r.match("col-left")?c='<ul class="feat-col">':r.match("grid-small")?c='<ul class="grid-small">':r.match("grid-big")?c='<ul class="grid-big">':r.match("post-list")?c='<ul class="custom-widget">':r.match("related")&&(c='<ul class="related-posts">');var m=o.feed.entry;if(void 0!=m){for(var h=0,d=m;h<d.length;h++){var p=t(d,h),u=a(d,h,p),f=i(d,h),g=s(d,h),v=e(d,h),b=l(d,h),$="";r.match("mega-menu")?$+='<div class="mega-item item-'+h+'"><div class="mega-content"><div class="post-image-wrap"><a class="post-image-link" href="'+p+'">'+f[1]+'</a></div><h2 class="post-title">'+u+'</h2><div class="post-meta">'+v+"</div></div></div>":r.match("hot-posts")?$+=0==h?'<li class="hot-item item-'+h+'"><div class="hot-item-inner"><a class="post-image-link" href="'+p+'">'+f[0]+'</a><div class="post-info"><h2 class="post-title">'+u+'</h2><div class="post-meta">'+g+'<span class="separator">-</span>'+v+"</div></div></div></li>":1==h?'<li class="hot-item item-'+h+'"><div class="hot-item-inner"><a class="post-image-link" href="'+p+'">'+f[0]+'</a><div class="post-info"><h2 class="post-title">'+u+'</h2><div class="post-meta">'+g+'<span class="separator">-</span>'+v+"</div></div></div></li>":'<li class="hot-item item-'+h+'"><div class="hot-item-inner"><a class="post-image-link" href="'+p+'">'+f[0]+'</a><div class="post-info"><h2 class="post-title">'+u+'</h2><div class="post-meta">'+v+"</div></div></div></li>":r.match("feat-big")?$+=0==h?'<li class="feat-item item-big item-'+h+'"><div class="feat-inner"><a class="post-image-link" href="'+p+'">'+f[0]+'</a><div class="post-info"><h2 class="post-title">'+u+'</h2><div class="post-meta">'+g+'<span class="separator">-</span>'+v+"</div>"+b+"</div></div></li>":'<li class="feat-item item-small item-'+h+'"><a class="post-image-link" href="'+p+'">'+f[1]+'</a><div class="post-info"><h2 class="post-title">'+u+'</h2><div class="post-meta">'+v+"</div></div></li>":r.match("col-left")||r.match("col-right")?$+=0==h?'<li class="feat-item item-big item-'+h+'"><div class="feat-inner"><a class="post-image-link" href="'+p+'">'+f[0]+'</a><div class="post-info"><h2 class="post-title">'+u+'</h2><div class="post-meta">'+g+'<span class="separator">-</span>'+v+"</div>"+b+"</div></div></li>":'<li class="feat-item item-small item-'+h+'"><a class="post-image-link" href="'+p+'">'+f[2]+'</a><div class="post-info"><h2 class="post-title">'+u+'</h2><div class="post-meta">'+v+"</div></div></li>":r.match("grid-small")?$+='<li class="feat-item item-small item-'+h+'"><div class="post-image-wrap"><a class="post-image-link" href="'+p+'">'+f[1]+'</a></div><div class="post-info"><h2 class="post-title">'+u+'</h2><div class="post-meta">'+v+"</div></div></li>":r.match("grid-big")?$+='<li class="feat-item item-big item-'+h+'"><div class="feat-inner"><a class="post-image-link" href="'+p+'">'+f[0]+'</a><div class="post-info"><h2 class="post-title">'+u+'</h2><div class="post-meta">'+g+'<span class="separator">-</span>'+v+"</div></div></div></li>":r.match("post-list")?$+='<li class="item-'+h+'"><a class="post-image-link" href="'+p+'">'+f[2]+'</a><h2 class="post-title">'+u+'</h2><div class="post-meta">'+v+"</div></div></li>":r.match("related")&&($+='<li class="related-item item-'+h+'"><div class="post-image-wrap"><a class="post-image-link" href="'+p+'">'+f[1]+'</a></div><h2 class="post-title">'+u+'</h2><div class="post-meta">'+v+"</div></li>"),c+=$}c+="</ul>"}else c='<ul class="no-posts">Error: No Posts Found <i class="fa fa-frown-o"/></ul>';r.match("mega-menu")?(n.addClass("has-sub mega-menu").append(c),n.find("a:first").attr("href",function(t,a){return a="recent"==d||"random"==d?a.replace(a,"/search/?&max-results="+postPerPage):a.replace(a,"/search/label/"+d+"?&max-results="+postPerPage)})):r.match("hot-posts")?n.html(c).parent().addClass("show-hot"):r.match("feat-big")||r.match("col-left")||r.match("col-right")||r.match("grid-small")||r.match("grid-big")?(n.parent().find(".widget-title").append('<a class="view-all" href="/search/label/'+d+"?&max-results="+postPerPage+'">'+messages.viewAll+"</a>"),(r.match("col-left")||r.match("col-right"))&&(r.match("col-right")&&n.parent().addClass("col-right"),n.parent().addClass("col-width")),n.html(c).parent().addClass("show-widget")):n.html(c)}})}}$("#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 r=e.parent();r.append('<ul class="sub-menu m-sub"/>')}}"_"===i.charAt(0)&&(e.text(i.replace("_","")),e.parent().appendTo(r.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 r=e.parent();r.append('<ul class="sub-menu2 m-sub"/>')}}"_"===i.charAt(0)&&(e.text(i.replace("_","")),e.parent().appendTo(r.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")}),$(".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];n(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];n(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];n(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];n(t,s,i,l)}),$(".related-ready").each(function(){var t=$(this),a=t.find(".related-tag").data("label");n(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()})});