";break;case"comments":r="
";break;case"related":r="
",r=l?msgError():r,e.html(r)switch(t)case"mega":case"megatabs":e.find("span.thumbnail").pbtLazy(onScroll:!1);break;default:e.find("span.thumbnail").pbtLazy(),error:function()switch(t)case"mega":e.find(".ul").replaceWith('
'+msgError()+"
");break;default:e.html(msgError())})}function getMega(e,t,a,s)function getTrending(e,t,a,s)if("trending"==t)return getPosts(e,t,a,s);e.html(msgError())function getWidget(e,t,a,s,o)"comments"==t?getPosts(e,t,a,s):e.html(msgError()))function getRelated(e,t,a,s,o)"related"==t?getPosts(e,t,a,s,o):e.html(msgError())function megaTabs(e,t,a)var s=(t=a).length,o='
';for(let e=0;e
');o+="
",e.addClass("megatabs").append(o),e.children("a").on("click",function(e)e.preventDefault());var n,r=e.find(".mega-tab");function i()e.find(".mega-tab.active").not(".loaded").each(function(e,t)t=(e=$(this)).data("tab"),getMega(e,"megatabs",5,t));var t=e.find(".mega-tab.loaded");r.length==t.length&&clearInterval(n)e.mouseenter(function()n=setInterval(i,100)).mouseleave(function()clearInterval(n)),e.find(".mega-tabs").pbtTabs(onHover:!0,isLinked:!0,animated:!1,transition:"fadeIn")function disqusComments(e)var t=document.createElement("script");t.type="text/javascript",t.async=!0,t.src="https://"+e+".disqus.com/blogger_item.js",document.getElementsByTagName("head")[0].appendChild(t)function beautiAvatar(e)$(e).attr("src",function(e,t,a)return a="//1.bp.blogspot.com/-QN2lgvtYZco/YN3mUSryAVI/AAAAAAAAADs/KrR-etCcvUMcPl06jopTs9pzq59IAXhMQCLcBGAsYHQ/s35/avatar.jpg",t=(t=(t=t.replace("//resources.blogblog.com/img/blank.gif",a)).replace("//lh3.googleusercontent.com/zFdxGE77vvD2w5xHy6jkVuElKv-U9_9qLkRYK8OnbDeJPtjSZ82UPq5w6hJ-SA=s35",a)).replace("/s35","/s39"))function pbtFixedSidebar(e)$(e).each(function(e,t)1==pbt.fixedSidebar&&(30,t=1==pbt.fixedMenu?$(".header-inner").height()+30:30,$(this).theiaStickySidebar(containerSelector:"#content-wrapper > .container",additionalMarginTop:t,additionalMarginBottom:30)))viewAllText="undefined"!=typeof viewAllText?viewAllText:pbt.viewAll,$("#techspot-pro-main-menu").pbtMenu(),$("html").each(function()var e=$(this),t=localStorage.darkMode;1!=pbt.darkMode&&0!=pbt.userDarkMode&&("true"==t&&(e.addClass("is-dark"),darkModeLogo(t)),$(".darkmode-toggle").click(function()$btn=$(this),$btn.hasClass("dark-on")?$btn.removeClass("dark-on").addClass("dark-off"):$btn.removeClass("dark-off").addClass("dark-on"),e.toggleClass("is-dark"),t="true"!=t?"true":"false",localStorage.darkMode=t,darkModeLogo(t)))),$(".dark-logo").each(function()1==pbt.darkMode&&darkModeLogo("true")),$(".main-search").each(function()var e=$(this);$(".show-search").click(function()$("body").addClass("search-active"),e.fadeIn(170).css("display","flex").find("input").focus()),$(".search-close").click(function()$("body").removeClass("search-active"),e.fadeOut(170).find("input").blur().val(""))),$(".social-toggle").click(function()$t=$(this),$t.hasClass("social-on")?$t.removeClass("social-on").addClass("social-off"):$t.removeClass("social-off").addClass("social-on"),$("body").toggleClass("social-active")),$(".blog1-title a.title-link, .related-title a.title-link").each(function()""!=viewAllText.trim()&&$(this).html(viewAllText)),$(".social-icons a").each(function(e)var t=$(this),a=t.attr("href").split("#"),s=t.data("text");a[1]&&1==s&&""!=(e=a[1].trim())&&t.append('
'+e+""),t.attr("href",a[0].trim())),$(".MailChimp .widget-content").each(function(e,t)var a=$(this),s=a.data("shortcode");s&&(e=getAttr(s,"title"),t=getAttr(s,"text"),0!=e&&a.find(".mailchimp-title").html(e),0!=t&&a.find(".mailchimp-text").html(t))),$(".post-body a").each(function()var e=$(this),t=e.text(),a=t.toLowerCase(),s=getAttr(t,"text");a.match("getbutton")&&0!=s&&(e.replaceText(/([^\]+(?=))/g,"
$1"),e.find("em").replaceText("$","%s"),e.each(function()var e=$(this),t=e.text(),a=getAttr(t,"text"),s=getAttr(t,"icon"),o=getAttr(t,"color"),n=getAttr(t,"size"),r=getAttr(t,"info"),i=e.parent().attr("style");e.addClass(0!=n?"button btn x2":"button btn").text(a.replace("%s","$")),i&&i.match("center")&&e.addClass("is-c"),0!=r?(e.addClass(0!=s?"x2 "+s:"x2"),e.append('
'+r.replace("%s","$")+"")):0!=s&&e.addClass(s),0!=o&&e.addClass("color").attr("style","background:"+o+";")))}),$(".post-body b").each(function()var e=$(this),t=e.text(),a=t.toLowerCase().trim();a.match(/(?:\$ads\=\1\)/g)&&e.replaceWith('
'),a.match(/(?:\$ads\=\2\)/g)&&e.replaceWith('
'),a.match("gettoc")&&(t=0!=(t=getAttr(t,"title"))?t:"Table of Contents",e.replaceWith('
'),$(".pbt-toc-title").click(function()$(this).toggleClass("is-expanded"),$("#pbt-toc").slideToggle(170)),$("#pbt-toc").toc(content:"#post-body",headings:"h2,h3,h4"),$("#pbt-toc li a").each(function()var e=$(this);e.click(function(t)return t.preventDefault(),$("html,body").animate(scrollTop:$(e.attr("href")).offset().top-20,500),!1))),a.match("contactform")&&(e.replaceWith('
'),$("#post-body .contact-form-widget").append($("#ContactForm1 .contact-form-form"))),a.match("leftsidebar")&&($("body").addClass("is-left"),e.remove()),a.match("rightsidebar")&&($("body").addClass("is-right").removeClass("is-left"),e.remove()),a.match("fullwidth")&&($("body").addClass("no-sidebar"),e.remove())),$("#techspot-pro-new-before-ad").each(function()var e=$(this);e.length&&$("#before-ad").appendTo(e)),$("#techspot-pro-new-after-ad").each(function()var e=$(this);e.length&&$("#after-ad").appendTo(e)),$("#techspot-pro-main-before-ad .widget").each(function()var e=$(this),t=e.parent();e.length&&e.appendTo($("#before-ad")),t.remove(),caEmpty()),$("#techspot-pro-main-after-ad .widget").each(function()var e=$(this),t=e.parent();e.length&&e.appendTo($("#after-ad")),t.remove(),caEmpty()),$("#techspot-pro-post-footer-ads .widget").each(function()var e=$(this),t=e.parent();e.length&&e.appendTo($("#post-footer-ads")),t.remove()),$(".post-body blockquote").each(function()var e=$(this),t=e.text().toLowerCase().trim(),a=e.html();if(t.match("alertsuccess"))var s=a.replace("alertSuccess","");e.replaceWith('
'+s+"
")if(t.match("alertinfo"))s=a.replace("alertInfo","");e.replaceWith('
'+s+"
")if(t.match("alertwarning"))s=a.replace("alertWarning","");e.replaceWith('
'+s+"
")if(t.match("alerterror"))s=a.replace("alertError","");e.replaceWith('
'+s+"
")if(t.match("codebox"))s=a.replace("codeBox","");e.replaceWith('
'+s+"
")),$(".pbt-window").click(function(e)e.preventDefault();var t=$(this),a=t.data("url"),s=t.data("width"),o=t.data("height");window.open(a,"_blank","scrollbars=yes,resizable=yes,toolbar=0,width="+s+",height="+o+",top=50,left=50").focus()),$(".post-share .show-more .btn, .share-toggle, .hide-modal, #share-overlay").click(function(e)e.preventDefault(),$("body").toggleClass("share-active")),$(".copy-link").each(function(e,t,a)e=$(this),(t=e.children("input")).click(function()this.select()),e.children("button").click(function()t.select(),document.execCommand("copy"),e.removeClass("copied-off").addClass("copied"),setTimeout(function()e.removeClass("copied").addClass("copied-off"),3e3))),$(".about-author .author-text").each(function()var e=$(this),t=e.find("a");t.length&&(t.each(function()var e=$(this),t=e.text().trim(),a=e.attr("href");e.replaceWith('
')),e.parent().append('
'),e.find("li").appendTo(e.parent().find(".author-links")))),$(".main-nav li.mega-menu").each(function(e,t,a,s)var o=$(this),n=o.find("a").data("shortcode");o.attr("id");n&&((e=getAttr(n,"label"))?(a=e.split("https://www.iitmind.com/"),"tabs"==(t=e.match("https://www.iitmind.com/")&&a[1]?"tabs":"mega")?megaTabs(o,e,a):(0!=e&&(s="recent"==e?"/search":"https://www.iitmind.com/search/label/"+e,o.children("a").attr("href",s)),o.mouseenter(function()getMega(o,t,5,e)))):o.append('
'+msgError()+"
").addClass("loaded"))),$("#trending .HTML .widget-content").each(function(e)var t=$(this),a=$(window),s=t.data("shortcode");s&&(e=getAttr(s,"label"),a.on("load resize scroll",function s()a.scrollTop()+a.height()>=t.offset().top&&(a.off("load resize scroll",s),getTrending(t,"trending",3,e))).trigger("scroll"))),$(".pbt-s .HTML .widget-content").each(function(e,t,a,s)var o=$(this),n=$(window),r=o.data("shortcode");r&&(e=r.toLowerCase(),t=getAttr(r,"results"),a=getAttr(r,"label"),s="posts"!=(s=0!=(s=getAttr(r,"type"))?s:"side")?s:"side",n.on("load resize scroll",function r()n.scrollTop()+n.height()>=o.offset().top&&(n.off("load resize scroll",r),getWidget(o,s,t,a,e))).trigger("scroll"))),$("#techspot-pro-related-posts .HTML").each(function(e,t)var a=$(this).data("shortcode");if(a)function s()return e=getAttr(a,"results"),t=getAttr(a,"label"),[e,t]$("#related-wrap").each(function(e,t,a,o)var n=$(this),r=n.find(".related-tag"),i=$(window),l=n.find(".related-content"),c=s();e=0!=c[0]?Number(c[0])+1:4,t=0!=c[1]?c[1]:r.data("label"),a=r.data("id"),0!=c[1]&&(o="recent"==t?"/search":"https://www.iitmind.com/search/label/"+t,n.find(".related-title .title-link").attr("href",o)),i.on("load resize scroll",function s()i.scrollTop()+i.height()>=l.offset().top&&(i.off("load resize scroll",s),getRelated(l,"related",e,t,a),$("#techspot-pro-related-posts").remove())).trigger("scroll"))),$(".techspot-pro-blog-post-comments").each(function()var e=$(this),t=e.data("shortcode"),a=getAttr(t,"type"),s="comments-system-"+a,o=e.find("#top-continue .comment-reply");switch(a)case"disqus":var n=getAttr(t,"shortname");0!=n&&(disqus_shortname=n),disqusComments(disqus_shortname),e.addClass(s+" is-visible");break;case"facebook":var r=getAttr(t,"lang"),i=0!=r?"https://connect.facebook.net/"+r+"/all.js#xfbml=1&version=v11.0":"https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v11.0";$("head").append('window.addEventListener('DOMContentLoaded', function() {'),e.addClass(s).find("#comments").html(''),e.addClass("is-visible");break;case"hide":e.addClass("is-hidden");break;default:e.addClass("comments-system-blogger is-visible"),o.addClass("btn"),beautiAvatar(".avatar-image-container img")var l=e.find(".comments .comment-reply"),c=e.find(".comments #top-continue"),d=e.find("#top-ce.comment-replybox-thread");l.click(function(e)e.preventDefault(),c.show(),d.hide()),c.click(function(e)e.preventDefault(),c.hide(),d.show())),$(function(){$(".entry-thumbnail .thumbnail,.entry-avatar .avatar").not(".pbt-lazy").pbtLazy(),$(".mobile-logo").each(function()var e=$(this),t=$(".main-logo a").clone();t.find("h1").remove(),t.appendTo(e)),$("#mobile-menu").each(function()var e=$(this),t=$(".main-nav").clone();t.attr("class","mobile-nav").attr("id","mobile-nav"),t.find(".mega-menu > .ul").remove(),t.find(".has-sub > a").after(''),t.find(".mega-menu").not(".megatabs").removeAttr("class").children(".submenu-toggle").remove(),t.find(".mega-menu > a").each(function(e,t,a,s)var o=$(this),n=o.data("shortcode");if(n&&(e=getAttr(n,"label")))if(a=e.split("https://www.iitmind.com/"),"tabs"==(e.match("https://www.iitmind.com/")&&a[1]?"tabs":"mega"))var r=(e=e.split("https://www.iitmind.com/")).length,i='",o.parent().append(i),o.parent().attr("class","has-sub"),o.on("click",function(e)e.preventDefault())else s="recent"==e?"/search":"https://www.iitmind.com/search/label/"+e,o.attr("href",s)),t.appendTo(e),$(".mobile-menu-toggle, .hide-mobile-menu, #overlay").click(function()$("body").toggleClass("nav-active")),$(".mobile-menu .submenu-toggle").click(function()var e=$(this);e.parent().hasClass("expanded")?e.parent().removeClass("expanded").children(".sub-menu").slideToggle(170):e.parent().addClass("expanded").children(".sub-menu").slideToggle(170))),$(".mm-footer").each(function()var e=$(this),t=$("#headerbar .social-icons"),a=$("#techspot-pro-about-section .social-icons"),s=$("#footer-menu .link-list"),o=t.length?t.clone():!!a.length&&a.clone();0!=o&&(o.find(".text").remove(),e.append(o)),$m=!!s.length&&s.clone(),0!=$m&&e.append($m)),$(".header-inner").each(function()var e=$(this);if(1==pbt.fixedMenu&&e.length>0)var t=$(document).scrollTop(),a=e.offset().top,s=e.height(),o=a+s+s;$(window).scroll(function(s,n)s=$(document).scrollTop(),a=e.offset().top,n=$(".main-header").offset().top+1,s>o?e.addClass("is-fixed"):a<=n&&e.removeClass("is-fixed").removeClass("show"),s
=n&&e.addClass("show"),170):setTimeout(function()e.removeClass("show"),170),t=s)),pbtFixedSidebar("#main-wrapper, #sidebar-wrapper"),$("#post-body iframe").each(function()var e=$(this);e.attr("src").match("www.youtube.com")&&e.wrap('')),$("p.comment-content").each(function()\.jpg),$("#techspot-pro-load-more-link").each(function()var e=$(this),t=e.data("load");t&&e.show(),e.click(function(a)a.preventDefault(),e.hide(),$.ajax(url:t,success:function(a)var s=$(a).find(".blog-posts");s.find(".post").addClass("fadeInUp"),$(".blog-posts").append(s.html()),(t=$(a).find("#techspot-pro-load-more-link").data("load"))?e.show():(e.hide(),$("#blog-pager .no-more").addClass("show")),beforeSend:function()$("#blog-pager .loading").show(),complete:function()$("#blog-pager .loading").hide(),$(".blog-posts .post .thumbnail").not(".pbt-lazy").pbtLazy(),pbtFixedSidebar("#main-wrapper, #sidebar-wrapper")))),$("#techspot-pro-cookie-consent").each(function()var e=$(this),t=e.find(".widget.Text").data("shortcode"),a=e.find(".consent-button");e.length>0&&(t&&(ok=getAttr(t,"ok"),days=getAttr(t,"days"),0!=ok&&a.text(ok),days=0!=days?Number(days):7),"1"!==$.cookie("techspot_pro_cookie_consent")&&(e.css("display","block"),$(window).on("load",function()e.addClass("is-visible"))),a.off("click").click(function(t)t.preventDefault(),t.stopPropagation(),$.cookie("techspot_pro_cookie_consent","1",expires:days,path:"https://www.iitmind.com/"),e.removeClass("is-visible"),setTimeout(function()e.css("display","none"),500)),cookieChoices=)),$("#back-top").each(function()var e=$(this);$(window).on("scroll",function()$(this).scrollTop()>=100?e.addClass("show"):e.removeClass("show"),e.offset().top>=$("#footer-wrapper").offset().top-36?e.addClass("on-footer"):e.removeClass("on-footer")),e.click(function(e)e.preventDefault(),$("html, body").animate(scrollTop:0,500)))});
//]]>
});
Source link Like this:
Like Loading...
Related