%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/emergentqj/antanimora/wp-content/plugins/td-cloud-library/assets/js/
Upload File :
Create Path :
Current File : /home/emergentqj/antanimora/wp-content/plugins/td-cloud-library/assets/js/js_posts_autoload.min.js

var tdbAutoload={};
(function(f,c,l){var m=f(document),d=f(c);tdbAutoload={original_post_id:null,is_ajax_running:!1,init:function(){var a=f("#tdb-autoload-article");if(0!==a.length){var g=a.data("autoload"),b=a.data("autoload-type"),k=a.data("autoload-count"),h=a.data("autoload-org-post-id"),e=h,n=0;tdbAutoload.original_post_id=h;tdbAutoload.log("%c tdbAutoload(inf) art. settings","background: #ffaa00; color: #ffffff; padding:3px 6px");tdbAutoload.log("tdbAutoload status: "+g);tdbAutoload.log("tdbAutoload type: "+b);
tdbAutoload.log("tdbAutoload original post id: "+h);tdbAutoload.log("tdbAutoload count: "+parseInt(k,10));tdbAutoload.log("tdbAutoload scroll percent: "+c.tdb_globals.autoloadScrollPercent);b=l.debounce(function(){tdbAutoload.log("ajax autoload > scroll");if(!0!==tdbAutoload.is_ajax_running){var b=100*d.scrollTop()/(m.height()-d.height()),g=c.tdb_globals.autoloadScrollPercent;(!k||n<parseInt(k,10))&&b>=g&&h===e&&(tdbAutoload._ajaxLoadingStart(a),tdbAutoload.is_ajax_running=!0,f.ajax({timeout:5E4,
type:"POST",url:tdbAutoload._getRestEndPoint("td-cloud-library/ajax_autoload","uid="+tdbAutoload._getUniqueID()),beforeSend:function(a){a.setRequestHeader("X-WP-Nonce",c.tdb_globals.wpRestNonce);h=null},data:{currentPostId:e,originalPostId:tdbAutoload.original_post_id},success:function(b,g,d){null!==b&&void 0===b.error&&(void 0!==b.noPosts?tdbAutoload._ajaxLoadingEnd(a):(n++,g=f(b.article),f(g).appendTo(a.find(".tdc-content-wrap")),e=h=b.id,g.filter("#tdb-infinte-post-"+e+"-iframe").load(function(){var b=
f(this);tdbAutoload.is_ajax_running=!1;tdbAutoload._ajaxLoadingEnd(a);b.css("opacity",1);setTimeout(function(){var a=b.contents().find("html").outerHeight(!0)+2;tdbAutoload.log("initial iframe load height set to: "+a);b.height(a)},50);b.contents().find("html").attr("id",b.attr("id"));var g=c.MutationObserver||c.WebKitMutationObserver||c.MozMutationObserver,d=document.querySelector("#"+b.attr("id")),h=(d.contentDocument||d.contentWindow.document).getElementsByTagName("html"),e=l.debounce(function(){var a=
h[0].offsetHeight;tdbAutoload.log("setHeight: height set to: "+a);b.height(a)},10);(new g(function(a){a.forEach(function(a){tdbAutoload.log("mutation occurred!");tdbAutoload.log(a);e()})})).observe(h[0],{childList:!0,subtree:!0})})))},error:function(a,b,g){}}))}},100);var p=l.debounce(function(){tdbAutoload.log("ajax_autoload > resize");f(".tdb-autoload-wrap").find(".tdb-infinte-post-iframe").each(function(){var a=f(this);a.height(a.contents().find("html").outerHeight())})},100),q=l.debounce(function(){tdbAutoload.log("ajax autoload > scroll location change");
tdbAutoload._locationChange()},10);"on"===g&&(d.scroll(b),d.scroll(q),d.resize(p),d.resize(function(){}),d.scroll(function(){}))}},_fixSmartSidebar:function(){var a=d.scrollTop(),g=a+d.height();f(".tdb-autoload-wrap").find("iframe").each(function(){var b=f(this),c=b.offset().top-f("#wpadminbar").outerHeight(),d=b.outerHeight(!0);b=b.attr("id");c<a&&c+d>g&&document.getElementById(b).contentWindow.tdSmartSidebar.td_events_scroll(a-c)})},_locationChange:function(){var a=d.scrollTop(),g=a+d.height(),
b=[];f(".tdb-autoload-wrap").find("article, iframe").each(function(){var c=f(this),d=c.offset().top-(f(".td-header-menu-wrap.td-affix").outerHeight()+f("#wpadminbar").outerHeight()),e=c.outerHeight(!0),h=c.data("post-url"),k=c.data("post-edit-url");c=c.data("post-title");e=d+e;d<a&&e>g?b.push({top:d,bottom:e,post_url:h,post_edit_url:k,post_title:c}):d>a&&d<g?b.push({top:d,bottom:e,post_url:h,post_edit_url:k,post_title:c}):e>a&&e<g&&b.push({top:d,bottom:e,post_url:h,post_edit_url:k,post_title:c})});
if(0===b.length){var k=c.location.href;var h=c.tdb_globals.origPostEditUrl;var e=document.title}else 1===b.length?(e=b.pop(),k=e.post_url,h=e.post_edit_url,e=e.post_title):(k=b[0].post_url,h=b[0].post_edit_url,e=b[0].post_title);tdbAutoload._updatePostURL(k,h,e)},_updatePostURL:function(a,d,b){c.location.href===a||""===a||c.location.href.includes(a)||(c.history.replaceState(null,null,a),document.title=b,c.tdb_globals.isAdminBarShowing&&f("#wp-admin-bar-edit").find("a").attr("href",d))},_ajaxLoadingStart:function(a){f(".td-loader-gif").remove();
a.find(".tdc-content-wrap").append('<div class="td-loader-gif td-loader-animation-start tdb-loader-autoload"></div>');tdLoadingBox.init(tds_theme_color_site_wide);setTimeout(function(){f(".td-loader-gif").removeClass("td-loader-animation-start").addClass("td-loader-animation-mid")},50)},_ajaxLoadingEnd:function(a){a.find(".td-loader-gif").removeClass("td-loader-animation-mid").addClass("td-loader-animation-end");setTimeout(function(){a.find(".td-loader-gif").remove();tdLoadingBox.stop()},400)},_getRestEndPoint:function(a,
d){return l.isEmpty(c.tdb_globals.permalinkStructure)?c.tdb_globals.wpRestUrl+a+"&"+d:c.tdb_globals.wpRestUrl+a+"?"+d},_getUniqueID:function(){function a(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return a()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()},log:function(a,c){}};m.ready(function(){tdbAutoload.init()})})(jQuery,this,_);

Zerion Mini Shell 1.0